Opened 8 years ago

Closed 8 years ago

#53351 closed defect (fixed)

shared-mime-info: support mpgk/mdmg packaging

Reported by: ctreleaven (Craig Treleaven) Owned by: rjvb
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mkae (Marko Käning)
Port: shared-mime-info

Description

Patch adds a postinstall script, etc, that mimics the existing post-activate step (which initializes or updates the mime info database.

Tested by creating and installing an mpkg of shared-mime-info. Installer log attached showing successful completion.

See also #44165. This contributed to the problems with a gtk2 installer.

Attachments (2)

patch_port_shared-mime-info_support_packaging.diff (1.1 KB) - added by ctreleaven (Craig Treleaven) 8 years ago.
Installer Log 18-Jan-2017.txt (40.5 KB) - added by ctreleaven (Craig Treleaven) 8 years ago.

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by ctreleaven (Craig Treleaven)

Changed 8 years ago by ctreleaven (Craig Treleaven)

comment:1 Changed 8 years ago by mkae (Marko Käning)

This looks like an unnecessary duplication of functionality of pre-activate which should be handled by port itself. This way it looks like a workaround...

Would be cool if MacPorts would support this out-of-the-box without the need for such tweaking.

But I guess it's not so easy or even impossible to implement this generically...

Last edited 8 years ago by mkae (Marko Käning) (previous) (diff)

comment:2 Changed 8 years ago by ctreleaven (Craig Treleaven)

Yeah, it would be nice but it sure would not be a lot of work. Luckily, only a few ports have post-activate actions. The program that shared-mime-info calls is not complicated so it is pretty easy to duplicate with a postinstall script.

I'll make the same changes that Ryan asked for in #53350. May I commit after that?

comment:3 Changed 8 years ago by RJVB (René Bertin)

This seems to change something only when using packaging, so as far as I'm concerned you can go ahead.

KF5 ports will have a post-activate action defined in the PortGroup, may I assume that we'll if and when you'll be wanting to package them (supposing they ever get published)?

comment:4 in reply to:  3 ; Changed 8 years ago by ctreleaven (Craig Treleaven)

Replying to RJVB:

This seems to change something only when using packaging, so as far as I'm concerned you can go ahead.

KF5 ports will have a post-activate action defined in the PortGroup, may I assume that we'll if and when you'll be wanting to package them (supposing they ever get published)?

Sorry, is there a word missing in the second sentence ("we'll ... if")? I don't have a reason to package KF5.

Without looking at the PortGroup, perhaps the script(s) just need to be added to whatever is the base port that the others will always include. Ie any port that has a dependency on shared-mime-info will (if packaged) 'inherit' the above postinstall script. For example, a stand-alone installer for gramps3 (the genealogy program) will include a mime database update 'for free'.

comment:5 in reply to:  4 Changed 8 years ago by RJVB (René Bertin)

Replying to ctreleaven:

Sorry, is there a word missing in the second sentence ("we'll ... if")? I don't have a reason to package KF5.

Yes, "we'll see ... if". Sorry about that.

Without looking at the PortGroup, perhaps the script(s) just need to be added to whatever is the base port that the others will always include.

Yes, that would make sense of course. Not the base port in this case, but the subport that installs the command that's run as the post-activate action.

Ie any port that has a dependency on shared-mime-info will (if packaged) 'inherit' the above postinstall script. For example, a stand-alone installer for gramps3 (the genealogy program) will include a mime database update 'for free'.

I haven't tried to figure out how that works, presumably because package.dir is actually a port-specific location under ${prefix}? If not I don't see where the postinstall script is installed so that other ports can invoke it. Unless this is automatic because the installer for any port depending on shared-mime-info will include a shared-mime-info installer? If that's how it works, would that also prevent the "issue" that not every port depending on shared-mime-info needs to provoke a database update, because the shared-mime-info installer won't be run if the port is already installed?

comment:6 Changed 8 years ago by ctreleaven (Craig Treleaven)

Resolution: fixed
Status: newclosed

comment:7 Changed 8 years ago by mkae (Marko Käning)

Resolution: fixed
Status: closedreopened

comment:8 Changed 8 years ago by mkae (Marko Käning)

Cc: mkae added
Owner: changed from mkae, rjvbertin@… to rjvb
Status: reopenedassigned

comment:9 Changed 8 years ago by mkae (Marko Käning)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.