Skip to contentSkip to conversation

vif-bridge: fix cut behavior change

PATCH In review Bob Proulx 2 participants 3 messages Aug 9, 2013 – Aug 20, 2013

lore
Share & tools
lore

Bob Proulx

author
#0 lore raw

PATCH 1/1 vif-bridge: fix cut behavior change

A recent change in GNU cut disallows use of a newline as a field delimiter. Avoid the problematic use of cut in vif-bridge.

---
 tools/hotplug/Linux/vif-bridge | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/hotplug/Linux/vif-bridge +1 -2
index f489519..9a6f82a 100644
@@ -37,8 +37,7 @@ bridge=$(xenstore_read_default "$XENBUS_PATH/bridge" "$bridge")
 
 if [ -z "$bridge" ]
 then
-  bridge=$(brctl show | cut -d "
-" -f 2 | cut -f 1)
+  bridge=$(brctl show | awk 'NR==2{print$1}')
 
   if [ -z "$bridge" ]
   then
Signature · 1 line
1.8.4.rc1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Bob Proulx

A recent change in GNU cut disallows use of a newline as a field delimiter. Avoid the problematic use of cut in vif-bridge.

Both of the committers who generally deal with toolside stuff are away (at debconf) at the moment, but this is on my list to deal with when I get back.

Cheers,
Ian.

Quoted 18 lines
---
 tools/hotplug/Linux/vif-bridge | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/hotplug/Linux/vif-bridge +1 -2
index f489519..9a6f82a 100644
@@ -37,8 +37,7 @@ bridge=$(xenstore_read_default "$XENBUS_PATH/bridge" "$bridge")
 
 if [ -z "$bridge" ]
 then
-  bridge=$(brctl show | cut -d "
-" -f 2 | cut -f 1)
+  bridge=$(brctl show | awk 'NR==2{print$1}')
 
   if [ -z "$bridge" ]
   then