summaryrefslogtreecommitdiffstats
path: root/src/pyfedpkg
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2011-01-21 15:52:42 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2011-02-05 01:24:12 +0100
commit267d1e8d17b1845d311c401cfcff13da25643005 (patch)
tree787e998bff2954c47db27e9474d44daf88987264 /src/pyfedpkg
parent3738d0af3674b700122265ce173b23ae80d4e31c (diff)
downloadfedora-packager-267d1e8d17b1845d311c401cfcff13da25643005.tar.gz
fedora-packager-267d1e8d17b1845d311c401cfcff13da25643005.tar.xz
fedora-packager-267d1e8d17b1845d311c401cfcff13da25643005.zip
Fix permission of files to be put into SRPM
Add an option '--fix-permissions' to the 'fedpkg srpm' call. If the '--fix-permissions' option is not given, the behaviour of 'fedpkg srpm' does not change at all. If the '--fix-permissions' option is given, fedpkg runs git ls-files -z | xargs -0 chmod a+r before running the normal rpmbuild command. This makes sure that all 0600 files the filesystem are changed to the usual 0644 before including them in .src.rpm file.
Diffstat (limited to 'src/pyfedpkg')
-rw-r--r--src/pyfedpkg/__init__.py7
1 files changed, 6 insertions, 1 deletions
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)