> On Jan 17, 2017, at 3:46 PM, Daniel J. Luke <dl...@geeklair.net> wrote: > > On Jan 13, 2017, at 8:20 PM, Craig Treleaven <ctrelea...@macports.org> wrote: >>> On Jan 13, 2017, at 4:06 PM, Joshua Root <j...@macports.org> wrote: >>> On 2017-1-14 07:28 , Daniel J. Luke wrote: >>>> On Jan 13, 2017, at 3:01 PM, Craig Treleaven <ctrelea...@macports.org> >>>> wrote: >>>>> Suppose I create an mpkg installer just for mariadb-server. The scripts >>>>> are included for the mariadb-server component, as expected. However, >>>>> when ‘port mpkg’ builds the installer component for the mariadb (client) >>>>> software is ALSO includes the Pre/Postinstall scripts—it doesn’t know >>>>> that they’re only intended for the server side. >>>> >>>> Why does it do that? >>>> >>>> To me, it seems like the simple solution would be for the scripts that >>>> pertain to mariadb-server to only be included with the mariadb-server port >>>> and not with the mariadb (client) port. >>> >>> I agree. Craig, it's not clear what exactly you are doing, so it's very >>> difficult to say whether the result is correct or not. >> >> As Ryan figured out, you can see the code related to mariadb-server in the >> ticket: >> >> https://trac.macports.org/ticket/52144 > > initial thoughts: > > - a quick hack would be to update the postinstall script so it doesn't matter > if you try to run it more than once
Yes, I’ve now done that. > - that postinstall script is confusing (why is it installing or chmod'ing > files? why is it doing a launchctl load -w [we generally don't do that per > policy]). > I ran into a case where the installed payload had inappropriate ownership/permissions. The internet seemed to say that PackageMaker caused this kind of problem, occaisonally. Thus the brute force to ensure the mysql user had permission to the data directory and whatnot. I’m not familiar with launchctl load -w being a bad thing? For folks using the installer, MacPorts will not be installed and thus ‘port load mariadb-server’ will be unavailable. My goal is to have a (minimally configured) database server running when the installer is finished. > If there is a bug in the way we generate pkg or mpkgs that's causing the > script to run too many times, that should be fixed. > >> Is there some way to directly inspect the contents of an installer mpkg to >> verify if the scripts are improperly included in mythtv-core.28 and mariadb? > > pkgutil / pacifist? Indeed. I’ve now figured out both of those. I have to say I’m no less confused. Using Pacifist, I can see that the mythtv.28 component includes the expected preinstall/postinstall scripts. I can’t find the mariadb scripts in either the mariadb or mariadb-server components. Since the installer is broken (see #53340), I can’t see what scripts are run (or how many times). Craig