New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #11971 (closed defect: fixed)

Opened 2 years ago

Last modified 9 months ago

BUG: "port -u -f upgrade installed" created many nested directories

Reported by: freebsd@… Owned by: jmr@…
Priority: High Milestone: MacPorts 1.7.0
Component: base Version: 1.4
Keywords: haspatch Cc:
Port:

Description

This is probably related to #10827 where upgrade repeats infinitely.

I have about 30 ports installed an attempted to force update to get rid of old libraries; I aborted the attempt after running for 50 hours.

When examining the /opt/local/var directory to determine why it was taking so long I noticed a lot of extra disk space was consumed by the distfiles and packages sub directories.

For example: distfiles/gettext had a copy of the .tar.bz2 plus another gettext subdirectory. This 2nd gettext directory only had a gettext subdirectory. The 3rd level had the .tar.bz2 and a gettext subdirectory.

This alternating pattern was repeated:

* The 4th, 6th, ... were like the second - just subdirectory.

* The 5th, 7th, ... included a copy of the .tar.bz2 files.

In total an extra 9 copies of gettext files; libiconv was similar. Many others had the same problem but usually only 3 to 5 extra copies.

A similar situation existed in the packages directory where darwin/powerpc was nested many times with copies of the compiled packages at each powerpc subdirectory.

removing all the duplicates recovered about 300MB of disk space.

Attachments

multi-init.diff (8.6 KB) - added by jmr@… 14 months ago.
proposed fix

Change History

Changed 2 years ago by freebsd@…

Some system information: (for PowerBook G4/1.33GHz/256MB)

uname -v

Darwin Kernel Version 8.9.0: Thu Feb 22 20:54:07 PST 2007; root:xnu-792.17.14~1/RELEASE_PPC

port --version

MacPorts 1.440

gcc --version

powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)

Changed 23 months ago by nox@…

  • priority changed from Important to High
  • summary changed from "port -u -f upgrade installed" created many nested directories to BUG: "port -u -f upgrade installed" created many nested directories
  • milestone set to MacPorts base bugs

Changed 23 months ago by jmpp@…

  • component changed from ports to base

Changed 14 months ago by jmr@…

  • cc jmr@… added

Looks like this is due to multiple invocations of fetch_init and archive_init, where dist_subdir is appended to distpath, and os.platform & os.arch are appended to archive.destpath, respectively.

Changed 14 months ago by jmr@…

proposed fix

Changed 14 months ago by jmr@…

  • milestone changed from MacPorts base bugs to MacPorts 1.6.1

Unarchive could have been affected as well. The attached patch should make it harmless to call fetch_init, archive_init, and unarchive_init more than once.

Nominating this for the upcoming release.

Changed 14 months ago by jmr@…

  • keywords haspatch added

Changed 14 months ago by raimue@…

This patch looks good.

Changed 14 months ago by jmr@…

  • cc jmr@… removed
  • owner changed from macports-tickets@… to jmr@…
  • status changed from new to assigned

Changed 14 months ago by jmr@…

Patch committed to trunk in r36679. Thanks for reviewing, Rainer!

Is there a simple test case we can use to ensure that the problem is really fixed?

Changed 14 months ago by jmr@…

Backed out the fetch part of the change in r36687 (hadn't thought through the other places where distpath is used). Committed a smaller, working fix in r36688.

Changed 9 months ago by raimue@…

  • status changed from assigned to closed
  • resolution set to fixed

Marking fixed.

Note: See TracTickets for help on using tickets.