Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#53532 closed defect (fixed)

MacPorts 2.4 :: installation from URL bz2 file failing

Reported by: JohnPritchard (Johnny P) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.4.1
Component: base Version: 2.4.0
Keywords: Cc:
Port:

Description

First and foremost, apologies if this is repeating another ticket, but I have searched and can not find anything relevant.

I am not certain exactly when this problem started but I believe it was with Macports 2.4.

My system: Mac OS Sierra, 10.12.3, Xcode 8.2.1, Macports 2.4.0, in more detail:

$ uname -a 
Darwin ma018012.ads.eso.org 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
$ port version
Version: 2.4.0
$ xcodebuild -version
Xcode 8.2.1
Build version 8C1002

I used to be able, prior to version 2.4 of MacPorts, to install a port with the following command:

$ sudo port install ftp://ftp.eso.org/pub/usg/fposs/P99/macports/flames-fposs.bz2

Where the contents of the file flames-fposs.bz2 are simply:

$ tar -tf flames-fposs.bz2 
flames-fposs/Portfile

But since version 2.4, I get the following error when attempting to install a port via a specified URL:

$ sudo port install ftp://ftp.eso.org/pub/usg/fposs/P99/macports/flames-fposs.bz2
--->  Fetching port ftp://ftp.eso.org/pub/usg/fposs/P99/macports/flames-fposs.bz2
Can't map the URL 'ftp://ftp.eso.org/pub/usg/fposs/P99/macports/flames-fposs.bz2' to a port description file ("couldn't change working directory to "/opt/local/var/macports/portdirs/flames-fposs": no such file or directory").
Please verify that the directory and portfile syntax are correct.
Error: Can't open URL 'ftp://ftp.eso.org/pub/usg/fposs/P99/macports/flames-fposs.bz2' as a port
Error: Improper expression syntax while processing parameters

If I manually extract the file into /opt/local/var/macports/portdirs/ then it works:

$ ftp ftp://ftp.eso.org/pub/usg/fposs/P99/macports/flames-fposs.bz2
$ sudo tar -C /opt/local/var/macports/portdirs/ -xvf flames-fposs.bz2
x flames-fposs/Portfile
$ sudo port install ftp://ftp.eso.org/pub/usg/fposs/P99/macports/flames-fposs.bz2
--->  Fetching port ftp://ftp.eso.org/pub/usg/fposs/P99/macports/flames-fposs.bz2
--->  Computing dependencies for flames-fposs
--->  Cleaning flames-fposs
--->  Scanning binaries for linking errors
--->  No broken files found.                             

This has the problem that if a previous version of this port was installed (e.g. ftp://ftp.eso.org/pub/usg/fposs/P98/macports/flames-fposs.bz2), and thus the older version of the Portfile already exists in /opt/local/var/macports/portdirs/flames-fposs, then the older version gets installed rather than the newer one.

So it seems that: 1) for extraction, MacPorts is assuming that all ports specified as remote URLs are binary packages, and this it is not handling correctly Portfile distribution via this mechanism 2) It is nonetheless still handling "correctly" processing the Portfile if it happens to already exist, or if the user "manually installs" it into /opt/local/var/macports/portdirs/.

Is is a bug? Or a new feature?

Many thanks in advance.

Cheers

John Pritchard

P.S. Yes I know I should just put this package in a proper repository somewhere, that's coming, but it's... complicated...

Change History (3)

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Keywords: source installation via remote URL removed

comment:2 Changed 8 years ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 8c2da16/macports-base:

Fix extraction of portdir archives

The -q flag of tar(1) should only be used when a list of files to
extract is specified. If no files are specified, nothing is extracted.

Fixes: #53532

comment:3 Changed 8 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.4.1
Note: See TracTickets for help on using tickets.