Subject: [PATCH] utils: Fix wrap-program filename generation.

From: Arun Isaac <[email-masked]>
Date: Mon, 9 Jul 2018 07:01:03 +0530

* guix/build/utils.scm (wrap-program): While generating a new filename for the
wrapped program, trim dots from the left of the basename. This prevents
already wrapped files being wrapped again with two or more dots prepended to
them.
---
 guix/build/utils.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index c58a1afd1..0794c658f 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2013 Andreas Enge <[email-masked]>
 ;;; Copyright © 2013 Nikita Karetnikov <[email-masked]>
 ;;; Copyright © 2015, 2018 Mark H Weaver <[email-masked]>
+;;; Copyright © 2018 Arun Isaac <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1032,7 +1033,8 @@ modules in $GUILE_LOAD_PATH, etc.
 If PROG has previously been wrapped by 'wrap-program', the wrapper is extended
 with definitions for VARS."
   (define wrapped-file
-    (string-append (dirname prog) "/." (basename prog) "-real"))
+    (string-append
+     (dirname prog) "/." (string-trim (basename prog) #\.) "-real"))
 
   (define already-wrapped?
     (file-exists? wrapped-file))
-- 
2.15.1