* calistirtirt
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
import sys
|
||||||
|
from optparse import OptionParser
|
||||||
|
import pisi
|
||||||
|
from pisi.config import config
|
||||||
|
import pisi.operations
|
||||||
|
from pisi.purl import PUrl
|
||||||
|
from common import *
|
||||||
|
|
||||||
# helper functions
|
# helper functions
|
||||||
def cmdObject(cmd, fail=False):
|
def cmdObject(cmd, fail=False):
|
||||||
commands = {"help": Help,
|
commands = {"help": Help,
|
||||||
@@ -22,7 +30,7 @@ class Command(object):
|
|||||||
"""generic help string for any command"""
|
"""generic help string for any command"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# now for the real parser
|
# now for the real parser
|
||||||
self.parser = OptionParser(usage=usage_text,
|
self.parser = OptionParser(usage="",
|
||||||
version="%prog " + pisi.__version__)
|
version="%prog " + pisi.__version__)
|
||||||
self.options()
|
self.options()
|
||||||
self.parser = commonopts(self.parser)
|
self.parser = commonopts(self.parser)
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
usage_text = """%prog <command> [options] [arguments]
|
||||||
|
|
||||||
|
where <command> is one of:
|
||||||
|
|
||||||
|
help
|
||||||
|
build
|
||||||
|
index
|
||||||
|
info
|
||||||
|
install
|
||||||
|
remove
|
||||||
|
updatedb
|
||||||
|
|
||||||
|
Use \"%prog help <command>\" for help on a specific subcommand.
|
||||||
|
|
||||||
|
PISI Package Manager
|
||||||
|
"""
|
||||||
|
|
||||||
|
def commonopts(parser):
|
||||||
|
p = parser
|
||||||
|
p.add_option("-D", "--destdir", action="store")
|
||||||
|
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,
|
||||||
|
help="Get password from the command line")
|
||||||
|
p.add_option("-v", "--verbose", action="store_true",
|
||||||
|
dest="verbose", default=False,
|
||||||
|
help="detailed output")
|
||||||
|
p.add_option("-d", "--debug", action="store_true",
|
||||||
|
default=True, help="show debugging information")
|
||||||
|
p.add_option("-n", "--dry-run", action="store_true", default=False,
|
||||||
|
help = "do not perform any action, just show what\
|
||||||
|
would be done")
|
||||||
|
return p
|
||||||
+1
-34
@@ -7,43 +7,10 @@ import pisi
|
|||||||
from pisi.config import config
|
from pisi.config import config
|
||||||
import pisi.operations
|
import pisi.operations
|
||||||
from pisi.purl import PUrl
|
from pisi.purl import PUrl
|
||||||
|
from common import *
|
||||||
from commands import *
|
from commands import *
|
||||||
|
|
||||||
# globals
|
# globals
|
||||||
usage_text = """%prog <command> [options] [arguments]
|
|
||||||
|
|
||||||
where <command> is one of:
|
|
||||||
|
|
||||||
help
|
|
||||||
build
|
|
||||||
index
|
|
||||||
info
|
|
||||||
install
|
|
||||||
remove
|
|
||||||
updatedb
|
|
||||||
|
|
||||||
Use \"%prog help <command>\" for help on a specific subcommand.
|
|
||||||
|
|
||||||
PISI Package Manager
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
def commonopts(parser):
|
|
||||||
p = parser
|
|
||||||
p.add_option("-D", "--destdir", action="store")
|
|
||||||
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,
|
|
||||||
help="Get password from the command line")
|
|
||||||
p.add_option("-v", "--verbose", action="store_true",
|
|
||||||
dest="verbose", default=False,
|
|
||||||
help="detailed output")
|
|
||||||
p.add_option("-d", "--debug", action="store_true",
|
|
||||||
default=True, help="show debugging information")
|
|
||||||
p.add_option("-n", "--dry-run", action="store_true", default=False,
|
|
||||||
help = "do not perform any action, just show what\
|
|
||||||
would be done")
|
|
||||||
return p
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,13 @@ class InstallDB:
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def list_installed(self):
|
||||||
|
l = []
|
||||||
|
for (pkg, (status,version,release)) in self.d.iteritems():
|
||||||
|
if status=='i':
|
||||||
|
l.append(pkg)
|
||||||
|
return l
|
||||||
|
|
||||||
def get_version(self, pkg):
|
def get_version(self, pkg):
|
||||||
pkg = str(pkg)
|
pkg = str(pkg)
|
||||||
(status, version, release) = self.d[pkg]
|
(status, version, release) = self.d[pkg]
|
||||||
|
|||||||
+3
-1
@@ -14,4 +14,6 @@ def remove(package_name):
|
|||||||
from install import Installer
|
from install import Installer
|
||||||
|
|
||||||
def install(package_name):
|
def install(package_name):
|
||||||
Installer
|
i = Installer(package_name), i.install()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ class Package:
|
|||||||
# extract control files
|
# extract control files
|
||||||
self.package.extract_PISI_files(tmpdir)
|
self.package.extract_PISI_files(tmpdir)
|
||||||
|
|
||||||
filesxml =
|
|
||||||
self.metadata = MetaData()
|
self.metadata = MetaData()
|
||||||
self.metadata.read( join(tmpdir, config.metadata_xml) )
|
self.metadata.read( join(tmpdir, config.metadata_xml) )
|
||||||
if not metadata.verify():
|
if not metadata.verify():
|
||||||
|
|||||||
Reference in New Issue
Block a user