aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-08-17 11:30:09 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-08-17 11:30:09 +0000
commit73c6cdd13f567f5ff97889d43626da6b7a8f4d23 (patch)
treed1e6c8c42d9e38dc226211a89d5247003e251cd0 /kiss
parentbab62963a76143dad86152c1171455130efcb3be (diff)
downloadcpt-73c6cdd13f567f5ff97889d43626da6b7a8f4d23.tar.gz
kiss: save build logs
FossilOrigin-Name: edd68b2a37dcdebefaee3c617927c827cc375017ef20a5577b7941fc49b64e6b
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss11
1 files changed, 9 insertions, 2 deletions
diff --git a/kiss b/kiss
index 4ed3a2a..f8d5211 100755
--- a/kiss
+++ b/kiss
@@ -480,8 +480,9 @@ pkg_build() {
mkdir -p "$pkg_dir/$pkg/$pkg_db"
# Move to the build directory and call the build script.
- (cd "$mak_dir/$pkg"; fakeroot "$repo_dir/build" "$pkg_dir/$pkg") ||
- die "[$pkg]: Build failed."
+ # This also saves the build output to a log file.
+ (cd "$mak_dir/$pkg"; fakeroot "$repo_dir/build" "$pkg_dir/$pkg" 2>&1 |
+ tee "$log_dir/$pkg-$date.log") || die "[$pkg]: Build failed."
# Copy the repository files to the package directory.
# This acts as the database entry.
@@ -505,6 +506,7 @@ pkg_build() {
done
log "Successfully built package(s)."
+ log "Saved build log files to '$log_dir'."
# Turn the explicit packages into a 'list'.
set -- $explicit_packages
@@ -1047,6 +1049,10 @@ main() {
# variable is ever changed.
old_ifs=$IFS
+ # Store the current date to properly name log files. This may also be
+ # used later for other functionality.
+ date=$(date +%F-%T)
+
# Catch errors and ensure that build files and directories are cleaned
# up before we die. This occurs on 'Ctrl+C' as well as success and error.
trap pkg_clean EXIT INT
@@ -1059,6 +1065,7 @@ main() {
"${tar_dir:=$cac_dir/extract-$pid}" \
"${src_dir:=$cac_dir/sources}" \
"${bin_dir:=$cac_dir/bin}" \
+ "${log_dir:=$cac_dir/logs}" \
|| die "Couldn't create cache directories."
args "$@"