Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #13509 (closed enhancement: fixed)

Opened 10 months ago

Last modified 5 months ago

Support .dmg disk images as distfiles with new use_dmg option

Reported by: ryandesign@… Owned by: ryandesign@…
Priority: Normal Milestone: MacPorts base enhancements
Component: base Version: 1.6.0
Keywords: Cc: boeyms@…
Port:

Description

We support several kinds distfile formats, including .tar.gz, .tar.bz2 and .zip. The former is the default; the others can be achieved by setting use_bzip2 or use_zip, respectively, to "yes". It would be nice to also support disk images with the .dmg extension via a new option use_dmg.

I will attach a patch for base to implement this which seems to work for me, but this is my first "major" bit of base hacking, so please scrutinize it extra carefully and point out any problems.

I'll also attach a patch for the isightcapture portfile, which currently has to do the disk image manipulation manually, to show how this simplifies the portfile. This is also the portfile I tested this feature with.

Attachments

use_dmg.diff (2.8 kB) - added by ryandesign@… 10 months ago.
base patch to implement the use_dmg option
isightcapture-use_dmg.diff (1.1 kB) - added by ryandesign@… 5 months ago.
updated patch for isightcapture

Change History

Changed 10 months ago by ryandesign@…

base patch to implement the use_dmg option

Changed 10 months ago by boeyms@…

  • cc boeyms@… added

I haven't tested it yet, but it looks good. One small suggestion, though: if it's not too much effort, it'd be nice to wrap this bit in a test for the platform that the user is running on so that fails more gracefully if MacPorts is not installed on Mac OS X.

For other platforms, there's a Java program called DMGExtractor, but it doesn't fail gracefully when it doesn't succeed, it's not really designed for command-line use (though it can be used that way), and it only works for some UDIF dmgs (those that have been successfully reverse-engineered, since it seems that Apple is not releasing the specs).

Changed 10 months ago by ryandesign@…

Bear in mind that my knowledge of Tcl and MacPorts base is still very limited, so I don't know how to wrap what I've done in a Mac OS X platform test. Is there existing code in other parts of base that I could look at?

I think it would be ok to commit the functionality now, and add support for non-Mac platforms--or beautify the error messages on those platforms--later. I wouldn't expect dmg-based extraction to be used on platforms other than Mac OS X anyway, since dmg is a Mac OS X format. Or rather, I wouldn't expect developers to distribute things on a dmg unless they intended it to be used exclusively on Mac OS X. To that end, I would expect any port using dmg-based extraction to declare only "platforms macosx", and I would further expect MacPorts to prevent installation of the port on platforms that are not macosx.

Changed 5 months ago by ryandesign@…

updated patch for isightcapture

Changed 5 months ago by ryandesign@…

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

Committed my patch to base in r36708. Updated the ChangeLog in r36711.

Note: See TracTickets for help on using tickets.