SPECS: adapter.awk - more python egg info code

glen glen at pld-linux.org
Fri Oct 17 00:26:24 CEST 2008


Author: glen                         Date: Thu Oct 16 22:26:24 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- more python egg info code

---- Files affected:
SPECS:
   adapter.awk (1.407 -> 1.408) 

---- Diffs:

================================================================
Index: SPECS/adapter.awk
diff -u SPECS/adapter.awk:1.407 SPECS/adapter.awk:1.408
--- SPECS/adapter.awk:1.407	Fri Oct 17 00:10:13 2008
+++ SPECS/adapter.awk	Fri Oct 17 00:26:18 2008
@@ -534,7 +534,9 @@
 	if ($0 ~ /^%files/)
 		defattr = 1
 
-	use_files_macros()
+	if (!use_files_macros()) {
+		next
+	}
 }
 
 ##############
@@ -1372,7 +1374,7 @@
 
 	# skip comments
 	if (/^#/) {
-		return;
+		return 1;
 	}
 
 	sub("^%doc %{_mandir}", "%{_mandir}")
@@ -1494,18 +1496,27 @@
 
 	# python egg-infos
 	if (match($0, "^%{py_site(script)?dir}/.+-py"py_ver".egg-info$")) {
+		# tests:
+		#%{py_sitedir}/*-py2.4.egg-info
+		#%{py_sitescriptdir}/GnuPGInterface-%{version}-py2.4.egg-info
+		#%{py_sitescriptdir}/python_mpd-%{version}-py2.4.egg-info
+		#%{py_sitescriptdir}/mechanize-0.1.6b-py2.4.egg-info
+
 		l = index($0, "/");
-		t = substr($0, 0, l - 1);
+		t = substr($0, 0, l);
 		s = substr($0, l + 1, RLENGTH - l - length("-py"py_ver".egg-info"));
 		if (match(s, "[^-]+$")) {
-			if (RLENGTH > 1) {
-				s = substr(s, 0, RSTART - 2);
+#printf("s[%s]; start[%d]; length[%d]\n", s, RSTART, RLENGTH);
+			if (RSTART > 1) {
+				s = substr(s, 0, RSTART - 1);
 			}
+#printf("s2[%s]\n", s);
 			print "%if \"%{py_ver}\" > \"2.4\""
+#print t "/.+.egg-info"
 			gsub(t "/.+.egg-info", t "/" s "-*.egg-info");
 			print
 			print "%endif"
-			next
+			return 0;
 		}
 	}
 
@@ -1523,6 +1534,8 @@
 	gsub("%{_datadir}/pixmaps", "%{_pixmapsdir}");
 	gsub("%{_datadir}/pear", "%{php_pear_dir}");
 	gsub("%{_datadir}/php", "%{php_data_dir}");
+
+	return 1
 }
 
 function use_script_macros()
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/adapter.awk?r1=1.407&r2=1.408&f=u



More information about the pld-cvs-commit mailing list