Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 192778

Summary: sys-apps/portage: warn about -MERGING- directories and add fixer to emaint
Product: Gentoo Linux Reporter: coolone <large.mailbox>
Component: New packagesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: betelgeuse, even.more.spam.for.me, hkbst, jlec, kmhzsem, mmokrejs, pacho, write2David, zerochaos
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=919752
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 192638    
Attachments: portage-warn_when_-MERGING-_directories_are_found.patch
portage-warn_when_-MERGING-_directories_are_found.patch

Description coolone 2007-09-17 08:17:56 UTC
!!! '=dev-libs/-MERGING-libxml2-2.6.27' is not a valid package atom.
!!! Please check ebuild(5) for full details.
!!! (Did you specify a version but forget to prefix with '='?)

Reproducible: Always

Actual Results:  
Actually, icannot find any ebuilds called : =dev-libs/-MERGING-libxml2-2.6.27
Comment 1 coolone 2007-09-17 08:18:29 UTC
#python-updater
* Starting Python Updater from 2.4 to 2.5 :
* Searching for packages with files in /usr/lib/python2.4 /usr/lib32/python2.4 /usr/lib64/python2.4 ..
* Adding to list: =net-dns/avahi-0.6.20-r2
* Adding to list: =sys-apps/file-4.21-r1
* Adding to list: =sys-apps/file-4.21-r1
* Adding to list: =app-portage/layman-1.1.1
* Adding to list: =net-misc/gnome-blog-0.9.1
* Adding to list: =x11-misc/alacarte-0.11.3-r1
* Adding to list: =sys-libs/cracklib-2.8.9-r1
* Adding to list: =sys-libs/libcap-1.10-r9
* Adding to list: =gnome-extra/libgsf-1.14.3
* Adding to list: =gnome-extra/libgsf-1.14.3
* Adding to list: =gnome-extra/deskbar-applet-2.18.1
* Adding to list: =gnome-extra/deskbar-applet-2.18.1
* Adding to list: =gnome-extra/gnome-games-2.18.2.1
* Adding to list: =dev-python/pysqlite-2.3.1
* Adding to list: =dev-python/python-ldap-2.2.1
* Adding to list: =dev-python/python-fchksum-1.7.1
* Adding to list: =dev-python/pyrex-0.9.4.1
* Adding to list: =dev-python/numeric-23.7
* Adding to list: =dev-python/numeric-23.7
* Adding to list: =dev-python/pycrypto-2.0.1-r6
* Adding to list: =dev-python/pycrypto-2.0.1-r6
* Adding to list: =dev-python/gnome-python-extras-2.14.2-r1
* Adding to list: =dev-python/pygobject-2.12.3
* Adding to list: =dev-python/pygtkglext-1.1.0
* Adding to list: =dev-python/pygtkglext-1.1.0
* Adding to list: =dev-python/pyorbit-2.14.3
* Adding to list: =dev-python/gnome-python-desktop-2.18.0
* Adding to list: =dev-python/compizconfig-python-9999
* Adding to list: =dev-python/pyxml-0.8.4
* Adding to list: =dev-python/dbus-python-0.81.0
* Adding to list: =dev-python/dbus-python-0.81.0
* Adding to list: =dev-python/pycairo-1.4.0
* Adding to list: =dev-python/pycairo-1.4.0
* Adding to list: =dev-python/pyopengl-2.0.0.44
* Adding to list: =dev-python/gst-python-0.10.6
* Adding to list: =dev-python/gnome-python-2.18.2
* Adding to list: =app-pda/libopensync-0.22
* Adding to list: =app-misc/beagle-0.2.17
* Adding to list: =gnome-base/gnome-menus-2.18.2
* Adding to list: =gnome-base/gnome-applets-2.18.0-r2
* Adding to list: =xfce-extra/exo-0.3.2
* Adding to list: =x11-apps/ccsm-9999
* Adding to list: =dev-java/java-config-1.3.7
* Adding to list: =dev-java/java-config-2.0.33-r1
* Adding to list: =dev-java/antlr-2.7.7
* Adding to list: =net-fs/samba-3.0.24-r3
* Adding to list: =app-admin/sabayon-2.18.1
* Adding to list: =app-admin/webapp-config-1.50.16-r1
* Adding to list: =app-admin/pessulus-2.16.2
* Adding to list: =app-admin/gamin-0.1.8
* Adding to list: =dev-libs/libxslt-1.1.20
* Adding to list: =dev-libs/-MERGING-libxml2-2.6.27
* Adding to list: =dev-libs/newt-0.51.6-r1
* Adding to list: =dev-util/scons-0.96.1
* Adding to list: =dev-util/subversion-1.4.4-r3
* Adding to list: =media-libs/lcms-1.15
* Adding to list: =media-libs/mutagen-1.8

These are the packages that would be merged, in order:

Calculating dependencies \

!!! '=dev-libs/-MERGING-libxml2-2.6.27' is not a valid package atom.
!!! Please check ebuild(5) for full details.
!!! (Did you specify a version but forget to prefix with '='?)
Comment 2 Zac Medico gentoo-dev 2007-09-17 15:14:18 UTC
You have an entry for an incomplete merge in '/var/db/pkg/dev-libs/-MERGING-libxml2-2.6.27'. You should remove that directory and reinstall the packages:

rm -r /var/db/pkg/dev-libs/-MERGING-libxml2-2.6.27
emerge -1 libxml2


We need to provide better error handling/recovery and user guidance for cases like this and bug 192638.
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-04-15 02:51:28 UTC
*** Bug 266177 has been marked as a duplicate of this bug. ***
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-04-15 03:54:09 UTC
Created attachment 188374 [details, diff]
portage-warn_when_-MERGING-_directories_are_found.patch

This patch seems to partially work.
Comment 5 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-04-18 04:51:41 UTC
Created attachment 188768 [details, diff]
portage-warn_when_-MERGING-_directories_are_found.patch

The previous patch was wrong. This patch works correctly.
Comment 6 Pacho Ramos gentoo-dev 2010-01-31 11:08:04 UTC
I have just suffered the same problem, a warning suggesting what to do would be nice :-)

Thanks a lot
Comment 7 Pacho Ramos gentoo-dev 2010-04-22 19:56:11 UTC
(In reply to comment #5)
> Created an attachment (id=188768) [details]
> portage-warn_when_-MERGING-_directories_are_found.patch
> 
> The previous patch was wrong. This patch works correctly.
> 

Sorry for insisting but I have just suffered this problem again and I think that would be really interesting to merge this patch in upcoming portage if possible

Thanks a lot :-)
Comment 8 Sebastian Luther (few) 2010-04-29 20:53:43 UTC
I think the patch does it in the wrong place. The correct place is imo pym/portage/dbapi/vartree.py in the vardbapi class. There is an regexp called _excluded_dirs that is used in several places to skip those entries. Not sure what the right course of action is, if a matching entry is found. Maybe store them to display them at some more appropriate place. Ideas?
Comment 9 Zac Medico gentoo-dev 2010-04-29 23:40:09 UTC
(In reply to comment #8)
> Maybe store
> them to display them at some more appropriate place. Ideas?

Yeah, since FakeVartree scans all the installed packages it makes sense for vardbapi.cpv_all() to save the data in a variable so that emerge can check for it and display the warning.

Also, it would be really nice if we had an emaint command to clean these up. If there is a CONTENTS file then it will have to check if any other packages reference the files listed in CONTENTS before removing them.
Comment 10 Sebastian Luther (few) 2010-04-30 10:01:00 UTC
Does any of have a -MERGING- directory with a CONTENTS file? I have two such directories, but none contains a CONTENTS file.
Comment 11 Zac Medico gentoo-dev 2010-04-30 22:46:08 UTC
(In reply to comment #10)
> Does any of have a -MERGING- directory with a CONTENTS file? I have two such
> directories, but none contains a CONTENTS file.

It would only happen if emerge dies while it's merging, due to a either a filesystem/hardware failure or being killed by the user.
Comment 12 Zac Medico gentoo-dev 2010-06-10 21:51:50 UTC
Note that we have a fix here for review:

http://github.com/few/fews-portage-branch/commits/invalid_vdb_entry_warning/
Comment 13 Justin Lecher (RETIRED) gentoo-dev 2010-12-09 10:29:07 UTC
*** Bug 348247 has been marked as a duplicate of this bug. ***
Comment 14 David 2011-04-04 21:37:36 UTC
I have this problem with "MERGING" usually only when running python-updater.


Since this bug has been open since 2007 (!), what would be a proper workaround?  Perhaps something like this:

rm /var/db/pkg/*/-MERGING-*


?
Comment 15 Zac Medico gentoo-dev 2011-04-04 22:07:08 UTC
(In reply to comment #14)
> Since this bug has been open since 2007 (!), what would be a proper workaround?
>  Perhaps something like this:
> 
> rm /var/db/pkg/*/-MERGING-*

They're directories, so you'd want to use rm -r. If you want to be really thorough, you can check if they contain any CONTENTS entries and remove the corresponding files if they're not owned by any installed packages. You can use the 'portageq owners' command to check for owners.
Comment 16 Zac Medico gentoo-dev 2011-04-04 22:12:32 UTC
*** Bug 217345 has been marked as a duplicate of this bug. ***
Comment 17 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-07-01 19:10:41 UTC
*** Bug 373739 has been marked as a duplicate of this bug. ***
Comment 18 Zac Medico gentoo-dev 2013-03-09 19:08:23 UTC
*** Bug 460610 has been marked as a duplicate of this bug. ***
Comment 19 Martin Mokrejš 2013-03-10 22:01:07 UTC
(In reply to comment #10)
> Does any of have a -MERGING- directory with a CONTENTS file? I have two such
> directories, but none contains a CONTENTS file.

# ls -la /var/db/pkg/app-emulation/-MERGING-emul-linux-x86-opengl-20121202-r1/
total 160
drwxr-xr-x  2 root root  4096 Jan  6 17:48 .
drwxr-xr-x 25 root root  4096 Mar  8 23:56 ..
-rw-r--r--  1 root root    11 Jan  6 17:48 BUILD_TIME
-rw-r--r--  1 root root    14 Jan  6 17:48 CATEGORY
-rw-r--r--  1 root root    20 Jan  6 17:48 CBUILD
-rw-r--r--  1 root root    89 Jan  6 17:48 CFLAGS
-rw-r--r--  1 root root    20 Jan  6 17:48 CHOST
-rw-r--r--  1 root root  6556 Jan  6 17:48 CONTENTS
-rw-r--r--  1 root root     4 Jan  6 17:48 COUNTER
-rw-r--r--  1 root root    89 Jan  6 17:48 CXXFLAGS
-rw-r--r--  1 root root     0 Jan  6 17:48 DEBUGBUILD
-rw-r--r--  1 root root    32 Jan  6 17:48 DEFINED_PHASES
-rw-r--r--  1 root root    84 Jan  6 17:48 DEPEND
-rw-r--r--  1 root root    37 Jan  6 17:48 DESCRIPTION
-rw-r--r--  1 root root     2 Jan  6 17:48 EAPI
-rw-r--r--  1 root root   236 Jan  6 17:48 FEATURES
-rw-r--r--  1 root root    39 Jan  6 17:48 HOMEPAGE
-rw-r--r--  1 root root    64 Jan  6 17:48 INHERITED
-rw-r--r--  1 root root    12 Jan  6 17:48 IUSE
-rw-r--r--  1 root root   767 Jan  6 17:48 IUSE_EFFECTIVE
-rw-r--r--  1 root root    22 Jan  6 17:48 KEYWORDS
-rw-r--r--  1 root root    24 Jan  6 17:48 LDFLAGS
-rw-r--r--  1 root root    25 Jan  6 17:48 LICENSE
-rw-r--r--  1 root root  4445 Jan  6 17:48 NEEDED
-rw-r--r--  1 root root  5033 Jan  6 17:48 NEEDED.ELF.2
-rw-r--r--  1 root root    34 Jan  6 17:48 PF
-rw-r--r--  1 root root   108 Jan  6 17:48 RDEPEND
-rw-r--r--  1 root root     6 Jan  6 17:48 RESTRICT
-rw-r--r--  1 root root    10 Jan  6 17:48 SIZE
-rw-r--r--  1 root root     2 Jan  6 17:48 SLOT
-rw-r--r--  1 root root    44 Jan  6 17:48 USE
-rw-r--r--  1 root root   967 Jan  6 17:48 emul-linux-x86-opengl-20121202-r1.ebuild
-rw-r--r--  1 root root 20210 Jan  6 17:48 environment.bz2
-rw-r--r--  1 root root     7 Jan  6 17:48 repository
#

Per comment #11: From last(1) output I gather I did not experience a kernel crash at about that time. Actually, from emerge.log I gather the emerge went fine:


1357486912: Started emerge on: Jan 06, 2013 16:41:52
1357486912:  *** emerge --newuse --deep --keep-going --update world

[cut]

1357490870:  >>> emerge (5 of 22) app-emulation/emul-linux-x86-opengl-20121202-r1 to /
1357490870:  === (5 of 22) Cleaning (app-emulation/emul-linux-x86-opengl-20121202-r1::/mnt/1TB/usr/portage/app-emulation/emul-linux-x86-opengl/emul-linux-x86-opengl-20121202-r1.ebuild)
1357490872:  === (5 of 22) Compiling/Merging (app-emulation/emul-linux-x86-opengl-20121202-r1::/mnt/1TB/usr/portage/app-emulation/emul-linux-x86-opengl/emul-linux-x86-opengl-20121202-r1.ebuild)
1357490880:  === (5 of 22) Merging (app-emulation/emul-linux-x86-opengl-20121202-r1::/mnt/1TB/usr/portage/app-emulation/emul-linux-x86-opengl/emul-linux-x86-opengl-20121202-r1.ebuild)
1357490891:  >>> AUTOCLEAN: app-emulation/emul-linux-x86-opengl:0
1357490891:  === Unmerging... (app-emulation/emul-linux-x86-opengl-20121028)
1357490921:  >>> unmerge success: app-emulation/emul-linux-x86-opengl-20121028
Comment 20 David 2014-02-24 03:24:30 UTC
I'm still running into this bug (from 2007).  Portage is trying to install packages with the name "-MERGING-" inserted into the package name.

Admittedly, I won't be much help in finding the solution, but I would think that it wouldn't be too hard to dissuade the package manager from automatically trying to install packages using the incorrect package name.
Comment 21 Brian Dolbec (RETIRED) gentoo-dev 2014-02-24 06:28:19 UTC
There is an emaint module being developed to fix these types of failures.

If all goes well, it should be available in portage-2.2.10
Comment 22 Rick Farina (Zero_Chaos) gentoo-dev 2014-07-02 16:28:05 UTC
(In reply to Brian Dolbec from comment #21)
> There is an emaint module being developed to fix these types of failures.
> 
> If all goes well, it should be available in portage-2.2.10

Is this available? Users are still hitting this.
Comment 23 Brian Dolbec (RETIRED) gentoo-dev 2014-07-19 22:49:28 UTC
Sorry, I've been in hospital for 3 weeks, and Alexander does not have commit capability so I don't think a portage release was made so the new module can be merged into master for some testing and inclusion in the release that will later follow.
Comment 24 Brian Dolbec (RETIRED) gentoo-dev 2014-12-04 06:03:45 UTC
This is in the portage-2.2.12 release.