misc/157543: pkg_add fails to install with -C from bad path

David Naylor naylor.b.david at gmail.com
Thu Jun 2 20:30:14 UTC 2011

>Number:         157543
>Category:       misc
>Synopsis:       pkg_add fails to install with -C from bad path
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 02 20:30:13 UTC 2011
>Originator:     David Naylor
>Release:        9.0-CURRENT
FreeBSD dragon.dg 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Sat May 21 22:12:29 SAST 2011
pkg_add appears to chdir back to its calling directory after installed the package.  When installing into a chroot that directory may not exist in the chroot and pkg_add fails.
# mkdir /does/not/exist/in/scratchpad
# cd /does/not/exist/in/scratchpad
# pkg_add -C /scratchpad/pkg_env /usr/ports/packages/All/perl-threaded-5.12.3.txz

Removing stale symlinks from /usr/bin...
    Removing /usr/bin/perl
    Removing /usr/bin/perl5
Creating various symlinks in /usr/bin...
    Symlinking /usr/local/bin/perl5.12.3 to /usr/bin/perl
    Symlinking /usr/local/bin/perl5.12.3 to /usr/bin/perl5
Cleaning up /etc/make.conf... Done.
Spamming /etc/make.conf... Done.
pkg_add: leave_playpen: can't chdir back to ''
# echo $?
Use `chroot /scratchpad/pkg_env pkg_add ...` or start pkg_add from a directory that exists in the chroot environment.


More information about the freebsd-bugs mailing list