* upgrade test'ini duzelt
* python import kurallarina uy - global degistirdigimiz yerde init order'ina dikkat et - her import statement'i tek satirda - global adlari kullan * yes-all diye bir common option ekle * install_files'in cagirdigi install_names'i eger bossa hic cagirma * fix: olmayan repo'yu kaldirma * fix: info ln'ler * commands: yeni init/finalize olayi ekle - import'u dogru yerde cagirmak icin ornegin gerekti
This commit is contained in:
+61
-17
@@ -16,8 +16,6 @@ from optparse import OptionParser
|
|||||||
import pisi
|
import pisi
|
||||||
from pisi.purl import PUrl
|
from pisi.purl import PUrl
|
||||||
from pisi.cli.common import *
|
from pisi.cli.common import *
|
||||||
import pisi.toplevel
|
|
||||||
from pisi.ui import ui
|
|
||||||
|
|
||||||
|
|
||||||
def commandsString():
|
def commandsString():
|
||||||
@@ -48,18 +46,21 @@ class Command(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# now for the real parser
|
# now for the real parser
|
||||||
|
import pisi
|
||||||
self.parser = OptionParser(usage=usage_text,
|
self.parser = OptionParser(usage=usage_text,
|
||||||
version="%prog " + pisi.__version__)
|
version="%prog " + pisi.__version__)
|
||||||
self.options()
|
self.options()
|
||||||
self.parser = commonopts(self.parser)
|
self.parser = commonopts(self.parser)
|
||||||
(self.options, self.args) = self.parser.parse_args()
|
(self.options, self.args) = self.parser.parse_args()
|
||||||
|
#print 'opts,args = ', self.options, self.args
|
||||||
self.args.pop(0) # exclude command arg
|
self.args.pop(0) # exclude command arg
|
||||||
|
|
||||||
|
import pisi
|
||||||
|
#from pisi.ui import ui
|
||||||
|
|
||||||
# initialize PiSi
|
# initialize PiSi
|
||||||
#print '**** running cmd'
|
|
||||||
pisi.config.config = pisi.config.Config(self.options)
|
pisi.config.config = pisi.config.Config(self.options)
|
||||||
cli = pisi.ui.CLI(self.options.debug)
|
pisi.ui.ui = pisi.ui.CLI(self.options.debug)
|
||||||
pisi.ui.ui = cli
|
|
||||||
|
|
||||||
self.checkAuthInfo()
|
self.checkAuthInfo()
|
||||||
|
|
||||||
@@ -91,9 +92,17 @@ class Command(object):
|
|||||||
else:
|
else:
|
||||||
self.authInfo = None
|
self.authInfo = None
|
||||||
|
|
||||||
def init_db(self):
|
def init(self, database = False):
|
||||||
from pisi.repodb import repodb
|
"""initialize PiSi components"""
|
||||||
repodb.init_dbs()
|
|
||||||
|
# IMPORTANT: command imports here or in the command class run fxns
|
||||||
|
import pisi.toplevel
|
||||||
|
if database:
|
||||||
|
from pisi.repodb import repodb
|
||||||
|
repodb.init_dbs()
|
||||||
|
|
||||||
|
def finalize(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def help(self):
|
def help(self):
|
||||||
print getattr(self, "__doc__")
|
print getattr(self, "__doc__")
|
||||||
@@ -121,12 +130,17 @@ for that command.
|
|||||||
if not self.args:
|
if not self.args:
|
||||||
self.parser.print_help()
|
self.parser.print_help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
|
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
|
print
|
||||||
|
pisi.ui.ui.info("%s: " % arg)
|
||||||
obj = cmdObject(arg, True)
|
obj = cmdObject(arg, True)
|
||||||
obj.help()
|
obj.help()
|
||||||
# print "\n",self.parser.format_option_help()
|
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class Build(Command):
|
class Build(Command):
|
||||||
"""Build a PISI package using a pspec.xml file
|
"""Build a PISI package using a pspec.xml file
|
||||||
@@ -145,8 +159,10 @@ fetch all necessary files and build the package for you.
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
pisi.toplevel.build(arg, self.authInfo)
|
pisi.toplevel.build(arg, self.authInfo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class PackageOp(Command):
|
class PackageOp(Command):
|
||||||
@@ -162,7 +178,7 @@ class PackageOp(Command):
|
|||||||
## default=False, help="xxxx")
|
## default=False, help="xxxx")
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
self.init_db()
|
super(PackageOp, self).init(True)
|
||||||
import pisi.comariface
|
import pisi.comariface
|
||||||
if not self.options.ignore_comar:
|
if not self.options.ignore_comar:
|
||||||
try:
|
try:
|
||||||
@@ -170,6 +186,7 @@ class PackageOp(Command):
|
|||||||
except pisi.comariface.ComarError:
|
except pisi.comariface.ComarError:
|
||||||
ui.error('Comar error encountered\n')
|
ui.error('Comar error encountered\n')
|
||||||
self.die()
|
self.die()
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
#self.finalize_db()
|
#self.finalize_db()
|
||||||
@@ -278,8 +295,10 @@ TODO: Some description...
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
self.printinfo(arg)
|
self.printinfo(arg)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
def printinfo(self, arg):
|
def printinfo(self, arg):
|
||||||
import os.path
|
import os.path
|
||||||
@@ -301,7 +320,8 @@ TODO: Some description...
|
|||||||
super(Index, self).__init__()
|
super(Index, self).__init__()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
|
self.init()
|
||||||
from pisi.toplevel import index
|
from pisi.toplevel import index
|
||||||
if len(self.args)==1:
|
if len(self.args)==1:
|
||||||
index(self.args[0])
|
index(self.args[0])
|
||||||
@@ -311,7 +331,7 @@ TODO: Some description...
|
|||||||
else:
|
else:
|
||||||
print 'Indexing only a single directory supported.'
|
print 'Indexing only a single directory supported.'
|
||||||
return
|
return
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
class ListInstalled(Command):
|
class ListInstalled(Command):
|
||||||
"""Print the list of all installed packages
|
"""Print the list of all installed packages
|
||||||
@@ -330,7 +350,7 @@ TODO: Some description...
|
|||||||
default=False, help="show in long format")
|
default=False, help="show in long format")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.init_db()
|
self.init(True)
|
||||||
from pisi.installdb import installdb
|
from pisi.installdb import installdb
|
||||||
for pkg in installdb.list_installed():
|
for pkg in installdb.list_installed():
|
||||||
package = pisi.packagedb.get_package(pkg)
|
package = pisi.packagedb.get_package(pkg)
|
||||||
@@ -338,6 +358,7 @@ TODO: Some description...
|
|||||||
print package.name, '-', package.summary
|
print package.name, '-', package.summary
|
||||||
else:
|
else:
|
||||||
print package
|
print package
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class UpdateRepo(Command):
|
class UpdateRepo(Command):
|
||||||
@@ -359,7 +380,7 @@ TODO: Some description...
|
|||||||
self.init_db()
|
self.init_db()
|
||||||
for repo in self.args:
|
for repo in self.args:
|
||||||
pisi.toplevel.update_repo(repo)
|
pisi.toplevel.update_repo(repo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
class AddRepo(Command):
|
class AddRepo(Command):
|
||||||
"""Add a repository
|
"""Add a repository
|
||||||
@@ -375,9 +396,11 @@ TODO: Some description...
|
|||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
if len(self.args)>=2:
|
if len(self.args)>=2:
|
||||||
|
self.init()
|
||||||
name = self.args[0]
|
name = self.args[0]
|
||||||
indexuri = self.args[1]
|
indexuri = self.args[1]
|
||||||
pisi.toplevel.add_repo(name, indexuri)
|
pisi.toplevel.add_repo(name, indexuri)
|
||||||
|
self.init()
|
||||||
else:
|
else:
|
||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
@@ -397,8 +420,10 @@ TODO: Some description...
|
|||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
if len(self.args)>=1:
|
if len(self.args)>=1:
|
||||||
|
self.init()
|
||||||
name = self.args[0]
|
name = self.args[0]
|
||||||
pisi.toplevel.remove_repo(name)
|
pisi.toplevel.remove_repo(name)
|
||||||
|
self.finalize()
|
||||||
else:
|
else:
|
||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
@@ -417,10 +442,12 @@ TODO: Some description...
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
|
self.init()
|
||||||
from pisi.repodb import repodb
|
from pisi.repodb import repodb
|
||||||
for repo in repodb.list():
|
for repo in repodb.list():
|
||||||
print repo
|
print repo
|
||||||
print ' ', repodb.get_repo(repo).indexuri.getUri()
|
print ' ', repodb.get_repo(repo).indexuri.getUri()
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class ListAvailable(Command):
|
class ListAvailable(Command):
|
||||||
@@ -448,6 +475,7 @@ TODO: desc...
|
|||||||
for repo in repodb.list():
|
for repo in repodb.list():
|
||||||
ui.info("Repository : %s\n" % repo)
|
ui.info("Repository : %s\n" % repo)
|
||||||
self.print_packages(repo)
|
self.print_packages(repo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
def print_packages(self, repo):
|
def print_packages(self, repo):
|
||||||
from pisi import packagedb
|
from pisi import packagedb
|
||||||
@@ -472,6 +500,7 @@ class ListPending(Command):
|
|||||||
for p in installdb.list_pending():
|
for p in installdb.list_pending():
|
||||||
print p
|
print p
|
||||||
|
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
class SearchAvailable(Command):
|
class SearchAvailable(Command):
|
||||||
"""Search in available packages
|
"""Search in available packages
|
||||||
@@ -506,14 +535,17 @@ for you.
|
|||||||
self.parser.add_option("-s", action="store", dest="state")
|
self.parser.add_option("-s", action="store", dest="state")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
if not self.args:
|
if not self.args:
|
||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
state = self.options.state
|
state = self.options.state
|
||||||
|
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
pisi.toplevel.build_until(arg, state, self.authInfo)
|
pisi.toplevel.build_until(arg, state, self.authInfo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildUnpack(Command):
|
class BuildUnpack(Command):
|
||||||
@@ -532,8 +564,10 @@ TODO: desc.
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
pisi.toplevel.build_until(arg, "unpack", self.authInfo)
|
pisi.toplevel.build_until(arg, "unpack", self.authInfo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildSetup(Command):
|
class BuildSetup(Command):
|
||||||
@@ -552,8 +586,11 @@ TODO: desc.
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
pisi.toplevel.build_until(arg, "setupaction", self.authInfo)
|
pisi.toplevel.build_until(arg, "setupaction",
|
||||||
|
self.authInfo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildBuild(Command):
|
class BuildBuild(Command):
|
||||||
@@ -572,8 +609,10 @@ TODO: desc.
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
pisi.toplevel.build_until(arg, "buildaction", self.authInfo)
|
pisi.toplevel.build_until(arg, "buildaction", self.authInfo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildInstall(Command):
|
class BuildInstall(Command):
|
||||||
@@ -592,8 +631,11 @@ TODO: desc.
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
pisi.toplevel.build_until(arg, "installaction", self.authInfo)
|
pisi.toplevel.build_until(arg, "installaction",
|
||||||
|
self.authInfo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildPackage(Command):
|
class BuildPackage(Command):
|
||||||
@@ -612,8 +654,10 @@ TODO: desc.
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.init()
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
pisi.toplevel.build_until(arg, "buildpackages", self.authInfo)
|
pisi.toplevel.build_until(arg, "buildpackages", self.authInfo)
|
||||||
|
self.finalize()
|
||||||
|
|
||||||
# command dictionary
|
# command dictionary
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ PISI Package Manager
|
|||||||
def commonopts(parser):
|
def commonopts(parser):
|
||||||
p = parser
|
p = parser
|
||||||
p.add_option("-D", "--destdir", action="store")
|
p.add_option("-D", "--destdir", action="store")
|
||||||
|
p.add_option("", "--yes-all", action="store_true",
|
||||||
|
default=False, help = "assume yes in all yes/no queries")
|
||||||
p.add_option("-u", "--username", action="store")
|
p.add_option("-u", "--username", action="store")
|
||||||
p.add_option("-p", "--password", action="store")
|
p.add_option("-p", "--password", action="store")
|
||||||
p.add_option("-P", action="store_true", dest="getpass", default=False,
|
p.add_option("-P", action="store_true", dest="getpass", default=False,
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import sys
|
|||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
import pisi
|
import pisi
|
||||||
import pisi.operations
|
|
||||||
from pisi.purl import PUrl
|
from pisi.purl import PUrl
|
||||||
from pisi.cli.common import *
|
from pisi.cli.common import *
|
||||||
from pisi.cli.commands import *
|
from pisi.cli.commands import *
|
||||||
|
|||||||
+3
-3
@@ -15,9 +15,9 @@
|
|||||||
# Authors: Baris Metin <baris@uludag.org.tr
|
# Authors: Baris Metin <baris@uludag.org.tr
|
||||||
# Eray Ozkural <eray@uludag.org.tr>
|
# Eray Ozkural <eray@uludag.org.tr>
|
||||||
|
|
||||||
from constants import const
|
from pisi.constants import const
|
||||||
from config import config
|
from pisi.config import config
|
||||||
from specfile import SpecFile
|
from pisi.specfile import SpecFile
|
||||||
|
|
||||||
class BuildContext(object):
|
class BuildContext(object):
|
||||||
"""Build Context Singleton"""
|
"""Build Context Singleton"""
|
||||||
|
|||||||
+9
-9
@@ -16,15 +16,15 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from package import Package
|
from pisi.package import Package
|
||||||
from xmlfile import XmlFile
|
from pisi.xmlfile import XmlFile
|
||||||
import metadata
|
import pisi.metadata as metadata
|
||||||
import packagedb
|
import pisi.packagedb as packagedb
|
||||||
from ui import ui
|
from pisi.ui import ui
|
||||||
import util
|
import pisi.util as util
|
||||||
from config import config
|
from pisi.config import config
|
||||||
from constants import const
|
from pisi.constants import const
|
||||||
from purl import PUrl
|
from pisi.purl import PUrl
|
||||||
|
|
||||||
class Index(XmlFile):
|
class Index(XmlFile):
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -101,10 +101,10 @@ class Installer:
|
|||||||
# is this an upgrade?
|
# is this an upgrade?
|
||||||
# determine and report the kind of upgrade: version, release, build
|
# determine and report the kind of upgrade: version, release, build
|
||||||
if pkg.version > iversion:
|
if pkg.version > iversion:
|
||||||
ui.info('Upgrading to new upstream version')
|
ui.info('Upgrading to new upstream version\n')
|
||||||
upgrade = True
|
upgrade = True
|
||||||
elif pkg.release > irelease:
|
elif pkg.release > irelease:
|
||||||
ui.info('Upgrading to new distribution release')
|
ui.info('Upgrading to new distribution release\n')
|
||||||
upgrade = True
|
upgrade = True
|
||||||
|
|
||||||
# is this a downgrade? confirm this action.
|
# is this a downgrade? confirm this action.
|
||||||
|
|||||||
+3
-3
@@ -36,12 +36,12 @@ class InstallDB:
|
|||||||
from os.path import join
|
from os.path import join
|
||||||
self.d = shelve.LockedDBShelf('install')
|
self.d = shelve.LockedDBShelf('install')
|
||||||
self.dp = shelve.LockedDBShelf('configpending')
|
self.dp = shelve.LockedDBShelf('configpending')
|
||||||
from config import config
|
from pisi.config import config
|
||||||
self.files_dir = os.path.join(config.db_dir(), 'files')
|
self.files_dir = os.path.join(config.db_dir(), 'files')
|
||||||
|
|
||||||
def files_name(self, pkg, version, release):
|
def files_name(self, pkg, version, release):
|
||||||
from os.path import join
|
from os.path import join
|
||||||
from config import config
|
from pisi.config import config
|
||||||
pkg_dir = join(config.lib_dir(), pkg + '-' + version + '-' + release)
|
pkg_dir = join(config.lib_dir(), pkg + '-' + version + '-' + release)
|
||||||
return join(pkg_dir, const.files_xml)
|
return join(pkg_dir, const.files_xml)
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ class InstallDB:
|
|||||||
def install(self, pkg, version, release):
|
def install(self, pkg, version, release):
|
||||||
"""install package with specific version and release"""
|
"""install package with specific version and release"""
|
||||||
pkg = str(pkg)
|
pkg = str(pkg)
|
||||||
from config import config
|
from pisi.config import config
|
||||||
if self.is_installed(pkg):
|
if self.is_installed(pkg):
|
||||||
raise InstallDBError("already installed")
|
raise InstallDBError("already installed")
|
||||||
if config.options and config.options.ignore_comar:
|
if config.options and config.options.ignore_comar:
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import bsddb.db as db
|
|||||||
import os
|
import os
|
||||||
import fcntl
|
import fcntl
|
||||||
|
|
||||||
from config import config
|
from pisi.config import config
|
||||||
import util
|
import pisi.util as util
|
||||||
|
|
||||||
class LockedDBShelf(shelve.DBShelf):
|
class LockedDBShelf(shelve.DBShelf):
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -14,8 +14,9 @@ from bsddb import db
|
|||||||
import bsddb.dbshelve as shelve
|
import bsddb.dbshelve as shelve
|
||||||
import os, fcntl
|
import os, fcntl
|
||||||
|
|
||||||
from config import config
|
from pisi.config import config
|
||||||
import packagedb, util
|
import pisi.packagedb as packagedb
|
||||||
|
import pisi.util as util
|
||||||
from pisi.purl import PUrl
|
from pisi.purl import PUrl
|
||||||
|
|
||||||
class RepoDB(object):
|
class RepoDB(object):
|
||||||
|
|||||||
+5
-4
@@ -19,12 +19,13 @@
|
|||||||
# yes, we are cheap
|
# yes, we are cheap
|
||||||
|
|
||||||
import bsddb.dbshelve as shelve
|
import bsddb.dbshelve as shelve
|
||||||
import os, fcntl
|
import os
|
||||||
|
import fcntl
|
||||||
import util
|
|
||||||
from config import config
|
|
||||||
from bsddb import db
|
from bsddb import db
|
||||||
|
|
||||||
|
import pisi.util as util
|
||||||
|
from pisi.config import config
|
||||||
|
|
||||||
class SourceDB(object):
|
class SourceDB(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
@@ -12,11 +12,11 @@
|
|||||||
|
|
||||||
from os.path import basename, dirname, join
|
from os.path import basename, dirname, join
|
||||||
|
|
||||||
from ui import ui
|
from pisi.ui import ui
|
||||||
from config import config
|
from pisi.config import config
|
||||||
from constants import const
|
from pisi.constants import const
|
||||||
from purl import PUrl
|
from pisi.purl import PUrl
|
||||||
from specfile import SpecFile
|
from pisi.specfile import SpecFile
|
||||||
|
|
||||||
class SourceFetcher(object):
|
class SourceFetcher(object):
|
||||||
def __init__(self, url, authInfo=None):
|
def __init__(self, url, authInfo=None):
|
||||||
|
|||||||
+8
-2
@@ -92,7 +92,9 @@ def install_pkg_files(packages):
|
|||||||
# be satisfied by installing packages from the repo
|
# be satisfied by installing packages from the repo
|
||||||
|
|
||||||
# if so, then invoke install_pkg_names
|
# if so, then invoke install_pkg_names
|
||||||
if install_pkg_names([x.package for x in dep_unsatis]):
|
extra_packages = [x.package for x in dep_unsatis]
|
||||||
|
if (extra_packages and install_pkg_names(extra_packages)) or \
|
||||||
|
(not extra_packages):
|
||||||
for x in packages:
|
for x in packages:
|
||||||
operations.install_single_file(x)
|
operations.install_single_file(x)
|
||||||
|
|
||||||
@@ -291,7 +293,11 @@ def add_repo(name, indexuri):
|
|||||||
repodb.add_repo(name, repo)
|
repodb.add_repo(name, repo)
|
||||||
|
|
||||||
def remove_repo(name):
|
def remove_repo(name):
|
||||||
repodb.remove_repo(name)
|
if repodb.has_repo(name):
|
||||||
|
repodb.remove_repo(name)
|
||||||
|
else:
|
||||||
|
ui.error('* Repository %s does not exist. Cannot remove.\n'
|
||||||
|
% name)
|
||||||
|
|
||||||
def update_repo(repo):
|
def update_repo(repo):
|
||||||
|
|
||||||
|
|||||||
+8
-2
@@ -14,7 +14,9 @@
|
|||||||
# Murat Eren <meren@uludag.org.tr>
|
# Murat Eren <meren@uludag.org.tr>
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from colors import colorize
|
|
||||||
|
from pisi.colors import colorize
|
||||||
|
from pisi.config import config
|
||||||
|
|
||||||
def register(_impl):
|
def register(_impl):
|
||||||
""" Register a UI implementation"""
|
""" Register a UI implementation"""
|
||||||
@@ -53,6 +55,9 @@ class CLI:
|
|||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def confirm(self, msg):
|
def confirm(self, msg):
|
||||||
|
from pisi.config import config
|
||||||
|
if config.options and config.options.yes_all:
|
||||||
|
return True
|
||||||
while True:
|
while True:
|
||||||
s = raw_input(msg + colorize('(yes/no)', 'red'))
|
s = raw_input(msg + colorize('(yes/no)', 'red'))
|
||||||
if s.startswith('y') or s.startswith('Y'):
|
if s.startswith('y') or s.startswith('Y'):
|
||||||
@@ -82,4 +87,5 @@ class CLI:
|
|||||||
self.info(out)
|
self.info(out)
|
||||||
|
|
||||||
# default UI is CLI
|
# default UI is CLI
|
||||||
ui = CLI()
|
ui = None
|
||||||
|
#CLI()
|
||||||
|
|||||||
+11
-11
@@ -4,18 +4,18 @@ pwd
|
|||||||
PATH=$PATH:.
|
PATH=$PATH:.
|
||||||
set -x -e
|
set -x -e
|
||||||
|
|
||||||
pisi-cli --ignore-comar remove unzip zip
|
|
||||||
pisi-cli build tests/zip/pspec.xml tests/unzip/pspec.xml
|
pisi-cli build tests/zip/pspec.xml tests/unzip/pspec.xml
|
||||||
pisi-cli --ignore-comar install unzip-5.50-1.pisi zip-2.3-1.pisi
|
pisi-cli --yes-all --ignore-comar install unzip-5.50-1.pisi zip-2.3-1.pisi
|
||||||
|
|
||||||
rm -rf myrepo
|
mkdir -p myrepo
|
||||||
mkdir myrepo
|
|
||||||
cd myrepo
|
cd myrepo
|
||||||
../pisi-cli build ../tests/zip2/pspec.xml ../tests/unzip2/pspec.xml
|
../pisi-cli build ../tests/zip2/pspec.xml ../tests/unzip2/pspec.xml
|
||||||
../pisi-cli index .
|
cd ..
|
||||||
../pisi-cli add-repo repo1 pisi-index.xml
|
pisi-cli index myrepo
|
||||||
../pisi-cli list-repo
|
pisi-cli remove-repo myrepo
|
||||||
../pisi-cli update-repo repo1
|
pisi-cli add-repo myrepo pisi-index.xml
|
||||||
../pisi-cli list-available
|
pisi-cli list-repo
|
||||||
../pisi-cli --ignore-comar upgrade zip
|
pisi-cli update-repo myrepo
|
||||||
../pisi-cli list-installed
|
pisi-cli list-available
|
||||||
|
pisi-cli --ignore-comar upgrade zip
|
||||||
|
pisi-cli list-installed
|
||||||
|
|||||||
Reference in New Issue
Block a user