pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Very deep work dir left behind by sysutils/coreutils ("solution")



Hi,

I installed El Capitan on my MacBook Air yesterday and found that most
things in my (not very extensive) pkgsrc installation worked.  Then,
during the day, there were a few updates to packages that prompted a
rebuild of the sysutils/coreutils package by pkg_rolling-replace.

Afterwards, I noticed that pkgclean complained about "No space left on
device" and there was a *very* deep directory structure left behind in
coreutils' "work" directory.

(I have the pkgsrc tree mounted on a sparsebundle disk image, if that
makes any difference)

$ cd pkgsrc/sysutils/coreutils/
$ bmake configure
=> Bootstrap dependency digest>=20010302: found digest-20121220
=> Checksum SHA1 OK for coreutils-8.23.tar.xz
=> Checksum RMD160 OK for coreutils-8.23.tar.xz
===> Installing dependencies for coreutils-8.23nb2
[...]
rm: confdir-14B---: Directory not empty
$ pkgclean
===> Cleaning in /Users/kk/pkgsrc/sysutils/coreutils/work
rm: cannot remove ‘/Volumes/NetBSD-pkgsrc/pkgsrc/sysutils/coreutils/work/coreutils-8.23/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---
[...]
confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---’: No space left on device

After investigation, it turned out that the work directory contiains
337 levels of "confdir-14B---" directories, and that final directory is
empty:

$ cd work/coreutils-8.23
$ n=1; while cd confdir-14B---; do (( n++ )); done
ksh: cd: confdir-14B---: [No such file or directory]
$ ls -a
./  ../
$ print $n
337

Creating a file here is ok, but it can't be removed because "No space
left on device".  I can't move up in the hierarchy ("cd ..") because
"File name too long", and removing the whole work directory won't work
either, as pkgclean discovered.

This is the only way I found to remove the work directory:

$ cd
$ cd pkgsrc/sysutils/coreutils/work/coreutils-8.23/

d="confdir-14B---"
while test -d "$d/confdir-14B---"; do
    nd=$(mktemp -u snafuXXXXXX)
    mv "$d/confdir-14B---" "$nd"
    d="$nd"
done

Basically, "pull up" (move) the second-level "confdir-14B---" directory
into the work directory level and rename it to a random name, until the
directories are all in the work directory:

$ ls
confdir-14B---/  snafuCG6axd/  snafuOqBID5/  snafubjcs9l/  snafuocPdqZ/
snafu01xftG/     snafuCJoomc/  snafuOycc5h/  snafubwt1FC/  snafuorEJ93/
snafu069VuP/     snafuCOdLZj/  snafuPMHXhs/  snafuc4RZqO/  snafuouvOLR/
snafu0Boezz/     snafuCPEf16/  snafuPTDoCt/  snafuc6XdPg/  snafupORRD9/
[...]

Then run pkgclean again:

$ cd
$ pkgclean
===> Cleaning in /Users/kk/pkgsrc/sysutils/coreutils/work

I'm not sure if this is related to the El Capitan upgrade from Yosemite
or not, and I have no hints for actually solving the problem in the
package, but I thought I'd just share the solution for getting rid of
the work directory.

Cheers,

-- 
:: Andreas Kusalananda Kähäri, Bioinformatics Developer, BILS,
:: Uppsala University, Sweden
::----------------------------------------------------------------------
:: My other car is a cdr.


Home | Main Index | Thread Index | Old Index