From 8b0632dbf9611025c5fca21521cf6f5077e9faaf Mon Sep 17 00:00:00 2001 From: rhatto Date: Thu, 22 Jan 2009 20:39:45 +0000 Subject: attempting to fix #61 git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@770 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/mkbuild | 55 ++++++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild index 7fd55d8..d46f828 100755 --- a/trunk/src/mkbuild +++ b/trunk/src/mkbuild @@ -979,6 +979,8 @@ function update_manifest_info { function edit_manifest { + local option="$1" + # Check if existing Manifest is properly signed if ! check_manifest_signature; then echo "Invalid signature at $WORK/Manifest, aborting." @@ -999,9 +1001,28 @@ function edit_manifest { update_manifest_info $WORK/slack-required fi - # Add source code information if its not already there - if ! grep -q -e "^DIST $DIST_SRC_NAME " $WORK/Manifest; then - update_manifest_info $DIST_SRC_NAME dist + if [ "$option" == "--update" ]; then + # Add DIST information only if source is not under revision control + if [ $SVN_MOD -eq $on -o $GIT_MOD -eq $on ]; then + echo "Source is under version control system, not adding hashes to Manifest." + else + echo "Updating DIST information at $MKBUILD_NAME Manifest..." + + # Determine file location + get_dist_file $SOURCE_FILE + + # Update Manifest metadata + if [ -e "$DIST_SRC_LOCATION" ]; then + update_manifest_info $DIST_SRC_LOCATION dist + else + echo "Can't get $DIST_SRC_NAME." + fi + fi + else + # Add source code information if its not already there + if ! grep -q -e "^DIST $DIST_SRC_NAME " $WORK/Manifest; then + update_manifest_info $DIST_SRC_NAME dist + fi fi # Update patches @@ -1183,32 +1204,8 @@ function update_manifest { # Get mkbuild values get_mkbuild_values - # Add DIST information only if source is not under revision control - if [ $SVN_MOD -eq $on -o $GIT_MOD -eq $on ]; then - echo "Source is under version control system, can't add hashes to Manifest." - return - fi - - # Check if existing Manifest is properly signed - if ! check_manifest_signature; then - echo "Invalid signature at $WORK/Manifest, aborting." - return 1 - fi - - echo "Updating DIST information at $MKBUILD_NAME Manifest..." - - # Determine file location - get_dist_file $SOURCE_FILE - - # Update Manifest metadata - if [ -e "$DIST_SRC_LOCATION" ]; then - update_manifest_info $DIST_SRC_LOCATION dist - else - echo "Can't get $DIST_SRC_NAME." - fi - - # Finally, sign the Manifest - sign_manifest + # Update the Manifest + edit_manifest --update } -- cgit v1.2.3