From d9a7b30d990e2bab67413fe11acb2d9f7096a61a Mon Sep 17 00:00:00 2001 From: in2 Date: Tue, 16 Dec 2003 06:33:57 +0000 Subject: set correct file permission after building git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1414 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- staticweb/manbuilder.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'staticweb') diff --git a/staticweb/manbuilder.pl b/staticweb/manbuilder.pl index 3b992a98..60b3de96 100755 --- a/staticweb/manbuilder.pl +++ b/staticweb/manbuilder.pl @@ -21,16 +21,17 @@ sub main ); foreach( @ARGV ){ + undef $idx; if( /\.db$/ ){ next if( $Getopt::Std::opt_n ); print "building idx for $_\n"; - tie %db, 'DB_File', $_, O_RDONLY, 0666, $DB_HASH; + tie %db, 'DB_File', $_, O_RDONLY, 0664, $DB_HASH; $idx = OurNet::FuzzyIndex->new(substr($_, 0, -3). '.idx'); buildidx(); } else{ - tie %db, 'DB_File', "$_.db", O_CREAT | O_RDWR, 0666, $DB_HASH; + tie %db, 'DB_File', "$_.db", O_CREAT | O_RDWR, 0664, $DB_HASH; $idx = OurNet::FuzzyIndex->new("$_.idx") if( !$Getopt::Std::opt_n ); build("/home/bbs/man/boards/".substr($_, 0, 1)."/$_", ''); @@ -38,6 +39,11 @@ sub main $db{_gzip} = 1 if( $Getopt::Std::opt_z ); untie %db; } + + if( $idx ){ + undef $idx; + chmod 0664, "$_.idx"; + } } } -- cgit v1.2.3