TritonDataCenter / pkgsrc-legacy

Automatically updated conversion of the "pkgsrc" module from anoncvs.netbsd.org
http://www.pkgsrc.org
127 stars 64 forks source link

pkgin doesn't report failure when it can't read CWD #528

Open gsadams opened 6 years ago

gsadams commented 6 years ago

I banged my head against this one for a while.

My home directory is mounted via NFS, and the root user has no privileges there. So, when I became root to do 'pkgin install' from my home directory, pkgin couldn't read . (the current directory). I didn't think about this for a while, though.

Running 'pkgin install ansible' appeared to work, but didn't actually install anything:

# pkgin install ansible
calculating dependencies... done.

nothing to upgrade.
7 packages to be installed (6082K to download, 30M to install):

py27-markupsafe-0.23 py27-ecdsa-0.13 py27-yaml-3.12 py27-paramiko-1.15.3 py27-jinja2-2.7.3 py27-crypto-2.6.1nb2 ansible-2.1.0.0

proceed ? [Y/n]
downloading packages...
py27-markupsafe-0.23.tgz              100%   30KB  29.8KB/s  29.8KB/s   00:00
py27-ecdsa-0.13.tgz                   100%   92KB  92.1KB/s  92.1KB/s   00:00
py27-yaml-3.12.tgz                    100%  213KB 213.1KB/s 213.1KB/s   00:00
py27-paramiko-1.15.3.tgz              100%  347KB 347.5KB/s 347.5KB/s   00:00
py27-jinja2-2.7.3.tgz                 100%  812KB 812.0KB/s 812.0KB/s   00:00
py27-crypto-2.6.1nb2.tgz              100%  666KB 666.1KB/s 666.1KB/s   00:01
ansible-2.1.0.0.tgz                   100% 3922KB   3.8MB/s 165.6KB/s   00:01
installing packages...
installing py27-markupsafe-0.23...
installing py27-ecdsa-0.13...
installing py27-yaml-3.12...
installing py27-paramiko-1.15.3...
installing py27-jinja2-2.7.3...
installing py27-crypto-2.6.1nb2...
installing ansible-2.1.0.0...
pkg_install warnings: 0, errors: 0
# 

It wasn't until I got frustrated and tried 'pkgin -V install ansible' that I discovered the problem:

# pkgin -V install ansible
...
proceed ? [Y/n]
downloading packages...
installing packages...
installing py27-markupsafe-0.23...
pkg_add: getcwd failed
installing py27-ecdsa-0.13...
pkg_add: getcwd failed
...

Aha! A simple 'cd /' first fixed it. But telling me that there were no warnings or errors threw me off the trail for a while.