File: mkdirinfo

package info (click to toggle)
ftpmirror 1.2l-9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 304 kB
  • ctags: 138
  • sloc: perl: 3,318; sh: 198; makefile: 31
file content (44 lines) | stat: -rwxr-xr-x 960 bytes parent folder | download | duplicates (4)
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
#!/usr/local/bin/perl
;#
;# Copyright (c) 1996, Ikuo Nakagawa.
;# All rights reserved.
;#
;# $Id: mkdirinfo,v 1.2 1997/05/22 08:39:27 ikuo Exp $
;#
;# mkdirinfo - generate directory information.
;#

;# IMPORTANT: change to the package directory
$prefix = '/usr/local/lib/ftpmirror';
unshift(@INC, $prefix);

;# modules
use Getopt::Std;
require "dirinfo.pl";
require "log.pl";

;# prototypes - for perl5.003 or later
;# sub usage();

;# store he basename of current program name
($program) =~ ($0 =~ m#([^/]+)$#);

;# print usage and exit
sub usage {
 die("Usage: $program [-rd] directory [directory...]\n");
}

;# parsing options and do real work
&getopts("rd") || &usage;
$opt_r = 0 if !defined($opt_r);
$opt_d = 0 if !defined($opt_d);

;#
log::mask("DEBUG") if $opt_d;

;# ARGV are directories to make dirinfo
for $dir (@ARGV) {
 # first, we go to the working directory
 chdir($dir) || do { warn("chdir($dir): $!"), next };
 dirinfo::update_dirinfo($dir);
}