aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-06-16 22:00:56 +0000
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-06-16 22:00:56 +0000
commitea8004aa3774c80341440e988155a37b99d59929 (patch)
treea1e54c4be769bd13797756a364c1f4bc65dbba64
parent5472c3f7264f2ef9e1b16707c81a16beb39113a0 (diff)
downloadsimplepkg-ea8004aa3774c80341440e988155a37b99d59929.tar.gz
simplepkg-ea8004aa3774c80341440e988155a37b99d59929.tar.bz2
mkbuild-0.9.5: correção ao commit. A criação de novos diretórios ainda não foi testada.
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@389 04377dda-e619-0410-9926-eae83683ac58
-rwxr-xr-xbranches/0.6/src/mkbuild60
1 files changed, 47 insertions, 13 deletions
diff --git a/branches/0.6/src/mkbuild b/branches/0.6/src/mkbuild
index 9e3ba5a..73d0453 100755
--- a/branches/0.6/src/mkbuild
+++ b/branches/0.6/src/mkbuild
@@ -9,8 +9,8 @@
# SlackBuilds são scripts utilizados no Slackware para gerar
# pacotes tgz.
#
-# Version 0.9.4
-PROG_VERSION=0.9.4
+# Version 0.9.5
+PROG_VERSION=0.9.5
#--------------------------------------------------------------------
# Functions
@@ -428,22 +428,53 @@ function commit_slackbuild {
SLACKBUILD_PATH="`dirname $AUX | tr - /`/`basename $AUX`"
- if [ -e $SLACKBUILDS_DIR/$SLACKBUILD_PATH/$SLACKBUILD ]; then
- echo "$SLACKBUILD_PATH/$SLACKBUILD exist!"
- else
- cp $SLACKBUILD $SLACKBUILDS_DIR/$SLACKBUILD_PATH/
- echo "copy $SLACKBUILD to $SLACKBUILDS_DIR/$SLACKBUILD_PATH/"
- fi
+ # change to SlackBuilds directory
+ cd $SLACKBUILDS_DIR/
+
+ # Add SlackBuild scripts
+ # check path
+ [ ! -e $SLACKBUILD_PATH ] && svn_mkdir $SLACKBUILD_PATH
+ # add SlackBuild
+ svn_add $SLACKBUILD $SLACKBUILD_PATH
+
+ # check slack-required
+ # add slack-required
+ svn_add slack-required $SLACKBUILD_PATH
+
+ cd $WORK
+}
+
+function svn_mkdir {
+
+ # svn make directory
+ [ $# -ne 1 ] && mkbuild_error 0
- if [ -e $SLACKBUILDS_DIR/$SLACKBUILD_PATH/slack-required ]; then
- echo "$SLACKBUILD_PATH/slack-required exist!"
+ echo "svn_mkdir $1 $2"
+ DIR_LIST=`echo $1 | tr '/' ' '`
+
+ DIR=""
+ for i in $DIR_LIST; do
+ DIR=$DIR/$i
+ [ ! -e ${DIR:1} ] && svn mkdir ${DIR:1}
+ done
+}
+
+function svn_add {
+
+ # svn add file
+ [ $# -ne 2 ] && mkbuild_error 0
+
+ # copy file
+ if [ -e $2/$1 ]; then
+ echo "$2/$1 exist. Overwriter it."
+ cp $WORK/$1 $2/
else
- cp slack-required $SLACKBUILDS_DIR/$SLACKBUILD_PATH/
- echo "copy slack-required to $SLACKBUILDS_DIR/$SLACKBUILD_PATH/"
+ cp $WORK/$1 $2/
+ # add file to svn tree
+ svn add $2/$1
fi
}
-
#=============================
# Main Program
#=============================
@@ -451,6 +482,9 @@ function commit_slackbuild {
# Common functions
COMMON="/usr/libexec/simplepkg/common.sh"
SIMPLEPKG_CONF="/etc/simplepkg/simplepkg.conf"
+WORK=`pwd`
+LANG=en_US
+COMMIT=0
if [ -f "$COMMON" ]; then
source $COMMON