diff options
| author | Michael Forney <mforney@mforney.org> | 2016-04-23 22:47:40 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-04-23 22:47:40 -0700 |
| commit | a4d1777beea410e56bdf39e2e075797a8b0580f0 (patch) | |
| tree | 6f96b490d31938420210bfe12ed72502df714098 /util | |
| parent | 39c4754056d2bbdf041cd71c7ca1b61023c701f4 (diff) | |
Add some scripts to help fetch non-git packages
Diffstat (limited to 'util')
| -rwxr-xr-x | util/fetch-curl.rc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/util/fetch-curl.rc b/util/fetch-curl.rc new file mode 100755 index 00000000..ee7eed6b --- /dev/null +++ b/util/fetch-curl.rc @@ -0,0 +1,35 @@ +#!/bin/rc + +flag e + + +ifs=' +' + +cd `{dirname $0} + +if([ -d src ]) rm -rf src + +if(! sha256sum -c sha256 >[2]/dev/null) { + curl -L -O -K url + sha256sum -c sha256 +} + +for(archive in `{awk '{print $2}' sha256}) { + switch($archive) { + case *.gz + tool=zcat + case *.bz2 + tool=bzcat + case *.xz + tool=xzcat + case * + tool=() + } + if(! ~ $#tool 0) $tool $archive | pax -r -s '/^\.\|[^\/]*/src/' +} + +if([ -d patch ]) { + if(! dir=`{git rev-parse --show-prefix}^src >[2]/dev/null) dir=src + git apply -v --directory $dir patch/* +} +status=() |
