Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#63534 closed defect (fixed)

PortGroup command fails if ports tree path contains spaces

Reported by: essandess (Steve Smith) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.7.2
Component: base Version: 2.7.1
Keywords: Cc:
Port:

Description

I'm trying to install the previous version of port google-glog to (temporarily) address an issue building pytorch (https://trac.macports.org/ticket/62921).

I've followed these instructions on my local repo: https://trac.macports.org/wiki/howto/InstallingOlderPort

git checkout master && git fetch --all && git merge upstream/master && git push
git checkout 055ddcb475c444d137c5412dce86a167d59d6b4c
cd devel/google-glog
sudo port install

Error:

Can't map the URL 'file://.' to a port description file ("wrong # args: should be "source ?-encoding name? fileName"").
Please verify that the directory and portfile syntax are correct.
To use the current port, you must be in a port's directory.

Change History (10)

comment:1 Changed 3 years ago by kencu (Ken)

what's in the directory?

comment:2 in reply to:  1 Changed 3 years ago by essandess (Steve Smith)

comment:3 Changed 3 years ago by kencu (Ken)

works fine for me:

$ sudo git checkout 055ddcb475c444d137c5412dce86a167d59d6b4c
Checking out files: 100% (6225/6225), done.
Note: checking out '055ddcb475c444d137c5412dce86a167d59d6b4c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 055ddcb475c google-glog: Avoid pre-release candidates in livecheck

$ cd devel/google-glog


$ port info
google-glog @0.4.0_2 (devel)
Variants:             debug, [+]gflags

Description:          The glog library implements application-level logging. This library
                      provides logging APIs based on C++-style streams and various helper
                      macros.
Homepage:             https://github.com/google/glog

Build Dependencies:   cmake
Library Dependencies: gflags
Platforms:            darwin
License:              BSD
Maintainers:          none

$ sudo port install
--->  Computing dependencies for google-glog
The following dependencies will be installed:  gflags
Continue? [Y/n]: 
$ ls -la
total 8
drwxr-xr-x     4 root  wheel    128 25 Sep 09:06 .
drwxr-xr-x  1099 root  wheel  35168 25 Sep 09:04 ..
-rw-r--r--     1 root  wheel   1528 25 Sep 09:04 Portfile
drwxr-xr-x     3 root  wheel     96 25 Sep 09:04 files

comment:4 Changed 3 years ago by essandess (Steve Smith)

Thanks for checking. With -dv for me:

sudo port -dv install
DEBUG: Copying /Volumes/Macintosh HD/Users/username/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
DEBUG: Using normalized porturl file:///Volumes/Macintosh HD/Users/username/Source/github/essandess/macports-ports/devel/google-glog
DEBUG: Changing to port directory: /Volumes/Macintosh HD/Users/username/Source/github/essandess/macports-ports/devel/google-glog
DEBUG: OS darwin/20.6.0 (macOS 11.6) arch i386
DEBUG: wrong # args: should be "source ?-encoding name? fileName"
    while executing
"source /Volumes/Macintosh HD/Users/username/Source/github/essandess/macports-ports/_resources/port1.0/group/github-1.0.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel "source $groupFile""
    (procedure "PortGroup" line 20)
    invoked from within
"PortGroup           github 1.0"
    (file "Portfile" line 4)
    invoked from within
"source Portfile"
    invoked from within
"$workername eval {source Portfile}"
DEBUG: wrong # args: should be "source ?-encoding name? fileName"
    while executing
"error $result"
    (procedure "mportopen" line 53)
    invoked from within
"mportopen $url"
Can't map the URL 'file://.' to a port description file ("wrong # args: should be "source ?-encoding name? fileName"").
Please verify that the directory and portfile syntax are correct.
To use the current port, you must be in a port's directory.

comment:5 Changed 3 years ago by kencu (Ken)

so -- what's in the directory, exactly?

comment:6 Changed 3 years ago by kencu (Ken)

you have a space in your directory path, I notice...

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

Component: portsbase
Summary: Installing old version of port fails with "Can't map the URL 'file://.' to a port description file"PortGroup command fails if ports tree path contains spaces

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

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In b83c74333b654e9645335bdb04a3e8bb0c5db136/macports-base (master):

handle portgroup paths containing spaces

Closes: #63534

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

I suspect that will not be the last problem you see from using a ports tree whose path contains spaces, though.

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

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