Commit 29c4d5cd authored by Seth Forshee's avatar Seth Forshee Committed by Khalid Elmously

UBUNTU: [Debian] autoreconstruct - add resoration of execute permissions

BugLink: https://bugs.launchpad.net/bugs/1861973

Debian source package diffs cannot represent that a file should
be executable. This is a problem for us if a patch adds a script
which is invoked directly during the build, as happened with a
recent stable update for 4.14. Update gen-auto-reconstruct to
detect this situation and restore the execute permissions in the
reconstruct script. Exclude the debian packaging directories as
the scripts here already account for the loss of execute
permissions.
Signed-off-by: default avatarSeth Forshee <seth.foddrshee@canonical.com>
Signed-off-by: default avatarPo-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: default avatarMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 55301616
...@@ -42,6 +42,23 @@ fi ...@@ -42,6 +42,23 @@ fi
echo "rm -f '$name'" echo "rm -f '$name'"
done done
# Identify files with execute permissions added since the proffered tag.
git diff "$tag.." --raw --no-renames | awk -F '[: \t]' '{print $2, $3, $NF }' | \
while IFS=" " read old new name
do
# Exclude files in debian* directories
if [[ "$name" =~ ^debian ]]; then
continue
fi
old=$( printf "0%s" $old )
new=$( printf "0%s" $new )
changed=$(( (old ^ new) & 0111 ))
if [ "$changed" -ne 0 ]; then
echo "chmod +x '$name'"
fi
done
# All done, make sure this does not complete in error. # All done, make sure this does not complete in error.
echo "exit 0" echo "exit 0"
) >"$reconstruct" ) >"$reconstruct"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment