Commit 8d272af1 authored by Michael Zuo's avatar Michael Zuo Committed by Sören Tempel

abuild: Fix indention of the snapshot() function

The snapshot function was indented with spaces while the rest of the
code is indented with tabs.
parent a2c0a689
...@@ -2024,52 +2024,52 @@ all() { ...@@ -2024,52 +2024,52 @@ all() {
# Base version defaults to 0 except if specified by $verbase. # Base version defaults to 0 except if specified by $verbase.
snapshot() { snapshot() {
# check if we setup vars correctly # check if we setup vars correctly
[ -z "$disturl" ] && warning "Missing disturl in APKBUILD, auto uploading disabled." [ -z "$disturl" ] && warning "Missing disturl in APKBUILD, auto uploading disabled."
[ -z "$svnurl" ] && [ -z "$giturl" ] && die "Missding repository url in APKBUILD!" [ -z "$svnurl" ] && [ -z "$giturl" ] && die "Missding repository url in APKBUILD!"
[ -n "$svnurl" ] && [ -n "$giturl" ] && die "You can only use a single repository!" [ -n "$svnurl" ] && [ -n "$giturl" ] && die "You can only use a single repository!"
local _date=$(date +%Y%m%d) local _date=$(date +%Y%m%d)
local _format="tar.gz" local _format="tar.gz"
# remove any repositories left in srcdir # remove any repositories left in srcdir
abuild clean abuild clean
mkdir -p "$srcdir" && cd "$srcdir" mkdir -p "$srcdir" && cd "$srcdir"
# clone git repo and archive # clone git repo and archive
if [ -n "$giturl" ]; then if [ -n "$giturl" ]; then
local _version=${verbase:-0}_git${_date} local _version=${verbase:-0}_git${_date}
command -v git >/dev/null || \ command -v git >/dev/null || \
die "Missing git! Install git to support git clone." die "Missing git! Install git to support git clone."
[ -z "$reporev" ] && local _rev="HEAD" && local _depth="--depth=1" [ -z "$reporev" ] && local _rev="HEAD" && local _depth="--depth=1"
msg "Creating git snapshot: $pkgname-$_version" msg "Creating git snapshot: $pkgname-$_version"
git clone $_depth --bare $giturl $pkgname-$_version || return 1 git clone $_depth --bare $giturl $pkgname-$_version || return 1
git --git-dir $pkgname-$_version archive \ git --git-dir $pkgname-$_version archive \
--format=$_format \ --format=$_format \
-o $pkgname-$_version.$_format \ -o $pkgname-$_version.$_format \
--prefix=$pkgname-$_version/ $_rev \ --prefix=$pkgname-$_version/ $_rev \
|| return 1 || return 1
fi fi
# export svn repo and archive # export svn repo and archive
if [ -n "$svnurl" ]; then if [ -n "$svnurl" ]; then
local _version=${verbase:-0}_svn${_date} local _version=${verbase:-0}_svn${_date}
command -v svn >/dev/null || \ command -v svn >/dev/null || \
die "Missing svn! Install subverion to support svn export." die "Missing svn! Install subverion to support svn export."
[ -n "$reporev" ] && local _rev="-r $reporev" [ -n "$reporev" ] && local _rev="-r $reporev"
msg "Creating svn snapshot: $pkgname-$_version" msg "Creating svn snapshot: $pkgname-$_version"
svn co $_rev $svnurl $pkgname-$_version || return 1 svn co $_rev $svnurl $pkgname-$_version || return 1
tar zcf $pkgname-$_version.$_format $pkgname-$_version || return 1 tar zcf $pkgname-$_version.$_format $pkgname-$_version || return 1
fi fi
# upload to defined distfiles url # upload to defined distfiles url
if [ -n "$disturl" ]; then if [ -n "$disturl" ]; then
command -v rsync >/dev/null || \ command -v rsync >/dev/null || \
die "Missing rsync! Install rsync to enable automatic uploads." die "Missing rsync! Install rsync to enable automatic uploads."
msg "Uploading to $disturl" msg "Uploading to $disturl"
rsync --progress -La $pkgname-$_version.$_format \ rsync --progress -La $pkgname-$_version.$_format \
$disturl || return 1 $disturl || return 1
cd "$startdir" cd "$startdir"
# set the pkgver to current date and update checksum # set the pkgver to current date and update checksum
sed -i -e "s/^pkgver=.*/pkgver=${_version}/" \ sed -i -e "s/^pkgver=.*/pkgver=${_version}/" \
APKBUILD || return 1 APKBUILD || return 1
abuild checksum abuild checksum
fi fi
} }
usage() { usage() {
......
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