* comar'i sadece ignore_build_no opsiyonu tanimlanmissa initialize
et: dikkat: bu demek ki boyle bir option'i pass etmelisiniz, api'a False ya da True. ui'cilara soyluyorum. bunun icin baska bir path de bulabiliriz, tabii. degistirmeye acik implementation. * sadece PackageOp'lara koy bu nacizane ozelligi.
This commit is contained in:
+6
-1
@@ -46,7 +46,12 @@ def init(database = True, options = None, ui = None ):
|
||||
import pisi.config
|
||||
ctx.config = pisi.config.Config(options)
|
||||
|
||||
if ctx.config.options and not ctx.config.options.ignore_comar:
|
||||
init_comar = False
|
||||
if ctx.config.options:
|
||||
if hasattr(ctx.config.options, 'ignore_comar'):
|
||||
if ctx.config.options.ignore_comar:
|
||||
init_comar = True
|
||||
if init_comar:
|
||||
# FIXME: just try for others (that don't use comar)
|
||||
try:
|
||||
import comar
|
||||
|
||||
+6
-18
@@ -18,7 +18,6 @@ import pisi.cli
|
||||
import pisi.context as ctx
|
||||
from pisi.uri import URI
|
||||
|
||||
|
||||
class Command(object):
|
||||
"""generic help string for any command"""
|
||||
|
||||
@@ -68,8 +67,6 @@ class Command(object):
|
||||
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("-B", "--ignore-comar", action="store_true",
|
||||
default=False, help="bypass comar configuration agent")
|
||||
p.add_option("-u", "--username", action="store")
|
||||
p.add_option("-p", "--password", action="store")
|
||||
p.add_option("-P", action="store_true", dest="getpass", default=False,
|
||||
@@ -279,24 +276,15 @@ class PackageOp(Command):
|
||||
super(PackageOp, self).__init__()
|
||||
|
||||
def options(self):
|
||||
pass
|
||||
## self.parser.add_option("", "--ignore-dependency",
|
||||
## action="store_true",
|
||||
## default=False, help="death")
|
||||
p = self.parser
|
||||
p.add_option("-B", "--ignore-comar", action="store_true",
|
||||
default=False, help="bypass comar configuration agent")
|
||||
p.add_option("", "--ignore-dependency",
|
||||
action="store_true",
|
||||
default=False, help="death of sanity")
|
||||
|
||||
def init(self):
|
||||
super(PackageOp, self).init(True)
|
||||
pass
|
||||
# ctx.comard should be initialized in pisi.api for other interfaces to
|
||||
# use it!
|
||||
# import pisi
|
||||
# if not self.options.ignore_comar:
|
||||
# import comar
|
||||
# try:
|
||||
# ctx.comard = comar.Link() # context
|
||||
# except comar.Error:
|
||||
# ctx.ui.error('Comar error encountered\n')
|
||||
# self.die()
|
||||
|
||||
def finalize(self):
|
||||
#self.finalize_db()
|
||||
|
||||
Reference in New Issue
Block a user