Author: ranger
Date: Thu Feb 14 20:46:32 2008
New Revision: 1130

URL: 
http://svn.finkproject.org/websvn/listing.php?sc=1&rev=1130&repname=user%3a+ranger
Log:
add timestamps, and also more detailed categories

Modified:
    trunk/experimental/scripts/tree-diff.pl

Modified: trunk/experimental/scripts/tree-diff.pl
URL: 
http://svn.finkproject.org/websvn/diff.php?path=/trunk/experimental/scripts/tree-diff.pl&rev=1130&repname=user%3a+ranger
==============================================================================
--- trunk/experimental/scripts/tree-diff.pl (original)
+++ trunk/experimental/scripts/tree-diff.pl Thu Feb 14 20:46:32 2008
@@ -76,10 +76,14 @@
        my @categories = qw(Packages);
        my $sortkey = ucfirst(basename($file));
 
-#      if (-s $PACKAGE_FILE > 500000) {
-#              print $OUTPUT "</mediawiki>\n";
-#              new_package_file();
-#      }
+       my $type = "";
+       if ($file =~ /\.info$/) {
+               $type = 'Info File';
+       } elsif ($file =~ /\.(patch|diff)$/) {
+               $type = 'Patch File';
+       } else {
+               $type = 'Unknown File Type';
+       }
 
        my $maintainer;
        my $text = "";
@@ -107,10 +111,10 @@
 
        if (not exists $TO_FILES->{$file}) {
                print "< $file: exists in $from, but not in $to\n";
-               push(@categories, 'Removed In Pangocairo', 'Modified Packages');
+               push(@categories, 'Removed In Pangocairo', 'Modified Packages', 
$type . ' Removed In Pangocairo');
        } elsif (not exists $FROM_FILES->{$file}) {
                print "> $file: exists in $to, but not in $from\n";
-               push(@categories, 'Added In Pangocairo', 'Modified Packages');
+               push(@categories, 'Added In Pangocairo', 'Modified Packages', 
$type . ' Added In Pangocairo');
        } elsif ($FROM_FILES->{$file} ne $TO_FILES->{$file}) {
                print "! $file: has changed\n";
                if ($file =~ /\.info$/) {
@@ -121,10 +125,10 @@
                        push(@categories, 'Patch Files');
                }
 
-               push(@categories, 'Updated In Pangocairo', 'Modified Packages');
+               push(@categories, 'Updated In Pangocairo', 'Modified Packages', 
$type . ' Updated In Pangocairo');
        } else {
                print "  $file\n";
-               push(@categories, 'Unchanged In Pangocairo');
+               push(@categories, 'Unchanged In Pangocairo', $type . ' 
Unchanged In Pangocairo');
        }
 
        $text .= "\n";
@@ -138,6 +142,12 @@
 
        $text = clean_up_text($text);
 
+       my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
+       $mon += 1;
+       $year += 1900;
+
+       my $timestamp = sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ', $year, $mon, 
$mday, $hour, $min, $sec);
+
        $ID++;
        print $OUTPUT <<END;
   <page>
@@ -145,7 +155,7 @@
     <id>$ID</id>
     <revision>
       <id>$REVISION</id>
-      <timestamp>2008-02-14T16:52:31Z</timestamp>
+      <timestamp>$timestamp</timestamp>
       <contributor>
         <ip>24.225.84.3</ip>
       </contributor>


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to