From 44b93dff35ea11aadfa39302174a15ddd193fea9 Mon Sep 17 00:00:00 2001 From: Peter Wilmott Date: Mon, 24 Aug 2015 18:20:16 +0100 Subject: Merge current and next targets into a single db entry --- bin/repoman.sh | 14 +++++++------- bin/tinder.sh | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'bin') diff --git a/bin/repoman.sh b/bin/repoman.sh index f76d514..5fe0101 100755 --- a/bin/repoman.sh +++ b/bin/repoman.sh @@ -22,7 +22,7 @@ function REPOMAN() { repoman manifest repoman full > /tmp/repoman_log_current || true - if [[ "$NEXT_TARGET" != 'unknown' ]]; then + if [[ "$NEXT_TARGET" != 'nil' ]]; then sed -i -e "/^USE_RUBY/s/=\"/=\"$NEXT_TARGET /" "$NAME-$VERSION.ebuild" repoman manifest repoman full > /tmp/repoman_log_next || true @@ -32,15 +32,14 @@ function REPOMAN() { } function LOG() { - DATE=$(date +%s) SHA1=$(sha1sum "/usr/portage/$CATEGORY/$NAME/$NAME-$VERSION.ebuild" | awk '{print $1}') - mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/current_target/repomans/$DATE" - cp /tmp/repoman_log_current "$SCRIPT_DIR/ci-logs/$SHA1/current_target/repomans/$DATE/repoman_log" + mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/repomans/current" + cp /tmp/repoman_log_current "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/repomans/current/repoman_log" - if [[ "$NEXT_TARGET" != 'unknown' ]]; then - mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/next_target/repomans/$DATE" - cp /tmp/repoman_log_next "$SCRIPT_DIR/ci-logs/$SHA1/next_target/repomans/$DATE/repoman_log" + if [[ "$NEXT_TARGET" != 'nil' ]]; then + mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/repomans/next_target" + cp /tmp/repoman_log_next "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/repomans/next_target/repoman_log" fi chmod 755 -R "$SCRIPT_DIR/ci-logs" @@ -54,6 +53,7 @@ function CLEANUP() { ENV_SETUP +DATE=$(date +%s) PKG_ARR=($(qatom "$1")) CATEGORY="${PKG_ARR[0]}" NAME="${PKG_ARR[1]}" diff --git a/bin/tinder.sh b/bin/tinder.sh index 6e78e54..47dd93e 100755 --- a/bin/tinder.sh +++ b/bin/tinder.sh @@ -58,31 +58,30 @@ function EMERGE() { } function LOG() { - DATE=$(date +%s) SHA1=$(sha1sum "/usr/portage/$CATEGORY/$NAME/$NAME-$VERSION.ebuild" | awk '{print $1}') - mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE" + mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE" - emerge --info "=$PACKAGE" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/emerge-info" - emerge -pqv "=$PACKAGE" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/emerge-pqv" - cp "/var/tmp/portage/$PACKAGE/temp/build.log" "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/build.log" - cp "/var/tmp/portage/$PACKAGE/temp/environment" "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/environment" - gem list > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/gem-list" + emerge --info "=$PACKAGE" > "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/emerge-info" + emerge -pqv "=$PACKAGE" > "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/emerge-pqv" + cp "/var/tmp/portage/$PACKAGE/temp/build.log" "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/build.log" + cp "/var/tmp/portage/$PACKAGE/temp/environment" "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/environment" + gem list > "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/gem-list" if [[ $1 == 0 ]]; then RESULT="\e[0;32mBUILD SUCCEEDED\e[0m" - echo "succeeded" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/result" + echo "succeeded" > "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/result" elif [[ $1 == 1 ]]; then RESULT="\e[0;31mBUILD FAILED\e[0m" - echo "failed" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/result" + echo "failed" > "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/result" elif [[ $1 == 124 ]]; then RESULT="\e[0;31mBUILD TIMED OUT\e[0m" - echo "timed out" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/result" + echo "timed out" > "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/result" else RESULT="\e[0;31mBUILD UNKNOWN\e[0m" - echo "unknown" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/result" + echo "unknown" > "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE/result" fi - chmod 755 -R "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE" + chmod 755 -R "$SCRIPT_DIR/ci-logs/$SHA1/$DATE/builds/$TYPE" } function CLEANUP() { @@ -98,6 +97,7 @@ function CLEANUP() { ENV_SETUP +DATE=$(date +%s) PKG_ARR=($(qatom "$1")) CATEGORY="${PKG_ARR[0]}" NAME="${PKG_ARR[1]}" @@ -108,13 +108,13 @@ else fi if [[ $# -eq 1 ]]; then - TYPE="current_target" + TYPE="current" PACKAGE=$1 SETUP EMERGE CLEANUP elif [[ $# -eq 2 ]]; then - TYPE="current_target" + TYPE="current" PACKAGE=$1 SETUP EMERGE -- cgit v1.2.3-65-gdbad