Advertisement
ponce

sqg patch

Feb 26th, 2013
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. --- src/usr/doc/contrib/sqg.orig 2013-02-26 11:59:23.507089085 +0100
  2. +++ src/usr/doc/contrib/sqg 2013-02-26 13:05:25.322821722 +0100
  3. @@ -35,22 +35,18 @@
  4. # If necessary, override SBOPKG_CONF below or directly from the environment.
  5. # The user may want to change QUEUEDIR to a local temporary directory in $HOME
  6. # since queuefiles in QUEUEDIR will be overwritten by this script. QUEUEDIR
  7. -# is commented out on purpose to get the user to review these variables.
  8. +# is set empty on purpose to get the user to review these variables.
  9. # QUEUEDIR must be writable by the user executing the script.
  10.  
  11. #QUEUEDIR=${QUEUEDIR:-/var/lib/sbopkg/queues}
  12. -REPO_ROOT=${REPO_ROOT:-/var/lib/sbopkg}
  13. -REPO_NAME=${REPO_NAME:-SBo}
  14. -REPO_BRANCH=${REPO_BRANCH:-14.0}
  15. +QUEUEDIR=""
  16.  
  17. ### NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE ###
  18.  
  19. -REPO_DIR=$REPO_ROOT/$REPO_NAME/$REPO_BRANCH
  20. -
  21. sanity_checks () {
  22. - if [[ ! -e $SBOPKG_CONF || ! -w $QUEUEDIR || ! -d $REPO_DIR ]]; then
  23. - echo "ERROR: $SBOPKG_CONF cannot be found or $QUEUEDIR"
  24. - echo "or $REPO_DIR do not exist or are not writable."
  25. + if [[ ! -e $SBOPKG_CONF || ! -w $QUEUEDIR ]]; then
  26. + echo "ERROR: $SBOPKG_CONF cannot be found or $QUEUEDIR do not exist"
  27. + echo "or is not writable."
  28. echo "Check the configurable variables at the top of the script."
  29. exit 1
  30. else
  31. @@ -116,8 +112,8 @@
  32. main_loop () {
  33. local MAINAPP="$1"
  34. if [[ $MAINAPP == "_all" ]]; then
  35. - printf "Processing all SlackBuilds in the $REPO_NAME/$REPO_BRANCH repo..."
  36. - for INFO in $(find $REPO_ROOT/$REPO_NAME/$REPO_BRANCH -name *.info); do
  37. + printf "Processing all SlackBuilds in the $REPO_SUBPATH repo..."
  38. + for INFO in $(find $REPO_DIR -name *.info); do
  39. printf "."
  40. . $INFO
  41. build_queuefile
  42. @@ -126,7 +122,7 @@
  43. for MAINAPP in $PKG; do
  44. if search_package $MAINAPP; then
  45. echo "Processing $MAINAPP."
  46. - . $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/$PKGPATH/$MAINAPP.info
  47. + . $REPO_DIR/$PKGPATH/$MAINAPP.info
  48. build_queuefile
  49. else
  50. echo "$MAINAPP not found. Exiting."
  51. @@ -143,6 +139,15 @@
  52. esac
  53.  
  54. sanity_checks
  55. +
  56. +# Set REPO_DIR correctly also in case of a git repository
  57. +if [ -d $REPO_ROOT/$REPO_NAME/.git ]; then
  58. + REPO_SUBPATH=$REPO_NAME
  59. +else
  60. + REPO_SUBPATH=$REPO_NAME/$REPO_BRANCH
  61. +fi
  62. +REPO_DIR=$REPO_ROOT/$REPO_SUBPATH
  63. +
  64. main_loop "$PKG"
  65. echo "Done."
  66. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement