From 5b216d4211dc175e959d47c17bac07d8f1014bf9 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 17 Oct 2014 12:59:28 +0000 Subject: reproducible: refactor, drop dependency between functions --- bin/reproducible_common.sh | 3 +++ bin/reproducible_stats.sh | 15 ++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 4f58569b..c828759e 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -97,3 +97,6 @@ elif [ ! -f ${PACKAGES_DB} ] ; then EOF fi +# shop trailing slash +JENKINS_URL=${JENKINS_URL:0:-1} + diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh index ebfe9069..f4f9cdab 100755 --- a/bin/reproducible_stats.sh +++ b/bin/reproducible_stats.sh @@ -9,6 +9,7 @@ common_init "$@" # common code defining db access . /srv/jenkins/bin/reproducible_common.sh +# FIXME: move to daily cleanup job # cp db away for backup purposes cp $PACKAGES_DB /var/lib/jenkins/userContent/reproducible.db @@ -73,8 +74,6 @@ SPOKENTARGET["FTBFS"]="packages which failed to build from source" SPOKENTARGET["404"]="packages where the sources failed to downloaded" SPOKENTARGET["not_for_us"]="packages which should not be build on 'amd64'" SPOKENTARGET["blacklisted"]="packages which have been blacklisted" -# shop trailing slash -JENKINS_URL=${JENKINS_URL:0:-1} # # gather notes @@ -94,7 +93,6 @@ NOTES_PATH=/var/lib/jenkins/userContent/notes ISSUES_PATH=/var/lib/jenkins/userContent/issues mkdir -p $NOTES_PATH $ISSUES_PATH -declare -A NOTES_PACKAGE declare -A NOTES_VERSION declare -A NOTES_ISSUES declare -A NOTES_BUGS @@ -320,7 +318,6 @@ parse_notes() { PACKAGES_WITH_NOTES=$(cat ${PACKAGES_YML} | /srv/jenkins/bin/shyaml keys) for PKG in $PACKAGES_WITH_NOTES ; do echo " Package = ${PKG}" - NOTES_PACKAGE[${PKG}]=" notes " for PROPERTY in version issues bugs comments ; do VALUE="$(cat ${PACKAGES_YML} | /srv/jenkins/bin/shyaml get-value ${PKG}.${PROPERTY} )" if [ "$VALUE" != "" ] ; then @@ -418,7 +415,7 @@ finish_pkg_page() { } set_package_class() { - if [ "${NOTES_PACKAGE[${PKG}]}" != "" ] ; then + if [ -f ${NOTES_PATH}/${PKG}_note.html ] ; then CLASS="class=\"noted\"" else CLASS="class=\"package\"" @@ -442,8 +439,12 @@ process_packages() { VERSION=$(echo $RESULT | cut -d "|" -f2) STATUS=$(echo $RESULT | cut -d "|" -f3) MAINLINK="" + NOTES_LINK="" + if [ -f ${NOTES_PATH}/${PKG}_note.html ] ; then + NOTES_LINK=" notes " + fi init_pkg_page "$PKG" "$VERSION" "$STATUS" "$BUILD_DATE" "${STAR[$PKG]}" - append2pkg_page "${NOTES_PACKAGE[${PKG}]}" + append2pkg_page "${NOTES_LINK}" if [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then append2pkg_page " buildinfo " MAINLINK="$JENKINS_URL/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" @@ -465,7 +466,7 @@ process_packages() { append2pkg_page " sources " append2pkg_page " debian/rules " - if [ "${NOTES_PACKAGE[${PKG}]}" != "" ] ; then + if [ ! -z "${NOTES_LINK}" ] ; then MAINLINK="$JENKINS_URL/userContent/notes/${PKG}_note.html" fi finish_pkg_page "$MAINLINK" -- cgit v1.2.3-54-g00ecf