summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNagy Gabor <ngaba@bibl.u-szeged.hu>2009-11-13 16:42:42 +0100
committerDan McGee <dan@archlinux.org>2009-12-14 06:18:58 +0100
commit444ff9564195223e31d445459009fceb2ae79002 (patch)
tree402e11b86a49c5c1a76afdb0459e50169b22406d /lib
parente612eb6ba227104761b9c6fafe375c74267bba09 (diff)
downloadpacman-444ff9564195223e31d445459009fceb2ae79002.tar.gz
pacman-444ff9564195223e31d445459009fceb2ae79002.tar.xz
Print error on duplicated database entries
Some users reported duplicated database entries in /var/lib/pacman/local/, for example, both foo-1.0-1 and foo-2.0-1 subdirectories existed. (Bogus 3rd-party scripts, backup?) In this case pacman reported no error and its behaviour was mysterious. From now on, pacman detects this situation and prints an error message. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/be_files.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c
index 90e97a55..f624d7cf 100644
--- a/lib/libalpm/be_files.c
+++ b/lib/libalpm/be_files.c
@@ -262,6 +262,13 @@ int _alpm_db_populate(pmdb_t *db)
continue;
}
+ /* duplicated database entries are not allowed */
+ if(_alpm_pkg_find(db->pkgcache, pkg->name)) {
+ _alpm_log(PM_LOG_ERROR, _("duplicated database entry '%s'\n"), pkg->name);
+ _alpm_pkg_free(pkg);
+ continue;
+ }
+
/* 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);