PKGBUILDs/community/system-tools-backends/Replace.patch

34 lines
805 B
Diff
Raw Normal View History

2009-10-10 02:15:33 +00:00
--- Utils/Replace.pm 2006-11-15 19:17:13.000000000 +0100
+++ Utils/Replace.pm 2007-09-24 01:51:53.000000000 +0200
@@ -272,6 +272,30 @@
return $ret;
}
+# Escape $value in /bin/sh array way, find/append key and set escaped value.
+sub set_sh_array
+{
+ my ($file, $key, $value) = @_;
+ my $ret;
+
+ &Utils::Report::enter ();
+ &Utils::Report::do_report ("replace_sh", $key, $file);
+
+ # This will expunge the whole var if the value is empty.
+ if ($value eq "")
+ {
+ $ret = &split ($file, $key, "[ \t]*=[ \t]*");
+ }
+ else
+ {
+ $value="(".$value.")";
+ $ret = &split ($file, $key, "[ \t]*=[ \t]*", $value);
+ }
+
+ &Utils::Report::leave ();
+ return $ret;
+}
+
# Escape $value in /bin/sh way, find/append key and set escaped value, make sure line har
sub set_sh_export
{