unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 16d8fa6e1d8312667bca5b0304e4979b3d7d7026 1102 bytes (raw)
name: packages/patches/wicd-template-instantiation.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
Wicd 1.7.3 fails to instantiate template lines that have several
variable references.  For instance, the line:

  wep_key$_KEY_INDEX=$_KEY

which is found in in the 'wep-hex' template, expands to these two
lines:

  wep_key0=$_KEY
  wep_key0=123456789ab

This patch fixes that by only emitting the fully substituted line.

Patch by Ludovic Courtès <ludo@gnu.org>.

--- a/wicd/misc.py	2012-11-17 00:07:08 +0000
+++ b/wicd/misc.py	2015-05-09 11:22:37 +0000
@@ -321,11 +321,11 @@ def ParseEncryption(network):
                                 rep_val = '0'
                         if rep_val:
                             line = line.replace("$_%s" % cur_val, str(rep_val))
-                            config_file = ''.join([config_file, line])
                         else:
                             print "Ignoring template line: '%s'" % line
                     else:
                         print "Weird parsing error occurred"
+                config_file = ''.join([config_file, line])
             else:  # Just a regular entry.
                 config_file = ''.join([config_file, line])

debug log:

solving 16d8fa6e1d8312667bca5b0304e4979b3d7d7026 ...
found 16d8fa6e1d8312667bca5b0304e4979b3d7d7026 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).