Date: Thu, 5 Mar 2015 00:18:33 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r279608 - projects/release-pkg/release/scripts Message-ID: <201503050018.t250IXYC076573@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Thu Mar 5 00:18:32 2015 New Revision: 279608 URL: https://svnweb.freebsd.org/changeset/base/279608 Log: Simplify and clean awk script Suggested by: dteske Modified: projects/release-pkg/release/scripts/mtree-to-plist.awk Modified: projects/release-pkg/release/scripts/mtree-to-plist.awk ============================================================================== --- projects/release-pkg/release/scripts/mtree-to-plist.awk Thu Mar 5 00:13:42 2015 (r279607) +++ projects/release-pkg/release/scripts/mtree-to-plist.awk Thu Mar 5 00:18:32 2015 (r279608) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503050018.t250IXYC076573>