aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/hyfetch-fix-generator-script-quotation-escaping.patch
blob: dc0986470762cf9693fde30d67e7560fbc5d886b (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
From db69285ec161452c11ae490266e84211bec38c0d Mon Sep 17 00:00:00 2001
From: Azalea Gui <me@hydev.org>
Date: Fri, 10 Feb 2023 23:05:23 -0500
Subject: [PATCH] [F] Fix generator script quotation escaping #91 #90

---
 hyfetch/distros/debian.py   | 4 ++--
 hyfetch/distros/haiku.py    | 2 +-
 hyfetch/distros/puffos.py   | 2 +-
 hyfetch/distros/skiffos.py  | 2 +-
 hyfetch/distros/trisquel.py | 4 ++--
 tools/list_distros.py       | 4 +++-
 6 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/hyfetch/distros/debian.py b/hyfetch/distros/debian.py
index 8aab161d..7b4a2a9c 100644
--- a/hyfetch/distros/debian.py
+++ b/hyfetch/distros/debian.py
@@ -4,7 +4,7 @@ from . import AsciiArt
 debian = AsciiArt(match=r'''"Debian"*''', color='1 7 3', ascii=r"""
 ${c2}       _,met$$$$$gg.
     ,g$$$$$$$$$$$$$$$P.
-  ,g$$P"        \"""Y$$.".
+  ,g$$P"        "\""Y$$.".
  ,$$P'              `$$$.
 ',$$P       ,ggs.     `$$b:
 `d$$'     ,$P"'   ${c1}.${c2}    $$$
@@ -18,6 +18,6 @@ ${c2}  `Y$$
      `$$b.
        `Y$$b.
           `"Y$b._
-              `\"""
+              `"\""
 """)
     
\ No newline at end of file
diff --git a/hyfetch/distros/haiku.py b/hyfetch/distros/haiku.py
index cf10cfc5..198cd142 100644
--- a/hyfetch/distros/haiku.py
+++ b/hyfetch/distros/haiku.py
@@ -15,6 +15,6 @@ ${c3}           MMMM${c4}   .cOMMMMM|/MMMMM/`
            MM${c4}MMMMMMM/`:MMM/  ${c3}MMMM
            MMMM              MMMM
            MMMM              MMMM
-           \""""              \""""
+           "\"\""              "\"\""
 """)
     
\ No newline at end of file
diff --git a/hyfetch/distros/puffos.py b/hyfetch/distros/puffos.py
index 789d3994..0e61def4 100644
--- a/hyfetch/distros/puffos.py
+++ b/hyfetch/distros/puffos.py
@@ -7,7 +7,7 @@ ${c1}
             ,/'      '"";
            /             ".
          ,'mmmMMMMmm.      \
-       _/-"^^^^^\"""%#%mm,   ;
+       _/-"^^^^^"\""%#%mm,   ;
  ,m,_,'              "###)  ;,
 (###%                 \#/  ;##mm.
  ^#/  __        ___    ;  (######)
diff --git a/hyfetch/distros/skiffos.py b/hyfetch/distros/skiffos.py
index 49d311c0..93a846a7 100644
--- a/hyfetch/distros/skiffos.py
+++ b/hyfetch/distros/skiffos.py
@@ -11,6 +11,6 @@ ${c2}
       ${c2}*@@@@@@@@@@@@@@@@@@@@@@@@@p${c1}||||==,
         ${c1}`'||LLL{{""${c2}@$B@@@@@@@@@@@@@@@p${c1}||
             ${c1}`~=|||||||||||L"${c2}$@@@@@@@@@@@
-                   ${c1}````'\"""\""""${c2}'\"""\"""""
+                   ${c1}````'"\"\""\"\""${c2}'"\"\""\"\"\""
 """)
     
\ No newline at end of file
diff --git a/hyfetch/distros/trisquel.py b/hyfetch/distros/trisquel.py
index c92a5938..b15eb1f4 100644
--- a/hyfetch/distros/trisquel.py
+++ b/hyfetch/distros/trisquel.py
@@ -3,7 +3,7 @@ from . import AsciiArt
 
 trisquel = AsciiArt(match=r'''"Trisquel"*''', color='4 6', ascii=r"""
 ${c1}                         ,o$$$o.
-                      ,o$$Y\"""Y$$b
+                      ,o$$Y"\""Y$$b
     ,o$$$$$$o.       ,$$'   ,   Y$$b
  ,o$$$$$$$$$$$$o.    :$      b   Y$$.
 ,$$"'      "Y$$$$o.   'b.   ,b  d$$$
@@ -11,7 +11,7 @@ $$'  .d$$$$b  '$$$$o   'Y$$$Y  d$$$'
 $$'  q'    'b  '$$$$$o._   _.o$$$$'
 .$$,_    _,d$  ,$$$$$$$$$$$$${c2}$$$$Y'
 ${c1} '$$$$aaa$$$' .$$$$$$${c2}$$$$$$$$'
-${c1}     \""""     ${c2}d$$$$"'
+${c1}     "\"\""     ${c2}d$$$$"'
              d$$$'   .d$$b.
              $$$$  .$"   'a$.
              $$$$  $b      $$.
diff --git a/tools/list_distros.py b/tools/list_distros.py
index d781b581..63fb5288 100755
--- a/tools/list_distros.py
+++ b/tools/list_distros.py
@@ -140,7 +140,9 @@ def export_distro(d: AsciiArt) -> str:
         varname = varname.replace(s, '_')
 
     # Escape/unescape ascii
-    ascii = d.ascii.replace('"""', '\\"""').replace("\\\\", "\\")
+    ascii = d.ascii.replace("\\\\", "\\")
+    while '"""' in ascii:
+        ascii = ascii.replace('"""', '"\\""')
 
     script = f"""
 from . import AsciiArt
-- 
2.39.1