Advertisement
ponce

sbopkg patch

Aug 30th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. --- sbopkg.orig/src/usr/sbin/sbopkg 2018-08-30 09:12:53.960671473 +0200
  2. +++ sbopkg/src/usr/sbin/sbopkg 2018-08-30 09:28:43.967667849 +0200
  3. @@ -2432,6 +2432,23 @@
  4. rm -f $SYNC_LOCK
  5. }
  6.  
  7. +current_check_updates() {
  8. + # This function checks for updates if repository is set to -current.
  9. +
  10. + local URL BRANCH REMOTE LOCAL
  11. +
  12. + eval $(sed 's/^\(.*\)@\(.*\)$/URL=\1; BRANCH=\2/g' <<< $REPO_LINK)
  13. +
  14. + cd $REPO_DIR
  15. + REMOTE=$(git ls-remote $URL $BRANCH | cut -f 1)
  16. + LOCAL=$(git rev-parse HEAD)
  17. + # If the remote has changed, wipe the local version
  18. + if [[ $REMOTE != $LOCAL ]]; then
  19. + cd ..
  20. + rm -fR $REPO_DIR
  21. + fi
  22. +}
  23. +
  24. git_command() {
  25. # This function synchronizes a local git repository with upstream.
  26.  
  27. @@ -2441,6 +2458,12 @@
  28. eval $(sed 's/^\(.*\)@\(.*\)$/URL=\1; BRANCH=\2/g' <<< $REPO_LINK)
  29.  
  30. CWD=$(pwd)
  31. + # If -CURRENT, handle correctly
  32. + if [[ $REPO_NAME == "SBo-git" ]]; then
  33. + if [[ $REPO_BRANCH == "current" ]]; then
  34. + current_check_updates
  35. + fi
  36. + fi
  37. # Create the repository if needed
  38. if [[ ! -d $REPO_DIR/.git ]]; then
  39. mkdir -p $REPO_DIR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement