Instead of removing the | when an alternative is found in the control
file such as
cryptsetup-bin | cryptsetup
remove the surrounding spaces so that it is treated as a regular
expression that matches either one.
Replace the form
sudo bash -c "FOO=bar ..."
with
sudo env FOO=bar ...
to reduce the levels of shell escaping.
Reported-by: http://dyweni.com/
Signed-off-by: Loic Dachary <ldachary@redhat.com>
packages=$(dpkg-checkbuilddeps --admindir=$DIR debian/control 2>&1 | \
perl -p -e 's/.*Unmet build dependencies: *//;' \
-e 's/build-essential:native/build-essential/;' \
- -e 's/\|//g;' \
+ -e 's/\s*\|\s*/\|/g;' \
-e 's/\(.*?\)//g;' \
-e 's/ +/\n/g;' | sort)
case $(lsb_release -sc) in
;;
esac
packages=$(echo $packages) # change newlines into spaces
- $SUDO bash -c "DEBIAN_FRONTEND=noninteractive apt-get install $backports -y $packages" || exit 1
+ $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install $backports -y $packages || exit 1
;;
CentOS|Fedora|RedHatEnterpriseServer)
case $(lsb_release -si) in