aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/createpkg
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src/createpkg')
-rw-r--r--trunk/src/createpkg40
1 files changed, 32 insertions, 8 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index 52116d9..c2d3c32 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -59,6 +59,8 @@ ${red}DESCRIPTION${normal}
check binary packages' svn repository status
${red}--import${normal}
import packages into a svn repository
+ ${red}--checkout${normal}
+ checkout binary packages from a svn repository
${red}--update-keyring${normal}
update GPG-KEY from binary repositories
${red}-h${normal}, ${red}--help${normal}
@@ -294,19 +296,33 @@ function load_parameters {
function repository_checkout {
- local svn
+ # checkout a binary repository
+ # usage: repository_checkout [repository-adress]
+
+ local svn oldfolder
if [ -d "$PACKAGES_DIR" ]; then
- mv $PACKAGES_DIR $PACKAGES_DIR.old
+ oldfolder="$(mktemp -d $(echo $PACKAGES_DIR | sed -e 's/\/*$//g').XXXXXX)"
+ echo "Moving old $PACKAGES_DIR to $oldfolder..."
+ mv $PACKAGES_DIR $oldfolder
fi
if [ -z "$1" ]; then
svn="$1"
else
- svn="$SLACKBUILDS_SVN"
+ svn="$PACKAGES_SVN"
fi
- svn checkout $svn $PACKAGES_DIR
+ if check_svn_repo $svn; then
+ svn checkout $svn $PACKAGES_DIR
+ chown_svn $PACKAGES_DIR && chgrp_svn $PACKAGES_DIR
+ if [ "$svn" != "$PACKAGES_SVN" ]; then
+ echo "Using svn repository different from the one pointed at $CONF."
+ fi
+ else
+ echo "Invalid repository $repository, aborting."
+ EXIT_CODE="1"
+ fi
}
@@ -354,6 +370,7 @@ function repository_import {
fi
if ! check_svn_repo $repository; then
+ echo "Invalid repository $repository, aborting."
EXIT_CODE="1"
return $EXIT_CODE
fi
@@ -379,6 +396,7 @@ function repository_import {
echo "Creating subversion repository $repository..."
mkdir -p `dirname $repository_path`
svnadmin create $repository_path --fs-type fsfs
+ chown_svn $repository_path && chgrp_svn $repository_path
if [ "$?" != "0" ]; then
EXIT_CODE="1"
return $EXIT_CODE
@@ -386,11 +404,12 @@ function repository_import {
fi
echo "Importing packages from $packages_dir into $repository..."
- svn import $packages_dir $repository -m "importing binary packages"
+ su_svn import $packages_dir $repository -m "importing binary packages"
if [ "$?" == "0" ]; then
echo "Making $packages_dir a working copy of $repository..."
rm -rf $packages_dir
- svn checkout $repository $packages_dir
+ chown_svn `dirname $packages_dir` && chgrp_svn `dirname $packages_dir`
+ su_svn checkout $repository $packages_dir
else
EXIT_CODE="1"
return $EXIT_CODE
@@ -648,13 +667,18 @@ case $1 in
fi
exit $EXIT_CODE
;;
+ '--status')
+ repository_status
+ exit $EXIT_CODE
+ ;;
'--import')
shift
repository_import $*
exit $EXIT_CODE
;;
- '--status')
- repository_status
+ '--checkout')
+ shift
+ repository_checkout $*
exit $EXIT_CODE
;;
'--update-keyring')