diff --git a/Makefile b/Makefile index f978e96..3d6af14 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ - SOURCES = sources CONFIG_SUB_REV = 3d5db9ebe860 @@ -19,8 +18,10 @@ GMP_SITE = $(GNU_SITE)/gmp MPC_SITE = $(GNU_SITE)/mpc MPFR_SITE = $(GNU_SITE)/mpfr -# ISL_SITE = https://libisl.sourceforge.io -ISL_SITE = https://downloads.sourceforge.net/project/libisl/ +# SOURCEFORGE_MIRROT = https://downloads.sourceforge.net +SOURCEFORGE_MIRROT = https://jaist.dl.sourceforge.net + +ISL_SITE = $(SOURCEFORGE_MIRROT)/project/libisl GCC_SNAP = https://sourceware.org/pub/gcc/snapshots MUSL_SITE = https://musl.libc.org/releases @@ -28,9 +29,9 @@ MUSL_SITE = https://musl.libc.org/releases MUSL_REPO = git://git.musl-libc.org/musl LINUX_SITE = https://cdn.kernel.org/pub/linux/kernel -LINUX_HEADERS_SITE = https://ftp.barfooze.de/pub/sabotage/tarballs/ +LINUX_HEADERS_SITE = https://ftp.barfooze.de/pub/sabotage/tarballs -MINGW_SITE = https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/ +MINGW_SITE = $(SOURCEFORGE_MIRROT)/project/mingw-w64/mingw-w64/mingw-w64-release DL_CMD = curl -sLo SHA1_CMD = sha1sum -c diff --git a/cowpatch.sh b/cowpatch.sh index c79c9d9..cac1f92 100755 --- a/cowpatch.sh +++ b/cowpatch.sh @@ -22,81 +22,95 @@ set -e -echo () { printf "%s\n" "$*" ; } +echo() { printf "%s\n" "$*"; } -cow () { -test -h "$1" || return 0 -if test -d "$1" ; then -case "$1" in -*/*) set -- "${1%/*}/" "${1##*/}" ;; -*) set -- "" "$1" ;; -esac -mkdir "$1$2.tmp.$$" -mv "$1$2" "$1.$2.orig" -mv "$1$2.tmp.$$" "$1$2" -( cd "$1$2" && ln -s ../".$2.orig"/* . ) -else -cp "$1" "$1.tmp.$$" -mv "$1.tmp.$$" "$1" -fi +cow() { + test -h "$1" || return 0 + if test -d "$1"; then + case "$1" in + */*) set -- "${1%/*}/" "${1##*/}" ;; + *) set -- "" "$1" ;; + esac + mkdir "$1$2.tmp.$$" + mv "$1$2" "$1.$2.orig" + mv "$1$2.tmp.$$" "$1$2" + (cd "$1$2" && ln -s ../".$2.orig"/* .) + else + cp "$1" "$1.tmp.$$" + mv "$1.tmp.$$" "$1" + fi } -cowp () { -while test "$1" ; do -case "$1" in -*/*) set -- "${1#*/}" "$2${2:+/}${1%%/*}" ;; -*) set -- "" "$2${2:+/}$1" ;; -esac -cow "$2" -done +cowp() { + while test "$1"; do + case "$1" in + */*) set -- "${1#*/}" "$2${2:+/}${1%%/*}" ;; + *) set -- "" "$2${2:+/}$1" ;; + esac + cow "$2" + done } -cowpatch () { +cowpatch() { -plev=0 -OPTIND=1 -while getopts ":p:i:RNE" opt ; do -test "$opt" = p && plev="$OPTARG" -done + plev=0 + OPTIND=1 + while getopts ":p:i:RNE" opt; do + test "$opt" = p && plev="$OPTARG" + done -while IFS= read -r l ; do -case "$l" in -+++*) -IFS=" " read -r junk pfile junk <