From 26f3bd0ea75a452988237fe65b18a702d9bade29 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 20 Oct 2014 08:46:01 +0200 Subject: [PATCH] xbps{,-static}: added support to read zplists from 0.42. --- srcpkgs/xbps-static/template | 2 +- srcpkgs/xbps/patches/0003-zplists.patch | 53 +++++++++++++++++++++++++ srcpkgs/xbps/template | 2 +- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/xbps/patches/0003-zplists.patch diff --git a/srcpkgs/xbps-static/template b/srcpkgs/xbps-static/template index 5e9317c1c1..5f24f1f8d0 100644 --- a/srcpkgs/xbps-static/template +++ b/srcpkgs/xbps-static/template @@ -3,7 +3,7 @@ # NOTE: keep this package synchronized with "srcpkgs/xbps". pkgname=xbps-static version=0.41 -revision=2 +revision=3 bootstrap=yes short_desc="The XBPS package system utilities - static binaries" maintainer="Juan RP " diff --git a/srcpkgs/xbps/patches/0003-zplists.patch b/srcpkgs/xbps/patches/0003-zplists.patch new file mode 100644 index 0000000000..4e0a8a2224 --- /dev/null +++ b/srcpkgs/xbps/patches/0003-zplists.patch @@ -0,0 +1,53 @@ +Switch to internalize_from_zfile() to be able to read zplists from 0.42. + +--- lib/pkgdb.c.orig 2014-10-20 08:42:01.750291119 +0200 ++++ lib/pkgdb.c 2014-10-20 08:42:17.430433368 +0200 +@@ -155,7 +155,7 @@ xbps_pkgdb_update(struct xbps_handle *xh + return cached_rv; + + if (xhp->pkgdb && flush) { +- pkgdb_storage = xbps_dictionary_internalize_from_file(xhp->pkgdb_plist); ++ pkgdb_storage = xbps_dictionary_internalize_from_zfile(xhp->pkgdb_plist); + if (pkgdb_storage == NULL || + !xbps_dictionary_equals(xhp->pkgdb, pkgdb_storage)) { + /* flush dictionary to storage */ +@@ -170,7 +170,7 @@ xbps_pkgdb_update(struct xbps_handle *xh + cached_rv = 0; + } + /* update copy in memory */ +- if ((xhp->pkgdb = xbps_dictionary_internalize_from_file(xhp->pkgdb_plist)) == NULL) { ++ if ((xhp->pkgdb = xbps_dictionary_internalize_from_zfile(xhp->pkgdb_plist)) == NULL) { + if (errno == ENOENT) + xhp->pkgdb = xbps_dictionary_create(); + else +@@ -346,7 +346,7 @@ xbps_pkgdb_get_pkg_files(struct xbps_han + + plist = xbps_xasprintf("%s/.%s-files.plist", xhp->metadir, pkgname); + free(pkgname); +- pkgfilesd = xbps_dictionary_internalize_from_file(plist); ++ pkgfilesd = xbps_dictionary_internalize_from_zfile(plist); + free(plist); + + if (pkgfilesd == NULL) { +--- lib/package_remove.c.orig 2014-10-20 08:42:53.597762164 +0200 ++++ lib/package_remove.c 2014-10-20 08:42:59.429815272 +0200 +@@ -268,7 +268,7 @@ xbps_remove_pkg(struct xbps_handle *xhp, + + /* internalize pkg files dictionary from metadir */ + snprintf(metafile, sizeof(metafile), "%s/.%s-files.plist", xhp->metadir, pkgname); +- pkgfilesd = xbps_dictionary_internalize_from_file(metafile); ++ pkgfilesd = xbps_dictionary_internalize_from_zfile(metafile); + if (pkgfilesd == NULL) + xbps_dbg_printf(xhp, "WARNING: metaplist for %s " + "doesn't exist!\n", pkgver); +--- bin/xbps-pkgdb/check.c.orig 2014-10-20 08:43:16.190968036 +0200 ++++ bin/xbps-pkgdb/check.c 2014-10-20 08:43:21.246014149 +0200 +@@ -94,7 +94,7 @@ check_pkg_integrity(struct xbps_handle * + if (xbps_dictionary_get_cstring_nocopy(opkgd, "metafile-sha256", &sha256)) { + buf = xbps_xasprintf("%s/.%s-files.plist", + xhp->metadir, pkgname); +- filesd = xbps_dictionary_internalize_from_file(buf); ++ filesd = xbps_dictionary_internalize_from_zfile(buf); + rv = xbps_file_hash_check(buf, sha256); + free(buf); + if (rv == ENOENT) { diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 10cde04011..7077c13592 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.41 -revision=2 +revision=3 bootstrap=yes short_desc="The XBPS package system utilities" maintainer="Juan RP "