Source: compton-conf 
Version: 0.1.0+20151226-1 
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: locale
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi,

While working on the "reproducible builds" effort [1], we have noticed that
compton-conf could not be built reproducibly.

When processing translation files and using a non-UTF8 locale, grep
misdetects them as binary files and embeds the line: "Binary file
(standard input) matches"

The attached patch fixes this by telling grep to treat the input as
text.Once applied, compton-conf can be built reproducibly in our current
experimental framework.

 [1]: https://wiki.debian.org/ReproducibleBuilds

Regards,
-- 
Dhole
diff -Nru compton-conf-0.1.0+20151226/debian/changelog 
compton-conf-0.1.0+20151226/debian/changelog
--- compton-conf-0.1.0+20151226/debian/changelog        2015-12-26 
13:25:40.000000000 +0100
+++ compton-conf-0.1.0+20151226/debian/changelog        2016-02-25 
11:11:54.000000000 +0100
@@ -1,3 +1,10 @@
+compton-conf (0.1.0+20151226-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix misdetection as binary input in grep when LC_ALL=C 
+
+ -- Eduard Sanou <dh...@openmailbox.org>  Thu, 25 Feb 2016 11:11:48 +0100
+
 compton-conf (0.1.0+20151226-1) unstable; urgency=medium
 
   * Cherry-picking upstream version 0.1.0+20151226.  
diff -Nru compton-conf-0.1.0+20151226/debian/patches/series 
compton-conf-0.1.0+20151226/debian/patches/series
--- compton-conf-0.1.0+20151226/debian/patches/series   1970-01-01 
01:00:00.000000000 +0100
+++ compton-conf-0.1.0+20151226/debian/patches/series   2016-02-25 
11:12:05.000000000 +0100
@@ -0,0 +1 @@
+unicode-grep.patch
diff -Nru compton-conf-0.1.0+20151226/debian/patches/unicode-grep.patch 
compton-conf-0.1.0+20151226/debian/patches/unicode-grep.patch
--- compton-conf-0.1.0+20151226/debian/patches/unicode-grep.patch       
1970-01-01 01:00:00.000000000 +0100
+++ compton-conf-0.1.0+20151226/debian/patches/unicode-grep.patch       
2016-02-25 11:12:16.000000000 +0100
@@ -0,0 +1,22 @@
+Author: Eduard Sanou <dh...@openmailbox.org>
+Description: Fix misdetection as binary input when LC_ALL=C
+
+--- compton-conf-0.1.0+20151226.orig/cmake/LXQtTranslateDesktop.cmake
++++ compton-conf-0.1.0+20151226/cmake/LXQtTranslateDesktop.cmake
+@@ -71,13 +71,13 @@ function(lxqt_translate_desktop _RESULT)
+         set(_pattern "'\\[.*]\\s*='")
+         if (_translations)
+             add_custom_command(OUTPUT ${_outFile}
+-                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > 
${_outFile}
+-                COMMAND grep -h ${_pattern} ${_translations} >> ${_outFile}
++                COMMAND grep -a -v "'#TRANSLATIONS_DIR='" ${_inFile} > 
${_outFile}
++                COMMAND grep -a -h ${_pattern} ${_translations} >> ${_outFile}
+                 COMMENT "Generating ${_fileName}${_fileExt}"
+             )
+         else()
+             add_custom_command(OUTPUT ${_outFile}
+-                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > 
${_outFile}
++                COMMAND grep -a -v "'#TRANSLATIONS_DIR='" ${_inFile} > 
${_outFile}
+                 COMMENT "Generating ${_fileName}${_fileExt}"
+             )
+         endif()

Attachment: signature.asc
Description: PGP signature

Reply via email to