Commit 427944a1 authored by Simon McVittie's avatar Simon McVittie

Merge branch 'wip/fdanis/6575' into 'master'

Fix script execution when bash is not available

See merge request smcv/flatdeb!1
parents 285e8097 54120fd8
......@@ -229,8 +229,8 @@ actions:
- action: run
label: put-ldconfig-in-path
chroot: true
script: put-ldconfig-in-path
chroot: false
command: 'echo; "$RECIPEDIR/put-ldconfig-in-path" "$ROOTDIR"'
- action: run
label: clean-up-before-pack
......@@ -279,8 +279,8 @@ actions:
- action: run
label: symlink-alternatives
chroot: true
script: symlink-alternatives
chroot: false
command: 'echo; "$RECIPEDIR/symlink-alternatives" "$ROOTDIR"'
{{ if $debug_symbols }}
- action: run
......
......@@ -30,16 +30,24 @@ set -o pipefail
me="$(basename "$0")"
if [ "$#" != 0 ] || [ "x$(id -u)" != x0 ]; then
if [ "$#" != 1 ] || [ "$1" = '--help' ] || [ "x$(id -u)" != x0 ] ||
! [ -d "$1" ]; then
echo "$me: Usage:" >&2
echo " $me" >&2
echo " $me SYSROOT" >&2
echo "" >&2
echo "Run this script as root, in the container." >&2
echo "Run this script as root." >&2
exit 2
fi
set -x
if ! test -e /bin/ldconfig; then
ln -s /sbin/ldconfig /bin/ldconfig
sysroot="$1"
cd "$sysroot"
in_chroot () {
chroot "$sysroot" "$@"
}
if ! test -e $sysroot/bin/ldconfig; then
in_chroot ln -s /sbin/ldconfig /bin/ldconfig
fi
......@@ -30,15 +30,23 @@ set -o pipefail
me="$(basename "$0")"
if [ "$#" != 0 ] || [ "x$(id -u)" != x0 ]; then
if [ "$#" != 1 ] || [ "$1" = '--help' ] || [ "x$(id -u)" != x0 ] ||
! [ -d "$1" ]; then
echo "$me: Usage:" >&2
echo " $me" >&2
echo " $me SYSROOT" >&2
echo "" >&2
echo "Run this script as root, in the container." >&2
echo "Run this script as root." >&2
exit 2
fi
find / -xdev '(' \
sysroot="$1"
cd "$sysroot"
in_chroot () {
chroot "$sysroot" "$@"
}
in_chroot find / -xdev '(' \
-lname '/etc/alternatives/*' -o \
-lname '/etc/locale.alias' \
')' -exec sh -euc '
......
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