summaryrefslogtreecommitdiffstats
path: root/files/pkglist.awk
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackware.com>2017-10-19 13:49:43 -0500
committerRobby Workman <rworkman@slackware.com>2017-10-22 01:59:41 -0500
commit406e0e84f5321652fa1a539d80be6ca5df1ffb1b (patch)
tree0225a21dca44efe55180ee2e83027d5eaca2ddec /files/pkglist.awk
downloadslackpkg-2.82.2.tar.xz
*: Initial commit of slackpkg (as of 2.82.2 release)2.82.2
Diffstat (limited to 'files/pkglist.awk')
-rw-r--r--files/pkglist.awk35
1 files changed, 35 insertions, 0 deletions
diff --git a/files/pkglist.awk b/files/pkglist.awk
new file mode 100644
index 0000000..5a0c18e
--- /dev/null
+++ b/files/pkglist.awk
@@ -0,0 +1,35 @@
+!/source\// && !/\.asc$/ {
+ INPUT=$NF
+ fs=FS
+ FS="/" ; OFS="/"
+ $0=INPUT
+ if ( $2 != "var" ) {
+ DIR=$2
+ FULLPACK=$NF
+ } else {
+ DIR="local"
+ FULLPACK=$NF".tgz"
+ }
+ NF=NF-1
+ PATH=$0
+ FS="-" ; OFS="-"
+ $0=FULLPACK
+ if ( NF > 3 ) {
+ SIZE=split($NF,RELEXT,".")
+ EXTENSION=RELEXT[SIZE]
+ LAST=length($NF)-4
+ RELEASE=substr($NF,1,LAST)
+ ARCH=$(NF-1)
+ VERSION=$(NF-2)
+ NF=NF-3
+ NAME=$0
+ } else {
+ RELEASE=none
+ ARCH=none
+ VERSION=none
+ EXTENSION=tgz
+ NAME=$0
+ }
+ FS=fs
+ print DIR" "NAME" "VERSION" "ARCH" "RELEASE" "NAME"-"VERSION"-"ARCH"-"RELEASE" "PATH" "EXTENSION
+}