forked from josch/mmdebstrap
coverage.sh: only patch /etc/shadow if necessary
This commit is contained in:
parent
46c9d4e058
commit
4daae7e9be
1 changed files with 20 additions and 4 deletions
16
coverage.sh
16
coverage.sh
|
@ -209,10 +209,26 @@ for f in "/tmp/debian-$dist-debootstrap/etc/shells" "/tmp/debian-$dist-mm/etc/sh
|
||||||
done
|
done
|
||||||
|
|
||||||
# workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917773
|
# workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917773
|
||||||
|
if ! cmp /tmp/debian-$dist-debootstrap/etc/shadow /tmp/debian-$dist-mm/etc/shadow; then
|
||||||
|
echo patching /etc/shadow on $dist $variant
|
||||||
|
head /tmp/debian-$dist-debootstrap/etc/shadow /tmp/debian-$dist-mm/etc/shadow
|
||||||
|
echo \$SOURCE_DATE_EPOCH
|
||||||
|
awk -v SDE=\$SOURCE_DATE_EPOCH 'BEGIN { print int(SDE/60/60/24) }'
|
||||||
awk -v FS=: -v OFS=: -v SDE=\$SOURCE_DATE_EPOCH '{ print \$1,\$2,int(SDE/60/60/24),\$4,\$5,\$6,\$7,\$8,\$9 }' < /tmp/debian-$dist-mm/etc/shadow > /tmp/debian-$dist-mm/etc/shadow.bak
|
awk -v FS=: -v OFS=: -v SDE=\$SOURCE_DATE_EPOCH '{ print \$1,\$2,int(SDE/60/60/24),\$4,\$5,\$6,\$7,\$8,\$9 }' < /tmp/debian-$dist-mm/etc/shadow > /tmp/debian-$dist-mm/etc/shadow.bak
|
||||||
mv /tmp/debian-$dist-mm/etc/shadow.bak /tmp/debian-$dist-mm/etc/shadow
|
mv /tmp/debian-$dist-mm/etc/shadow.bak /tmp/debian-$dist-mm/etc/shadow
|
||||||
|
else
|
||||||
|
echo no difference for /etc/shadow on $dist $variant
|
||||||
|
fi
|
||||||
|
if ! cmp /tmp/debian-$dist-debootstrap/etc/shadow- /tmp/debian-$dist-mm/etc/shadow-; then
|
||||||
|
echo patching /etc/shadow- on $dist $variant
|
||||||
|
echo \$SOURCE_DATE_EPOCH
|
||||||
|
awk -v SDE=\$SOURCE_DATE_EPOCH 'BEGIN { print int(SDE/60/60/24) }'
|
||||||
|
head /tmp/debian-$dist-debootstrap/etc/shadow- /tmp/debian-$dist-mm/etc/shadow-
|
||||||
awk -v FS=: -v OFS=: -v SDE=\$SOURCE_DATE_EPOCH '{ print \$1,\$2,int(SDE/60/60/24),\$4,\$5,\$6,\$7,\$8,\$9 }' < /tmp/debian-$dist-mm/etc/shadow- > /tmp/debian-$dist-mm/etc/shadow-.bak
|
awk -v FS=: -v OFS=: -v SDE=\$SOURCE_DATE_EPOCH '{ print \$1,\$2,int(SDE/60/60/24),\$4,\$5,\$6,\$7,\$8,\$9 }' < /tmp/debian-$dist-mm/etc/shadow- > /tmp/debian-$dist-mm/etc/shadow-.bak
|
||||||
mv /tmp/debian-$dist-mm/etc/shadow-.bak /tmp/debian-$dist-mm/etc/shadow-
|
mv /tmp/debian-$dist-mm/etc/shadow-.bak /tmp/debian-$dist-mm/etc/shadow-
|
||||||
|
else
|
||||||
|
echo no difference for /etc/shadow- on $dist $variant
|
||||||
|
fi
|
||||||
|
|
||||||
# check if the file content differs
|
# check if the file content differs
|
||||||
diff --no-dereference --recursive /tmp/debian-$dist-debootstrap /tmp/debian-$dist-mm
|
diff --no-dereference --recursive /tmp/debian-$dist-debootstrap /tmp/debian-$dist-mm
|
||||||
|
|
Loading…
Reference in a new issue