diff options
-rwxr-xr-x | src/fedpkg.py | 3 | ||||
-rw-r--r-- | src/pyfedpkg/__init__.py | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py index 5551722..a62755f 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -1155,6 +1155,9 @@ packages will be built sequentially. parser_srpm.add_argument('--md5', action = 'store_const', dest='hashtype', const='md5', default=None, help = 'Use md5 checksums (for older rpm hosts)') + parser_srpm.add_argument('--fix-permissions', action='store_true', + default=False, + help = 'Fix permissions of files to be put into .src.rpm file') parser_srpm.set_defaults(command = srpm) # switch branches diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 4a36ffc..52998ee 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1681,7 +1681,7 @@ class PackageModule: _run_command(cmd, shell=True) return - def srpm(self, hashtype=None): + def srpm(self, hashtype=None, fix_permissions=False): """Create an srpm using hashtype from content in the module Requires sources already downloaded. @@ -1692,6 +1692,11 @@ class PackageModule: if not hashtype: hashtype = self.hashtype + if fix_permissions: + _run_command(cmd=['git', 'ls-files', '-z'], + pipe= ['xargs', '-0', 'chmod', 'a+r'], + shell=False) + cmd = ['rpmbuild'] cmd.extend(self.rpmdefines) # This may need to get updated if we ever change our checksum default |