Skip to content

Commit

Permalink
Add support to specify the repo type with the repo url
Browse files Browse the repository at this point in the history
This makes it possible to build against remote susetags repos.
  • Loading branch information
mlschroe committed Nov 24, 2016
1 parent 265951f commit 2fdc73a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions init_buildsystem
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,24 @@ create_cache_file() {
findonly=1
continue
fi
SRCREPOTYPE=$REPOTYPE
case $SRC in
arch@* | debian@* | hdlist2@* | rpmmd@* | rpm-md@* | suse@*)
SRCREPOTYPE=${SRC%%@*}
SRC=${SRC#*@}
;;
esac
test -z "$SRC" && SRC=`pwd`
if test "${SRC#http://}" != "$SRC" -o "${SRC#https://}" != "$SRC" -o "${SRC#ftp://}" != "$SRC" -o "${SRC#ftps://}" != "$SRC" ; then
# remote repo, cache binary packages
mkdir -p "$(getcachedir "$SRC")"
if test "$REPOTYPE" = arch ; then
if test "$SRCREPOTYPE" = arch ; then
set -- $BUILD_DIR/createarchdeps --cachedir="$CACHE_DIR" "$SRC"
elif test "$REPOTYPE" = debian ; then
elif test "$SRCREPOTYPE" = debian ; then
set -- $BUILD_DIR/createdebdeps --cachedir="$CACHE_DIR" --archpath "$BUILD_ARCH" "$SRC"
elif test "$REPOTYPE" = hdlist2 ; then
elif test "$SRCREPOTYPE" = suse ; then
set -- $BUILD_DIR/createyastdeps --cachedir="$CACHE_DIR" "$SRC"
elif test "$SRCREPOTYPE" = hdlist2 ; then
set -- $BUILD_DIR/createmdkdeps --cachedir="$CACHE_DIR" "$SRC"
else
set -- $BUILD_DIR/createrepomddeps --cachedir="$CACHE_DIR" "$SRC"
Expand Down Expand Up @@ -434,6 +443,9 @@ downloadpkg() {
getcachedir() {
local url=$1
for repo in "${repos[@]}" ; do
case $repo in
arch@* | debian@* | hdlist2@* | rpmmd@* | rpm-md@* | suse@*) repo=${repo#*@} ;;
esac
if test "${url:0:${#repo}}" == "$repo" ; then
read repoid dummy < <(echo -n "$repo" | md5sum)
echo "$CACHE_DIR/$repoid"
Expand Down

0 comments on commit 2fdc73a

Please sign in to comment.