#!/bin/bash CONF_FILE="/etc/lliurex/llxdev.conf" LIB_FILE="/usr/share/lliurex-non-essential-tools/common.sh" SET_TAG="" [ -e "$LIB_FILE" -a -e "$CONF_FILE" ] || exit 1 . "$LIB_FILE" . "$CONF_FILE" show_usage(){ echo "llxdev-svn-tag [set|check]" exit 1 } get_url_tag(){ # Extract the Tag url for Package SVNURL=$(svn info | grep URL: | sed -e "s%URL:[[:blank:]]%%g") SVNTAG=$(echo $SVNURL| sed -e "s%trunk%tags%g") if [ $(svn ls "$SVNTAG" > /dev/null) ] ; then echo " * TAG DIRECTORY in :" else echo " * ERROR: SVN TAG Directory not present:" if [ -n "$SET_TAG" ] ; then svn up svn mkdir "$SVNURL" -m "Added tag directory for current package" fi fi echo "$SVNURL" } # # MAIN # # FIXME: remaining some prefix to be set. [ $# -eq 1 ] || show_usage _sanity_checks ACTION="$1" case $ACTION in check) get_url_tag ;; set) SET_TAG="True" get_url_tag ;; *) show_usage ;; esac