updated to clean up compiler issues with how functions were used from basis namespace;
[feisty_meow.git] / scripts / archival / snarf_opensim.pl
1 #!/usr/bin/perl
2
3 ###############################################################################
4 #                                                                             #
5 #  Name   : snarf_opensim                                                     #
6 #  Author : Chris Koeritz                                                     #
7 #  Rights : Copyright (C) 1996-$now by Author                                 #
8 #                                                                             #
9 #  Purpose:                                                                   #
10 #                                                                             #
11 #    Backs up the full set of opensim configuration files.                    #
12 #                                                                             #
13 ###############################################################################
14 #  This program is free software; you can redistribute it and/or modify it    #
15 #  under the terms of the GNU General Public License as published by the Free #
16 #  Software Foundation; either version 2 of the License or (at your option)   #
17 #  any later version.  See: "http://www.gruntose.com/Info/GNU/GPL.html" for a #
18 #  version of the License.  Please send any updates to "fred@gruntose.com".   #
19 ###############################################################################
20
21 require "shared_snarfer.pl";
22
23 use Env qw(HOME);
24
25 &initialize_snarfer;  # let the snarfer hook us in.
26
27 # get the number attachment and increment it for the next use.
28 local($number) = &retrieve_number("aa_backup");
29
30 # variables used throughout here.
31 local($snarf_file_base) = &snarf_prefix("config-opensim");
32 local($snarf_file) = &snarf_name($snarf_file_base, $number);
33
34 # store the archive number in the file for retrieval on the other side.
35 &backup_number("aa_backup", $snarf_file_base, $number);
36
37 # the top directory where everything we're grabbing lives.
38 local($root) = &canonicalize(&glob_list("$HOME/opensim"));
39
40 # grab the top level stuff.
41 #&backup_files($snarf_file_base, $number, $HOME, ".",
42 #    ("*.sh"));
43 &backup_files($snarf_file_base, $number, $root, ".",
44     ("*.sh"));
45
46 # snag the main config files.
47 &backup_files($snarf_file_base, $number, $root, "bin",
48     ("OpenSim.ini", "Robust.ini", "OpenSim.exe.config", "Robust.exe.config"));
49
50 # snag the configuration include file.
51 &backup_files($snarf_file_base, $number, $root, "bin/config-include", ("GridCommon.ini"));
52
53 # get the region definitions.
54 &backup_hierarchy($snarf_file_base, $number, "$root", "bin/Regions");
55
56 # now rename the file so only the unpacker can access it.
57 &rename_archive($snarf_file);
58
59 exit 0;
60