Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#41996 closed defect (invalid)

expat @2.1.0: sh: /usr/bin/gnutar: No such file or directory

Reported by: glowworm4200@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: expat

Description (last modified by ryandesign (Ryan Carsten Schmidt))

$ sudo port install expat
Password:
--->  Extracting expat
Error: org.macports.extract for port expat returned: command execution failed
Please see the log file for port expat for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port expat failed
$ cat /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log 
version:1
:debug:main expat has no conflicts
:debug:main Executing org.macports.main (expat)
:debug:main changing euid/egid - current euid: 0 - current egid: 0
:debug:main egid changed to: 500
:debug:main euid changed to: 502
:debug:main Skipping completed org.macports.archivefetch (expat)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.fetch (expat)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.checksum (expat)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:extract extract phase started at Wed Jan  1 18:47:59 EST 2014
:notice:extract --->  Extracting expat
:debug:extract Executing org.macports.extract (expat)
:info:extract --->  Extracting expat-2.1.0.tar.gz
:debug:extract setting option extract.args to '/opt/local/var/macports/distfiles/expat/expat-2.1.0.tar.gz'
:debug:extract Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.5'
:debug:extract Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/expat/expat-2.1.0.tar.gz' | /usr/bin/gnutar --no-same-owner -xf -'
:debug:extract Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/expat/expat-2.1.0.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
:info:extract sh: /usr/bin/gnutar: No such file or directory
:info:extract 
:info:extract gzip: stdout: Broken pipe
:info:extract Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/expat/expat-2.1.0.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
:info:extract Exit code: 127
:error:extract org.macports.extract for port expat returned: command execution failed
:debug:extract Error code: NONE
:debug:extract Backtrace: command execution failed
    while executing
"$procedure $targetname"
:info:extract Warning: targets not executed for expat: org.macports.activate org.macports.extract org.macports.patch org.macports.configure org.macports.build org.macports.destroot org.macports.install
:notice:extract Please see the log file for port expat for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log

I'm on OSX 10.5.8 (PPC G4), with Macports 2.2.1, and I downloaded and installed Xcode 3.1.4

I've used macports in the past on OSX 10.4.11 without issue. I must have done something wrong or am missing something, but I can't figure out what. All attempts to install anything fail.

I'm not sure if the Command Line Utitilites from Xcode are installed, but from other errors caused by that problem, this doesn't appear to look the same. All guides point to going into Xcode > Preferences > Downloads, but either I"m overlooking it or that option doesn't exist in my version. There is no "Downloads" tab.

Another thing I would like to mention, which may or may not be causing problems are the $PATH and $MANPATH values which return:

$ $PATH
-bash: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:: No such file or directory
$ $MANPATH
-bash: /opt/local/share/man:/opt/local/share/man:/usr/share/man:/usr/local/share/man:/usr/X11/man: No such file or directory

I'm pretty sure that it shouldn't contain "No such file or directory", but without going into vim and deleting it manually, I don't know how to fix it. The installer script backed up my .bash_profile and created a new one. I don't know if that "if" block running in there is causing issues or what.

$ cat .bash_profile
# System-wide .profile for sh(1)

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:"
export PATH

if [ "${BASH-no}" != "no" ]; then
	[ -r /etc/bashrc ] && . /etc/bashrc
fi

##
# Your previous /Users/phil/.bash_profile file was backed up as /Users/phil/.bash_profile.macports-saved_2014-01-01_at_03:50:42
##

# MacPorts Installer addition on 2014-01-01_at_03:50:42: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.


# MacPorts Installer addition on 2014-01-01_at_03:50:42: adding an appropriate MANPATH variable for use with MacPorts.
export MANPATH=/opt/local/share/man:$MANPATH
# Finished adapting your MANPATH environment variable for use with MacPorts.


##
# Your previous /Users/phil/.bash_profile file was backed up as /Users/phil/.bash_profile.macports-saved_2014-01-01_at_17:47:24
##

# MacPorts Installer addition on 2014-01-01_at_17:47:24: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.


# MacPorts Installer addition on 2014-01-01_at_17:47:24: adding an appropriate MANPATH variable for use with MacPorts.
export MANPATH=/opt/local/share/man:$MANPATH
# Finished adapting your MANPATH environment variable for use with MacPorts.

I'm guessing I'm either missing some component or something is setup incorrectly. Unfortunately I don't know where to look to see what's missing. I've searched the internet for two days, with no progress. Any help would be appreciated.

Change History (6)

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Description: modified (diff)
Port: expat added
Resolution: invalid
Status: newclosed
Summary: expat @2.1.0 command execution failedexpat @2.1.0: sh: /usr/bin/gnutar: No such file or directory

/usr/bin/gnutar is part of your operating system. If it's missing, restore it from your backups, or reinstall Mac OS X.

comment:2 in reply to:  description Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to glowworm4200@…:

I'm not sure if the Command Line Utitilites from Xcode are installed, but from other errors caused by that problem, this doesn't appear to look the same. All guides point to going into Xcode > Preferences > Downloads, but either I"m overlooking it or that option doesn't exist in my version. There is no "Downloads" tab.

The instructions you're reading are for much newer versions of Xcode than your version of Mac OS X supports. In your version of Xcode, the command line tools are automatically included with the standard Xcode installation.

comment:3 Changed 11 years ago by glowworm4200@…

This is more serious than I thought. I don't currently have a 10.5.8 disc and apparently "tar" is missing from my system. I tried digging around the net for a download, but unfortunately all of them are tarballed themselves. @.@

I really have no idea how such an important utility could be missing.

Assuming I can find an installation of Leopard, do I need to reinstall the entire OS, or is their a specific package I can install?

comment:4 Changed 11 years ago by glowworm4200@…

I think I solved my problem, so I thought I'd share for anyone else who may encounter a similar problem and stumble across this page.

I downloaded gnu tar 1.27.1 from: http://ftp.gnu.org/gnu/tar/

There's several types of archived files there, including .tar, .cpio, .shar. I didn't have anyway to unarchive any of those, but I lucked out with an older laptop that had BSD tar on it. If that's not an option, hopefully the tools to unpack .cpio and .shar are easier to obtain.

Anyways, I copied the /usr/bin/tar utility from my old laptop, running OSX 4.1.11 (Tiger), onto a thumb drive. Then I copied it back into usr/bin on my current laptop. I double-clicked on the dowloaded file and it worked. Then I removed tar from /usr/bin.

Then, following directions from the download, I changed directories to the unarchived folder in my Downloads folder and:

$ ./configure
$ make
$ sudo make install

I've always been leery of compiling from source, as I've never done it before, but it worked out. The finished tar (binary, I believe it's called) is found in the "src" folder. Next, I copied that tar file into /usr/bin and tried macports again. Doh! It wants /usr/bin/gnutar...

$ cp /Users/name/Downloads/tar-1.27.1/src/tar /usr/bin/gnutar

Now macports works just fine!

comment:5 in reply to:  4 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to glowworm4200@…:

I think I solved my problem, so I thought I'd share for anyone else who may encounter a similar problem and stumble across this page.

Glad you got it working, but I already shared the correct solution above: put back the /usr/bin/gnutar that Apple provided. You should not replace Apple operating system components with different versions or different software.

/usr/bin/gnutar could be directly copied from the Mac OS X 10.5 install DVD, or you could use a utility like Pacifist to extract it from the pkg file on the Mac OS X 10.5.8 Combo Update disk image downloadable from Apple's support web site.

Since we cannot explain why /usr/bin/gnutar went missing on your system, we have no way of knowing if other essential OS components are also missing. The safest fix is to reinstall the OS; that will ensure all parts are there. At least keep this suggestion in mind if you run into other missing files later.

comment:6 Changed 11 years ago by glowworm4200@…

Thanks ryandesign. I'll keep that that in mind. I actually did come across the Combo Update, and started to download it. Upon reading some of the description, it mentioned updating Safari to a version lower than the current one I'm running. I'm afraid to even mess with it, as it may do more harm than good. I may look into that Pacifist, as I would like to have the correct one Apple provided, as you say. My father is going to try to find an install disc. He has to look around for it.

I'm embarrassed to say, but thinking back over everything I did over the last several days, I believe I stupidly removed gnutar.

I think I misunderstood bash's errors. I'm not a complete novice, but I'm definitely not at the intermediate level either.

I believe I took the "No such file or directory" to mean I should create one. I think I did a "mkdir /usr/bin/gnutar", then removed it later. Well, as you can imagine, I must have removed the utility. At least that's the best explanation I can come up with. That would seem to explain why the man page for gnutar was available, but not the actual file.

$ port search gnutar

suggested @1.27.1 So it's the best solution for the moment. At least macports hasn't complained.

As an aside, I forgot to use the "echo" command with the $PATH and $MANPATH variables, which is what was causing my earlier confusion.

Note: See TracTickets for help on using tickets.