From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr93L-0004Lr-Mi for guix-patches@gnu.org; Sun, 10 Sep 2017 16:42:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr93K-0000Vo-NZ for guix-patches@gnu.org; Sun, 10 Sep 2017 16:42:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51095) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dr93K-0000Vf-J9 for guix-patches@gnu.org; Sun, 10 Sep 2017 16:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dr93K-0000mf-Cf for guix-patches@gnu.org; Sun, 10 Sep 2017 16:42:02 -0400 Subject: [bug#28281] [PATCH] gnu: Add os-prober. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170909171635.7968-1-arunisaac@systemreboot.net> <874lsa900c.fsf@gnu.org> <403302d1.ADkAAC_e-_IAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZtWIT@mailjet.com> Date: Sun, 10 Sep 2017 22:41:37 +0200 In-Reply-To: <403302d1.ADkAAC_e-_IAAAAAAAAAAAOzWv8AAAACwQwAAAAAAAW9WABZtWIT@mailjet.com> (Arun Isaac's message of "Sun, 10 Sep 2017 21:32:19 +0530") Message-ID: <87k2165lry.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Arun Isaac Cc: 28281@debbugs.gnu.org Arun Isaac skribis: >>>> + (replace 'install >>>> + (lambda* (#:key outputs #:allow-other-keys) >>>> + (define (find-files-non-recursive directory) >>>> + (find-files directory >>>> + (lambda (file stat) >>>> + (string-match (string-append "^" directo= ry "/[^/]*$") >>>> + file)) >>>> + #:directories? #t)) >>> >>> Do you think it would be a good idea to add a #:recursive? keyword >>> argument to `find-files' in (guix build utils), instead of creating this >>> `find-files-non-recursive-function' here? >> >> Hmm I didn=E2=80=99t understand that it *had* to be non-recursive. Does= it >> really make a difference? > > I am trying to do > > cp -r /some/directory/* destination > > To do this, I used `find-files-non-recursive' to get all files in > /some/directory/ and applied `copy-recursively' on each one of them. > > Do you have a better way of doing this in mind? Would (copy-recursively "/some/directory" destination) work for you? >> If it does, then =E2=80=98scandir=E2=80=99 from (ice-9 ftw) would be the= thing. Sorry >> if I led you in the wrong direction. :-/ > > Yes, scandir could be used. But, it also returns "." and "..", and I'll > have to filter them out. So code length, or clarity-wise, it won't be > much of an improvement. That is why I thought adding a #:recursive? > argument to `find-files' would be nice. Yeah, looks like none of the options is a perfect match. HTH, LUdo=E2=80=99.