aboutsummaryrefslogtreecommitdiff
path: root/release/scripts/mtree-to-plist.awk
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-03-05 00:18:32 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-03-05 00:18:32 +0000
commitf1d1786e2497b4c2ae72fe38177efdc49aa875ec (patch)
tree9f067557ff0b1cbbec3d3825c4fd4fb6c1d6e51e /release/scripts/mtree-to-plist.awk
parentca0abefb746f3a59a0496ff0de157c0e429a8f79 (diff)
downloadsrc-f1d1786e2497b4c2ae72fe38177efdc49aa875ec.tar.gz
src-f1d1786e2497b4c2ae72fe38177efdc49aa875ec.zip
Simplify and clean awk script
Suggested by: dteske
Notes
Notes: svn path=/projects/release-pkg/; revision=279608
Diffstat (limited to 'release/scripts/mtree-to-plist.awk')
-rw-r--r--release/scripts/mtree-to-plist.awk22
1 files changed, 9 insertions, 13 deletions
diff --git a/release/scripts/mtree-to-plist.awk b/release/scripts/mtree-to-plist.awk
index 12a6bd97fd02..453c63bb54f0 100644
--- a/release/scripts/mtree-to-plist.awk
+++ b/release/scripts/mtree-to-plist.awk
@@ -1,35 +1,31 @@
#!/usr/bin/awk
/^[^#]/ {
gsub(/^\./,"", $1)
- uname=""
- gname=""
- mode=""
- flags=""
- tags=""
+ uname = gname = mode = flags = tags = ""
for (i=2; i<=NF; i++) {
if ($i ~ /^uname=/) {
uname=$i
- gsub(/uname=/, "", uname);
+ gsub(/uname=/, "", uname)
} else if ($i ~ /^gname=/) {
gname=$i
- gsub(/gname=/, "", gname);
+ gsub(/gname=/, "", gname)
} else if ($i ~ /^mode=/) {
mode=$i
- gsub(/mode=/,"", mode);
+ gsub(/mode=/,"", mode)
} else if ($i ~ /^flags=/) {
flags=$i
- gsub(/flags=/, "", flags);
+ gsub(/flags=/, "", flags)
} else if ($i ~ /^tags=/) {
tags=$i
- gsub(/tags=/, "", tags);
+ gsub(/tags=/, "", tags)
}
}
if (length(tags) == 0)
next
if (tags ~ /package=/) {
- gsub(/package=/,"",tags);
- gsub(/,/, "-", tags);
- gsub(/runtime-/, "", tags);
+ gsub(/package=/,"",tags)
+ gsub(/,/, "-", tags)
+ gsub(/runtime-/, "", tags)
pkg=tags
} else {
pkg=tags