commit 484bbf6dc1307392038ea26da103efbfb0316391
Author: Elan Ruusamäe <[email protected]>
Date:   Thu Oct 16 22:26:18 2008 +0000

    - more python egg info code
    
    Changed files:
        adapter.awk -> 1.408

 adapter.awk | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index 5634c2d..40d3083 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -534,7 +534,9 @@ function b_makekey(a, b,    s) {
        if ($0 ~ /^%files/)
                defattr = 1
 
-       use_files_macros()
+       if (!use_files_macros()) {
+               next
+       }
 }
 
 ##############
@@ -1372,7 +1374,7 @@ function use_files_macros(        i, n, t, a, l)
 
        # skip comments
        if (/^#/) {
-               return;
+               return 1;
        }
 
        sub("^%doc %{_mandir}", "%{_mandir}")
@@ -1494,18 +1496,27 @@ function use_files_macros(      i, n, t, a, l)
 
        # 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 @@ function use_files_macros(        i, n, t, a, l)
        gsub("%{_datadir}/pixmaps", "%{_pixmapsdir}");
        gsub("%{_datadir}/pear", "%{php_pear_dir}");
        gsub("%{_datadir}/php", "%{php_data_dir}");
+
+       return 1
 }
 
 function use_script_macros()
================================================================

---- gitweb:

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

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to