blob: edc2b6e515f1052162f99c618c6a2397c7bcae07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
flag e +
if(~ $#* 0) {
echo 'usage: fetch-curl.rc dir pattern...' >[1=2]
exit 2
}
cd $1
shift
if([ -e src ]) rm -rf src
if(! sha256sum -c sha256 >[2]/dev/null) {
curl -L -K url -O
sha256sum -c sha256
}
for(archive in `{awk '{print $2}' sha256}) {
switch($archive) {
case *.tar.gz *.tgz
tool=zcat
case *.tar.bz2
tool=bzcat
case *.tar.xz
tool=xzcat
case *
tool=()
}
pats=()
while(! ~ $1 '' ';') {
pats=($pats $1)
shift
}
if(~ $#pats 0)
pats='*/*'
shift
if(! ~ $#tool 0) $tool $archive | pax -r -s '/^\.\|[^\/]*/src/' $pats
}
if([ -d patch ]) {
if(prefix=`{git rev-parse --show-prefix >[2]/dev/null}) dir=$prefix^src
if not dir=src
git apply -v '--whitespace=nowarn' --directory $dir patch/*
}
status=()
|