]> git.donarmstrong.com Git - debbugs.git/blobdiff - scripts/html-control.in
* Remove getmaintainers from Debbugs::CGI
[debbugs.git] / scripts / html-control.in
index beb82d347632d73a87df1b3941257af5bca10a48..5dd8e0dcec218400179511be42a60799833b10bf 100755 (executable)
@@ -1,13 +1,19 @@
 #!/usr/bin/perl
-# $Id: html-control.in,v 1.3 1999/09/20 05:40:07 gecko Exp $
+# $Id: html-control.in,v 1.12 2004/10/26 14:00:05 cjwatson Exp $
 
-use POSIX;
+use POSIX qw(strftime tzset ENOENT);
+$ENV{"TZ"} = 'UTC';
+tzset();
+
+$config_path = '/etc/debbugs';
+$lib_path = '/usr/lib/debbugs';
+
+require("$config_path/config");
+require("$lib_path/errorlib");
+$ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
 
-require '/etc/debbugs/config';
-require '/usr/lib/debbugs/errorlib';
-$ENV{'PATH'}= '/usr/lib/debbugs'.$ENV{'PATH'};
 chdir("$gSpoolDir") || die "chdir spool: $!\n";
-#push(@INC,'/usr/lib/debbugs');
+#push(@INC,"$lib_path");
 
 &filelock("html.fcntl-lock");
 
@@ -28,7 +34,7 @@ if (open(US,'updateseqs') && -f 'stamp.html') {
     rename("stamp.html","stamp.html.run") or &quit("rename stamp.html: $!");
 } else {
     $lastsub=0;
-    chop($lastmain=`TZ=GMT date '+%Y%m%d%H%M%S'`);
+    $lastmain = strftime "%Y%m%d%H%M%S", localtime;
     $args= '-full';
     unlink('stamp.html') || $!==&ENOENT or &quit("excise stale stamp.html: $!");
 }
@@ -56,8 +62,8 @@ print(MM <<END
 From: $gMaintainerEmail ($gProject $gBug Tracking System)
 To: $gMirrorList\@$gListDomain
 Subject: $gProject $gBugs autoupdate 259012
-Message-ID: <handle.htmlup.$seqmid\@gEmailDebian>
-X-$gProject=PR: update $sequences
+Message-ID: <handle.htmlup.$seqmid\@$gEmailDomain>
+X-$gProject-PR: update $sequences
 
 END
       ) or nonawful("write html-data.mail header: $!");
@@ -66,26 +72,27 @@ print(MM <<END
 From: $gMaintainerEmail ($gProject $gBug Tracking System)
 To: $gMaintainerEmail
 Subject: $gProject $gBugs autoupdate 259012
-Message-ID: <handle.htmlup.$seqmid\@gEmailDebian>
-X-$gProject=PR: update $sequences
+Message-ID: <handle.htmlup.$seqmid\@$gEmailDomain>
+X-$gProject-PR: update $sequences
 
 END
       ) or nonawful("write html-data.mail header: $!");
 }
 close(MM) or nonawful("close html-data.mail: $!");
 
-runshell("/usr/lib/debbugs/db2html $args 2>&1 >html-data $gWebDir/db",
+runshell("$lib_path/db2html $args 2>&1 >html-data $gWebDir/db",
          sub { &nonawful; });
-runshell("/usr/lib/debbugs/html-install $gWebDir/db <html-data 2>&1",sub { &quit; });
-runshell("gzip -9 html-data 2>&1",sub { &quit; });
+runshell("$lib_path/html-install $gWebDir/db <html-data 2>&1",sub { &quit; });
+#runshell("gzip -9 html-data 2>&1",sub { &quit; });
 #runshell("btoa 2>&1 <html-data.gz >>html-data.mail",sub { &quit; });
 #runshell('2>&1 '.join(' ',('/usr/lib/sendmail','-f'."$gMaintainerEmail")).' -oem -oi -t <html-data.mail',
 #         sub { &quit; });
 
 rename("stamp.html.new","stamp.html") or &quit("install new stamp.html: $!");
 
-unlink("html-data.gz") or warn "remove html-data.gz: $!";
-unlink("html-data.mail") or warn "remove html-data.mail: $!";
+unlink("html-data") or warn "remove html-data: $!";
+#unlink("html-data.gz") or warn "remove html-data.gz: $!";
+#unlink("html-data.mail") or warn "remove html-data.mail: $!";
 unlink("stamp.html.run") || $!==&ENOENT or warn "remove stamp.html.run: $!";
 
 print "sequences $lastmain $lastsub\n";