Commit 25e8ab8e authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

helper: Use gawk instead of awk

In jessie, awk by default is mawk and some features like the "match"
function are not present there.
parent f92cd9bb
......@@ -615,7 +615,7 @@ mount_all() {
esac
fstab="$(grep -v ^\# "${target}/etc/fstab" \
| awk "{ if (match(\$3, \"$fs\")) { print \$2,\$1,\$3 } }" \
| gawk "{ if (match(\$3, \"$fs\")) { print \$2,\$1,\$3 } }" \
| sort -bd)"
# <mpoint> <device> <fs>
while read -ra entry; do
......@@ -683,7 +683,7 @@ umount_all() {
target="$1"
# Unmount file systems mounted under directory `target'
mpoints="$({ awk "{ if (match(\$2, \"^$target\")) { print \$2 } }" < /proc/mounts; } \
mpoints="$({ gawk "{ if (match(\$2, \"^$target\")) { print \$2 } }" < /proc/mounts; } \
| sort -rbd | uniq)"
for mpoint in $mpoints; do
......@@ -701,7 +701,7 @@ get_ufstype() {
set +o pipefail
fi
ufs="$($DUMPFS_UFS "$device" | head -1 \
| awk -F "[()]" '{ for (i=2; i<NF; i+=2) print $i }')"
| gawk -F "[()]" '{ for (i=2; i<NF; i+=2) print $i }')"
if [ "$pipefail" = on ]; then
set -o pipefail
fi
......@@ -835,7 +835,7 @@ examine_gpt_partition() {
id=$($SGDISK -i "$num" "$dev" | \
grep "^Partition GUID code:" | \
cut -f2 -d: | \
awk '{print $1}') || true
gawk '{print $1}') || true
case "$id" in
516E7CB6-6ECF-11D6-8FF8-00022D09712B) # FreeBSD
......@@ -1093,7 +1093,7 @@ check_windows_computer_name() {
log_error "$msg It's size is bigger (=$length) than 15 bytes."
fi
pipefail=$(set -o | grep pipefail | awk '{ print $2 }')
pipefail=$(set -o | grep pipefail | gawk '{ print $2 }')
set -o pipefail
set +e
# We only check for invalid ascii characters but this is OK. The name
......
......@@ -95,7 +95,7 @@ windows_password() {
fi
names="$($HIVEXREGEDIT --export "$sam" '\SAM\Domains\Account\Users\Names' \
| awk 'match($0, /Names\\([^\\]+)\]/, n) { print n[1]; }' )"
| gawk 'match($0, /Names\\([^\\]+)\]/, n) { print n[1]; }' )"
if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = 'windows' ]; then
# Add the users that get created by the unattend.xml file
......
......@@ -21,7 +21,7 @@ debootstrap=Debian GRNet Helper OldHelper
aptsources=Debian
[Debian]
packages=socat iproute xenstore-utils xmlstarlet python parted python-support eatmydata gdisk ntfs-3g python-passlib libhivex-bin libwin-hivex-perl btrfs-tools xfsprogs python-bcrypt upstart
packages=socat iproute xenstore-utils xmlstarlet python parted python-support eatmydata gdisk ntfs-3g python-passlib libhivex-bin libwin-hivex-perl btrfs-tools xfsprogs python-bcrypt upstart gawk
source=http://ftp.gr.debian.org/debian
suite=jessie
......
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