diff options
Diffstat (limited to 'trunk/src')
-rw-r--r-- | trunk/src/createpkg | 26 | ||||
-rwxr-xr-x | trunk/src/rebuildpkg | 7 | ||||
-rwxr-xr-x | trunk/src/simplaret | 29 | ||||
-rwxr-xr-x | trunk/src/simpletrack | 6 | ||||
-rwxr-xr-x | trunk/src/templatepkg | 2 |
5 files changed, 40 insertions, 30 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 diff --git a/trunk/src/rebuildpkg b/trunk/src/rebuildpkg index 6d3d10c..65315ad 100755 --- a/trunk/src/rebuildpkg +++ b/trunk/src/rebuildpkg @@ -18,7 +18,6 @@ # COMMON="/usr/libexec/simplepkg/common.sh" -TMP="/tmp" function usage { echo "usage: ROOT=/otherroot `basename $0` <package-name>" @@ -82,6 +81,6 @@ if [ -f "$ROOT/var/log/scripts/$package_name" ]; then cp $ROOT/var/log/scripts/$package_name $TMP/package-$pack/install/doinst.sh fi -makepkg $package_name.tgz -mv $package_name.tgz $TMP/ -echo "done: package rebuilt and stored at $TMP/$package_name.tgz" +makepkg $package_name.$MKBUILD_COMPRESS +mv $package_name.$MKBUILD_COMPRESS $TMP/ +echo "done: package rebuilt and stored at $TMP/$package_name.$MKBUILD_COMPRESS" diff --git a/trunk/src/simplaret b/trunk/src/simplaret index 04281f2..b981867 100755 --- a/trunk/src/simplaret +++ b/trunk/src/simplaret @@ -240,7 +240,11 @@ function simplaret_repository_url { if [ "$repos_type" == "root" ]; then simplaret_set_arch - repository_url="$repository_url/`basename $repository_url`-$VERSION/" + distro="`basename $repository_url`" + if [ "$ARCH" == "x86_64" && "$distro" == "slackware" ]; then + distro="slackware64" + fi + repository_url="$repository_url/$distro-$VERSION/" fi } @@ -294,9 +298,9 @@ function simplaret_find_package { # usage: simplaret_find_package <package-name|-all> <repository-folder> if [ "$1" == "-all" ]; then - grep -e ".tgz$" $2/`simplaret_filelist` | awk '{ print $8 }' + grep -E -e "$(pkg_ext_grep .)$" $2/`simplaret_filelist` | awk '{ print $8 }' else - grep $1 $2/`simplaret_filelist` | awk '{ print $8 }' | grep -e ".tgz$" + grep $1 $2/`simplaret_filelist` | awk '{ print $8 }' | grep -E -e "$(pkg_ext_grep .)$" fi } @@ -465,7 +469,7 @@ function simplaret_purge { simplaret_set_storage_folder for file in `find $storage/ $mtime 2> /dev/null`; do - for extension in tgz asc meta txt slack-required; do + for extension in `pkg_ext` asc meta txt slack-required; do if echo $file | grep -qe ".$extension$"; then rm $file fi @@ -495,6 +499,7 @@ function simplaret_search_and_delete { # searching by full package filename name_version="`package_version $1`" name_build="`package_build $1`" + name_ext="`package_ext $1`" # search wheter the package filename is in the repositories if [ "`simplaret_search $1 | grep $1 | wc -l`" == "0" ]; then @@ -502,14 +507,16 @@ function simplaret_search_and_delete { return 1 fi - for file in `find $2/ -name $name*tgz 2> /dev/null`; do + for file in `find $2/ $(pkg_ext_find $name*) 2> /dev/null`; do candidate="`basename $file`" version="`package_version $candidate`" build="`package_build $candidate`" + ext="`package_ext $candidate`" if [ "`package_name $candidate`" == "$name" ]; then if [ "$name_version" == "$version" ] && \ - [ "$name_build" == "$build" ]; then + [ "$name_build" == "$build" ] && \ + [ "$name_ext" == "$ext" ]; then LAST_DOWNLOADED_PACKAGE="$file" if [ "$3" != "--silent" ]; then echo Package $candidate already downloaded @@ -521,7 +528,7 @@ function simplaret_search_and_delete { return 1 else place="`dirname $file`" - basename="`basename $file tgz`" + basename="`strip_pkg_ext $file`" rm -f $file rm -f $place/$candidate.slack-required rm -f $file.asc $place/$basename.meta $place/$basename.txt @@ -533,17 +540,19 @@ function simplaret_search_and_delete { else - for file in `find $2/ -name $name*tgz 2> /dev/null`; do + for file in `find $2/ $(pkg_ext_find $name*) 2> /dev/null`; do candidate="`basename $file`" version="`package_version $candidate`" build="`package_build $candidate`" + ext="`package_ext $candidate`" if [ "`package_name $candidate`" == "$name" ]; then # check if has the same version and build number, otherwise erase the old one for result in `simplaret_search $(package_name $candidate) --basename-only`; do if [ "`package_name $candidate`" == "`package_name $result`" ]; then if [ "$version" == "`package_version $result`" ] && \ - [ "$build" == "`package_build $result`" ]; then + [ "$build" == "`package_build $result`" ] && \ + [ "$ext" == "`package_ext $result`" ]; then LAST_DOWNLOADED_PACKAGE="$file" if [ "$3" != "--silent" ]; then echo Package $candidate already downloaded @@ -555,7 +564,7 @@ function simplaret_search_and_delete { return 1 else place="`dirname $file`" - basename="`basename $file tgz`" + basename="`strip_pkg_ext $file`" rm -f $file rm -f $place/$candidate.slack-required rm -f $file.asc $place/$basename.meta $place/$basename.txt diff --git a/trunk/src/simpletrack b/trunk/src/simpletrack index c643a89..31b7225 100755 --- a/trunk/src/simpletrack +++ b/trunk/src/simpletrack @@ -21,19 +21,19 @@ BASENAME="`basename $0`" function slacktrack { - $1 -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.tgz" "./$2" + $1 -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.$MKBUILD_COMPRESS" "./$2" } function slacktrack-real { - $1 -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.tgz" "./$2" + $1 -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.$MKBUILD_COMPRESS" "./$2" } function altertrack { - $1 -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.tgz" "./$2" + $1 -b $REPOS -x $TMP,$SRC_DIR,/dev -jefkzp "$PACKAGE-$VERSION-$ARCH-$BUILD.$MKBUILD_COMPRESS" "./$2" } diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg index 2d1ada2..c107bd8 100755 --- a/trunk/src/templatepkg +++ b/trunk/src/templatepkg @@ -884,7 +884,7 @@ function package_template { cd $TMP/templatepkg - makepkg -c n -l y $TMP/template-$template-$version-noarch-$build.tgz + makepkg -c n -l y $TMP/template-$template-$version-noarch-$build.$MKBUILD_COMPRESS cd $TMP rm -rf templatepkg |