45 lines
1.2 KiB
Python
Executable File
45 lines
1.2 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
|
|
|
|
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()
|
|
|
|
# package filename
|
|
package_fn = ""
|
|
|
|
# TODO: We accept only one package file arg ATM
|
|
if len(args) != 1:
|
|
print usage
|
|
raise ArgError, "pisi-install expects one (and only one) package file currently"
|
|
else:
|
|
package_fn = args[0]
|
|
|
|
pisi.install.install_package_file(package_fn)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|