Opened 14 years ago

Closed 13 years ago

#11971 closed defect (fixed)

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

Reported by: freebsd@… Owned by: jmroot (Joshua Root)
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 (1)

multi-init.diff (8.6 KB) - added by jmroot (Joshua Root) 13 years ago.
proposed fix

Download all attachments as: .zip

Change History (12)

comment:1 Changed 14 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)

comment:2 Changed 14 years ago by nox@…

Milestone: MacPorts base bugs
Priority: ImportantHigh
Summary: "port -u -f upgrade installed" created many nested directoriesBUG: "port -u -f upgrade installed" created many nested directories

comment:3 Changed 14 years ago by jmpp@…

Component: portsbase

comment:4 Changed 13 years ago by jmroot (Joshua Root)

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 13 years ago by jmroot (Joshua Root)

Attachment: multi-init.diff added

proposed fix

comment:5 Changed 13 years ago by jmroot (Joshua Root)

Milestone: MacPorts base bugsMacPorts 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.

comment:6 Changed 13 years ago by jmroot (Joshua Root)

Keywords: haspatch added

comment:7 Changed 13 years ago by raimue (Rainer Müller)

This patch looks good.

comment:8 Changed 13 years ago by jmroot (Joshua Root)

Cc: jmr@… removed
Owner: changed from macports-tickets@… to jmr@…
Status: newassigned

comment:9 Changed 13 years ago by jmroot (Joshua Root)

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?

comment:10 Changed 13 years ago by jmroot (Joshua Root)

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.

comment:11 Changed 13 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: assignedclosed

Marking fixed.

Note: See TracTickets for help on using tickets.