taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:
> Mark H Weaver <m...@netris.org> writes: > >>> ;; There is no /usr/bin or /bin - replace it with /gnu/store >>> (substitute* "testsuite/cpio.tests" >>> - (("/usr/bin") "/gnu/store") >>> - (("usr") "gnu")) >>> + (("/usr/bin") (%store-directory)) >>> + (("usr") (car (filter (negate string-null?) >>> + (string-split (%store-directory) >>> #\/))))) >> >> What is the rationale for replacing "usr" with "gnu" here? In the >> general case where (%store-directory) might be almost anything, I fail >> to see why "usr" should be replaced with the first component of >> (%store-directory). > > The test suite contains: > > testing "cpio -p with absolute paths" \ > "echo /usr/bin | cpio -dp cpio.testdir 2>&1; echo \$?; > ls cpio.testdir" \ > "\ > 1 blocks > 0 > usr > " "" "" > > Where the second argument is code to evaluate and the third argument the > expected output; it expects the cpio command to print "1 blocks", the > 'echo $?' command to print "0", and the ls command to print "usr" > because that directory has been copied there (without its contents). > > I believe this works in all cases except where (%store-directory) is /. Ah, okay, thanks for the explanation. > Should we try to prevent such a limitation? No, I think we can reasonably assume that (%store-directory) won't be /. Thanks! Mark