chiark / gitweb /
bin: Remove some scripts I no longer use (they used to be part of the
authorColin Watson <cjwatson@chiark.greenend.org.uk>
Sun, 29 Dec 2002 19:12:23 +0000 (19:12 +0000)
committerColin Watson <cjwatson@chiark.greenend.org.uk>
Sun, 29 Dec 2002 19:12:23 +0000 (19:12 +0000)
public_html build process).

expandvars [deleted file]
format [deleted file]
genheaders [deleted file]

diff --git a/expandvars b/expandvars
deleted file mode 100755 (executable)
index d9d7fd9..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#! /usr/bin/perl -w
-use strict;
-use Getopt::Long;
-
-sub usage ()
-{
-    print STDERR <<"EOF";
-Usage: $0 [options] source-filename
-EOF
-    print STDERR <<'EOF';
-where options are:
-
-  -h, -?, --help            print this message
-  -c,     --conf FILENAME   use FILENAME as configuration file, default
-                            '.headers'
-  -d,     --directory DIR   change to directory DIR
-  -s,     --suffix SUFFIX   use SUFFIX for all output filenames, default null
-
-The configuration file is of the following form:
-
-# Comments are preceded by hashes and extend to the end of the line.
-# List of names of parameters to be substituted (as $param1$, $param2$,
-# etc.) in order.
-param1 param2 ...
-
-# Multiple records, one per line.
-# Each record consists of an output filename (automatically used as the value
-# of the name parameter; suffix will be added if present) followed by a list of
-# parameter values. Fields are space-separated. Double quotes (") may be used
-# to delimit fields containing spaces, and double quotes themselves may be
-# escaped with backslashes.
-
-EOF
-    exit;
-}
-
-my %opts = (conf => '.headers', directory => '', suffix => '');
-GetOptions(\%opts, 'help|h|?', 'conf|c=s', 'directory|d=s', 'suffix|s=s');
-my $source = shift;
-usage unless defined $source;
-
-usage if $opts{'help'};
-chdir $opts{'directory'} if $opts{'directory'};
-open CONF, $opts{'conf'} or
-    die "Can't open configuration file " . $opts{'conf'} . ": $!";
--r $source or die "Can't read source file $source: $!";
-
-my @params;
-while (<CONF>)
-{
-    next if /^#/ || /^\s+/;
-    @params = split;
-    last;
-}
-
-usage unless @params;
-
-# Eek. This matches the next (optionally double-quoted) string on the line.
-my $stringre = qr/\s*("(?:[^\\]|\\.)*?"|(?:[^\\]|\\.)+?)(?:\s|$)/;
-while (<CONF>)
-{
-    next if /^#/ || /^\s+/;
-    my $confline = $_;
-    next unless $confline =~ /$stringre/g;
-    my $target = $1;
-    my %values = (name => $target);
-    my @conffields = ($confline =~ /\G$stringre/g);
-    my $offset = 0;
-    for (my $i = 0; $i + $offset <= $#params && $i <= $#conffields; $i++)
-    {
-       $offset++ while $params[$i + $offset] eq 'name';
-       last if $i + $offset > $#params;
-       my $value = $conffields[$i];
-       $value =~ s/^"(.*)"$/$1/;
-       $value =~ s/\\(.)/$1/g;
-       $values{$params[$i + $offset]} = $value;
-    }
-
-    # Do the substitution in the source file.
-    open SOURCE, $source or die "Can't open source file $source: $!";
-    open TARGET, ">$target" . $opts{'suffix'} or
-       die "Can't open target file $target" . $opts{'suffix'} . ": $!";
-    select TARGET;
-    while (<SOURCE>)
-    {
-       foreach my $param (keys %values)
-       {
-           my $value = $values{$param};
-           s/\$\Q$param\E\$/$value/g;
-       }
-       s/\$\$/\$/g;
-       print;
-    }
-    select STDOUT;
-    close TARGET;
-}
-
diff --git a/format b/format
deleted file mode 100755 (executable)
index 08a9d45..0000000
--- a/format
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# Parameterizes a document.
-# Input arguments Param1 Value1 Param2 Value2 ... will replace
-# $Param1$ with Value1, $Param2$ with Value2, and so on.
-
-# Arguments with spaces in must be quoted.
-
-function getargs ()
-{
-       while [ $# != 0 -a $# != 1 ]; do
-               SUBST=${2//\'/\'\\\'\'};
-               SUBST=${SUBST//\//\\\/};
-               echo -n -;
-               echo -n e \'s/\\\$$1\\\$/$SUBST/g\'\ ;
-               shift 2;
-       done
-       echo -n -;
-       echo -n e \'s/\\\$\%/\$/g\' -e \'s/\\\$\\\$/\$/g\'\ ;
-       echo -n $1;
-}
-
-if [ "$1" == "-v" ]; then
-       shift;
-       bash --norc -vc "sed `getargs \"$@\"`";
-else
-       bash --norc -c "sed `getargs \"$@\"`";
-fi
-
diff --git a/genheaders b/genheaders
deleted file mode 100755 (executable)
index d9035f3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /bin/sh
-expandvars -s .header.ssi header.ssi