dist: redhat: fix up bad file ownership of rpms/srpms
mock outputs files owned by root. This causes attempts by scripts that want to junk the working directory (typically continuous integration) to fail on permission errors. Fixup those permissions after the fact. Message-Id: <20180719163258.4393-1-avi@scylladb.com> (cherry picked from commit b4d983b45abd1f3dc4bb00b684e2fb9a52047385)
This commit is contained in:
parent
1dc4338c5b
commit
24c90a3587
7
dist/redhat/build_rpm.sh
vendored
7
dist/redhat/build_rpm.sh
vendored
@ -76,5 +76,12 @@ SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE)
|
||||
git archive --format=tar --prefix=scylla-jmx-$SCYLLA_VERSION/ HEAD -o build/scylla-jmx-$VERSION.tar
|
||||
pystache dist/redhat/scylla-jmx.spec.mustache "{ \"version\": \"$SCYLLA_VERSION\", \"release\": \"$SCYLLA_RELEASE\" }" > build/scylla-jmx.spec
|
||||
|
||||
# mock generates files owned by root, fix this up
|
||||
fix_ownership() {
|
||||
sudo chown "$(id -u):$(id -g)" -R "$@"
|
||||
}
|
||||
|
||||
sudo mock --buildsrpm --root=$TARGET --resultdir=`pwd`/build/srpms --spec=build/scylla-jmx.spec --sources=build/scylla-jmx-$VERSION.tar
|
||||
fix_ownership build/srpms
|
||||
sudo mock --rebuild --root=$TARGET --resultdir=`pwd`/build/rpms build/srpms/scylla-jmx-$VERSION*.src.rpm
|
||||
fix_ownership build/rpms
|
||||
|
Loading…
x
Reference in New Issue
Block a user