--- work/sbopkg/src/usr/doc/contrib/sqg 2013-02-25 20:12:21.318922460 -0500
+++ ./sqg 2013-02-26 16:37:37.939838255 -0500
@@ -45,17 +45,25 @@ REPO_BRANCH=${REPO_BRANCH:-14.0}
### NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE ###
-REPO_DIR=$REPO_ROOT/$REPO_NAME/$REPO_BRANCH
-
sanity_checks () {
- if [[ ! -e $SBOPKG_CONF || ! -w $QUEUEDIR || ! -d $REPO_DIR ]]; then
- echo "ERROR: $SBOPKG_CONF cannot be found or $QUEUEDIR"
- echo "or $REPO_DIR do not exist or are not writable."
+ if [[ ! -e $SBOPKG_CONF ]]; then
+ echo "$SBOPKG_CONF not found."
echo "Check the configurable variables at the top of the script."
exit 1
else
. $SBOPKG_CONF
fi
+ if [ -d $REPO_ROOT/$REPO_NAME/.git ]; then
+ REPO_SUBPATH=$REPO_NAME
+ else
+ REPO_SUBPATH=$REPO_NAME/$REPO_BRANCH
+ fi
+ REPO_DIR=$REPO_ROOT/$REPO_SUBPATH
+ if [[ ! -w $QUEUEDIR || ! -d $REPO_DIR ]]; then
+ echo "ERROR: $QUEUEDIR or $REPO_DIR do not exit or are not writable."
+ echo "Check the configurable variables at the top of the script."
+ exit 1
+ fi
}
usage() {
@@ -116,8 +124,8 @@ build_queuefile () {
main_loop () {
local MAINAPP="$1"
if [[ $MAINAPP == "_all" ]]; then
- printf "Processing all SlackBuilds in the $REPO_NAME/$REPO_BRANCH repo..."
- for INFO in $(find $REPO_ROOT/$REPO_NAME/$REPO_BRANCH -name *.info); do
+ printf "Processing all SlackBuilds in the $REPO_SUBPATH repo..."
+ for INFO in $(find $REPO_DIR -name *.info); do
printf "."
. $INFO
build_queuefile
@@ -126,7 +134,7 @@ main_loop () {
for MAINAPP in $PKG; do
if search_package $MAINAPP; then
echo "Processing $MAINAPP."
- . $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/$PKGPATH/$MAINAPP.info
+ . $REPO_DIR/$PKGPATH/$MAINAPP.info
build_queuefile
else
echo "$MAINAPP not found. Exiting."