Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 64260 - macos: sed merge fails, deletes system sed
Summary: macos: sed merge fails, deletes system sed
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal
Assignee: osx porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-16 06:16 UTC by Chris L. Mason
Modified: 2005-02-06 13:33 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris L. Mason 2004-09-16 06:16:04 UTC
I just attempted a new install of gentoo macos, and the last step of "emerge system",
which was to install "sed" failed.  Here's the output of the merge:

>>> Completed installing into /var/tmp/portage/sed-4.0.9/image/

* checking 16 files for package collisions
* spend 0.0283830165863 seconds checking for file collisions
>>> Merging sys-apps/sed-4.0.9 to /
--- /bin/
>>> /bin/gsed
--- /usr/
--- /usr/bin/
>>> /usr/bin/gsed -> ../../bin/gsed
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/gsed-4.0.9/
>>> /usr/share/doc/gsed-4.0.9/AUTHORS.gz
>>> /usr/share/doc/gsed-4.0.9/BUGS.gz
>>> /usr/share/doc/gsed-4.0.9/ChangeLog.gz
>>> /usr/share/doc/gsed-4.0.9/COPYING.gz
>>> /usr/share/doc/gsed-4.0.9/examples/
>>> /usr/share/doc/gsed-4.0.9/examples/dos2unix.gz
>>> /usr/share/doc/gsed-4.0.9/examples/unix2dos.gz
>>> /usr/share/doc/gsed-4.0.9/NEWS.gz
>>> /usr/share/doc/gsed-4.0.9/README.boot.gz
>>> /usr/share/doc/gsed-4.0.9/README.gz
>>> /usr/share/doc/gsed-4.0.9/THANKS.gz
--- /usr/share/info/
>>> /usr/share/info/gsed.info-1.gz
>>> /usr/share/info/gsed.info-2.gz
>>> /usr/share/info/gsed.info.gz
--- /usr/share/man/
--- /usr/share/man/man1/
>>> /usr/share/man/man1/gsed.1.gz
!!! failed to properly create symlink:
!!! /usr/bin/sed -> ../../bin/sed
!!! [Errno 2] No such file or directory: '/usr/bin/sed'
!!! Failed to move file.
!!! /usr/bin/sed -> ../../bin/sed

This resulted in an "INCOMPLETE MERGE" and no working sed on my system.  I had
to manually unmerge all the files, then copy sed.ORIG back to sed.  (Which I had created
a copy months ago out of paranoia.  :)  So, I think it actually wiped out the system sed,
even though collision protection is on.

I'm running Mac OS X 10.3.5.
Comment 1 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-09-16 06:49:03 UTC
Thanks
Comment 2 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-09-16 06:52:27 UTC
Thanks for the bug report. Fixed in CVS.

--- sed-4.0.9.ebuild.orig       Thu Sep 16 11:37:19 2004
+++ sed-4.0.9.ebuild    Thu Sep 16 22:39:51 2004
@@ -45,8 +45,6 @@
        fi
 
        rm -f ${D}/usr/bin/sed
-       use macos && cd ${D} && for x in `find . -name 'sed*' -print`; do mv "$x" "${x//sed/gsed}"; done && cd ${WORKDIR}/${P}
-       use macos && dosym ../../bin/gsed /usr/bin/gsed || dosym ../../bin/sed /usr/bin/sed
-       use ppc-macos && cd ${D} && for x in `find . -name 'sed*' -print`; do mv "$x" "${x//sed/gsed}"; done && cd ${WORKDIR}/${P}
-       use ppc-macos && dosym ../../bin/gsed /usr/bin/gsed || dosym ../../bin/sed /usr/bin/sed
+       ( use macos || use ppc-macos ) && cd ${D} && for x in `find . -name 'sed*' -print`; do mv "$x" "${x//sed/gsed}"; done && cd ${WORKDIR}/${P}
+       ( use macos || use ppc-macos ) && dosym ../../bin/gsed /usr/bin/gsed || dosym ../../bin/sed /usr/bin/sed
 }

pvdabeel, I think you might do similar things to other ebuilds. Could you (or other guys if he's busy) check it?
Comment 3 Chris L. Mason 2004-09-16 07:40:10 UTC
Thanks a lot.  When I try it now I get:

>>> Completed installing into /var/tmp/portage/sed-4.0.9/image/

Traceback (most recent call last):
  File "/usr/lib/portage/bin/emerge", line 2755, in ?
    mydepgraph.merge(mydepgraph.altlist())
  File "/usr/lib/portage/bin/emerge", line 1678, in merge
    retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug)
  File "/usr/lib/portage/pym/portage.py", line 2779, in doebuild
    return merge(mysettings["CATEGORY"],mysettings["PF"],mysettings["D"],mysettings["BUILDDIR"]+"/build-info",myroot,mysettings,myebuild=mysettings["EBUILD"])
  File "/usr/lib/portage/pym/portage.py", line 2901, in merge
    return mylink.merge(pkgloc,infloc,myroot,myebuild)
  File "/usr/lib/portage/pym/portage.py", line 6694, in merge
    return self.treewalk(mergeroot,myroot,inforoot,myebuild,cleanup=cleanup)
  File "/usr/lib/portage/pym/portage.py", line 6221, in treewalk
    if catpkgsplit(p)[0] == self.cat and catpkgsplit(p)[1] == pkgsplit(self.pkg)[0]:
TypeError: unsubscriptable object

Is there something I need to do to get my system back into a sane state?

Thanks.
Comment 4 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-09-16 07:55:42 UTC
Do you have something in /var/db/pkg/sys-apps? 
If you are not running emerge, remove -MERGING-blah and foo.lockfile if you find any.
(Just FYI, you can delete files starting with - by "rm ./-MERGING-blah" or "rm -- -MERGING-blah")
Comment 5 Chris L. Mason 2004-09-16 08:03:23 UTC
Thanks for the hints, sed is now merging properly.
Comment 6 Hasan Khalil (RETIRED) gentoo-dev 2005-02-06 13:33:21 UTC
Closing out bugs that've been resolved for a while now...