diff options
Diffstat (limited to 'trunk/src/createpkg')
-rw-r--r-- | trunk/src/createpkg | 72 |
1 files changed, 28 insertions, 44 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg index a02c8c8..0a67648 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -272,7 +272,7 @@ function repository_checkout { if [ -d "$PACKAGES_DIR" ]; then oldfolder="$(mktemp -d $(echo $PACKAGES_DIR | sed -e 's/\/*$//g').XXXXXX)" - echo "Moving old $PACKAGES_DIR to $oldfolder..." + echo "Backing up old $folder at $oldfolder..." mv $PACKAGES_DIR $oldfolder fi @@ -327,58 +327,21 @@ function repository_status { } -function repository_import { +function binary_repository_import { # import packages into a subversion repository - # usage: repository_import [repository] + # usage: binary_repository_import [repository] - local repository="$1" repository_type repository_path packages_dir + local repository="$1" folder if [ -z "$repository" ]; then repository="file:////var/svn/packages" fi - if ! check_svn_repo $repository; then - echo "Invalid repository $repository, aborting." - EXIT_CODE="1" - return $EXIT_CODE - fi - - if ! echo $repository | grep -q ":"; then - repository="file://$repository" - fi - - 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 + folder="`eval_parameter PACKAGES_DIR /var/simplepkg/repos`" - 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 - - check_and_create_svn_repo $repository - if [ "$?" != "0" ]; then - EXIT_CODE="1" - return $EXIT_CODE - fi - - chown_svn $repository_path && chgrp_svn $repository_path - - echo "Importing packages from $packages_dir into $repository..." - 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 - chown_svn `dirname $packages_dir` && chgrp_svn `dirname $packages_dir` - su_svn checkout $repository $packages_dir - else - EXIT_CODE="1" - return $EXIT_CODE - fi + repository_import $folder $repository } @@ -519,6 +482,27 @@ function update_metadata { } +function list_packages { + + # TODO + true + +} + +function delete_packages { + + # TODO + true + +} + +function sign_package { + + # TODO + true + +} + #--------------------------------------------------- # Starting createpkg #--------------------------------------------------- @@ -638,7 +622,7 @@ case $1 in ;; '--import') shift - repository_import $* + binary_repository_import $* exit $EXIT_CODE ;; '--checkout') |