[packages/adapter: 262/631] - fix sorting with groups

glen glen at pld-linux.org
Mon Sep 12 19:56:25 CEST 2016


commit d9e2bd9b1d2b7484db21ef91e0833a51aba7b169
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Mon Dec 26 23:10:03 2005 +0000

    - fix sorting with groups
    
    Changed files:
        adapter.awk -> 1.252

 adapter.awk | 67 +++++++++++++++++++++++++++++++------------------------------
 1 file changed, 34 insertions(+), 33 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index 8459489..d985a02 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -123,6 +123,8 @@ function b_makekey(a, b,	s) {
     gsub(/^Obsoletes/, "YObsoletes", s);
     gsub(/^BuildArch/, "ZBuildArch", s);
     gsub(/^BuildRoot/, "ZBuildRoot", s);
+
+#	printf("%s -> %s\n", a""b, s);
 	return s;
 }
 
@@ -552,53 +554,52 @@ preamble == 1 {
 		next
 	if (field ~ /group:/) {
 		format_preamble()
-		sub(/^Utilities\//,"Applications/",$2)
-		sub(/^Games/,"Applications/Games",$2)
-		sub(/^X11\/Games/,"X11/Applications/Games",$2)
-		sub(/^X11\/GNOME\/Development\/Libraries/,"X11/Development/Libraries",$2)
-		sub(/^X11\/GNOME\/Applications/,"X11/Applications",$2)
-		sub(/^X11\/GNOME/,"X11/Applications",$2)
-		sub(/^X11\/Utilities/,"X11/Applications",$2)
-		sub(/^X11\/Games\/Strategy/,"X11/Applications/Games/Strategy",$2)
-		sub(/^Shells/,"Applications/Shells",$2)
-
-		sub(/^[^ \t]*[ \t]*/,"")
-		Grupa = $0
-
-		sub(/^System Environment\/Libraries$/, "Libraries", Grupa)
-		sub(/^System Environment\/Daemons$/, "Daemons", Grupa)
-		sub(/^Applications\/Internet$/, "Applications/Networking", Grupa)
-		sub(/^Applications\/Daemons$/, "Daemons", Grupa)
-		sub(/^Application\/Multimedia$/, "Applications/Multimedia", Grupa)
-		sub(/^System\/Servers$/, "Daemons", Grupa)
-		sub(/^X11\/Xserver$/, "X11/Servers", Grupa)
-		sub(/^X11\/XFree86/, "X11", Grupa)
-		sub(/^Applications\/Compilers$/, "Development/Languages", Grupa)
-		sub(/^Applications\/Internet\/Peer to Peer/, "Applications/Networking", Grupa)
-		sub(/^Networking\/Deamons$/, "Networking/Daemons", Grupa)
-		sub(/^Development\/Docs$/, "Documentation", Grupa)
-
-		print "Group:\t\t" Grupa
-		if (Grupa ~ /^X11/ && x11 == 0)	# Is it X11 application?
+		group = $0;
+		sub(/^[^ \t]*[ \t]*/, "", group);
+
+		sub(/^Utilities\//,"Applications/", group)
+		sub(/^Games/,"Applications/Games", group)
+		sub(/^X11\/Games/,"X11/Applications/Games", group)
+		sub(/^X11\/GNOME\/Development\/Libraries/,"X11/Development/Libraries", group)
+		sub(/^X11\/GNOME\/Applications/,"X11/Applications", group)
+		sub(/^X11\/GNOME/,"X11/Applications", group)
+		sub(/^X11\/Utilities/,"X11/Applications", group)
+		sub(/^X11\/Games\/Strategy/,"X11/Applications/Games/Strategy", group)
+		sub(/^Shells/,"Applications/Shells", group)
+		sub(/^System Environment\/Libraries$/, "Libraries", group)
+		sub(/^System Environment\/Daemons$/, "Daemons", group)
+		sub(/^Applications\/Internet$/, "Applications/Networking", group)
+		sub(/^Applications\/Daemons$/, "Daemons", group)
+		sub(/^Application\/Multimedia$/, "Applications/Multimedia", group)
+		sub(/^System\/Servers$/, "Daemons", group)
+		sub(/^X11\/Xserver$/, "X11/Servers", group)
+		sub(/^X11\/XFree86/, "X11", group)
+		sub(/^Applications\/Compilers$/, "Development/Languages", group)
+		sub(/^Applications\/Internet\/Peer to Peer/, "Applications/Networking", group)
+		sub(/^Networking\/Deamons$/, "Networking/Daemons", group)
+		sub(/^Development\/Docs$/, "Documentation", group)
+
+		$0 = "Group:\t\t" group
+
+		if (group ~ /^X11/ && x11 == 0)	# Is it X11 application?
 			x11 = 1
 
-		byl_plik_z_grupami = 0
+		byl_plik_z_groupmi = 0
 		byl_opis_grupy = 0
 		while ((getline linia_grup < groups_file) > 0) {
-			byl_plik_z_grupami = 1
-			if (linia_grup == Grupa) {
+			byl_plik_z_groupmi = 1
+			if (linia_grup == group) {
 				byl_opis_grupy = 1
 				break
 			}
 		}
 
-		if (!byl_plik_z_grupami)
+		if (!byl_plik_z_groupmi)
 			print "######\t\t" groups_file ": no such file"
 		else if (!byl_opis_grupy)
 			print "######\t\t" "Unknown group!"
 
 		close(groups_file)
-		next
 	}
 
 	if (field ~ /prereq:/) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885



More information about the pld-cvs-commit mailing list