Skip to content
Snippets Groups Projects
Commit 8eb498e0 authored by Natanael Copa's avatar Natanael Copa
Browse files

buildrepo: added -r option to specify dependency repos

the dependency repo tells apk index that dependencies are found
in another repository.
parent 1a28d389
No related branches found
No related tags found
No related merge requests found
...@@ -7,13 +7,16 @@ repodir=${REPODIR:-$HOME/packages} ...@@ -7,13 +7,16 @@ repodir=${REPODIR:-$HOME/packages}
usage() { usage() {
echo "usage: $program [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ] REPOSITORY..." echo "usage: $program [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ]"
echo " [-r DEPREPO] REPOSITORY..."
echo "options:" echo "options:"
echo " -a Set the aports base dir to APORTSDIR instead of $aportsdir" echo " -a Set the aports base dir to APORTSDIR instead of $aportsdir"
echo " -d Set destination repository base dir to REPODIR instead of $repodir" echo " -d Set destination repository base dir to REPODIR instead of $repodir"
echo " -h Show this help and exit" echo " -h Show this help and exit"
echo " -l Send build to logfile, prefixed by LOGPREFIX" echo " -l Send build to logfile, prefixed by LOGPREFIX"
echo " -p Purge obsolete packages from REPODIR after build" echo " -p Purge obsolete packages from REPODIR after build"
echo " -r Dependencies are found in DEPREPO"
exit 1 exit 1
} }
...@@ -47,20 +50,26 @@ build() { ...@@ -47,20 +50,26 @@ build() {
) || return 1 ) || return 1
done done
cd "$repodir/$repo" cd "$repodir/$repo"
echo ">>> Generating Index..."
md5sum *.apk | gzip -9 > INDEX.md5.gz md5sum *.apk | gzip -9 > INDEX.md5.gz
if which apk >/dev/null; then if which apk >/dev/null; then
apk index *.apk | gzip -9 > APK_INDEX.gz local deps
for i in $deprepo; do
deps="--repo $repodir/$i"
done
apk $deps index *.apk | gzip -9 > APK_INDEX.gz
fi fi
purge "$repo" purge "$repo"
} }
while getopts "a:d:hl:p" opt; do while getopts "a:d:hl:pr:" opt; do
case "$opt" in case "$opt" in
a) aportsdir=$OPTARG;; a) aportsdir=$OPTARG;;
d) repodir=$OPTARG;; d) repodir=$OPTARG;;
h) usage >&2;; h) usage >&2;;
l) logprefix=$OPTARG;; l) logprefix=$OPTARG;;
p) dopurge=1;; p) dopurge=1;;
r) deprepo="$deprepo $OPTARG";;
esac esac
done done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment