Package: xen-utils-common
Version: 4.0.0-1
Severity: wishlist
Tags: patch
I am not a gawk/mawk expert, but I looked carefully at the few uses of
gawk that I saw in /etc/xen/scripts/vtpm-common.sh and network-bridge,
and I did not see anything that was gawk-specific. It would be nice if
they could be changed to awk and the dependency on gawk removed.
base-files is Essential: yes and it PreDepends: awk. I am not sure, but
I think this means that other packages do not need an explicit Depends:
awk. The attached patch does not modify debian/control, but it replaces
gawk with awk in the above two named scripts.
I have not tested the changes in context, as I have no idea what vtpm
is, and can't put network bridge through normal use until bug 588888 is
solved, but I did test the change from network-bridge manually by
extracting the pipeline where gawk was used and trying it with both gawk
and mawk and comparing the results.
...Marvin
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages xen-utils-common depends on:
ii gawk 1:3.1.7.dfsg-5 GNU awk, a pattern scanning and pr
ii lsb-base 3.2-23.1 Linux Standard Base 3.2 init scrip
ii udev 158-1 /dev/ and hotplug management daemo
ii xenstore-utils 4.0.1~rc3-1 Xenstore utilities for Xen
xen-utils-common recommends no packages.
xen-utils-common suggests no packages.
-- no debconf information
diff -ru xen-common-4.0.0/tools/hotplug/Linux/network-bridge xen-common-4.0.0-mrvn/tools/hotplug/Linux/network-bridge
--- xen-common-4.0.0/tools/hotplug/Linux/network-bridge 2010-06-21 09:46:02.000000000 -0400
+++ xen-common-4.0.0-mrvn/tools/hotplug/Linux/network-bridge 2010-07-15 10:03:21.000000000 -0400
@@ -80,7 +80,7 @@
local interf=$1
local prefix=${interf%[[:digit:]]}
local ifs=$(ip link show | grep " $prefix" |\
- gawk '{ printf ("%s",substr($2,1,length($2)-1)) }' |\
+ awk '{ printf ("%s",substr($2,1,length($2)-1)) }' |\
sed s/$interf//)
echo "$ifs"
}
diff -ru xen-common-4.0.0/tools/hotplug/Linux/vtpm-common.sh xen-common-4.0.0-mrvn/tools/hotplug/Linux/vtpm-common.sh
--- xen-common-4.0.0/tools/hotplug/Linux/vtpm-common.sh 2010-06-21 09:46:02.000000000 -0400
+++ xen-common-4.0.0-mrvn/tools/hotplug/Linux/vtpm-common.sh 2010-07-15 10:04:45.000000000 -0400
@@ -98,7 +98,7 @@
avail=0
else
instances=$(cat $VTPMDB | \
- gawk \
+ awk \
'{ \
if (1 != index($1,"#")) { \
printf("%s ",$2); \
@@ -120,7 +120,7 @@
function vtpmdb_get_free_instancenum () {
local ctr instances don found
instances=$(cat $VTPMDB | \
- gawk \
+ awk \
'{ \
if (1 != index($1,"#")) { \
printf("%s ",$2); \
@@ -174,7 +174,7 @@
inst=$2
res=$(cat $VTPMDB | \
- gawk -vvmname=$vmname \
+ awk -vvmname=$vmname \
-vinst=$inst \
'{ \
if ( 1 == index($1,"#")) {\
@@ -209,7 +209,7 @@
VTPMDB_TMP="$VTPMDB".tmp
$(cat $VTPMDB | \
- gawk -vvmname=$vmname \
+ awk -vvmname=$vmname \
'{ \
if ( $1 != vmname ) { \
print $0; \
@@ -350,13 +350,13 @@
function vtpm_isLocalAddress() {
local addr res
addr=$(ping $1 -c 1 | \
- gawk '{ print substr($3,2,length($3)-2); exit }')
+ awk '{ print substr($3,2,length($3)-2); exit }')
if [ "$addr" == "" ]; then
echo "-1"
return
fi
res=$(ifconfig | grep "inet addr" | \
- gawk -vaddr=$addr \
+ awk -vaddr=$addr \
'{ \
if ( addr == substr($2, 6)) {\
print "1"; \