Commit 60dda678 authored by Natanael Copa's avatar Natanael Copa

newapkbuild: detect github archives

parent b4fb3c6a
......@@ -23,6 +23,13 @@ is_url() {
return 1
}
is_github_url() {
case $1 in
https://github.com/*/*/archive/*.tar.gz) return 0;;
esac
return 1
}
# Build sections
build_make() {
cat >>APKBUILD<<__EOF__
......@@ -91,7 +98,15 @@ newaport() {
local source=
is_url "$1" && source="$1"
if [ "$pn" != "$newname" ]; then
if is_github_url $source; then
if [ -z "$pkgname" ]; then
pkgname=${source%/archive/*}
pkgname=${pkgname##*/}
fi
pv=${newname%.t*} #strip .tar.gz .tgz .tar.bz2 etc
pv=${pv#*[a-z]}
source="$pkgname-$pv.tar.gz::$source"
elif [ "$pn" != "$newname" ]; then
pv=${newname#$pn-}
pv=${pv%.t*} #strip .tar.gz .tgz .tar.bz2 etc
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment