aboutsummaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2008-11-27 23:51:27 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2008-11-27 23:51:27 +0000
commit292a00b1207c07a6795ec0121a7a65eb56e02d9c (patch)
tree49766df6bdfcf20d3992f707ec17862f9e6a081c /trunk
parent143a51b5d5689eb73cfb2a9080673646e04b9ee3 (diff)
downloadsimplepkg-292a00b1207c07a6795ec0121a7a65eb56e02d9c.tar.gz
simplepkg-292a00b1207c07a6795ec0121a7a65eb56e02d9c.tar.bz2
minor cleanup
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@564 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk')
-rw-r--r--trunk/doc/CHANGELOG1
-rw-r--r--trunk/lib/common.sh25
-rw-r--r--trunk/src/createpkg9
-rwxr-xr-xtrunk/src/mkbuild29
4 files changed, 31 insertions, 33 deletions
diff --git a/trunk/doc/CHANGELOG b/trunk/doc/CHANGELOG
index 5f02b04..e77f73d 100644
--- a/trunk/doc/CHANGELOG
+++ b/trunk/doc/CHANGELOG
@@ -22,6 +22,7 @@ simplepkg changelog
- new repositories
- mkbuild:
- function svn_mkdir moved to common.sh
+ - function svn_add moved to common.sh and renamed as svn_copy
- some svn check routines extended for git
- perl.mkSlackBuild
- added sections copy_init_scripts and copy_config_files
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index 4b54cc6..faeaeb4 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -572,13 +572,36 @@ function sync_repo {
function svn_add {
- # TODO: merge with svn_add function from mkbuild
if [ -d "`dirname $1`/.svn" ] && ! svn_check $1; then
su_svn add $1
fi
}
+function svn_copy {
+
+ # usage: svn_copy <orig> <dest>
+
+ # svn add file
+ [ $# -ne 1 ] && handle_error $ERROR_PAR_NUMBER
+
+ orig="`dirname $1`"
+ file="`basename $1`"
+ dest="$2"
+
+ if [ -d "$dest" ]; then
+ dest="$dest/$file"
+ fi
+
+ # copy file
+ cp $orig/$file $dest
+ if [ -d "`dirname $dest`/.svn" ]; then
+ chown_svn $dest && chgrp_svn $dest
+ svn_add $dest
+ fi
+
+}
+
function svn_mkdir {
# svn make directory
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index 49b3cfb..42c4043 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -611,14 +611,7 @@ if [ $MOVE_BIN_PACKAGE -eq $on ]; then
# Move package's slack-required to binary repository
if [ $MOVE_SLACK_REQUIRED -eq $on ]; then
if [ ! -z "$SLACK_REQUIRED" ]; then
- cp $SLACK_REQUIRED $NEW_REPOS/$PACKAGE.slack-required
- if [ -d "$NEW_REPOS/.svn" ] && ! svn_check $NEW_REPOS/$PACKAGE.slack-required; then
- cwd="`pwd`"
- cd $NEW_REPOS
- chown_svn $MAKEPKG_REPOS && chgrp_svn $MAKEPKG_REPOS
- su_svn add $PACKAGE.slack-required
- cd $cwd
- fi
+ svn_copy $SLACK_REQUIRED $NEW_REPOS/$PACKAGE.slack-required
fi
fi
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index 98d7b5c..951252e 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -558,14 +558,14 @@ function commit_slackbuild {
# check path
[ ! -e $SLACKBUILD_PATH ] && svn_mkdir $SLACKBUILD_PATH
# add SlackBuild
- svn_add $SLACKBUILD $SLACKBUILD_PATH
+ svn_copy $WORK/$SLACKBUILD $SLACKBUILD_PATH
# check slack-required
# add slack-required
- [ -e $WORK/slack-required ] && svn_add slack-required $SLACKBUILD_PATH
+ [ -e $WORK/slack-required ] && svn_copy $WORK/slack-required $SLACKBUILD_PATH
for i in `ls $WORK | egrep -v '(SlackBuild|old|slack-required|.mkbuild$|.tmp$)\*{0,1}$'`; do
- svn_add `basename $i` $SLACKBUILD_PATH
+ svn_copy $WORK/$i $SLACKBUILD_PATH
done
cd $WORK
@@ -594,34 +594,15 @@ function commit_mkbuild {
# check path
[ ! -e $MKBUILD_PATH ] && svn_mkdir $MKBUILD_PATH
# add mkbuild
- svn_add $MKBUILD_NAME $MKBUILD_PATH
+ svn_copy $WORK/$MKBUILD_NAME $MKBUILD_PATH
for i in `ls $WORK | egrep -v '(SlackBuild|old|slack-required|.mkbuild$|.tmp$)\*{0,1}$'`; do
- svn_add `basename $i` $MKBUILD_PATH
+ svn_copy $WORK/$i $MKBUILD_PATH
done
cd $WORK
}
-# TODO: merge with svn_add function from common.sh
-function svn_add {
-
- # svn add file
- [ $# -ne 2 ] && handle_error $ERROR_PAR_NUMBER
-
- # copy file
- if [ -e $2/$1 ]; then
- echo "$2/$1 exists. Overwrite it."
- cp $WORK/$1 $2/
- else
- cp $WORK/$1 $2/
- # add file to svn tree
- chown_svn $2/$1 && chgrp_svn $2/$1
- su_svn add $2/$1
- fi
-
-}
-
# ----------------------------------------------------------------
# ------------------- general functions --------------------------