develooper Front page | perl.datetime | Postings from July 2003

Re: ultimate date module released - Acme::Current

Thread Previous | Thread Next
July 14, 2003 16:44
Re: ultimate date module released - Acme::Current
Message ID:
>>>>> "Dave" == Dave Rolsky <> writes:

Dave> That's quite a maintenance challenge you've taken on!

It's all automated.  Once an hour, I run this, located in my src
directory.  When the gmtime rolls over, PAUSE gets tapped.

In about six weeks, I should have more distros than even Damian.


    use strict;

    use FindBin qw($Bin);
    BEGIN { chdir $Bin or die "Cannot chdir to $Bin: $!" }

    use WWW::Mechanize;
    use File::Copy;

    my $CPAN_DIR = "/web/pic/CPAN";
    my $CPAN_URI = "";
    my $CPAN_USER = "merlyn";
    chomp(my $CPAN_PASSWORD = <STDIN>);

    my @now = gmtime;
    my ($Y, $M, $D) = ($now[5]+1900, $now[4]+1, $now[3]);

      local @ARGV = "lib/Acme/";
      local $^I = "~";
      while (<>) {
        s/\$YEAR = \d+; \$MONTH = \d+; \$DAY = \d+;/\$YEAR = $Y; \$MONTH = $M; \$DAY = $D;/;

    system "perl Makefile.PL >/dev/null && make all test tardist </dev/null >/dev/null 2>&1";

    unlink glob "*.tar";		# in case it blocked from a .gz
    submit_to_cpan($_) for glob "Acme-Current-*.tar.gz";

    sub submit_to_cpan {
      my $local_file = shift;

      my $cpan_dir_file = "$CPAN_DIR/$local_file";
      return if -f $cpan_dir_file;	# already submitted;

      copy $local_file, $cpan_dir_file;
      my $agent = WWW::Mechanize->new();

      $agent->credentials('', 'PAUSE',
                          $CPAN_USER, $CPAN_PASSWORD);
      $agent->follow(qr/Upload a file/);
      print "$local_file submitted\n";
      ### print $agent->current_form->dump;

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<> <URL:>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See for onsite and open-enrollment Perl training!

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About