svn commit: r279660 - projects/release-pkg/release/scripts

Baptiste Daroussin bapt at FreeBSD.org
Thu Mar 5 16:20:54 UTC 2015


Author: bapt
Date: Thu Mar  5 16:20:53 2015
New Revision: 279660
URL: https://svnweb.freebsd.org/changeset/base/279660

Log:
  Support a config tag to flag a file that should be merge on upgrade

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 16:19:45 2015	(r279659)
+++ projects/release-pkg/release/scripts/mtree-to-plist.awk	Thu Mar  5 16:20:53 2015	(r279660)
@@ -25,14 +25,30 @@
 	if (length(tags) == 0)
 		next
 	if (tags ~ /package=/) {
-		gsub(/package=/,"",tags)
-		gsub(/,/, "-", tags)
-		gsub(/runtime-/, "", tags)
-		pkg=tags
+		ext = pkgname = ""
+		split(tags, a, ",");
+		for (i in a) {
+			if (a[i] ~ /^package=/) {
+				pkgname=a[i]
+				gsub(/package=/, "", pkgname)
+			} else if (a[i] == "config") {
+				type="config"
+			} else {
+				ext=a[i]
+			}
+		}
+		if (length(ext) > 0) {
+			if (pkgname == "runtime") {
+				pkgname=ext
+			} else {
+				pkgname=pkgname"-"ext
+			}
+		}
 	} else {
-		pkg=tags
+		print "No packages specified in line: $0" > 2
+		next
 	}
-	output=pkg".plist"
+	output=pkgname".plist"
 
 	print "@"type"("uname","gname","mode","flags") " $1 > output
 }


More information about the svn-src-projects mailing list