]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
attempting to fix #61
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 22 Jan 2009 20:39:45 +0000 (20:39 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 22 Jan 2009 20:39:45 +0000 (20:39 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@770 04377dda-e619-0410-9926-eae83683ac58

trunk/src/mkbuild

index 7fd55d81d238fc1993b85e394a5004fd9fdd9453..d46f828c6f407ee2a8fc660034c5d9899f5b5e54 100755 (executable)
@@ -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
 
 }