tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

help with awk

Given the following line(s) of a file as an example:

source = { git = "";, rev = "a799bc5da7c2a84bc9a06ba5f3540cf1191e4ee3" }

and this awk script:

BEGIN { print "# $Net" "BSD$"; }
/(^|\n)source =/ { 
        for (i = 1; i <= NF; i++) {
                split($i, f, " ")
                print "field f["$i"]"
                if (f[$i] ~ /^https/)
                if (f[$i] ~ /[a-f0-9]{40}/)
                print name
                print vers
        print "DISTFILES+=\t" name "-" vers ".tar.gz"
# -url/archive/vers.tar.gz
#/^source = {/ { print "DISTFILES+=\t" name "-" vers ".tar.gz"; }

what do I fix to correctly output
DISTFILES+=	name-vers.tar.gz -url/archive/vers.tar.gz

where name is the last path part of url?
I know I'm still missing filtering the name from the url, and basically
everything else, as it's been too long since I had to work in awk.

This is to spare myself or whoever updates editor/helix to do the same
copy-pasting 30+ minutes process again and again with every new release.

Home | Main Index | Thread Index | Old Index