diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2011-01-21 15:52:42 +0100 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2011-01-21 17:09:46 +0100 |
commit | 0df9afbeb29ea708ad5b4f16551076f1c9d43f56 (patch) | |
tree | b733cbb318c68b586c4d49ec0315a0725aabbf35 /src/pyfedpkg/__init__.py | |
parent | b231f35b52825383c8b8d8f33b8fe651d78489b8 (diff) | |
download | fedora-packager-0df9afbeb29ea708ad5b4f16551076f1c9d43f56.tar.gz fedora-packager-0df9afbeb29ea708ad5b4f16551076f1c9d43f56.tar.xz fedora-packager-0df9afbeb29ea708ad5b4f16551076f1c9d43f56.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/__init__.py')
-rw-r--r-- | src/pyfedpkg/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 |