diff options
Diffstat (limited to 'trunk/src')
-rw-r--r-- | trunk/src/createpkg | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg index e8aad31..8ec901d 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -289,19 +289,11 @@ function repository_checkout { function repository_update { - if [ -d "$PACKAGES_DIR/.svn" ]; then - echo "Fetching changes from svn repository for $PACKAGES_DIR..." - cwd="`pwd`" - chown_svn $PACKAGES_DIR && chgrp_svn $PACKAGES_DIR - cd $PACKAGES_DIR && su_svn update - cd $cwd - fi - - if [ -d "$NOARCH_DIR/.svn" ]; then - echo "Fetching changes from svn repository for $NOARCH_DIR..." + if [ ! -z "$1" ] && [ -d "$1/.svn" ]; then + echo "Fetching changes from svn repository for $1..." cwd="`pwd`" - chown_svn $NOARCH_DIR && chgrp_svn $NOARCH_DIR - cd $NOARCH_DIR && su_svn update + chown_svn $1 && chgrp_svn $1 + cd $1 && su_svn update cd $cwd fi @@ -391,10 +383,6 @@ function remove_old_package_data { cd $makepkg_repos - PACKAGE_VERSION="`package_version $PKG_NAME`" - PACKAGE_ARCH="`package_arch $PKG_NAME`" - PACKAGE_BUILD="`package_build $PKG_NAME`" - # Using -mindepth 2 so it doesn't delete the new PACKAGE for file in `find . -mindepth 2 -name "$PACKAGE-*-*-*.tgz" -o -name "$PACKAGE-*-*-*.meta"`; do candidate="`echo $file | sed -e 's/\.meta/\.tgz/'`" # otherwise PACKAGE info functions can fail @@ -563,7 +551,8 @@ case $1 in exit $EXIT_CODE ;; '--update') - repository_update + repository_update $PACKAGES_DIR + repository_update $NOARCH_DIR exit $EXIT_CODE ;; '--commit') @@ -674,8 +663,11 @@ cd $SCRIPT_BASE # Check if package was built handle_error $? $PACKAGE -# Get package name +# Get package name, arch, version and build number PKG_NAME="`ls -1 -c $PACKAGES_DIR/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basename`" +PACKAGE_VERSION="`package_version $PKG_NAME`" +PACKAGE_ARCH="`package_arch $PKG_NAME`" +PACKAGE_BUILD="`package_build $PKG_NAME`" # Select repository directory if [ $MOVE_BIN_PACKAGE -eq $on ]; then @@ -689,6 +681,9 @@ fi # Create the repository folders create_repo_folder $PACKAGES_DIR +# Update information from remote repository +repository_update $PACKAGES_DIR + # Remove old packages from repository tree remove_old_package_data $PACKAGES_DIR @@ -714,7 +709,6 @@ if [ $MOVE_BIN_PACKAGE -eq $on ]; then fi # Update repository metadata -repository_update update_metadata $PACKAGES_DIR # General cleanup @@ -723,6 +717,7 @@ svn_remove_empty_folders $PACKAGES_DIR # Update noarch repository if [ $PACKAGES_REPOS_NOARCH -eq $on ] && [ "`package_arch $PKG_NAME`" == "noarch" ]; then + repository_update $NOARCH_DIR echo Copying package to noarch repository... create_repo_folder $NOARCH_DIR remove_old_package_data $NOARCH_DIR |