aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-01-16 17:21:07 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-01-16 17:21:07 +0000
commite459c92573a0799b173c8e6edf531441e0f6d044 (patch)
tree1e10fffc18be2c4306c16013fa2601230c452deb
parent4e19402484e6cbc2e543192baed16d3dc8c77ba2 (diff)
downloadsimplepkg-e459c92573a0799b173c8e6edf531441e0f6d044.tar.gz
simplepkg-e459c92573a0799b173c8e6edf531441e0f6d044.tar.bz2
adding createpkg --import
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@747 04377dda-e619-0410-9926-eae83683ac58
-rw-r--r--trunk/src/createpkg60
1 files changed, 59 insertions, 1 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index a46417d..93cc5ce 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -43,7 +43,7 @@ ${red}DESCRIPTION${normal}
does not solve dependences
${red}-d${normal}, ${red}--debug${normal} ${green}<program>${normal}
enable SlackBuild debug (sh -x ...)
- ${red}-s${normal}, ${red}--search${normal} ${green}S<program${normal}>
+ ${red}-s${normal}, ${red}--search${normal} ${green}<program${normal}>
search for a ${green}<program>${normal}
${red}-f${normal}, ${red}--info${normal} ${green}<program>${normal}
show description and dependences of the program
@@ -57,6 +57,8 @@ ${red}DESCRIPTION${normal}
commit changes to binary packages' repository
${red}--status${normal}
check binary packages' svn repository status
+ ${red}--import${normal}
+ import packages into a svn repository
${red}--update-keyring${normal}
update GPG-KEY from binary repositories
${red}-h${normal}, ${red}--help${normal}
@@ -340,6 +342,57 @@ function repository_status {
}
+function repository_import {
+
+ # import packages into a subversion repository
+ # usage: repository_import [repository]
+
+ local repository="$1" repository_type repository_path packages_dir
+
+ if [ -z "$repository" ]; then
+ repository="file:////var/svn/packages"
+ fi
+
+ if ! check_svn_repo $repository; then
+ EXIT_CODE="1"
+ return $EXIT_CODE
+ fi
+
+ repository_type="`echo $repository | cut -d : -f 1`"
+ repository_path="`echo $repository | cut -d : -f 2`"
+
+ # eval again so it doesn't include repository style information
+ packages_dir="`eval_parameter PACKAGES_DIR /var/simplepkg/repos`"
+ mkdir -p $packages_dir
+
+ if [ -d "$packages_dir/.svn" ]; then
+ echo "Packages folder $packages_dir seens to be already under revision control, aborting."
+ EXIT_CODE="1"
+ return $EXIT_CODE
+ fi
+
+ if [ "$repository_type" == "file" ] && [ ! -d "$repository_path" ]; then
+ echo "Creating subversion repository $repository..."
+ svnadmin create $repository --fs-type fsfs
+ if [ "$?" != "0" ]; then
+ EXIT_CODE="1"
+ return $EXIT_CODE
+ fi
+ fi
+
+ echo "Importing packages from $packages_dir into $repository..."
+ svn --import $packages_dir $repository
+ if [ "$?" == "0" ]; then
+ echo "Making $packages_dir a working copy of $repository..."
+ rm -rf $packages_dir
+ svn checkout $repository $packages_dir
+ else
+ EXIT_CODE="1"
+ return $EXIT_CODE
+ fi
+
+}
+
function create_repo_folder {
# Create repository directory
@@ -590,6 +643,11 @@ case $1 in
fi
exit $EXIT_CODE
;;
+ '--import')
+ shift
+ repository_import $*
+ exit $EXIT_CODE
+ ;;
'--status')
repository_status
exit $EXIT_CODE