From 98f6b745137d075ee49b70a7214a7e33d37e9f96 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 28 Jun 2016 00:35:03 -0700 Subject: fetch-curl: Support specifying a pattern of files to extract --- scripts/fetch-curl.rc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetch-curl.rc b/scripts/fetch-curl.rc index 09ba2157..9f811837 100755 --- a/scripts/fetch-curl.rc +++ b/scripts/fetch-curl.rc @@ -2,12 +2,13 @@ flag e + -if(! ~ $#* 1) { - echo 'usage: fetch-curl.rc dir' >[1=2] +if(~ $#* 0) { + echo 'usage: fetch-curl.rc dir pattern...' >[1=2] exit 2 } cd $1 +shift if([ -e src ]) rm -rf src @@ -27,7 +28,13 @@ for(archive in `{awk '{print $2}' sha256}) { case * tool=() } - if(! ~ $#tool 0) $tool $archive | pax -r -s '/^\.\|[^\/]*/src/' + pats=() + while(! ~ $1 '' ';') { + pats=($pats $1) + shift + } + shift + if(! ~ $#tool 0) $tool $archive | pax -r -s '/^\.\|[^\/]*/src/' $pats } if([ -d patch ]) { -- cgit v1.2.3