[MacPorts] #26406: .packlist files contain each line twice
#26406: .packlist files contain each line twice -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: perl5 portgroup -------------------------------------+-------------------------------------- Take for example p5-variable-magic: {{{ $ cat /opt/local/lib/perl5/vendor_perl//5.8.9/darwin- 2level/auto/Variable/Magic/.packlist /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/Variable/Magic.pm /opt/local/lib/perl5/vendor_perl/5.8.9/darwin- 2level/auto/Variable/Magic/Magic.bs /opt/local/lib/perl5/vendor_perl/5.8.9/darwin- 2level/auto/Variable/Magic/Magic.bundle /opt/local/share/man/man3/Variable::Magic.3pm /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/Variable/Magic.pm /opt/local/lib/perl5/vendor_perl/5.8.9/darwin- 2level/auto/Variable/Magic/Magic.bs /opt/local/lib/perl5/vendor_perl/5.8.9/darwin- 2level/auto/Variable/Magic/Magic.bundle /opt/local/share/man/man3/Variable::Magic.3pm }}} But this affects all ports that install a .packlist, which is probably most or all ports in the perl5 portgroup, and some more. The problem only occurs if the port is already installed and active and is then rebuilt, for example for an upgrade. During the initial install, all is well and only the paths to the items in the destroot get added to the .packlist. The perl5 portgroup's post- destroot reinplace removes the path to the destroot from each line and that's what gets installed. On an upgrade install, I think all the lines from the existing .packlist are copied into the new .packlist, then new lines are appended for the paths in the destroot, then when the perl5 portgroup removes the path to the destroot from those lines, they become the same as the first set of lines, making them duplicates. I think we need some line de-duplication code there, or a way to tell it not to look at an existing .packlist. A nice shortcut might be to first delete all lines in the new .packlist that do not contain the destroot path. Then remove the destroot path from the remaining lines. This should be an easy two-statement one-liner with sed; I'm not sure if reinplace alone can handle it. It might be nice if MacPorts base would take care of this for all ports automatically, rather than having to copy a block of code into each port that has a .packlist. -- Ticket URL: <http://trac.macports.org/ticket/26406> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26406: .packlist files contain each line twice -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: perl5 portgroup -------------------------------------+-------------------------------------- Comment(by ryandesign@…): Replying to [ticket:26406 ryandesign@…]:
This should be an easy two-statement one-liner with sed; I'm not sure if reinplace alone can handle it.
Make that a one-statement one-liner with sed: {{{ sed -n "s|${destroot}||p" ${file} }}} That would be within an `fs-traverse` finding all .packlists. `reinplace` doesn't have the `-n` switch though so we may actually have to call out to `sed` using `system`. Or we could enhance `reinplace` to support the `-n` switch. -- Ticket URL: <http://trac.macports.org/ticket/26406#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26406: .packlist files contain each line twice -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: perl5 portgroup -------------------------------------+-------------------------------------- Comment(by ryandesign@…): Replying to [comment:1 ryandesign@…]:
Or we could enhance `reinplace` to support the `-n` switch.
Here is [attachment:portutil.tcl.diff a patch that enhances reinplace to have a -n switch], and [attachment:perl5-1.0.tcl.diff a patch to modify the perl5 portgroup] to use it. Are there any objections to these changes? Obviously the perl5-1.0.tcl patch could not be applied until a new version of MacPorts is released containing the `reinplace -n` code. -- Ticket URL: <http://trac.macports.org/ticket/26406#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26406: .packlist files contain each line twice -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: perl5 portgroup -------------------------------------+-------------------------------------- Comment(by ryandesign@…): Add the -n switch to reinplace in trunk in r73227 and updated the ChangeLog in r73228. -- Ticket URL: <https://trac.macports.org/ticket/26406#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26406: .packlist files contain each line twice --------------------------------------+------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Resolution: fixed | Keywords: Port: perl5 portgroup | --------------------------------------+------------------------------------- Changes (by ryandesign@…): * status: new => closed * resolution: => fixed Comment: Updated perl5-1.0 portgroup in r88287. -- Ticket URL: <https://trac.macports.org/ticket/26406#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts