* fix: usage goes into CLI of course, and put CLI proc. also in pisi-install
This commit is contained in:
+6
-6
@@ -4,15 +4,16 @@
|
|||||||
# python standard library
|
# python standard library
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
|
|
||||||
from specfile import SpecFile
|
|
||||||
from fetcher import Fetcher
|
|
||||||
# import archive
|
|
||||||
# import pisipackage
|
|
||||||
# import pisiutils # patch, fileutils?
|
|
||||||
import pisiconfig
|
import pisiconfig
|
||||||
import util
|
import util
|
||||||
from pisibuild import PisiBuild
|
from pisibuild import PisiBuild
|
||||||
|
|
||||||
|
def usage(progname = "pisi-build"):
|
||||||
|
print """
|
||||||
|
Usage:
|
||||||
|
%s [options] package-name.pspec
|
||||||
|
""" %(progname)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
import sys
|
import sys
|
||||||
import getopt
|
import getopt
|
||||||
@@ -44,7 +45,6 @@ def main():
|
|||||||
else:
|
else:
|
||||||
pspec = args[0]
|
pspec = args[0]
|
||||||
|
|
||||||
|
|
||||||
# doing the real job... vs. vs...
|
# doing the real job... vs. vs...
|
||||||
pb = PisiBuild(pspec)
|
pb = PisiBuild(pspec)
|
||||||
util.information("Building PISI package for: %s" % pb.packageName)
|
util.information("Building PISI package for: %s" % pb.packageName)
|
||||||
|
|||||||
@@ -1,3 +1,39 @@
|
|||||||
#! /usr/bin/python
|
#! /usr/bin/python
|
||||||
# -*- python -*-
|
# -*- python -*-
|
||||||
|
|
||||||
|
def usage(progname = "pisi-install"):
|
||||||
|
print """
|
||||||
|
Usage:
|
||||||
|
%s [options] package-name.pspec
|
||||||
|
""" %(progname)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
import sys
|
||||||
|
import getopt
|
||||||
|
|
||||||
|
# wrapper for usage(progname) function
|
||||||
|
help = lambda: usage(sys.argv[0])
|
||||||
|
|
||||||
|
# getopt magic
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:],"h",["help"])
|
||||||
|
except getopt.GetoptError:
|
||||||
|
help()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
for opt, arg in opts:
|
||||||
|
if opt == "-h":
|
||||||
|
help()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# package filename
|
||||||
|
packagefn = ""
|
||||||
|
|
||||||
|
# TODO: We accept only one pspec file (at a time) currently,
|
||||||
|
# but pisi-build may build many packages (pspecs given in order)
|
||||||
|
# sequentially.
|
||||||
|
if len(args) != 1:
|
||||||
|
help()
|
||||||
|
raise PisiBuildError, "pisi-install excepts one (and only one) pspec file currently"
|
||||||
|
else:
|
||||||
|
packagefn = args[0]
|
||||||
|
|||||||
@@ -34,8 +34,3 @@ class PisiBuild:
|
|||||||
fetch = Fetcher(self.archiveUri)
|
fetch = Fetcher(self.archiveUri)
|
||||||
fetch.fetch()
|
fetch.fetch()
|
||||||
|
|
||||||
def usage(progname = "pisi-build"):
|
|
||||||
print """
|
|
||||||
Usage:
|
|
||||||
%s [options] package-name.pspec
|
|
||||||
""" %(progname)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user