commit 19af4eecbfcf54b8c9ee170c6c27e4677cb574af
parent 0be1ad131aa48ae0b0e0b8b5d4967abbedb68982
Author: Cem Keylan <cem@ckyln.com>
Date: Fri, 29 May 2020 19:55:31 +0300
kiss: add '$2' for version and '$3' for arch information on build
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kiss b/kiss
@@ -681,6 +681,8 @@ pkg_build() {
pkg_extract "$pkg"
repo_dir=$(pkg_find "$pkg")
+ read -r build_version _ < "$repo_dir/version"
+
# Install built packages to a directory under the package name
# to avoid collisions with other packages.
mkdir -p "$pkg_dir/$pkg/$pkg_db"
@@ -695,7 +697,7 @@ pkg_build() {
# Call the build script, log the output to the terminal
# and to a file. There's no PIPEFAIL in POSIX shelll so
# we must resort to tricks like killing the script ourselves.
- { "$repo_dir/build" "$pkg_dir/$pkg" 2>&1 || {
+ { "$repo_dir/build" "$pkg_dir/$pkg" "$build_version" "$sys_arch" 2>&1 || {
log "$pkg" "Build failed"
log "$pkg" "Log stored to $log_dir/$pkg-$time-$pid"
run_hook build-fail "$pkg" "$pkg_dir/$pkg"
@@ -1650,6 +1652,10 @@ main() {
KISS_ROOT=${KISS_ROOT%/}
}
+ # Define an optional sys_arch variable in order to provide
+ # information to build files with architectural information.
+ sys_arch=$(uname -m 2>/dev/null) ||:
+
# Define this variable but don't create its directory structure from
# the get go. It will be created as needed by package installation.
sys_db=$KISS_ROOT/$pkg_db