diff options
-rw-r--r-- | trunk/doc/CHANGELOG | 1 | ||||
-rw-r--r-- | trunk/lib/common.sh | 25 | ||||
-rw-r--r-- | trunk/src/createpkg | 9 | ||||
-rwxr-xr-x | trunk/src/mkbuild | 29 |
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 -------------------------- |