summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/fedpkg.py6
-rw-r--r--src/pyfedpkg/__init__.py7
2 files changed, 11 insertions, 2 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py
index e1e63e9..207f479 100755
--- a/src/fedpkg.py
+++ b/src/fedpkg.py
@@ -669,7 +669,8 @@ def srpm(args):
try:
mymodule = pyfedpkg.PackageModule(args.path, args.dist)
pyfedpkg.sources(args.path)
- mymodule.srpm(hashtype=args.hashtype)
+ mymodule.srpm(hashtype=args.hashtype,
+ fix_permissions=args.fix_permissions)
except pyfedpkg.FedpkgError, e:
log.error('Could not make an srpm: %s' % e)
sys.exit(1)
@@ -1147,6 +1148,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 fdfdfe7..510cfe7 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -1724,7 +1724,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.
@@ -1742,6 +1742,11 @@ class PackageModule:
# srpm is newer, don't redo it
return
+ if fix_permissions:
+ _run_command(cmd=['git', 'ls-files', '-z'],
+ pipe= ['xargs', '-0', 'chmod', 'a+r'],
+ shell=False)
+
cmd = ['rpmbuild']
cmd.extend(self.rpmdefines)