2db2e14bd2
./pisi-install startup-notification-0.8-2.pisi startup-notification-devel-0.8-2.pisi
43 lines
1.3 KiB
Python
Executable File
43 lines
1.3 KiB
Python
Executable File
#! /usr/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# sys modules
|
|
import sys
|
|
from optparse import OptionParser
|
|
|
|
sys.path.append("./lib")
|
|
import pisi.install
|
|
import pisi.util
|
|
from pisi.ui import ui
|
|
|
|
class ArgError(Exception):
|
|
pass
|
|
|
|
def main():
|
|
|
|
usage = "usage: %prog [options] <package>"
|
|
parser = OptionParser(usage=usage,version="%prog " + pisi.__version__)
|
|
parser.add_option("-D", "--destdir", action="store")
|
|
parser.add_option("-v", "--verbose", action="store_true",
|
|
dest="verbose", default=False,
|
|
help="detailed output")
|
|
parser.add_option("-d", "--debug", action="store_true", default=True)
|
|
parser.add_option("-n", "--dry-run", action="store_true",
|
|
default = "do not perform any action, just show what\
|
|
would be done")
|
|
|
|
(options, args) = parser.parse_args()
|
|
|
|
for package_fn in args:
|
|
try:
|
|
ui.info('* Installing ' + package_fn + '\n')
|
|
pisi.install.install(package_fn)
|
|
except pisi.install.InstallError, estr:
|
|
print '*** An installation error has occured:'
|
|
print ' ', estr
|
|
sys.exit(1)
|
|
ui.info("Package(s) installed successfully as intended.\n")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|