Merge lp:~smoser/maas/vdenv-fix-mawk into lp:maas/trunk

Proposed by Scott Moser on 2012-07-20
Status: Merged
Approved by: Andres Rodriguez on 2012-07-20
Approved revision: 759
Merged at revision: 759
Proposed branch: lp:~smoser/maas/vdenv-fix-mawk
Merge into: lp:maas/trunk
Diff against target: 12 lines (+1/-1)
1 file modified
vdenv/zimmer-build/ud-build.txt (+1/-1)
To merge this branch: bzr merge lp:~smoser/maas/vdenv-fix-mawk
Reviewer Review Type Date Requested Status
Andres Rodriguez Approve on 2012-07-20
Launchpad code reviewers 2012-07-20 Pending
Review via email: mp+116067@code.launchpad.net

Commit Message

vdenv: fix usage of awk if awk is 'mawk' rather than 'gawk'

Description of the Change

vdenv: fix usage of awk if awk is 'mawk' rather than 'gawk'

The issue is that /usr/bin/awk is an alternative. and if it is provided by mawk rather than gawk (as it was in roaksoaks case), then it fails just like this:
  $ mawk '{gsub("*","");} $1 == key { print $2 }' "key=$1:" /dev/null
  mawk: line 1: regular expression compile failed (missing operand)
  *

new syntax works in gawk or mawk or busybox awk.

To post a comment you must log in.
Andres Rodriguez (andreserl) wrote :

Looks good to me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'vdenv/zimmer-build/ud-build.txt'
2--- vdenv/zimmer-build/ud-build.txt 2012-07-19 03:12:57 +0000
3+++ vdenv/zimmer-build/ud-build.txt 2012-07-20 20:12:21 +0000
4@@ -110,7 +110,7 @@
5
6 get() {
7 _RET=$(debconf-show ${1%%/*} 2>/dev/null |
8- awk '{gsub("*","");} $1 == key { print $2 }' "key=$1:")
9+ awk '{gsub("[*]","");} $1 == key { print $2 }' "key=$1:")
10 }
11 show() {
12 while [ $# -ne 0 ]; do