diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-08-30 20:53:15 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-08-30 20:53:15 +0000 |
commit | 632ec0d8518f1ee1b2af1eeae6a9d967dd26b16f (patch) | |
tree | e184d352ba2764561155b1ce3ab3cd343f5929e9 /trunk/src/createpkg | |
parent | 33da53d2d881d85cfdeb97910c16c71902749c58 (diff) | |
download | simplepkg-632ec0d8518f1ee1b2af1eeae6a9d967dd26b16f.tar.gz simplepkg-632ec0d8518f1ee1b2af1eeae6a9d967dd26b16f.tar.bz2 |
Attempt to fix #94 and #95
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@811 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src/createpkg')
-rw-r--r-- | trunk/src/createpkg | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 579f2c8..65af714 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -426,13 +426,14 @@ function remove_old_package_data { cd $makepkg_repos # Using -mindepth 2 so it doesn't delete the new PACKAGE - for file in `find . -mindepth 2 -name "$PACKAGE-*-*-*.tgz" -o -name "$PACKAGE-*-*-*.meta" -o -name "$PACKAGE-*-*-*.tgz.asc"`; do + for file in `find . -mindepth 2 $(pkg_ext_find $PACKAGE-*-*-*) -o -name "$PACKAGE-*-*-*.meta" -o -name "$PACKAGE-*-*-*.*.asc"`; do candidate="`echo $file | sed -e 's/\.meta$/\.tgz/'`" # otherwise PACKAGE info functions can fail candidate="`echo $candidate | sed -e 's/\.asc$//'`" # otherwise PACKAGE info functions can fail # Just delete packages with different arch, version, build number or folder if [ "`package_version $candidate`" != "$PACKAGE_VERSION" ] || \ [ "`package_arch $candidate`" != "$PACKAGE_ARCH" ] || \ [ "`package_build $candidate`" != "$PACKAGE_BUILD" ] || \ + [ "`package_ext $candidate`" != "$PACKAGE_EXT" ] || \ [ "`dirname $candidate | sed -e 's/^\.\///'`" != "`dirname $SUBFOLDER/$PKG_NAME | sed -e 's/^\.\///'`" ]; then svn_del $file fi @@ -450,9 +451,9 @@ function remove_old_package_data { else # Using -mindepth 2 so it doesn't delete the new package - find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.tgz" -exec rm {} 2>/dev/null \; + find $makepkg_repos -mindepth 2 $(package_ext_find $PACKAGE-*-*-*) -exec rm {} 2>/dev/null \; find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.meta" -exec rm {} 2>/dev/null \; - find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.tgz.asc" -exec rm {} 2>/dev/null \; + find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.*.asc" -exec rm {} 2>/dev/null \; find $makepkg_repos -name "$PACKAGE.slack-required" -exec rm {} 2>/dev/null \; fi fi @@ -485,7 +486,7 @@ function update_metadata { found_patch="no" - for file in `find patches/ -name "$PACKAGE-*-*-*.tgz"`; do + for file in `find patches/ $(package_ext_find $PACKAGE-*-*-*)`; do found_patch="yes" update_md5_checksum $makepkg_repos/patches patches/$SUBFOLDER/$PKG_NAME done @@ -512,7 +513,7 @@ function list_packages { for repository in $repositories; do echo "Packages from $repository..." - find $repository -name '*.tgz' + find $repository $(package_ext_find) done } @@ -538,9 +539,9 @@ function remove_package { cd $repository - for file in `find . -name "$package-*-*-*.tgz" -o -name "$package-*-*-*.meta" -o -name "$package-*-*-*.tgz.asc"`; do + for file in `find . $(package_ext_find $package-*-*-*) -o -name "$package-*-*-*.meta" -o -name "$package-*-*-*.*.asc"`; do svn_del $file - if [ -e "CHECKSUMS.md5" ] && echo $file | grep -q -e ".tgz$"; then + if [ -e "CHECKSUMS.md5" ] && echo $file | grep -q -E -e "$(pkg_ext_grep)$"; then # remove md5 information sed -i "/ \.*\/*$(regexp_slash $file)$/d" CHECKSUMS.md5 cat CHECKSUMS.md5 | gzip -9 -c - > CHECKSUMS.md5.gz @@ -579,7 +580,7 @@ function sign_package { cd $repository - for file in `find . -name "$package-*-*-*.tgz"`; do + for file in `find . $(pkg_ext_find $package-*-*-*)`; do echo "Signing package..." @@ -748,11 +749,12 @@ function create_package { fi # Get package name, arch, version and build number - PKG_NAME="`ls -1 -c $PACKAGES_DIR/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basename`" + PKG_NAME="`ls -1 -c $PACKAGES_DIR/$PACKAGE-*-*-*.* | grep -E -e "$(pkg_ext_grep)$" | head -n 1 | xargs basename`" PACKAGE_NAME="`package_name $PKG_NAME`" PACKAGE_VERSION="`package_version $PKG_NAME`" PACKAGE_ARCH="`package_arch $PKG_NAME`" PACKAGE_BUILD="`package_build $PKG_NAME`" + PACKAGE_EXT="`package_ext $PKG_NAME`" # Update package author if [ ! -z "$CREATEPKG_AUTHOR" ]; then @@ -761,8 +763,8 @@ function create_package { echo "Changing package build author..." BUILD_NUMBER="`echo $PACKAGE_BUILD | sed -e "s/$AUTHOR$//"`" NEW_BUILD="$BUILD_NUMBER""$CREATEPKG_AUTHOR" - mv $PACKAGES_DIR/$PKG_NAME $PACKAGES_DIR/$PACKAGE_NAME-$PACKAGE_VERSION-$PACKAGE_ARCH-$NEW_BUILD.tgz - PKG_NAME="$PACKAGE_NAME-$PACKAGE_VERSION-$PACKAGE_ARCH-$NEW_BUILD.tgz" + mv $PACKAGES_DIR/$PKG_NAME $PACKAGES_DIR/$PACKAGE_NAME-$PACKAGE_VERSION-$PACKAGE_ARCH-$NEW_BUILD.$PACKAGE_EXT + PKG_NAME="$PACKAGE_NAME-$PACKAGE_VERSION-$PACKAGE_ARCH-$NEW_BUILD.$PACKAGE_EXT" PACKAGE_BUILD="$NEW_BUILD" AUTHOR="$CREATEPKG_AUTHOR" echo "New package name is $PKG_NAME." @@ -849,7 +851,7 @@ function create_package { create_repo_folder $NOARCH_DIR remove_old_package_data $NOARCH_DIR svn_copy $NEW_REPOS/$PKG_NAME $NOARCH_DIR/$SUBFOLDER/ - svn_copy $NEW_REPOS/`basename $PKG_NAME .tgz`.meta $NOARCH_DIR/$SUBFOLDER/ + svn_copy $NEW_REPOS/`strip_pkg_ext $PKG_NAME`.meta $NOARCH_DIR/$SUBFOLDER/ svn_copy $NEW_REPOS/`basename $PKG_NAME`.asc $NOARCH_DIR/$SUBFOLDER/ svn_copy $NEW_REPOS/$PACKAGE.slack-required $NOARCH_DIR/$SUBFOLDER/ update_metadata $NOARCH_DIR |