gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: Proposed fix for https://bu


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: Proposed fix for https://bugs.gnunet.org/view.php?id=5611
Date: Tue, 26 Feb 2019 09:36:21 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 5f80de3fb Proposed fix for https://bugs.gnunet.org/view.php?id=5611
     new faf2ff1ed Merge branch 'master' of gnunet.org:gnunet
5f80de3fb is described below

commit 5f80de3fbc0c4b43fb93d0ef4460aea16b2c78e0
Author: ng0 <address@hidden>
AuthorDate: Tue Feb 26 08:35:45 2019 +0000

    Proposed fix for https://bugs.gnunet.org/view.php?id=5611
---
 src/util/Makefile.am                       | 27 +++++++-----------
 src/util/gnunet-qr.in                      | 46 ++++++++++++++++++++++++++++++
 src/util/{gnunet-qr.py.in => gnunet-qr.py} |  1 -
 3 files changed, 56 insertions(+), 18 deletions(-)

diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index d1aa8aa9b..7041004ac 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -204,8 +204,15 @@ libexec_PROGRAMS = \
  gnunet-timeout \
  $(W32CONSOLEHELPER)
 
+do_subst = $(SED) -e 's,address@hidden@],$(PREFIX),g'
+
+gnunet-qr: gnunet-qr.in Makefile
+       $(do_subst) < $(srcdir)/gnunet-qr.in > gnunet-qr
+       chmod +x gnunet-qr
+
 bin_SCRIPTS =\
- gnunet-qr
+ gnunet-qr \
+ gnunet-qr.py
 
 bin_PROGRAMS = \
  gnunet-resolver \
@@ -236,21 +243,6 @@ gnunet_timeout_SOURCES = \
  gnunet-timeout-w32.c
 endif
 
-# This is horrible, but compared to the alternatives and the solution
-# which preceded this it is a good compromise and good enough for one
-# file. Everyone else is invited to patch it locally.
-# In case someone reads this file and is wondering about the
-# assignment operator below, it's explained here:
-# https://lists.gnu.org/archive/html/make-w32/2013-10/msg00021.html
-
-xENV != which env
-
-do_subst = $(SED) -e 's,address@hidden@],${xENV},g'
-
-gnunet-qr: gnunet-qr.py.in Makefile
-       $(do_subst) < $(top_srcdir)/src/util/gnunet-qr.py.in > gnunet-qr
-       chmod +x gnunet-qr
-
 gnunet_service_resolver_SOURCES = \
  gnunet-service-resolver.c
 gnunet_service_resolver_LDADD = \
@@ -675,4 +667,5 @@ EXTRA_DIST = \
   test_resolver_api_data.conf \
   test_service_data.conf \
   test_speedup_data.conf \
-  gnunet-qr.py.in
+  gnunet-qr.py \
+  gnunet-qr.in
diff --git a/src/util/gnunet-qr.in b/src/util/gnunet-qr.in
new file mode 100755
index 000000000..5e7a285ac
--- /dev/null
+++ b/src/util/gnunet-qr.in
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# From curl's buildconf, making this script subject to the
+# curl license: https://curl.haxx.se/docs/copyright.html
+# Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
+# Copyright (C) 2019 GNUnet e.V.
+
+# findtool works like which without relying on which (which is a problem
+# for some limited shells.
+findtool(){
+  file="$1"
+
+  if { echo "$file" | grep "/" >/dev/null 2>&1; } then
+    # when file is given with a path check it first
+    if test -f "$file"; then
+      echo "$file"
+      return
+    fi
+  fi
+
+  old_IFS=$IFS; IFS=':'
+  for path in $PATH
+  do
+    IFS=$old_IFS
+    # echo "checks for $file in $path" >&2
+    if test "$path" -a "$path" != '.' -a -f "$path/$file"; then
+      echo "$path/$file"
+      return
+    fi
+  done
+  IFS=$old_IFS
+}
+
+# end curl licensed code
+pythonize=`findtool python2.7 2>/dev/null`
+if test ! -x "$pythonize"; then
+       pythonize=`findtool ${PYTHON2:-python2.7}`
+fi
+
+if test -z "$pythonize"; then
+  echo "ERROR: python2.7 not found."
+  echo "  You need python2.7 installed."
+  exit 1
+fi
+
+${pythonize} @PREFIX@/bin/gnunet-qr.py || echo "ERROR: python2.7 or future not 
found" && exit 1
diff --git a/src/util/gnunet-qr.py.in b/src/util/gnunet-qr.py
similarity index 99%
rename from src/util/gnunet-qr.py.in
rename to src/util/gnunet-qr.py
index ceed8bd77..bf35b3a7e 100755
--- a/src/util/gnunet-qr.py.in
+++ b/src/util/gnunet-qr.py
@@ -1,4 +1,3 @@
address@hidden@ python2.7
 from __future__ import print_function
 from builtins import str
 import sys

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]