changeset 215:967ecb541df9

Updated to improve the date + time handling of files. Added manpage for chronicle-spooler
author Steve Kemp <steve@steve.org.uk>
date Tue, 15 Apr 2008 20:42:34 +0100
parents 3f538fac68eb
children 33f86c258df5
files bin/chronicle bin/chronicle-spooler debian/changelog debian/rules
diffstat 4 files changed, 35 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/bin/chronicle	Mon Apr 14 19:20:44 2008 +0100
+++ b/bin/chronicle	Tue Apr 15 20:42:34 2008 +0100
@@ -1597,14 +1597,21 @@
     }
 
     #
-    #  Make an entry date for the XML feed, if we have a date.
+    #  Get the Hours::Mins::Seconds from the Date: psuedo-header
     #
     my $time = str2time($date);
-    if ($time)
+    my $hms  = time2str("%H:%M:%S",$time);
+
+
+    #
+    #  If the time is missing from the Date: psuedo-header
+    # we need to magic them up.  Use the mtime of the file.
+    #
+    if ($hms eq '00:00:00')
     {
 
         #
-        #  Get the details of the file.
+        #  Find all the details from the file.
         #
         my (
              $dev,   $ino,     $mode, $nlink, $uid,
@@ -1612,19 +1619,18 @@
              $ctime, $blksize, $blocks
         ) = stat($filename);
 
-        #
-        #  Get the modification hours.
-        #
-        my ( $sec, $min, $hour ) = localtime($mtime);
-
+
+        $hms = time2str("%H:%M:%S",$mtime);
+    }
+
+
+    #
+    #  If we found a time then we're OK, and can store it away.
+    #
+    if ( $time )
+    {
         #
-        #  Pad to two digits for each of the hours, minutes, and seconds.
-        #
-        my $hms = sprintf( "%02d:%02d:%02d", $hour, $min, $sec );
-
-        #
-        # Store the published date & time away.
-        # [Collapsing multiple spaces]
+        #  RSS 2
         #
         $entry{ 'pubdate' } = time2str( "%a, %e %b %Y $hms GMT", $time );
         $entry{ 'pubdate' } =~ s/  +/ /g;
--- a/bin/chronicle-spooler	Mon Apr 14 19:20:44 2008 +0100
+++ b/bin/chronicle-spooler	Tue Apr 15 20:42:34 2008 +0100
@@ -166,7 +166,7 @@
 #
 #  If we should run our command do so.
 #
-if ( $CONFIG{ 'post-move' } )
+if ( ( $CONFIG{ 'post-move' } ) && $live )
 {
     if ( $CONFIG{ 'test' } )
     {
--- a/debian/changelog	Mon Apr 14 19:20:44 2008 +0100
+++ b/debian/changelog	Tue Apr 15 20:42:34 2008 +0100
@@ -1,3 +1,10 @@
+chronicle (2.6-2) unstable; urgency=low
+
+  * Include manpage for chronicle-spooler.
+  * Include patch from MJ Ray for correct time handling of entries.
+
+ -- Steve Kemp <skx@debian.org>  Mon, 14 Apr 2008 20:00:02 +0000
+
 chronicle (2.6-1) unstable; urgency=low
 
   * New upstream release:
--- a/debian/rules	Mon Apr 14 19:20:44 2008 +0100
+++ b/debian/rules	Tue Apr 15 20:42:34 2008 +0100
@@ -13,14 +13,15 @@
 
 build-stamp:
 	dh_testdir
-	pod2man bin/chronicle > chronicle.1
+	pod2man bin/chronicle         > chronicle.1
+	pod2man bin/chronicle-spooler > chronicle-spooler.1
 	touch $@
 
 clean:
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp configure-stamp
-	rm -f chronicle.1
+	rm -f chronicle.1 chronicle-spooler.1
 	dh_clean
 
 install: build
@@ -32,6 +33,8 @@
 	$(MAKE) prefix=$(CURDIR)/debian/chronicle install
 	mv $(CURDIR)/debian/chronicle/usr/local/bin/chronicle \
 		$(CURDIR)/debian/chronicle/usr/bin
+	mv $(CURDIR)/debian/chronicle/usr/local/bin/chronicle-spooler \
+		$(CURDIR)/debian/chronicle/usr/bin
 	rmdir $(CURDIR)/debian/chronicle/usr/local/bin/
 	rmdir $(CURDIR)/debian/chronicle/usr/local
 
@@ -42,7 +45,7 @@
 	dh_testroot
 	dh_installchangelogs
 	dh_installdocs
-	dh_installman chronicle.1
+	dh_installman chronicle.1 chronicle-spooler.1
 	dh_compress
 	dh_fixperms
 	dh_perl