Skip to content
Snippets Groups Projects
Commit 70559557 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

Remove things not needed anymore with the new site config

parent 94b6b125
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl
use warnings;
use strict;
use POSIX qw(strftime);
sub nightly {
strftime "%Y%m%d", localtime;
}
our $CONFIG = do $ENV{GLUONDIR} . '/site/site.conf.pl';
my $script = shift @ARGV;
do $script;
use warnings;
my %config;
sub add_config {
my ($prefix, $c) = @_;
foreach my $key (keys $c) {
my $val = $c->{$key};
if (ref($val) eq 'HASH') {
add_config($key . '.', $val);
}
elsif (ref($val) eq 'ARRAY') {
$config{'@' . $prefix . $key . '@'} = join ' ', map {s/'/'\\''/g; "'" . $_ . "'"} @{$val}
}
unless (ref($val)) {
$config{'@' . $prefix . $key . '@'} = $val;
}
}
}
add_config('', $CONFIG);
my $regex = join '|', map {quotemeta} keys %config;
for (<>) {
s/($regex)/${config{$1}}/g;
print;
}
#!/usr/bin/env bash
set -e
declare -a IN
for ((i = 1; i < $#; i++)); do
IN[$i]="${!i}"
done
OUT="$(readlink -f "${!#}")"
for S in "${IN[@]}"; do (
cd "$(dirname "$S")"
NAME="$(basename "$S")"
IFS='
'
for FILE in $(find "$NAME" -type f); do
D="$(dirname "$FILE")"
mkdir -p "$OUT/$D"
(cd "$GLUONDIR"; scripts/configure.pl scripts/generate.pl) < "$FILE" > "$OUT/$FILE"
chmod --reference="$FILE" "$OUT/$FILE"
done
); done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment