summaryrefslogtreecommitdiffstats
path: root/perl-install/share/advertising/07-server.pl
blob: 97101347b5d383743891e21c23b7d8b245511c9d (plain)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/perl

$width = 556;
$height = 303;

$y_start = 10;

$title = N("Turn your computer into a reliable server");

@text = (N("Transform your computer into a powerful Linux server: Web server, mail, firewall, router, file and print server (etc.) are just a few clicks away!"));
wargs)
+unescaped_macro_pat = re.compile(r"([^%])%([^%])")
+
+def escape_macros(text):
+ escaped = unescaped_macro_pat.sub("\\1%%\\2", text)
+ return escaped
def format_lines(lines):
first = 1
@@ -110,7 +115,7 @@ def format_lines(lines):
perexpr = re.compile(r"([^%])%([^%])")
for line in lines:
if line:
- line = perexpr.sub("\\1%%\\2", line)
+ line = escape_macros(line)
if first:
first = 0
line = line.lstrip()
@@ -425,7 +430,9 @@ def specfile_svn2rpm(pkgdirurl, specfile, rev=None, size=None,
if os.path.isfile(logfile):
file = open(logfile)
newlines.append("\n")
- newlines.append(file.read())
+ log = file.read()
+ log = escape_macros(log)
+ newlines.append(log)
file.close()
finally:
if os.path.isdir(tmpdir):