diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-10-26 14:12:59 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-10-26 14:12:59 +0000 |
commit | fbddf9cf8b355e70a55da329f0b6129e67b5449a (patch) | |
tree | abe695af5b6acc1ce72838d7d28c7454269e6fd1 /main | |
parent | 74332a6e3f71e259b4f240bb6684dd47eca21ed9 (diff) | |
download | aports-fbddf9cf8b355e70a55da329f0b6129e67b5449a.tar.bz2 aports-fbddf9cf8b355e70a55da329f0b6129e67b5449a.tar.xz |
main/apk-tools: upgade to 2.0_rc6 + 2 patches
Diffstat (limited to 'main')
4 files changed, 118 insertions, 37 deletions
diff --git a/main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch b/main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch new file mode 100644 index 0000000000..ad42d466cc --- /dev/null +++ b/main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch @@ -0,0 +1,45 @@ +From cc4644a54e4bb92507f957832647d91f7f91c21b Mon Sep 17 00:00:00 2001 +From: Timo Teras <timo.teras@iki.fi> +Date: Mon, 26 Oct 2009 09:33:12 +0200 +Subject: [PATCH 1/2] version: fix comparision of pre-suffixes + +got broke in 0b9bfa8d52ea7ec2cae562a71932a9cc6e2b9963 which +fixed another corner case. hopefully it's good now. fixes #191. +--- + src/version.c | 17 ++++++++++++++--- + 1 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/src/version.c b/src/version.c +index 97b87a6..4253042 100644 +--- a/src/version.c ++++ b/src/version.c +@@ -207,12 +207,23 @@ int apk_version_compare_blob(apk_blob_t a, apk_blob_t b) + if (av > bv) + return APK_VERSION_GREATER; + +- /* at and bt are the next expected token type */ ++ /* both have TOKEN_END or TOKEN_INVALID next? */ + if (at == bt) + return APK_VERSION_EQUAL; +- if (at < bt || bt == TOKEN_INVALID) ++ ++ /* leading version components and their values are equal, ++ * now the non-terminating version is greater unless it's a suffix ++ * indicating pre-release */ ++ if (at == TOKEN_SUFFIX && get_token(&at, &a) < 0) ++ return APK_VERSION_LESS; ++ if (bt == TOKEN_SUFFIX && get_token(&bt, &b) < 0) + return APK_VERSION_GREATER; +- return APK_VERSION_LESS; ++ if (at == TOKEN_END) ++ return APK_VERSION_LESS; ++ if (bt == TOKEN_END) ++ return APK_VERSION_GREATER; ++ ++ return APK_VERSION_EQUAL; + } + + int apk_version_compare(const char *str1, const char *str2) +-- +1.6.5 + diff --git a/main/apk-tools/0001-version-index-output-to-stdout-instead-of-stderr.patch b/main/apk-tools/0001-version-index-output-to-stdout-instead-of-stderr.patch deleted file mode 100644 index 31bfc9a368..0000000000 --- a/main/apk-tools/0001-version-index-output-to-stdout-instead-of-stderr.patch +++ /dev/null @@ -1,31 +0,0 @@ -From d3861d70a88c6d2d3583fb90946aedb48a8d3e46 Mon Sep 17 00:00:00 2001 -From: Timo Teras <timo.teras@iki.fi> -Date: Fri, 4 Sep 2009 11:38:19 +0300 -Subject: [PATCH] version: --index output to stdout instead of stderr - ---- - src/ver.c | 8 ++++---- - 1 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/ver.c b/src/ver.c -index 3f85afc..a617bdb 100644 ---- a/src/ver.c -+++ b/src/ver.c -@@ -31,10 +31,10 @@ static int ver_indexes(struct apk_database *db, int argc, char **argv) - if (APK_BLOB_IS_NULL(repo->description)) - continue; - -- apk_message("%.*s [%s]", -- repo->description.len, -- repo->description.ptr, -- db->repos[i].url); -+ printf("%.*s [%s]\n", -+ repo->description.len, -+ repo->description.ptr, -+ db->repos[i].url); - } - - return 0; --- -1.6.4.2 - diff --git a/main/apk-tools/0002-db-fix-migration-and-pruning-of-symlinks-to-dirs.patch b/main/apk-tools/0002-db-fix-migration-and-pruning-of-symlinks-to-dirs.patch new file mode 100644 index 0000000000..de2d313448 --- /dev/null +++ b/main/apk-tools/0002-db-fix-migration-and-pruning-of-symlinks-to-dirs.patch @@ -0,0 +1,62 @@ +From a7360395ea963334e80fb49d3fc36789d6f40685 Mon Sep 17 00:00:00 2001 +From: Timo Teras <timo.teras@iki.fi> +Date: Mon, 26 Oct 2009 09:46:09 +0200 +Subject: [PATCH 2/2] db: fix migration and pruning of symlinks to dirs + +the old code treated a symlink to directory as file; it tried +to calculate regular has of it. fix this by: 1) using no follow +on migration and pruning stats, and 2) the helper function to +check if it's point to directory and not calculate hash in that +case. fixes #188. +--- + src/database.c | 6 ++++-- + src/io.c | 2 +- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/database.c b/src/database.c +index 16f8bb8..5b1d6bb 100644 +--- a/src/database.c ++++ b/src/database.c +@@ -1810,7 +1810,7 @@ static void apk_db_purge_pkg(struct apk_database *db, + if (!(diri->dir->flags & APK_DBDIRF_PROTECTED) || + (apk_flags & APK_PURGE) || + (file->csum.type != APK_CHECKSUM_NONE && +- apk_file_get_info(db->root_fd, name, file->csum.type, &fi) == 0 && ++ apk_file_get_info(db->root_fd, name, APK_FI_NOFOLLOW | file->csum.type, &fi) == 0 && + apk_checksum_compare(&file->csum, &fi.csum) == 0)) + unlinkat(db->root_fd, name, 0); + if (apk_verbosity >= 3) +@@ -1868,6 +1868,7 @@ static void apk_db_migrate_files(struct apk_database *db, + if (ofile != NULL && + (diri->dir->flags & APK_DBDIRF_PROTECTED)) + cstype = ofile->csum.type; ++ cstype |= APK_FI_NOFOLLOW; + + r = apk_file_get_info(db->root_fd, name, cstype, &fi); + if ((diri->dir->flags & APK_DBDIRF_PROTECTED) && +@@ -1882,7 +1883,8 @@ static void apk_db_migrate_files(struct apk_database *db, + * existing file */ + if (ofile == NULL || + ofile->csum.type != file->csum.type) +- apk_file_get_info(db->root_fd, name, file->csum.type, &fi); ++ apk_file_get_info(db->root_fd, name, ++ APK_FI_NOFOLLOW | file->csum.type, &fi); + if ((apk_flags & APK_CLEAN_PROTECTED) || + (file->csum.type != APK_CHECKSUM_NONE && + apk_checksum_compare(&file->csum, &fi.csum) == 0)) +diff --git a/src/io.c b/src/io.c +index 40590a2..3e292a7 100644 +--- a/src/io.c ++++ b/src/io.c +@@ -487,7 +487,7 @@ int apk_file_get_info(int atfd, const char *filename, unsigned int flags, + .device = st.st_dev, + }; + +- if (checksum == APK_CHECKSUM_NONE) ++ if (checksum == APK_CHECKSUM_NONE || S_ISDIR(st.st_mode)) + return 0; + + if ((flags & APK_FI_NOFOLLOW) && S_ISLNK(st.st_mode)) { +-- +1.6.5 + diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD index 7729b17163..18a60a5ee4 100644 --- a/main/apk-tools/APKBUILD +++ b/main/apk-tools/APKBUILD @@ -1,13 +1,14 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=apk-tools -pkgver=2.0_rc5 -pkgrel=1 +pkgver=2.0_rc6 +pkgrel=0 pkgdesc="Alpine Package Keeper - package manager for alpine" subpackages="$pkgname-static" depends= makedepends="zlib-dev openssl-dev pkgconfig" source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 - 0001-version-index-output-to-stdout-instead-of-stderr.patch + 0001-version-fix-comparision-of-pre-suffixes.patch + 0002-db-fix-migration-and-pruning-of-symlinks-to-dirs.patch " @@ -17,7 +18,10 @@ license=GPL-2 build() { cd "$srcdir/$pkgname-$pkgver" sed -i -e 's:-Werror::' Make.rules - patch -p1 -i ../0001-version-index-output-to-stdout-instead-of-stderr.patch || return 1 + for i in ../*.patch; do + [ -f $i ] || continue + patch -p1 -i $i || return 1 + done make || return 1 make static || return 1 @@ -38,5 +42,6 @@ static() { "$subpkgdir"/sbin/apk.static } -md5sums="0d7507305586e2f4bcc4884cf6684977 apk-tools-2.0_rc5.tar.bz2 -5fafd1581c7d2bce26fc9531f4a128e7 0001-version-index-output-to-stdout-instead-of-stderr.patch" +md5sums="0209128debe2791e2380198af4ef5676 apk-tools-2.0_rc6.tar.bz2 +3772c9db20a6d90d355fe89741dd5991 0001-version-fix-comparision-of-pre-suffixes.patch +ff7be1c68ad27a69fbeeae7b9a548270 0002-db-fix-migration-and-pruning-of-symlinks-to-dirs.patch" |