[pacman-dev] Fun little bug- pacman3 fails to remove flex and words packages correctly
Steps to reproduce: 1. Ensure current/flex and extra/words packages are not installed on system. 2. Install packages with either pacman2 or pacman3 using -S operation. 3. Attempt to remove packages with pacman3. The following errors occur: $ sudo pacman3 -S flex words resolving dependencies... done. looking for inter-conflicts... done. Targets: flex-2.5.33-1 words-1.0-4 Total Package Size: 5.0 MB Proceed with installation? [Y/n] y checking package integrity... done. checking for file conflicts (2/2) [#######################] 100% (1/2) installing flex [#######################] 100% (2/2) installing words [#######################] 100% ==> Determining which 'words' file to use in /usr/share/dict ==> Setting 'words' link to /usr/share/dict/usa $ sudo pacman3 -R flex words checking dependencies... done. error: cannot remove file usr/share/dict/words error: cannot remove file usr/share/dict/usa error: cannot remove file usr/share/dict/spanish error: cannot remove file usr/share/dict/ngerman error: cannot remove file usr/share/dict/italian error: cannot remove file usr/share/dict/german error: cannot remove file usr/share/dict/french error: cannot remove file usr/share/dict/finnish error: cannot remove file usr/share/dict/catalan error: cannot remove file usr/share/dict/british (1/2) removing words [#######################] 100% error: cannot remove file usr/share/locale/zh_CN/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/vi/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/tr/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/sv/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/ru/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/ro/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/pt_BR/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/pl/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/nl/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/ko/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/ga/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/fr/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/es/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/de/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/da/LC_MESSAGES/flex.mo error: cannot remove file usr/share/locale/ca/LC_MESSAGES/flex.mo error: cannot remove file usr/man/man1/flex.1.gz error: cannot remove file usr/lib/libfl.a error: cannot remove file usr/include/FlexLexer.h error: cannot remove file usr/bin/lex error: cannot remove file usr/bin/flex (2/2) removing flex [#######################] 100% 4. Pacman2 can remove the packages correctly without error. $ sudo pacman -S flex words Targets: flex-2.5.33-1 words-1.0-4 Total Package Size: 5.0 MB Proceed with upgrade? [Y/n] y checking package integrity... done. loading package data... done. checking for file conflicts... done. installing flex... done. installing words... done. ==> Determining which 'words' file to use in /usr/share/dict ==> Setting 'words' link to /usr/share/dict/usa $ sudo pacman -R flex words removing words... done. removing flex... done. If you want verbose or debug output, let me know. Dan
On 1/18/07, Dan McGee <dpmcgee@gmail.com> wrote:
If you want verbose or debug output, let me know.
What are the permissions on those files when installed? Do they have some goofy sticky bit set, perhaps? I jammed the output of strerror on the end of those "cannot remove file" lines (in CVS) to see if we can gain any info from that...
With new stderr output: $ sudo pacman3 -S flex words resolving dependencies... done. looking for inter-conflicts... done. Targets: flex-2.5.33-1 words-1.0-4 Total Package Size: 5.0 MB Proceed with installation? [Y/n] y checking package integrity... done. checking for file conflicts (2/2) [#######################] 100% (1/2) installing flex [#######################] 100% (2/2) installing words [#######################] 100% ==> Determining which 'words' file to use in /usr/share/dict ==> Setting 'words' link to /usr/share/dict/usa $ sudo pacman3 -R flex words checking dependencies... done. error: cannot remove file usr/share/dict/words: No such file or directory error: cannot remove file usr/share/dict/usa: No such file or directory error: cannot remove file usr/share/dict/spanish: No such file or directory error: cannot remove file usr/share/dict/ngerman: No such file or directory error: cannot remove file usr/share/dict/italian: No such file or directory error: cannot remove file usr/share/dict/german: No such file or directory error: cannot remove file usr/share/dict/french: No such file or directory error: cannot remove file usr/share/dict/finnish: No such file or directory error: cannot remove file usr/share/dict/catalan: No such file or directory error: cannot remove file usr/share/dict/british: No such file or directory (1/2) removing words [#######################] 100% error: cannot remove file usr/share/locale/zh_CN/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/vi/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/tr/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/sv/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/ru/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/ro/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/pt_BR/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/pl/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/nl/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/ko/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/ga/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/fr/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/es/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/de/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/da/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/share/locale/ca/LC_MESSAGES/flex.mo: No such file or directory error: cannot remove file usr/man/man1/flex.1.gz: No such file or directory error: cannot remove file usr/lib/libfl.a: No such file or directory error: cannot remove file usr/include/FlexLexer.h: No such file or directory error: cannot remove file usr/bin/lex: No such file or directory error: cannot remove file usr/bin/flex: No such file or directory (2/2) removing flex [#######################] 100% $ sudo pacman3 -S flex words resolving dependencies... done. looking for inter-conflicts... done. Targets: flex-2.5.33-1 words-1.0-4 Total Package Size: 5.0 MB Proceed with installation? [Y/n] y checking package integrity... done. checking for file conflicts (2/2) [#######################] 100% error: could not prepare transaction error: failed to commit transaction (conflicting files) flex: /usr/bin/flex exists in filesystemflex: /usr/bin/lex exists in filesystemflex: /usr/include/FlexLexer.h exists in filesystemflex: /usr/lib/libfl.a exists in filesystemflex: /usr/man/man1/flex.1.gz exists in filesystemflex: /usr/share/locale/ca/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/da/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/de/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/es/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/fr/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/ga/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/ko/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/nl/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/pl/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/pt_BR/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/ro/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/ru/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/sv/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/tr/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/vi/LC_MESSAGES/flex.mo exists in filesystemflex: /usr/share/locale/zh_CN/LC_MESSAGES/flex.mo exists in filesystemwords: /usr/share/dict/british exists in filesystemwords: /usr/share/dict/catalan exists in filesystemwords: /usr/share/dict/finnish exists in filesystemwords: /usr/share/dict/french exists in filesystemwords: /usr/share/dict/german exists in filesystemwords: /usr/share/dict/italian exists in filesystemwords: /usr/share/dict/ngerman exists in filesystemwords: /usr/share/dict/spanish exists in filesystemwords: /usr/share/dict/usa exists in filesystemwords: /usr/share/dict/words exists in filesystem errors occurred, no packages were upgraded. $ ls -la /usr/share/dict/ total 23012 drwxr-xr-x 2 root root 4096 2007-01-18 11:35 . drwxr-xr-x 131 root root 4096 2007-01-18 11:33 .. -rw-r--r-- 1 root root 617300 2004-09-06 09:15 british -rw-r--r-- 1 root root 3565935 2004-09-06 09:15 catalan -rw-r--r-- 1 root root 529871 2006-05-31 00:45 cracklib-small -rw-r--r-- 1 root root 9996241 2004-09-06 09:15 finnish -rw-r--r-- 1 root root 1464402 2004-09-06 09:15 french -rw-r--r-- 1 root root 951917 2004-09-06 09:15 german -rw-r--r-- 1 root root 1243660 2004-09-06 09:15 italian -rw-r--r-- 1 root root 3874019 2004-09-06 09:15 ngerman -rw-r--r-- 1 root root 835265 2004-09-06 09:15 spanish -rw-r--r-- 1 root root 408969 2004-09-06 09:15 usa lrwxrwxrwx 1 root root 5 2007-01-18 11:35 words -> ./usa
On 1/18/07, Dan McGee <dpmcgee@gmail.com> wrote:
flex: /usr/bin/flex exists in filesystemflex
This worries me. It appears that some spaces have been removed from the deps in the DB, merging "filesystem" and "flex" as one name. As for the "cannot remove file" stuff. The error makes sense now. What file can't it find? usr/man/man1/flex.1.gz NOT /usr/man/man1/flex.1.gz The issue is in unlink_file. It uses the version of the file which DOESN'T have the current root prepended. I fixed this in CVS (and added the absolute path to some output there as well).
On 1/18/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 1/18/07, Dan McGee <dpmcgee@gmail.com> wrote:
flex: /usr/bin/flex exists in filesystemflex
This worries me. It appears that some spaces have been removed from the deps in the DB, merging "filesystem" and "flex" as one name.
This might explain it better: line 730, sync.c: case PM_CONFLICT_TYPE_FILE: MSG(NL, _("%s: %s%s exists in filesystem"), alpm_conflict_get_target(conflict), config->root, alpm_conflict_get_file(conflict)); The MSG simply needs a \n at the end of it (I patched it locally when looking at this last night, but not in the CVS build I ran the above with). The 'flex' text comes from the first part of the MSG output: %s:.
As for the "cannot remove file" stuff. The error makes sense now. What file can't it find? usr/man/man1/flex.1.gz NOT /usr/man/man1/flex.1.gz
The issue is in unlink_file. It uses the version of the file which DOESN'T have the current root prepended. I fixed this in CVS (and added the absolute path to some output there as well).
Why did it error on these packages and not others? Or does it error on others? -Dan
On 1/18/07, Dan McGee <dpmcgee@gmail.com> wrote:
Why did it error on these packages and not others? Or does it error on others?
I'd assume it would error on all packages... or possibly you were running from "cd /" which would make the paths match up. Does CVS fix this?
On 1/18/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
Does CVS fix this?
CVS isn't building at the moment. I need at least this patch: Index: src/pacman/pacman.c =================================================================== RCS file: /home/cvs-pacman/pacman-lib/src/pacman/pacman.c,v retrieving revision 1.80 diff -u -r1.80 pacman.c --- src/pacman/pacman.c 18 Jan 2007 16:53:04 -0000 1.80 +++ src/pacman/pacman.c 18 Jan 2007 19:54:31 -0000 @@ -412,7 +412,6 @@ /*setenv("MALLOC_TRACE","pacman.mtrace", 0);*/ mtrace(); #endif - maxcols = getcols(); /* set signal handlers */ signal(SIGINT, cleanup); Even with that, I still get this error, which is weird, since my regular build isn't doing it: /var/abs/local/pacman-rc/src/pacman-lib-build/src/pacman/pacman.c:209: undefined reference to `neednl' collect2: ld returned 1 exit status make[3]: *** [pacman.static] Error 1 make[3]: Leaving directory `/var/abs/local/pacman-rc/src/pacman-lib-build/src/pacman' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/abs/local/pacman-rc/src/pacman-lib-build/src/pacman' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/abs/local/pacman-rc/src/pacman-lib-build' make: *** [all] Error 2 ==> ERROR: Build Failed. Aborting...
On 1/18/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 1/18/07, Dan McGee <dpmcgee@gmail.com> wrote:
On 1/18/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
Does CVS fix this?
CVS isn't building at the moment.
My fault - try now.
We're good on the build, and good with the remove. FYI, using the 'bad' previous build of pacman3, I tried to to a pacman3 -S pacman-rc to upgrade (I have it in a local custom repo), and it errored on the file removal, so it wasn't just those two packages. But it looks good now. -Dan
On 1/18/07, Dan McGee <dpmcgee@gmail.com> wrote:
The MSG simply needs a \n at the end of it (I patched it locally when looking at this last night, but not in the CVS build I ran the above with).
Requested patch. Definitely has line wrap issues, but not hard to apply by hand- the only difference at each line that changed is the addition of a \n. --- pacman-lib.orig/src/pacman/add.c 2006-11-22 04:03:42.000000000 -0500 +++ pacman-lib/src/pacman/add.c 2007-01-18 02:15:03.000000000 -0500 @@ -94,7 +94,7 @@ int pacman_add(list_t *targets) case PM_ERR_UNSATISFIED_DEPS: for(i = alpm_list_first(data); i; i = alpm_list_next(i)) { pmdepmissing_t *miss = alpm_list_getdata(i); - MSG(NL, _(":: %s: requires %s"), alpm_dep_get_target(miss), + MSG(NL, _(":: %s: requires %s\n"), alpm_dep_get_target(miss), alpm_dep_get_name(miss)); switch(alpm_dep_get_mod(miss)) { case PM_DEP_MOD_EQ: MSG(CL, "=%s", alpm_dep_get_version(miss)); break; @@ -107,7 +107,7 @@ int pacman_add(list_t *targets) case PM_ERR_CONFLICTING_DEPS: for(i = alpm_list_first(data); i; i = alpm_list_next(i)) { pmdepmissing_t *miss = alpm_list_getdata(i); - MSG(NL, _(":: %s: conflicts with %s"), + MSG(NL, _(":: %s: conflicts with %s\n"), alpm_dep_get_target(miss), alpm_dep_get_name(miss)); } break; @@ -116,14 +116,14 @@ int pacman_add(list_t *targets) pmconflict_t *conflict = alpm_list_getdata(i); switch(alpm_conflict_get_type(conflict)) { case PM_CONFLICT_TYPE_TARGET: - MSG(NL, _("%s%s exists in \"%s\" (target) and \"%s\" (target)"), + MSG(NL, _("%s%s exists in \"%s\" (target) and \"%s\" (target)\n"), config->root, alpm_conflict_get_file(conflict), alpm_conflict_get_target(conflict), alpm_conflict_get_ctarget(conflict)); break; case PM_CONFLICT_TYPE_FILE: - MSG(NL, _("%s: %s%s exists in filesystem"), + MSG(NL, _("%s: %s%s exists in filesystem\n"), alpm_conflict_get_target(conflict), config->root, alpm_conflict_get_file(conflict)); --- pacman-lib.orig/src/pacman/sync.c 2007-01-18 15:14:25.000000000 -0500 +++ pacman-lib/src/pacman/sync.c 2007-01-18 15:37:17.000000000 -0500 @@ -727,14 +727,14 @@ int pacman_sync(list_t *targets) pmconflict_t *conflict = alpm_list_getdata(lp); switch(alpm_conflict_get_type(conflict)) { case PM_CONFLICT_TYPE_TARGET: - MSG(NL, _("%s%s exists in \"%s\" (target) and \"%s\" (target)"), + MSG(NL, _("%s%s exists in \"%s\" (target) and \"%s\" (target)\n"), config->root, alpm_conflict_get_file(conflict), alpm_conflict_get_target(conflict), alpm_conflict_get_ctarget(conflict)); break; case PM_CONFLICT_TYPE_FILE: - MSG(NL, _("%s: %s%s exists in filesystem"), + MSG(NL, _("%s: %s%s exists in filesystem\n"), alpm_conflict_get_target(conflict), config->root, alpm_conflict_get_file(conflict));
participants (2)
-
Aaron Griffin
-
Dan McGee