[LON-CAPA-cvs] cvs: loncom /build Makefile getcvsdate.pl lpml_parse.pl doc/loncapafiles buildfiles.lpml loncapafiles.lpml

raeburn raeburn at source.lon-capa.org
Fri Jan 27 18:50:58 EST 2012


raeburn		Fri Jan 27 23:50:58 2012 EDT

  Added files:                 
    /loncom/build	getcvsdate.pl 

  Modified files:              
    /doc/loncapafiles	loncapafiles.lpml buildfiles.lpml 
    /loncom/build	Makefile lpml_parse.pl 
  Log:
  - Bug 6535 
   Eliminate creation of unnecessary .lpmlsave files during install.
    - PDF manuals are not included in CVS, but instead are built dynamically
      when running make build (e.g., when creating a tarball for release).
      - Assign new categoryname: pdf manual and include check for this in
        lpml_parse.pl so filecompare.pl is called with -b3 flag.
    - license/about.html and loncapa_apache.conf in release tree are modified
      by make aboutVERSION, so developer installations can include version
      and datestamp of build in version info.
      - make aboutVERSION now includes code to set the last modified time to
        the CVS commit date, so unanted .lpmlsave files will no longer be created.
    - new file: getcvsdate.pl now included in loncom/build -- used to extract
      commit date/time from CVS/Entries for about.html and loncapa_apache.conf
  
  
-------------- next part --------------
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.783 doc/loncapafiles/loncapafiles.lpml:1.784
--- doc/loncapafiles/loncapafiles.lpml:1.783	Wed Jan 25 00:58:53 2012
+++ doc/loncapafiles/loncapafiles.lpml	Fri Jan 27 23:50:49 2012
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.783 2012/01/25 00:58:53 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.784 2012/01/27 23:50:49 raeburn Exp $ -->
 
 <!--
 
@@ -194,6 +194,14 @@
   <chmod dist='default'>0700</chmod><chown dist='default'>www:www</chown>
   <abbreviation>directory</abbreviation>
 </category>
+<category name="pdf manual" type="runtime">
+  <chmod dist='default'>0444</chmod><chown dist='default'>www:www</chown>
+  <abbreviation>manual</abbreviation>
+</category>
+<category name="pdf manual" type="development">
+  <chmod dist='default'>0644</chmod><chown dist='default'>www:www</chown>
+  <abbreviation>manual</abbreviation>
+</category>
 </categories>
 <rpm>
   <rpmSummary>Basic files for running a LON-CAPA server.</rpmSummary>
@@ -975,7 +983,7 @@
 </table>
 </note>
 </file>
-<file>
+<file type="postaboutversion">
 <source>loncom/loncapa_apache.conf</source>
 <target dist='default'>etc/httpd/conf/loncapa_apache.conf</target>
 <target dist='sles10 sles11 suse10.1 suse10.2 suse10.3 suse11.1 suse11.2 suse11.3 suse11.4 suse12.1 debian5 debian6 ubuntu6 ubuntu8 ubuntu10'>etc/apache2/loncapa_apache.conf</target>
@@ -2031,7 +2039,7 @@
 HTTPi webserver readme 
 </description>
 </file>
-<file>
+<file type="postaboutversion">
 <source>loncom/license/about.html</source>
 <target dist='default'>home/httpd/html/adm/about.html</target>
 <categoryname>interface file</categoryname>
@@ -2486,7 +2494,7 @@
 <file>
 <source>doc/help/author.manual.pdf</source>
 <target dist='default'>home/httpd/html/adm/help/author.manual.pdf</target>
-<categoryname>handler</categoryname>
+<categoryname>pdf manual</categoryname>
 <description>
 The PDF Author's Manual
 </description>
@@ -2515,7 +2523,7 @@
 <file>
 <source>doc/help/course.manual.pdf</source>
 <target dist='default'>home/httpd/html/adm/help/course.manual.pdf</target>
-<categoryname>interface file</categoryname>
+<categoryname>pdf manual</categoryname>
 <description>
 The PDF Course Manual
 </description>
@@ -2544,7 +2552,7 @@
 <file>
 <source>doc/help/domain.manual.pdf</source>
 <target dist='default'>home/httpd/html/adm/help/domain.manual.pdf</target>
-<categoryname>interface file</categoryname>
+<categoryname>pdf manual</categoryname>
 <description>
 The PDF Domain Manual
 </description>
Index: doc/loncapafiles/buildfiles.lpml
diff -u doc/loncapafiles/buildfiles.lpml:1.28 doc/loncapafiles/buildfiles.lpml:1.29
--- doc/loncapafiles/buildfiles.lpml:1.28	Mon Sep 19 18:45:58 2011
+++ doc/loncapafiles/buildfiles.lpml	Fri Jan 27 23:50:49 2012
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- buildfiles.lpml -->
 
-<!-- $Id: buildfiles.lpml,v 1.28 2011/09/19 18:45:58 raeburn Exp $ -->
+<!-- $Id: buildfiles.lpml,v 1.29 2012/01/27 23:50:49 raeburn Exp $ -->
 
 <!--
 
@@ -428,6 +428,18 @@
 </note>
 </file>
 <file>
+<source>loncom/build/getcvsdate.pl</source>
+<target dist='default'>getcvsdate.pl</target>
+<categoryname>system file</categoryname>
+<description>
+script to get CVS commit date/time for a file from file's entry in
+CVS/Entries for directory containing the file
+</description>
+<note>
+</note>
+</file>
+
+<file>
 <source>loncom/build/loncaparestoreconfigurations</source>
 <target dist='default'>loncaparestoreconfigurations</target>
 <categoryname>system file</categoryname>
Index: loncom/build/Makefile
diff -u loncom/build/Makefile:1.199 loncom/build/Makefile:1.200
--- loncom/build/Makefile:1.199	Tue Nov  8 07:40:04 2011
+++ loncom/build/Makefile	Fri Jan 27 23:50:57 2012
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 
-# $Id: Makefile,v 1.199 2011/11/08 07:40:04 raeburn Exp $
+# $Id: Makefile,v 1.200 2012/01/27 23:50:57 raeburn Exp $
 
 # TYPICAL USAGE of this Makefile is primarily for two targets:
 # "make build" and "make install".
@@ -558,40 +558,52 @@
 aboutVERSION:
 	cp -p -v $(SOURCE)/loncom/license/about.html \
 	$(SOURCE)/loncom/license/about.html.orig
-	cp -p -v $(SOURCE)/loncom/loncapa_apache.conf \
-	$(SOURCE)/loncom/loncapa_apache.conf.orig
 	cat $(SOURCE)/loncom/license/about.html | \
 	perl -e '$$d=`date +"%Y%m%d%H"`;chomp($$d);while(<>){s/(\<\!\-\- VERSION \-\-\>|\d+\.\d+\.CVS_HEAD\-\d{10})/$(SHOWVERSION)-$$d/; print;}' > \
 	$(SOURCE)/loncom/license/about.html.new
 	mv -v $(SOURCE)/loncom/license/about.html.new \
 	$(SOURCE)/loncom/license/about.html
+	touch --date="$(shell echo `perl getcvsdate.pl \
+	$(SOURCE)/loncom/license/CVS/Entries about.html`)" \
+	$(SOURCE)/loncom/license/about.html
+	cp -p -v $(SOURCE)/loncom/loncapa_apache.conf \
+	$(SOURCE)/loncom/loncapa_apache.conf.orig
 	cat $(SOURCE)/loncom/loncapa_apache.conf | \
 	perl -e '$$d=`date +"%Y%m%d%H"`;chomp($$d);while(<>){s/(\<\!\-\- VERSION \-\-\>|\d+\.\d+\.CVS_HEAD\-\d{10})/$(SHOWVERSION)-$$d/; print;}' > \
 	$(SOURCE)/loncom/loncapa_apache.conf.new
 	mv -v $(SOURCE)/loncom/loncapa_apache.conf.new \
 	$(SOURCE)/loncom/loncapa_apache.conf
+	touch --date="$(shell echo `perl getcvsdate.pl \
+	$(SOURCE)/loncom/CVS/Entries loncapa_apache.conf`)" \
+	$(SOURCE)/loncom/loncapa_apache.conf
 
 postaboutVERSION:
 	if (test -e $(SOURCE)/loncom/license/about.html.orig) && \
-		(diff $(SOURCE)/loncom/license/about.html \
+		(diff $(SOURCE)/loncom/license/about.html.orig \
 		$(SOURCE)/loncom/license/about.html > /dev/null); then \
 		mv -v $(SOURCE)/loncom/license/about.html.orig \
 		$(SOURCE)/loncom/license/about.html; \
 	elif (test -e $(SOURCE)/loncom/license/about.html.orig) && \
-		!(diff $(SOURCE)/loncom/license/about.html \
+		!(diff $(SOURCE)/loncom/license/about.html.orig \
 		$(SOURCE)/loncom/license/about.html > /dev/null); then \
 		rm -f $(SOURCE)/loncom/license/about.html.orig; \
 	fi
+	touch --date="$(shell echo `perl getcvsdate.pl \
+	$(SOURCE)/loncom/license/CVS/Entries about.html`)" \
+	$(SOURCE)/loncom/license/about.html
 	if (test -e $(SOURCE)/loncom/loncapa_apache.conf.orig) && \
-		(diff $(SOURCE)/loncom/license/about.html \
-		$(SOURCE)/loncom/license/about.html > /dev/null); then \
+		(diff $(SOURCE)/loncom/loncapa_apache.conf.orig \
+		$(SOURCE)/loncom/loncapa_apache.conf > /dev/null); then \
 		mv -v $(SOURCE)/loncom/loncapa_apache.conf.orig \
 		$(SOURCE)/loncom/loncapa_apache.conf; \
 	elif (test -e $(SOURCE)/loncom/loncapa_apache.conf.orig) && \
-		!(diff $(SOURCE)/loncom/license/about.html \
-		$(SOURCE)/loncom/license/about.html > /dev/null); then \
+		!(diff $(SOURCE)/loncom/loncapa_apache.conf.orig \
+		$(SOURCE)/loncom/loncapa_apache.conf > /dev/null); then \
 		rm -f $(SOURCE)/loncom/loncapa_apache.conf.orig; \
 	fi
+	touch --date="$(shell echo `perl getcvsdate.pl \
+	$(SOURCE)/loncom/CVS/Entries loncapa_apache.conf`)" \
+	$(SOURCE)/loncom/loncapa_apache.conf
 
 # ========= *** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***
 
Index: loncom/build/lpml_parse.pl
diff -u loncom/build/lpml_parse.pl:1.59 loncom/build/lpml_parse.pl:1.60
--- loncom/build/lpml_parse.pl:1.59	Mon Jan 23 12:48:45 2012
+++ loncom/build/lpml_parse.pl	Fri Jan 27 23:50:57 2012
@@ -12,7 +12,7 @@
 # The LearningOnline Network with CAPA
 # lpml_parse.pl - Linux Packaging Markup Language parser
 #
-# $Id: lpml_parse.pl,v 1.59 2012/01/23 12:48:45 raeburn Exp $
+# $Id: lpml_parse.pl,v 1.60 2012/01/27 23:50:57 raeburn Exp $
 #
 # Written by Scott Harrison, codeharrison at yahoo.com
 #
@@ -1324,7 +1324,8 @@
 		return $result;
 	    }
             my $bflag='-b1';
-            $bflag='-b3' if $dependencies or $buildlink;
+            $bflag='-b3' if (($dependencies or $buildlink) or 
+                             ($categoryname eq 'pdf manual'));
 	    if ($tokeninfo[2]{type} eq 'private') {
 		return <<END;
 $buildtest	\@if (test -e "${sourceroot}/${source}") && (test -e "${targetroot}/${target}"); then \\

Index: loncom/build/getcvsdate.pl
+++ loncom/build/getcvsdate.pl
#!/usr/bin/perl

# The LearningOnline Network with CAPA
# getcvsdate.pl - script to get CVS commit date for a file from CVS/Entries.
#
# $Id: getcvsdate.pl,v 1.1 2012/01/27 23:50:57 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
# LON-CAPA is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LON-CAPA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
#

use strict;

# ------------------------------------------------------------------ Invocation
my $invocation=<<END;
getcvsdate.pl [PATH TO CVS/Entries] [FILE]

END

unless (@ARGV) {
    print $invocation;
    exit 1;
}

my %month_to_twodigit = (
    Jan => '01',
    Feb => '02',
    Mar => '03',
    Apr => '04',
    May => '05',
    Jun => '06',
    Jul => '07',
    Aug => '08',
    Sep => '09',
    Oct => '10',
    Nov => '11',
    Dec => '12',
);

if (@ARGV==2) {
    my $path = $ARGV[0];
    my $file = $ARGV[1];
    my $datetime;
    if ($path ne '' && $file ne '') {
        if (-e $path) {
            if (open(my $fh,"<$path")) {
                while(<$fh>) {
                    chomp();
                    if (m{\Q$file\E/[\d.]+/+([^/]+)/}) {
                        my ($wday,$month,$day,$clock,$yr) = split(/\s+/,$1);
                        if (exists($month_to_twodigit{$month})) { 
                            $datetime = $yr.'-'.$month_to_twodigit{$month}.'-'.$day.' '.$clock.' +0000';
                        }
                        last;
                    }
                }
                close($fh);
            }
        }
    }
    print $datetime;
}

=pod

=head1 NAME

getcvsdate.pl - script to get CVS commit date for a file from CVS/Entries.

=head1 SYNOPSIS

getcvsdate.pl [PATH TO CVS/Entries] [FILE]

=head1 DESCRIPTION

getcvsdate.pl can be used to retrieve the CVS commit date/time for a prticular
file from the corresponding entry in CVS/Entries.

The date is returned in the following format:
YYYY-MM-DD HH:MM:SS +0000

where +0000 (in HHMM) is the (assumed zero) timezone offset from UTC. 

This script is invoked in Makefile (within aboutVERSION and postaboutVERSION
targets) to set the modification dates for two files containing version 
information which are modified during the LON-CAPA installation process. 
In this use case the time string generated by a call to getcvsdate.pl for 
loncapa_apache.conf and about.html is passed as the input for the date argument
in a call to the touch utility, e.g.,

touch --date="$(shell echo `perl getcvsdate.pl 
$(SOURCE)/loncom/license/CVS/Entries about.html`)" 
$(SOURCE)/loncom/license/about.html

=cut



More information about the LON-CAPA-cvs mailing list