From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petter Subject: [PATCH] gnu: Remove redundancy where mkdir-p is followed by install-file . Date: Sun, 20 Nov 2016 16:25:59 +0100 Message-ID: <6e80b7731f12011fac7794e01750338a@mykolab.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8U0L-0005dp-Bq for guix-devel@gnu.org; Sun, 20 Nov 2016 10:26:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8U0I-0006Je-8m for guix-devel@gnu.org; Sun, 20 Nov 2016 10:26:05 -0500 Received: from mx.kolabnow.com ([95.128.36.1]:22572 helo=mx-out01.mykolab.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c8U0I-0006JT-1W for guix-devel@gnu.org; Sun, 20 Nov 2016 10:26:02 -0500 Received: from mx04.mykolab.com (mx04.mykolab.com [10.20.7.102]) by mx-out01.mykolab.com (Postfix) with ESMTPS id 612576161A for ; Sun, 20 Nov 2016 16:25:59 +0100 (CET) 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" To: guix-devel@gnu.org Hi. Following up on an encouragement by Leo to remove a redundancy in the package recipes. In several places (mkdir-p) is used right before (install-file), to the same directory. However, (install-file) does (mkdir-p) itself, which makes an explicit (mkdir-p) redundant. For reference: === guix/build/utils.scm === (define (install-file file directory) "Create DIRECTORY if it does not exist and copy FILE in there under the same name." (mkdir-p directory) (copy-file file (string-append directory "/" (basename file)))) I assume the (mkdir-p)s here could be removed as well. === gnu/packages/bioinformatics.scm === (mkdir-p lib) (mkdir-p include) (for-each (cut install-file <> lib) (find-files "." "\\.o$")) (for-each (cut install-file <> include) (find-files "." "\\.hpp$"))) And this (mkdir-p). === gnu/packages/ocaml.scm === (mkdir-p doc) ;; This file needs write-permissions, because it's ;; overwritten by 'docs' during documentation generation. (chmod "src/strings.ml" #o600) (and (zero? (system* "make" "docs" "TEXDIRECTIVES=\\\\draftfalse")) (begin (for-each (lambda (f) (install-file f doc)) I did not include them because they're not trivial (to me). I have not build all the affected packages! It's all a little too much. Hopefully, someone about to compile these packages can include this patch first. Also, I'm inexperienced with this, so please be extra alert. Best, Petter P.S. If it's of interest to anyone. I used this sed script to locate areas with a possible redundant (mkdir-p): sed -n '/mkdir-p/{ h; :a; /))))/!{n; H; ba;}; x; /install-file/{F; p;}; };' gnu/packages/*.scm