Advertisement
mateorod

file-dependent-auto_updater.diff

Aug 7th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.21 KB | None | 0 0
  1. diff --git a/auto_patcher b/auto_patcher
  2. index 757f4b8..d747f06 100755
  3. --- a/auto_patcher
  4. +++ b/auto_patcher
  5. @@ -477,7 +477,8 @@ auto_update_error () {
  6.       echo ""
  7.       printtask "### Update failed ###"
  8.       printtask ""
  9. -     printtask "It appears you may have made some changes to the script that pr
  10. +     printtask "It appears you may have made some changes that prevent automati
  11. +     echo ""
  12.       printtask "You could run 'git reset --hard' to return the autopatcher to i
  13.       printtask " or set AUTO_UPDATE to false in the .config file to stop gettin
  14.       echo ""
  15. @@ -513,11 +514,12 @@ establish_repo() {
  16.  }
  17.  
  18.  export_log_and_variables () {
  19. -     cp -a "$LOG" .updated.log
  20. -     rm -f "$LOG"
  21.       AUTO_PATCHER_OLD_VERSION=$VERSION
  22.       AUTO_PATCHER_OLD_PATCHES_VERSION=$PATCHES_VERSION
  23.       AUTO_PATCHER_WAS_UPDATED=true
  24. +     UPDATED_LOG="$PATCHES_VERSION".updated.log
  25. +     cp -a "$LOG" "$UPDATED_LOG"
  26. +     rm -f "$LOG"
  27.  }
  28.  
  29.  print_changelog () {
  30. @@ -1215,12 +1217,6 @@ else
  31.       GIT=false
  32.  fi
  33.  
  34. -# If program was updated, merge the logs
  35. -if [[ -n "$AUTO_PATCHER_WAS_UPDATED" ]]; then
  36. -     cat .updated.log >> "$LOG"
  37. -     rm -f .updated.log
  38. -fi
  39. -
  40.  if [[ "$AUTO_UPDATE" == true ]] && [[ "$GIT" == true ]]; then
  41.       PING_CHECK "www.github.com" > /dev/null 2>&1 && NETWORK=true || no_network
  42.       if [[ "$NETWORK" == true ]]; then
  43. @@ -1263,13 +1259,20 @@ if [[ "$AUTO_UPDATE" == true ]] && [[ "$GIT" == true ]];
  44.       fi
  45.  fi
  46.  
  47. -if [[ -n "$AUTO_PATCHER_WAS_UPDATED" ]]; then
  48. -     if [[ $PATCHES_VERSION -gt $AUTO_PATCHER_OLD_PATCHES_VERSION ]]; then
  49. +if ( [[ -n "$AUTO_PATCHER_WAS_UPDATED" ]] || [ -f *".updated.log" ] ); then
  50. +     ORIGINAL_PATCHES_VERSION=$( ls *.updated.log | sed -e 's/\.updated.log//'
  51. +     if ( [[ $PATCHES_VERSION -gt $AUTO_PATCHER_OLD_PATCHES_VERSION ]] || [[ $P
  52.            echo "... integrating new patches ..."
  53.            sh batch.sh >> /dev/null 2>> "$LOG"
  54.       fi
  55.  fi
  56.  
  57. +# If program was updated, merge the logs
  58. +if ( [[ -n "$AUTO_PATCHER_WAS_UPDATED" ]] || [ -f *".updated.log" ] ); then
  59. +     cat *".updated.log" >> "$LOG"
  60. +     rm -f *".updated.log"
  61. +fi
  62. +
  63.  #remove old zips, if built under identical parameters.
  64.  \rm -f $RESTORE.zip $UPDATE.zip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement