chiark / gitweb /
No need for Makefile-etc now - we hope. tag-2001-10-07-before-debianise-reorg
authorianmdlvl <ianmdlvl>
Sun, 7 Oct 2001 18:17:14 +0000 (18:17 +0000)
committerianmdlvl <ianmdlvl>
Sun, 7 Oct 2001 18:17:14 +0000 (18:17 +0000)
backup/Makefile-etc [deleted file]
backup/backuplib.pl
backup/fsys.all
backup/fsys.pt0
backup/fsys.pt1
backup/fsys.pt2

diff --git a/backup/Makefile-etc b/backup/Makefile-etc
deleted file mode 100644 (file)
index 62b0b2f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# Makefile-etc
-# for putting in /etc/backup to make fsys.* from ifsys.*
-#
-# This file is part of chiark backup, a system for backing up GNU/Linux and
-# other UN*X-compatible machines, as used on chiark.greenend.org.uk.
-#
-# chiark backup is:
-#  Copyright (C) 1997-1998,2000-2001 Ian Jackson <ian@chiark.greenend.org.uk>
-#  Copyright (C) 1999 Peter Maydell <pmaydell@chiark.greenend.org.uk>
-#
-# This is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2, or (at your option) any later version.
-#
-# This is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-all:           fsys.pt0 fsys.pt1 fsys.pt2 fsys.all
-
-fsys.pt%:      ifsys.prefixes ifsys.pt% ifsys.end
-               cat $^ >$@.new && mv -f $@.new $@
-
-fsys.all:      ifsys.prefixes ifsys.pt0 ifsys.pt1 ifsys.pt2 ifsys.end
-               cat $^ >$@.new && mv -f $@.new $@
-
index 37b3d7936f6c8bf3568739f77e5b56bcc315c6fd..26a8533d1150e85ee3e2fa7079f742ddf2df5647 100644 (file)
@@ -73,11 +73,14 @@ sub killprocesses {
 # Trailing whitespace is ignored. Lines of the form 'prefix foo bar'
 # are handled specially, as arex lines 'exclude regexp'; otherwise 
 # we just shove the line into @fsys and let parsefsys deal with it.
 # Trailing whitespace is ignored. Lines of the form 'prefix foo bar'
 # are handled specially, as arex lines 'exclude regexp'; otherwise 
 # we just shove the line into @fsys and let parsefsys deal with it.
-sub readfsys ($) {
-    my ($fsnm) = @_;
-    open F, "$etc/fsys.$fsnm" or die "Filesystems $fsnm unknown ($!).\n";
+
+sub readfsysfile ($) {
+    my ($fn) = @_;
+    my ($fh,$sfn);
+    $fh= new IO::File "$fn", "r" or die "cannot open fsys file $fn ($!).\n";
     for (;;) {
     for (;;) {
-       $_= <F> or die "unexpected EOF in $etc/fsys.$fsnm\n"; chomp; s/\s*$//;
+       $!=0; $_= <$fh> or die "unexpected EOF in $fn ($!)\n";
+       chomp; s/\s*$//;
        last if m/^end$/;
        next unless m/\S/;
        next if m/^\#/;
        last if m/^end$/;
        next unless m/\S/;
        next if m/^\#/;
@@ -89,11 +92,23 @@ sub readfsys ($) {
             push @excldir,$1;
         } elsif (m/^exclude\s+(\S.*\S)$/) {
             push @excl,$1;
             push @excldir,$1;
         } elsif (m/^exclude\s+(\S.*\S)$/) {
             push @excl,$1;
+       } elsif (m/^include\s+(\S.*\S)$/) {
+           $sfn =~ s/^\./fsys./;
+           $sfn = "$etc/$sfn" if $sfn !~ m,^/,;
+           readfsysfile($sfn);
         } else {
            push @fsys,$_;
        }
     }
         } else {
            push @fsys,$_;
        }
     }
-    close F or die $!;
+    close $fn or die $!;
+}
+
+sub readfsys ($) {
+    my ($fsnm) = @_;
+    my ($fsf);
+    $fsf= "$etc/fsys.$fsnm";
+    stat $fsf or die "Filesystems $fsnm unknown ($!).\n";
+    readfsysfile($fsf);
 }
 
 # Parse a line from a filesystem definition file. We expect the line
 }
 
 # Parse a line from a filesystem definition file. We expect the line
index 26b8a9c1c128dde24f890f42d9e12420e4f85024..50e9b575d7d7055f13b79510884ff9feaedb8565 100644 (file)
@@ -1,44 +1,4 @@
-#
-
-prefix davenant ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' davenant 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-prefix xenophobe ssh -o 'BatchMode yes' -c blowfish -o 'Compression no' xenophobe 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-
-prefix khem ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' -o 'CompressionLevel 1' khem 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-
-prefix kadath ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' -o 'CompressionLevel 1' kadath -l ian 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH really'
-prefix-df kadath /bin/df -t noprocfs,nfs
-#
-
-/usr/src               dump    davenant
-
-/var                   dump    davenant
-/u                     dump    davenant
-/                      dump
-
-/                      dump    davenant
-
-/export/mirror/work    cpio    davenant
-
-/usr                   dump    davenant
-/boot                  dump    davenant
-#
-
-/                      dump    kadath
-
-/usr                   dump    kadath
-/var                   dump    kadath
-/home                  dump    kadath
-
-/var                   dump    khem
-/home                  dump    khem
-/                      dump    khem
-
-/usr                   dump    khem
-#
-
-/                      dump    xenophobe
-
-/dos/c                 cpio
-/dos/d                 cpio
-
-end
+include ifsys.prefixes
+include        ifsys.pt0
+include ifsys.pt1
+include ifsys.pt2
index f14c1143a2bcf1f5e53c99094cb7f7d196b76e9a..9f19fb5d1bfc831b147febe584955e4260d82bdc 100644 (file)
@@ -1,25 +1,2 @@
-#
-
-prefix davenant ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' davenant 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-prefix xenophobe ssh -o 'BatchMode yes' -c blowfish -o 'Compression no' xenophobe 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-
-prefix khem ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' -o 'CompressionLevel 1' khem 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-
-prefix kadath ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' -o 'CompressionLevel 1' kadath -l ian 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH really'
-prefix-df kadath /bin/df -t noprocfs,nfs
-#
-
-/usr/src               dump    davenant
-
-/var                   dump    davenant
-/u                     dump    davenant
-/                      dump
-
-/                      dump    davenant
-
-/export/mirror/work    cpio    davenant
-
-/usr                   dump    davenant
-/boot                  dump    davenant
-
-end
+include ifsys.prefixes
+include ifsys.pt0
index e1118b369d87673d0e8756e9283883d53d21e85d..0dbab9e42f794141a2543222dd5c1d90cbd5af05 100644 (file)
@@ -1,24 +1,2 @@
-#
-
-prefix davenant ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' davenant 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-prefix xenophobe ssh -o 'BatchMode yes' -c blowfish -o 'Compression no' xenophobe 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-
-prefix khem ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' -o 'CompressionLevel 1' khem 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-
-prefix kadath ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' -o 'CompressionLevel 1' kadath -l ian 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH really'
-prefix-df kadath /bin/df -t noprocfs,nfs
-#
-
-/                      dump    kadath
-
-/usr                   dump    kadath
-/var                   dump    kadath
-/home                  dump    kadath
-
-/var                   dump    khem
-/home                  dump    khem
-/                      dump    khem
-
-/usr                   dump    khem
-
-end
+include ifsys.prefixes
+include ifsys.pt1
index ebbb1856fd1f533b3a076a409981398d122df173..3e78fa413711c72523c1ae373230da08071774a7 100644 (file)
@@ -1,17 +1,2 @@
-#
-
-prefix davenant ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' davenant 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-prefix xenophobe ssh -o 'BatchMode yes' -c blowfish -o 'Compression no' xenophobe 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-
-prefix khem ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' -o 'CompressionLevel 1' khem 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH'
-
-prefix kadath ssh -o 'BatchMode yes' -c blowfish -o 'Compression yes' -o 'CompressionLevel 1' kadath -l ian 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH really'
-prefix-df kadath /bin/df -t noprocfs,nfs
-#
-
-/                      dump    xenophobe
-
-/dos/c                 cpio
-/dos/d                 cpio
-
-end
+include ifsys.prefixes
+include ifsys.pt2