From 9e8af82c97992ab15e4c182af84f06afd4885dc7 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 11 Jan 2011 23:15:44 -0600 Subject: Back out anticipated epoch changes After all the debate as to what to do on maint, we are going to end up just incorporating epoch into the version string, so we don't need this separate field at all. Revert commit 5c8083baa4a and also kill the force flag we were recording here as well. Signed-off-by: Dan McGee --- lib/libalpm/be_files.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c index c0b8b439..1c9aaeec 100644 --- a/lib/libalpm/be_files.c +++ b/lib/libalpm/be_files.c @@ -811,10 +811,6 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) fprintf(fp, "\n"); } if(local) { - if(info->force) { - fprintf(fp, "%%EPOCH%%\n" - "1\n\n"); - } if(info->url) { fprintf(fp, "%%URL%%\n" "%s\n\n", info->url); -- cgit v1.2.3-24-g4f1b From 8e30a46adbe350a9741bbb9748334a4adc9742f6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 11 Jan 2011 23:16:52 -0600 Subject: Make debug config messages consistent in capitalization Signed-off-by: Dan McGee --- src/pacman/pacman.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 78407d67..2cd99cbb 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -218,10 +218,10 @@ static void setarch(const char *arch) if (strcmp(arch, "auto") == 0) { struct utsname un; uname(&un); - pm_printf(PM_LOG_DEBUG, "config: architecture: %s\n", un.machine); + pm_printf(PM_LOG_DEBUG, "config: Architecture: %s\n", un.machine); alpm_option_set_arch(un.machine); } else { - pm_printf(PM_LOG_DEBUG, "config: architecture: %s\n", arch); + pm_printf(PM_LOG_DEBUG, "config: Architecture: %s\n", arch); alpm_option_set_arch(arch); } } -- cgit v1.2.3-24-g4f1b From cae2bdafec93381284ba487010738d72d0992aab Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 11 Jan 2011 18:43:28 -0600 Subject: pactest: build the filelist using a set() This will prevent duplicates, which we had plenty of once I made a few tests that had a list of files greater than the normal two. The previous logic was not working quite right. Signed-off-by: Dan McGee (cherry picked from commit 0d4dd09993971924d379be4d0944d72f4c77b021) --- test/pacman/pmdb.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py index 8cb1b832..218e3b58 100755 --- a/test/pacman/pmdb.py +++ b/test/pacman/pmdb.py @@ -38,16 +38,14 @@ def _mkfilelist(files): usr/local/bin/ usr/local/bin/dummy """ - i = [] + file_list = set() for f in files: dir = getfilename(f) - i.append(dir) + file_list.add(dir) while "/" in dir: [dir, tmp] = dir.rsplit("/", 1) - if not dir + "/" in files: - i.append(dir + "/") - i.sort() - return i + file_list.add(dir + "/") + return sorted(file_list) def _mkbackuplist(backup): """ -- cgit v1.2.3-24-g4f1b From 30f53cfe8d3f07bc9f350387b55ddf8579dd75e3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 12 Jan 2011 09:17:22 -0600 Subject: Fix double read issue in maint releases This is essentially a backport/cherry-pick of commit 33240e87b99e from master, but has to be done by hand because the DB format has diverged. Read more in the commit message used there, which follows. Due to the way we funk around with package data loading, we had a condition where the filelist got doubled up because it was loaded twice. Packages are originally loaded with INFRQ_BASE. In an upgrade/sync, the package is checked for file conflicts next, leaving us in an "INFRQ_BASE | INFRQ_FILES" state. Later, when committing a single package, we have an explicit call to _alpm_local_db_read() with INFRQ_ALL as the level. Because the package's level did not match this, we skipped over our previous "does the incoming level match where I'm at" shortcut, and continued to load things again, because of a lack of fine-grained checking for each of DESC, FILES, and INSTALL. The end result is we loaded the filelist twice, causing our remove logic to iterate twice over the installed files, spewing a bunch of "cannot find file X" messages. Fix the problem by doing a bit more bitmasking logic throughout the load method, and also fix the sanity check at the beginning of the function- this should *only* be used for local packages as opposed to the "not a package" check that was there before. Signed-off-by: Dan McGee --- lib/libalpm/be_files.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c index 1c9aaeec..0ee8a3bb 100644 --- a/lib/libalpm/be_files.c +++ b/lib/libalpm/be_files.c @@ -396,14 +396,16 @@ int _alpm_db_populate(pmdb_t *db) continue; } + pkg->origin = PKG_FROM_CACHE; + pkg->origin_data.db = db; + /* explicitly read with only 'BASE' data, accessors will handle the rest */ if(_alpm_db_read(db, pkg, INFRQ_BASE) == -1) { _alpm_log(PM_LOG_ERROR, _("corrupted database entry '%s'\n"), name); _alpm_pkg_free(pkg); continue; } - pkg->origin = PKG_FROM_CACHE; - pkg->origin_data.db = db; + /* add to the collection */ _alpm_log(PM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n", pkg->name, db->treename); @@ -460,7 +462,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) * & result: 00000100 * == to inforeq? nope, we need to load more info. */ if((info->infolevel & inforeq) == inforeq) { - /* already loaded this info, do nothing */ + /* already loaded all of this info, do nothing */ return(0); } _alpm_log(PM_LOG_FUNCTION, "loading package data for %s : level=0x%x\n", @@ -479,7 +481,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } /* DESC */ - if(inforeq & INFRQ_DESC) { + if(inforeq & INFRQ_DESC && !(info->infolevel & INFRQ_DESC)) { snprintf(path, PATH_MAX, "%sdesc", pkgpath); if((fp = fopen(path, "r")) == NULL) { _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno)); @@ -623,7 +625,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } /* FILES */ - if(inforeq & INFRQ_FILES) { + if(inforeq & INFRQ_FILES && !(info->infolevel & INFRQ_FILES)) { snprintf(path, PATH_MAX, "%sfiles", pkgpath); if((fp = fopen(path, "r")) == NULL) { _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno)); @@ -650,7 +652,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } /* DEPENDS */ - if(inforeq & INFRQ_DEPENDS) { + if(inforeq & INFRQ_DEPENDS && !(info->infolevel & INFRQ_DEPENDS)) { snprintf(path, PATH_MAX, "%sdepends", pkgpath); if((fp = fopen(path, "r")) == NULL) { _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno)); @@ -689,7 +691,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } /* DELTAS */ - if(inforeq & INFRQ_DELTAS) { + if(inforeq & INFRQ_DELTAS && !(info->infolevel & INFRQ_DELTAS)) { snprintf(path, PATH_MAX, "%sdeltas", pkgpath); if((fp = fopen(path, "r"))) { while(!feof(fp)) { @@ -710,7 +712,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } /* INSTALL */ - if(inforeq & INFRQ_SCRIPTLET) { + if(inforeq & INFRQ_SCRIPTLET && !(info->infolevel & INFRQ_SCRIPTLET)) { snprintf(path, PATH_MAX, "%sinstall", pkgpath); if(access(path, F_OK) == 0) { info->scriptlet = 1; -- cgit v1.2.3-24-g4f1b