summaryrefslogtreecommitdiff
path: root/make/configure.pm
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-05-16 14:25:24 +0100
committerSadie Powell <sadie@witchery.services>2020-05-16 14:25:24 +0100
commit87bb27a7a794d413bd75ea17d4e1f83e207c8bdc (patch)
tree25fbe66a0db74f36f561d99c52e86127ce52b218 /make/configure.pm
parent5a95d907d45c972c883fc0e763db1b960ecff55a (diff)
Implement support for portable installations.
Diffstat (limited to 'make/configure.pm')
-rw-r--r--make/configure.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/make/configure.pm b/make/configure.pm
index 1ce5a1c1e..bd3591e3c 100644
--- a/make/configure.pm
+++ b/make/configure.pm
@@ -272,10 +272,12 @@ sub parse_templates($$$) {
chomp $line;
# Does this line match a variable?
- while ($line =~ /(@(\w+?)@)/) {
- my ($variable, $name) = ($1, $2);
+ while ($line =~ /(@(\w+?)(?:\|(\w*))?@)/) {
+ my ($variable, $name, $default) = ($1, $2, $3);
if (defined $settings{$name}) {
$line =~ s/\Q$variable\E/$settings{$name}/;
+ } elsif (defined $default) {
+ $line =~ s/\Q$variable\E/$default/;
} else {
print_warning "unknown template variable '$name' in $_!";
last;