From 5ffe422c55ff2c2c7fd71b1fc9b5fdd57cb2d003 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 14 May 2019 00:45:26 -0400 Subject: config: Make version-agnostic --- diff --git a/config b/config index 3821ab7..2d66848 100755 --- a/config +++ b/config @@ -2,7 +2,9 @@ set -e -TPL_PKGS='gcc-4.7 g++-4.7' +OPK_SOURCE="$(sed 's/ .*//; q;' changelog)" +BASE_VERSION="${OPK_SOURCE#gcc-}" +TPL_PKGS='gcc g++' main() { @@ -35,7 +37,7 @@ main() msg() { - printf 'gcc-4.7 config: ' + printf "${OPK_SOURCE} config: " printf "${@}" printf '\n' } @@ -50,12 +52,11 @@ configure_build() # Write metadata for - packages. for _pkg in ${TPL_PKGS}; do - mkdir -p "${_pkg}-${PKG_TARGET_ARCH}.pkg" - sed "${_ss}" "${_pkg}.pkg.in/control" \ - >"${_pkg}-${PKG_TARGET_ARCH}.pkg/control" - cp "${_pkg}.pkg.in/files" "${_pkg}-${PKG_TARGET_ARCH}.pkg/files" - msg 'Metadata for package "%s" generated.' \ - "${_pkg}-${PKG_TARGET_ARCH}" + _out_pkg="${_pkg}-${BASE_VERSION}-${PKG_TARGET_ARCH}" + mkdir -p "${_out_pkg}.pkg" + sed "${_ss}" "${_pkg}.pkg.in/control" >"${_out_pkg}.pkg/control" + cp "${_pkg}.pkg.in/files" "${_out_pkg}.pkg/files" + msg 'Metadata for package "%s" generated.' "${_out_pkg}" done } @@ -63,7 +64,7 @@ clean() { # Remove generated metadata for - packages. for _pkg in ${TPL_PKGS}; do - rm -Rf "${_pkg}"-*-*-*.pkg/ + rm -Rf "${_pkg}-${BASE_VERSION}"-*-*-*.pkg/ done } -- cgit v0.9.1