mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-12-08 23:03:46 +00:00
33 lines
805 B
Diff
33 lines
805 B
Diff
--- 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
|
|
{
|