diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2016-08-15 17:38:20 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2016-08-15 17:39:46 +0200 |
commit | fbe849134ff7a8b21e65d66def273827b208b326 (patch) | |
tree | 814ac983da5678a8c62d07d2e2352f52e266a881 | |
parent | e6f08f5e9fc688d97f859ebb96d3260481bce883 (diff) | |
download | ptxdist-2016.08.0.tar.gz ptxdist-2016.08.0.tar.xz |
ptxd_make_get_git: check permissions before changing themptxdist-2016.08.0
If someone else created the initial repository, then FETCH_HEAD already has
the correct permissions but 'chmod' will fail, so only try to change the
permissions if they are incorrect.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | scripts/lib/ptxd_make_get.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_make_get.sh b/scripts/lib/ptxd_make_get.sh index 3f57c8d3f..a0b961524 100644 --- a/scripts/lib/ptxd_make_get.sh +++ b/scripts/lib/ptxd_make_get.sh @@ -140,7 +140,9 @@ ptxd_make_get_git() { git --git-dir="${mirror}" remote add origin "${url}" && git --git-dir="${mirror}" fetch --progress -pf origin "+refs/*:refs/*" && # at least for some git versions this is not group writeable for shared repos - chmod g+w "${mirror}/FETCH_HEAD" && + if [ "$(stat -c '%A' "${mirror}/FETCH_HEAD" | cut -c 6)" != "w" ]; then + chmod g+w "${mirror}/FETCH_HEAD" + fi && if ! git --git-dir="${mirror}" rev-parse --verify -q "${tag}" > /dev/null; then ptxd_make_serialize_put |