]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - pldnotify.awk
- remove .gz from manfiles
[packages/rpm-build-tools.git] / pldnotify.awk
index c0da0a1521dbaf31471cb26588a69bc4cb8ea1f6..59bd2fefca15863e37e0005b76a0fc30b1e6cbc6 100644 (file)
@@ -1,5 +1,7 @@
 #!/bin/awk -f
 # $Revision$, $Date$
+# TODO: "SourceXDownload" support (use given URLs if present instead of cut-down SourceX URLs)
+
 function fixedsub(s1,s2,t,     ind) {
 # substitutes fixed strings (not regexps)
        if (ind = index(t,s1)) {
@@ -159,9 +161,9 @@ function get_links(url,     errno,link,oneline,retval,odp,tmpfile) {
                        if (tolower(odp) ~ /<frame[ \t]/) {
                                match(tolower(odp),/<frame[ \t][^>]*>/)
                                ramka=substr(odp,RSTART,RLENGTH)
-                               odp=substr(odp,RSTART+RLENGTH)
-                               sub(/[sS][rR][cC]=[ \t]+/,"src=",ramka);
-                               match(tolower(ramka),/src="[^"]+"/)
+                               odp=substr(odp,1,RSTART) substr(odp,RSTART+RLENGTH)
+                               sub(/[sS][rR][cC]=[ \t]*/,"src=",ramka);
+                               match(ramka,/src="[^"]+"/)
                                newurl=substr(ramka,RSTART+5,RLENGTH-6)
                                if (DEBUG) print "Ramka: " newurl
                                if (newurl !~ /\//) {
@@ -169,20 +171,30 @@ function get_links(url,   errno,link,oneline,retval,odp,tmpfile) {
                                        if (DEBUG) print "Ramka->: " newurl
                                }
                                retval=(retval " " get_links(newurl))
-                       } else if (tolower(odp) ~ /href=[ \t]*"[^"]+"/) {
-                               sub(/[hH][rR][eE][fF]=[ \t]+/,"href=",odp)
-                               match(tolower(odp),/href="[^"]+"/)
+                       } else if (tolower(odp) ~ /href=[ \t]*"[^"]*"/) {
+                               sub(/[hH][rR][eE][fF]=[ \t]*"/,"href=\"",odp)
+                               match(odp,/href="[^"]*"/)
+                               link=substr(odp,RSTART,RLENGTH)
+                               odp=substr(odp,1,RSTART) substr(odp,RSTART+RLENGTH)
+                               link=substr(link,7,length(link)-7)
+                               retval=(retval " " link)
+                               if (DEBUG) print "href(\"\"): " link
+                       } else if (tolower(odp) ~ /href=[ \t]*'[^']*'/) {
+                               sub(/[hH][rR][eE][fF]=[ \t]*'/,"href='",odp)
+                               match(odp,/href='[^']*'/)
                                link=substr(odp,RSTART,RLENGTH)
-                               odp=substr(odp,RSTART+RLENGTH)
+                               odp=substr(odp,1,RSTART) substr(odp,RSTART+RLENGTH)
                                link=substr(link,7,length(link)-7)
                                retval=(retval " " link)
-                       } else if (tolower(odp) ~ /href=[ \t]*[^ \t>]+/) {
-                               sub(/[hH][rR][eE][fF]=[ \t]+/,"href=",odp)
-                               match(tolower(odp),/href=[^ \t>]+/)
+                               if (DEBUG) print "href(''): " link
+                       } else if (tolower(odp) ~ /href=[ \t]*[^ \t>]*/) {
+                               sub(/[hH][rR][eE][fF]=[ \t]*/,"href=",odp)
+                               match(odp,/href=[^ \t>]*/)
                                link=substr(odp,RSTART,RLENGTH)
-                               odp=substr(odp,RSTART+RLENGTH)
+                               odp=substr(odp,1,RSTART) substr(odp,RSTART+RLENGTH)
                                link=substr(link,6,length(link)-5)
                                retval=(retval " " link)
+                               if (DEBUG) print "href(): " link
                        } else {
                                retval=(retval " INTERNAL_ERROR")
                                break
@@ -226,7 +238,7 @@ function find_mirror(url) {
                        if (prefix==origin){
                                if ( DEBUG ) print "Mirror znaleziony na " mname
                                close("mirrors")
-                               return mirror substr(url,length(origin))
+                               return mirror substr(url,length(origin)+1)
                        }
                }
        }
@@ -295,7 +307,7 @@ function process_source(number,lurl,name,version) {
                                newfilename=fixedsub(prever,"",newfilename)
                                newfilename=fixedsub(postver,"",newfilename)
                                if (DEBUG) print "Wersja: " newfilename
-                               if (newfilename ~ /\.(pkg|bin|binary)$/) continue
+                               if (newfilename ~ /\.(pkg|bin|binary|built)$/) continue
                                if (NUMERIC) {
                                        if ( compare_ver_dec(version, newfilename)==1 ) {
                                                if (DEBUG) print "Tak, jest nowa"
This page took 0.037958 seconds and 4 git commands to generate.