summaryrefslogtreecommitdiffstats
path: root/BuildManager
diff options
context:
space:
mode:
authordaviddavid <geiger.david68210@gmail.com>2024-02-12 19:07:53 +0100
committerdaviddavid <geiger.david68210@gmail.com>2024-02-12 19:07:53 +0100
commit23ce51cf774a24cafd46a9a5896e54f45c42de35 (patch)
tree38b904a5c8c3250ef169469834c03add257799db /BuildManager
parentfde9fe10ef2bb4d201f81c28052dd82f36276cff (diff)
downloadbm-23ce51cf774a24cafd46a9a5896e54f45c42de35.tar
bm-23ce51cf774a24cafd46a9a5896e54f45c42de35.tar.gz
bm-23ce51cf774a24cafd46a9a5896e54f45c42de35.tar.bz2
bm-23ce51cf774a24cafd46a9a5896e54f45c42de35.tar.xz
bm-23ce51cf774a24cafd46a9a5896e54f45c42de35.zip
Add "--force-unpack" command to force unpacking (mga#32829)
- Thanks to Aurelian R
Diffstat (limited to 'BuildManager')
-rw-r--r--BuildManager/build.py2
-rw-r--r--BuildManager/package.py11
2 files changed, 8 insertions, 5 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]