APKBUILD examples:Git checkout

From Alpine Linux
Revision as of 12:30, 7 March 2016 by Fab (talk | contribs) (Reverted edits by RuthHughes (talk) to last revision by Fab)
source="http://dev.alpinelinux.org/archive/configshell/$_realname-$_ver.tar.gz"

_giturl="https://github.com/agrover/configshell-fb"
_gittag=v$_ver

_builddir="$srcdir"/$_realname-fb-v$_ver

snapshot() {
	mkdir -p "$srcdir"
	cd "${SRCDEST:-$srcdir}"
	if ! [ -d $_realname-fb.git ]; then
		git clone --bare  $_giturl || return 1
		cd $_realname-fb.git
	else
		cd $_realname-fb.git
		git fetch || return 1
	fi
	
	git archive --prefix=$_realname/ -o "$SRCDEST"/$_realname-$_ver.tar.gz $_gittag
	scp "$SRCDEST"/$_realname-$_ver.tar.gz dev.alpinelinux.org:/archive/$_realname/
}