summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BuildManager/build.py2
-rw-r--r--BuildManager/package.py11
-rw-r--r--bash-completion/bm4
-rw-r--r--bm2
-rw-r--r--man/bm.84
5 files changed, 16 insertions, 7 deletions
diff --git a/BuildManager/build.py b/BuildManager/build.py
index 5a039bb..d8762c5 100644
--- a/BuildManager/build.py
+++ b/BuildManager/build.py
@@ -40,7 +40,7 @@ class PackageBuilder:
self.pkglist = PackageList()
logger.info("creating package list")
for filename in self.opts.args:
- pkg = Package(filename, self.opts.build_log)
+ pkg = Package(filename, self.opts.build_log, self.opts.forceunpack)
if pkg.type == 'rpm':
logger.info("skipping %s, not a src.rpm" % filename)
break
diff --git a/BuildManager/package.py b/BuildManager/package.py
index 031e36e..1c88bd3 100644
--- a/BuildManager/package.py
+++ b/BuildManager/package.py
@@ -26,15 +26,15 @@ def subst(s, vars):
raise Error("variable $%s not declared" % var)
class Package:
- def __init__(self, file, log=None):
+ def __init__(self, file, log=None, flag=False):
self._package = None
ext = self._filename_extension(file)
if not ext:
raise Error("unknown file extension of "+file)
if "_package_"+ext not in globals():
raise Error("unknown package extension of "+file)
- self._package = globals()["_package_"+ext](file, log)
-
+ self._package = globals()["_package_"+ext](file, log, flag)
+
def __getattr__(self, name):
return getattr(self._package, name)
@@ -47,7 +47,7 @@ class Package:
return filename[dotpos+1:]
class _package:
- def __init__(self, file, log):
+ def __init__(self, file, log, flag):
self.file = file
self.absfile = os.path.abspath(file)
self.type = None
@@ -58,6 +58,7 @@ class _package:
self.spec = None
self.builddir = None
self.log = log or "$builddir/SPECS/log.$name"
+ self.flag = flag or False
self._init()
def __cmp__(self, pkg):
@@ -150,6 +151,8 @@ class _package_rpm(_package):
h = rpm.headerFromPackage(file.fileno())[0]
else:
ts = rpm.TransactionSet()
+ if self.flag:
+ ts.setVSFlags(-1)
h = ts.hdrFromFdno(file.fileno())
file.close()
self.name = h[rpm.RPMTAG_NAME]
diff --git a/bash-completion/bm b/bash-completion/bm
index 65c6efb..feb2c18 100644
--- a/bash-completion/bm
+++ b/bash-completion/bm
@@ -28,8 +28,8 @@ _bm()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--version -h --help -a -u -p -c -i \
- -s -b -l -j -o --unpack-dir= --build-log= --move-srpm= \
- --move-rpm= --move-failed-srpm= --copy-failed-srpm= \
+ -s -b -l -j -o --unpack-dir= --build-log= --force-unpack \
+ --move-srpm= --move-rpm= --move-failed-srpm= --copy-failed-srpm= \
--remove-failed-srpm --move-succeeded-srpm= \
--copy-succeeded-srpm= --remove-succeeded-srpm \
--move-log= --move-failed-log= --filter-renew= \
diff --git a/bm b/bm
index 7a50e4c..9b8ca66 100644
--- a/bm
+++ b/bm
@@ -84,6 +84,8 @@ def parse_options():
help="same as --clean, but only remove if build has succeeded")
parser.add_option("--ignore", metavar="PKGNAME", action="append", default=[],
help="ignore given package names (shell globbing allowed)")
+ parser.add_option("--force-unpack", dest="forceunpack", action="store_true",
+ help="force unpacking regardless of rpm errors or warnings", default=False)
# Passtrough options
parser.add_option("--sign", action="callback", nargs=0, callback=passtrough,
diff --git a/man/bm.8 b/man/bm.8
index 855dc77..8794c1c 100644
--- a/man/bm.8
+++ b/man/bm.8
@@ -69,6 +69,10 @@ pass given parameters directly to rpm
specify directory where to unpack \fBfile\fP(s)
.TP
.B
+\fB--force-unpack\fP
+force unpacking regardless of rpm errors or warnings
+.TP
+.B
\fB--build-log\fP=FILE
specify where to put the build log for each package
.TP