From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: Re: --with-store-dir and/or --localstatedir seem to be ignored Date: Wed, 20 May 2015 09:27:46 +0200 Message-ID: <87wq03yah9.fsf@T420.taylan> References: <87h9refc0y.fsf@gmail.com> <87vbfu15n6.fsf@gnu.org> <87d222ey57.fsf@gmail.com> <87mw10mcuk.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuyPu-00045I-2w for guix-devel@gnu.org; Wed, 20 May 2015 03:27:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuyPt-0007FA-0q for guix-devel@gnu.org; Wed, 20 May 2015 03:27:49 -0400 In-Reply-To: <87mw10mcuk.fsf@netris.org> (Mark H. Weaver's message of "Tue, 19 May 2015 18:17:23 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver Cc: guix-devel@gnu.org, Alex Vorobiev Mark H Weaver 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 /. Should we try to prevent such a limitation? Taylan