Mailinglist Archive: opensuse-buildservice (348 mails)

< Previous Next >
Re: [opensuse-buildservice] [PATCH 1/1 for build] Support remote repos (v2)
  • From: Ludwig Nussel <ludwig.nussel@xxxxxxx>
  • Date: Thu, 8 Apr 2010 15:57:47 +0200
  • Message-id: <201004081557.48031.ludwig.nussel@xxxxxxx>
Yi Yang wrote:
From effe07d4f90fc387d7bdd42db1507400e33c819f Mon Sep 17 00:00:00 2001
From: Yi Yang <yi.y.yang@xxxxxxxxx>
Date: Fri, 2 Apr 2010 14:57:59 +0800
Subject: [PATCH] Support remote repos

Thanks, I've applied it with minor corrections (unexpand tabs).
Some comments though...

+test -z "$CACHE_DIR" && CACHE_DIR=/var/cache/build

Things like that should be the other way around, ie
test -n "$CACHE_DIR" || CACHE_DIR=/var/cache/build
in order to enable use of set -e in the future.
One can also bash magic
: ${CACHE_DIR:=/var/cache/build}

+ elif [ "${SRC#http://}"; != "$SRC" ]; then
+ mkdir -p "$(getcachedir "$SRC")"
+ set -- env CACHE_DIR="$CACHE_DIR"
$BUILD_DIR/createrepomddeps "$SRC"

createrepomddeps already has command line option handling so this
could be passed as command line option instead.

- ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRC##*.}"
+ if [ "${SRC:0:7}" == "http://"; ] ; then
+ target_file=$(get_pkg_filename "$SRC")
+ ln -s "$target_file"
+ else
+ ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRC##*.}"
+ fi

Things should work without that change I think as downloadpkg
modifies $SRC.


(o_ Ludwig Nussel
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups