X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=poldek-git.patch;h=81d7b7a228a60e8ffc49dc119aefb3ab44a37e5e;hb=a5f27c7136f46073aeffa2e79126029dd61cb23a;hp=f579c7ab59f636649ccdb68127284de261ff734a;hpb=bb336a89b0b92fda128bf022856bac7ce92fa695;p=packages%2Fpoldek.git diff --git a/poldek-git.patch b/poldek-git.patch index f579c7a..81d7b7a 100644 --- a/poldek-git.patch +++ b/poldek-git.patch @@ -1,42 +1,167 @@ -commit 3c90766404683407368cab9526d13b0aa8036469 -Author: Bartlomiej Zimon -Date: Wed Mar 21 01:48:26 2012 +0100 +commit 2f6b86835cbbad530f838bcf5d3e183f92eb3396 +Author: Marcin Banasiak +Date: Thu Sep 27 17:44:19 2012 +0200 - - pndir update: realy keep quiet + Change the way how / is stored in dirindex - Signed-off-by: Bartlomiej Zimon + Previously, / was stored in dirindex with leading slash (i.e. as //) + what caused various side effects as: + + filesystem-4.0-12.x86_64 obsoleted by filesystem-4.0-13.x86_64 + filesystem-4.0-13.x86_64 marks FHS-2.3-35.x86_64 (cap //) + error: FHS-2.3-35.x86_64: equal version installed, give up -diff --git a/pkgdir/pndir/update.c b/pkgdir/pndir/update.c -index 830356a..c26fe9f 100644 ---- a/pkgdir/pndir/update.c -+++ b/pkgdir/pndir/update.c -@@ -289,8 +289,7 @@ int pndir_m_update(struct pkgdir *pkgdir, enum pkgdir_uprc *uprc) - pidxpath += 6; - - // to keep quiet vf_stat -- if (poldek_VERBOSE < 2) -- vfile_configure(VFILE_CONF_VERBOSE, &poldek_VERBOSE); -+ vfile_configure(VFILE_CONF_VERBOSE, 0); +diff --git a/pkgdir/pkgdir_dirindex.c b/pkgdir/pkgdir_dirindex.c +index a6f422f..abfd05c 100644 +--- a/pkgdir/pkgdir_dirindex.c ++++ b/pkgdir/pkgdir_dirindex.c +@@ -103,10 +103,14 @@ static int package_key(char *key, int size, const struct pkg *pkg, int prefix) + static tn_buf *dirarray_join(tn_buf *nbuf, tn_array *arr, char *sep) + { + int i, size = n_array_size(arr); ++ + for (i=0; i < size; i++) { +- n_buf_printf(nbuf, "%s%s", (char*)n_array_nth(arr, i), +- i < size - 1 ? sep : ""); ++ const char *dirname = n_array_nth(arr, i); ++ ++ n_buf_printf(nbuf, "%s%s%s", *dirname != '/' ? "/" : "", ++ dirname, i < size - 1 ? sep : ""); + } ++ + return nbuf; + } + +@@ -179,7 +183,8 @@ static int store_from_previous(uint32_t package_no, struct pkg *pkg, struct tndb + + while (*tl) { + const char *dir = *tl; +- dir = dir + 1; /* skip '/' */ ++ if (dir[1] != '\0') ++ dir = dir + 1; /* skip '/' only when strlen(dir) > 1 */ + add_to_path_index(path_index, dir, package_no); + tl++; + } +@@ -238,15 +243,13 @@ void store_package(uint32_t package_no, struct pkg *pkg, struct tndb *db, + + if (required) { + n_buf_clean(nbuf); +- n_buf_printf(nbuf, "/"); /* prefix all by '/' */ +- nbuf = dirarray_join(nbuf, required, ":/"); ++ nbuf = dirarray_join(nbuf, required, ":"); + tndb_put(db, key, klen, n_buf_ptr(nbuf), n_buf_size(nbuf)); + } + + if (owned) { + n_buf_clean(nbuf); +- n_buf_printf(nbuf, "/"); /* prefix all by '/' */ +- nbuf = dirarray_join(nbuf, owned, ":/"); ++ nbuf = dirarray_join(nbuf, owned, ":"); + + /* ugly, but what for another package_key() call */ + key[1] = PREFIX_PKGKEY_OWNDIR; +@@ -323,9 +326,13 @@ static int dirindex_create(const struct pkgdir *pkgdir, const char *path, + for (i=0; i < n_array_size(directories); i++) { + const char *path = n_array_nth(directories, i); + tn_array *ids = n_hash_get(path_index, path); ++ int j; + + n_buf_clean(nbuf); +- nbuf = dirarray_join(nbuf, ids, ":"); ++ for (j = 0; j < n_array_size(ids); j++) { ++ n_buf_printf(nbuf, "%s%s", (char *)n_array_nth(ids, j), ++ j < n_array_size(ids) - 1 ? ":" : ""); ++ } + + DBGF(" dir %s %s\n", path, (char*)n_buf_ptr(nbuf)); + +@@ -774,11 +781,11 @@ tn_array *get_package_directories_as_array(const struct pkgdir *pkgdir, + + dirs = n_array_new(n, free, (tn_fn_cmp)strcmp); + while (*tl) { +- if (**tl) ++ if (**tl) + n_array_push(dirs, n_strdup(*tl)); + tl++; + } +- ++ + n_str_tokl_free(tl_save); + n_free(val); + +@@ -809,7 +816,7 @@ static tn_array *do_dirindex_get(const struct pkgdir_dirindex *dirindex, + unsigned char val[8192]; + int n, found, pkgs_passsed = 1; + +- if (*path == '/') ++ if (*path == '/' && path[1] != '\0') + path++; + + if (!tndb_get_str(dirindex->db, path, val, sizeof(val))) +@@ -877,7 +884,7 @@ int pkgdir_dirindex_pkg_has_path(const struct pkgdir *pkgdir, - snprintf(path, sizeof(path), "%s.ndir.%s", - pkgdir->idxpath, pidxpath); -commit 55c3e1253032e28eab75bf775b247db4882961f2 -Author: Bartlomiej Zimon -Date: Wed Mar 21 02:23:27 2012 +0100 + DBGF("%s %s\n", pkg_id(pkg), path); + +- if (*path == '/') ++ if (*path == '/' && path[1] != '\0') + path++; + + if (!tndb_get_str(dirindex->db, path, val, sizeof(val))) +commit f575c9bbe3cdd8f2d6ef27eb73dcc270c1a8a3f2 +Author: Marcin Banasiak +Date: Sun Oct 7 12:41:42 2012 +0200 - - add name for aria fetcher - - Signed-off-by: Bartlomiej Zimon + Provide function body for inlined pkg_id + +diff --git a/pkg.c b/pkg.c +index 6e83694..227fe14 100644 +--- a/pkg.c ++++ b/pkg.c +@@ -1463,11 +1463,6 @@ struct pkg *pkg_link(struct pkg *pkg) + return pkg; + } + +-const char *pkg_id(const struct pkg *p) +-{ +- return p->_nvr; +-} +- + int pkg_id_snprintf(char *str, size_t size, const struct pkg *pkg) + { + return n_snprintf(str, size, "%s", pkg_id(pkg)); +diff --git a/pkg.h b/pkg.h +index f0d71ac..ec6cc6d 100644 +--- a/pkg.h ++++ b/pkg.h +@@ -231,7 +231,11 @@ EXPORT const char *pkg_pkgdirpath(const struct pkg *pkg); + EXPORT unsigned pkg_file_url_type(const struct pkg *pkg); + + +-EXPORT extern__inline const char *pkg_id(const struct pkg *p); ++static inline const char *pkg_id(const struct pkg *p) ++{ ++ return p->_nvr; ++} ++ + EXPORT int pkg_id_snprintf(char *str, size_t size, const struct pkg *pkg); + EXPORT int pkg_idevr_snprintf(char *str, size_t size, const struct pkg *pkg); + +commit ce00c5a5311fb6d77fcf96b04bca5cf2904d90ae +Author: Marcin Banasiak +Date: Sun Oct 7 12:46:36 2012 +0200 + + Kill redundant EXPORT in pm.h -diff --git a/doc/poldek.conf.xml b/doc/poldek.conf.xml -index 5846888..17347e5 100644 ---- a/doc/poldek.conf.xml -+++ b/doc/poldek.conf.xml -@@ -729,6 +729,7 @@ proto = http,ftp,https - cmd = wget -N --dot-style=binary -P %d %Pn - - [fetcher] -+name = aria - proto = http,ftp,https - cmd = aria2c --log-level=info --summary-interval=0 --truncate-console-readout=true -c -k1M -j5 -s5 -x5 -Z -P -d %d %Pn +diff --git a/pm/pm.h b/pm/pm.h +index 9913168..a20c305 100644 +--- a/pm/pm.h ++++ b/pm/pm.h +@@ -204,7 +204,7 @@ EXPORT int pm_get_dbdepdirs(struct pm_ctx *ctx, + EXPORT struct pkg *pm_load_package(struct pm_ctx *ctx, + tn_alloc *na, const char *path, unsigned ldflags); +-EXPORT struct pkgdir; ++struct pkgdir; + EXPORT struct pkgdir *pkgdb_to_pkgdir(struct pm_ctx *ctx, const char *rootdir, + const char *path, unsigned pkgdir_ldflags, + const char *key, ...);