Test in local repository without privileges

Christopher Jones jonesc at hep.phy.cam.ac.uk
Fri Jan 17 22:44:48 UTC 2020


> On 17 Jan 2020, at 10:36 pm, Dave Allured - NOAA Affiliate via macports-users <macports-users at lists.macports.org> wrote:
> 
> Chris, thanks for the quick reply.  You are correct, a private macports installation would enable testing ports without special privilege.  Actually I have already done this many times for testing and debugging other cases.
> 
> However, I would like to find an intermediate solution that avoids full build-up from sources.  My main reasons are (1) test sensitivity to installed ports in the system prefix; (2) save time and effort; and (3) be able to provide compact, uncomplicated reproducers to third parties.
> 
> If not currently possible, it would be nice to have a new feature to enable local repository testing, with fallback to the system prefix for everything not found in the local repository.

What you are asking for is I am afraid really not possible, I suspect. The installation prefix is a fundamental parameter in most port builds. Many directly use this via the ${prefix} variable, which is a single valued path. What you are asking for is for a port use to use one location for some ports and a second one from others. I just don’t see how that could work.

I think your only option is really to go with a second installation using a custom prefix.

Chris

> 
> 
> On Fri, Jan 17, 2020 at 3:09 PM Christopher Jones <jonesc at hep.phy.cam.ac.uk <mailto:jonesc at hep.phy.cam.ac.uk>> wrote:
> Hi,
> 
> I might be wrong, but I do not believe it is possible to temporarily change the install prefix, for a single port.
> 
> Most probably you will need to start a new installation, using a custom installation prefix, from scratch. see
> 
> https://www.macports.org/install.php#source <https://www.macports.org/install.php#source>
> 
> on installing from source, which you will need to do to change the installation prefix, as its a configure time option.
> 
> Chris
> 
>> On 17 Jan 2020, at 9:33 pm, Dave Allured - NOAA Affiliate via macports-users <macports-users at lists.macports.org <mailto:macports-users at lists.macports.org>> wrote:
>> 
>> I am on a corporate network with ports installed normally in /opt/local, controlled by system admins.  Users do not have any write access into system directories.  I would like to use a local portfile repository in user space, as described in Macports guide 4.6.
>> 
>> How can I test ports in the local repository?  The "portindex" command works as expected in this directory.  However, "port install" fails with "Insufficient privileges to write to MacPorts install prefix".  I need a way to tell "port install" to use a local prefix, rather than the default system prefix, for only the port under test.
>> 
>> I figured that I could avoid tampering with the protected sources.conf, by manually pre-staging the desired distfiles in the local repository.  Here is my embryonic directory structure:
>> 
>> $HOME/portx/science/netcdf-fortran/Portfile
>> $HOME/portx/science/netcdf-fortran/files/patch-Makefile.in.diff
>> $HOME/portx/var/macports/distfiles/netcdf-fortran/netcdf-fortran-4.5.2.tar.gz
>> 
>> Thank you for any advice.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20200117/b43b1fc9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1930 bytes
Desc: not available
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20200117/b43b1fc9/attachment.bin>


More information about the macports-users mailing list