diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2017-05-28 19:13:20 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2017-07-06 16:17:31 +0300 |
commit | ee52fee11ce09abf3b070cbfb3697646c24f51e5 (patch) | |
tree | f78b9d8933f06458d4f5315986f99263ef59e63d | |
parent | e3a2e14ffa6a5842bc836d5809fcbb0494cbbfdd (diff) | |
download | abuild-ee52fee11ce09abf3b070cbfb3697646c24f51e5.tar.gz abuild-ee52fee11ce09abf3b070cbfb3697646c24f51e5.tar.bz2 abuild-ee52fee11ce09abf3b070cbfb3697646c24f51e5.tar.xz abuild-ee52fee11ce09abf3b070cbfb3697646c24f51e5.zip |
abuild: rootbld: always require repo template
-rw-r--r-- | abuild.in | 56 |
1 files changed, 22 insertions, 34 deletions
@@ -1997,29 +1997,6 @@ checksum() { echo "sha512sums=\"$sha512sums\"" >>"$APKBUILD" } -subst() { - ( - for key in $(git config --list --name-only); do - k=${key#abuild.} - [ $k != $key ] && \ - eval "export $k=\"$(git config --get $key)\"" - done - - export mirror version - [ "$mirror" ] || mirror=http://dl-cdn.alpinelinux.org/alpine - - if [ -z "$version" ]; then - version=$(git symbolic-ref --short HEAD) - [ "$version" ] && \ - version=$(expr "$version" : '\([0-9]\+\(\.[0-9]\+\)*\)-') && \ - version=v${version} - [ "$version" ] || version=edge - fi - - envsubst - ) -} - rootbld() { if apk_up2date && [ -z "$force" ]; then msg "Package is up to date" @@ -2060,17 +2037,28 @@ rootbld() { cp /etc/apk/keys/* "$BUILD_ROOT/etc/apk/keys" local repo_template=$aportsgit/$repo/.rootbld-repositories - local repofile=$BUILD_ROOT/etc/apk/repositories - if [ -s "$repo_template" ]; then - subst < "$repo_template" - else - local prefix='$mirror/$version' - subst <<-EOF - $prefix/main - $prefix/community - EOF - fi > "$repofile" - echo "$REPODEST/$repo" >> "$repofile" + [ -s "$repo_template" ] || die "rootbld: $repo_template does not exist" + ( + for key in $(git config --list --name-only); do + k=${key#abuild.} + [ $k != $key ] && \ + eval "export $k=\"$(git config --get $key)\"" + done + + export mirror version + [ "$mirror" ] || mirror=http://dl-cdn.alpinelinux.org/alpine + + if [ -z "$version" ]; then + version=$(git symbolic-ref --short HEAD) + [ "$version" ] && \ + version=$(expr "$version" : '\([0-9]\+\(\.[0-9]\+\)*\)-') && \ + version=v${version} + [ "$version" ] || version=edge + fi + + envsubst + echo "$REPODEST/$repo" + ) < "$repo_template" > "$BUILD_ROOT/etc/apk/repositories" calcdeps $SUDO_APK add --initdb --root "$BUILD_ROOT" --update \ |