From 5e5a560508e8f572032a69c2e52f9240d835f287 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 24 Nov 2009 12:20:06 +0000 Subject: main/apk-tools: upgrade to 2.0_rc7 ref #197 --- ...1-version-fix-comparision-of-pre-suffixes.patch | 45 ---------------- ...migration-and-pruning-of-symlinks-to-dirs.patch | 62 ---------------------- main/apk-tools/APKBUILD | 8 +-- 3 files changed, 2 insertions(+), 113 deletions(-) delete mode 100644 main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch delete mode 100644 main/apk-tools/0002-db-fix-migration-and-pruning-of-symlinks-to-dirs.patch 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 deleted file mode 100644 index ad42d466c..000000000 --- a/main/apk-tools/0001-version-fix-comparision-of-pre-suffixes.patch +++ /dev/null @@ -1,45 +0,0 @@ -From cc4644a54e4bb92507f957832647d91f7f91c21b Mon Sep 17 00:00:00 2001 -From: Timo Teras -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/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 deleted file mode 100644 index de2d31344..000000000 --- a/main/apk-tools/0002-db-fix-migration-and-pruning-of-symlinks-to-dirs.patch +++ /dev/null @@ -1,62 +0,0 @@ -From a7360395ea963334e80fb49d3fc36789d6f40685 Mon Sep 17 00:00:00 2001 -From: Timo Teras -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 18a60a5ee..c1de1d045 100644 --- a/main/apk-tools/APKBUILD +++ b/main/apk-tools/APKBUILD @@ -1,14 +1,12 @@ # Maintainer: Natanael Copa pkgname=apk-tools -pkgver=2.0_rc6 +pkgver=2.0_rc7 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-fix-comparision-of-pre-suffixes.patch - 0002-db-fix-migration-and-pruning-of-symlinks-to-dirs.patch " @@ -42,6 +40,4 @@ static() { "$subpkgdir"/sbin/apk.static } -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" +md5sums="8654e4e4e32ead79560890567caaea5e apk-tools-2.0_rc7.tar.bz2" -- cgit v1.2.3