File: save_the_files.pl

package info (click to toggle)
tct 1.07-9
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,828 kB
  • ctags: 1,128
  • sloc: perl: 9,604; ansic: 4,861; makefile: 516; sh: 77
file content (53 lines) | stat: -rw-r--r-- 905 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
#  Sorta like save the whales, 'cept save the files.
# copy everything out of the "$save_these_files" config file.
#

require "vault_cp.pl";

sub process_files_to_save {

print "saving all files in $save_these_files (in &process_files_to_save())\n" if $verbose;

die "Can't open $save_these_files (in process_files_to_save())\n" unless open(STF, "$save_these_files");

# $debug = 1;

# 
# Go over each of the files
#
while (<STF>) {
	next if (/^\s*#/ || /^\s*$/);
	chop();
	print "IN FI: $_\n" if $debug;
	# print "IN FI: $_\n";

	$files = $_;

	if (!$CORPSE) { $files =~ s@\$CORPSE@@; }
	else          { $files =~ s@\$CORPSE@$CORPSE@; }

	print "next file: $files\n" if $debug;

	while (<${files}>) {
		print "Going into while...\n" if $debug;


		$file = $_;

		print "next file: $file\n" if $debug;

		&vault_file_cp($file);

		}
	}

# $debug = 0;

closedir(DIR);

}

# &process_files_to_save();

1;