Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 136199 - Portage doesn't handle fifos correct
Summary: Portage doesn't handle fifos correct
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 130612 136244 137445
  Show dependency tree
Reported: 2006-06-09 08:11 UTC by Jonas Jonsson
Modified: 2006-06-20 16:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---

An ebuild to show the problem (test-1.0.ebuild,322 bytes, text/plain)
2006-06-09 08:12 UTC, Jonas Jonsson
emerge --info (emerge-info,2.25 KB, text/plain)
2006-06-09 08:13 UTC, Jonas Jonsson

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Jonsson 2006-06-09 08:11:17 UTC

It looks like portage doesn't handle fifos correct, attach a .ebuild with a simple mkfifo creation.

First time I do an emerge test I get this:
>>> Merging net-print/test-1.0 to /
--- /var/
>>> /var/test/
>>> /var/test/testfifo

If I do an emerge test again right after I get this
>>> Merging net-print/test-1.0 to /
--- /var/
--- /var/test/
!!! /var/test/testfifo
>>> Safely unmerging already-installed instance...
<<<        fif /var/test/testfifo
<<<        dir /var/test
--- !empty dir /var
>>> Original instance of package unmerged safely.

The fifo /var/test/testfifo is removed and if I do it a third time it works again as in the first ouput.

There is an workaround for this to use an ugly hack in pkg_postinst and pkg_prerm but this way there will be files left when unmerge and isn't a good solution. Heard that there are some packages that use this kind of hack.
Comment 1 Jonas Jonsson 2006-06-09 08:12:17 UTC
Created attachment 88770 [details]
An ebuild to show the problem
Comment 2 Jonas Jonsson 2006-06-09 08:13:41 UTC
Created attachment 88771 [details]
emerge --info
Comment 3 Zac Medico gentoo-dev 2006-06-09 15:49:28 UTC
If the destination file doesn't exist, the fifo is correctly installed.  The merge logic doesn't even attempt to install the fifo if the destination file already exists.  Then, during the unmerge phase, the previously existing distination file is removed because it's timestamp has not changed since it was installed.
Comment 4 Zac Medico gentoo-dev 2006-06-09 22:12:33 UTC
Actually, the fifo mtime is not stored in CONTENTS, so we can't be sure if they belong to another package unless we search through all CONTENTS for all installed packages.  In svn r3482 I've changed it so that they will never be unmerged (we already do the same for device files).  In the future we should implement global reference counting so that we can simply unmerge files that are no longer owned by any installed packages.
Comment 5 Zac Medico gentoo-dev 2006-06-16 10:01:50 UTC
This has been released in 2.1.1_pre1.