diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-18 18:49:13 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-18 18:49:37 +0200 |
commit | 123687a5aa3482b5ba9ca86179526c94422b409d (patch) | |
tree | 83fa480a7727cd67eb5840e7555d984478c53afd /xpkg | |
parent | 830afa08f95e2026f97b62d22484c27d42c104b1 (diff) | |
download | patches-123687a5aa3482b5ba9ca86179526c94422b409d.tar.gz |
Add savepatch, xpkg scripts
Diffstat (limited to 'xpkg')
-rwxr-xr-x | xpkg | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,26 @@ +#!/bin/sh -e + +# xpkg -- fetch and extract pkgsrc archive + +case "$PWD" in +/usr/pkgsrc/*/*) ;; +*) echo "${0##*/}: not in package directory" 1>&2; exit 1 ;; +esac + +make fetch +f=/usr/pkgsrc/distfiles/$(sed -n '/.*(\(.*\)).*/{s//\1/;p;q}' distinfo) +d=$(tar -tf "$f" | head -1) + +opt= +if [ -e "$d" ]; then + printf "%s: $d already exists; overwrite? " "${0##*/}" + read ans + case $ans in + y*) opt=-U ;; + *) exit 1 ;; + esac +fi + +echo extracting archive... 1>&2 +tar -x $opt -f "$f" +echo "$d" |