[Ttssh2-commit] [4613] ソースが更新されている時だけchmをコンパイルするようにした

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 9月 3日 (土) 14:22:04 JST


Revision: 4613
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4613
Author:   maya
Date:     2011-09-03 14:22:04 +0900 (Sat, 03 Sep 2011)

Log Message:
-----------
ソースが更新されている時だけchmをコンパイルするようにした

Modified Paths:
--------------
    trunk/doc/makechm.bat
    trunk/installer/2sjis.pl

Added Paths:
-----------
    trunk/doc/htmlhelp_update_check.pl


-------------- next part --------------
Added: trunk/doc/htmlhelp_update_check.pl
===================================================================
--- trunk/doc/htmlhelp_update_check.pl	                        (rev 0)
+++ trunk/doc/htmlhelp_update_check.pl	2011-09-03 05:22:04 UTC (rev 4613)
@@ -0,0 +1,65 @@
+#! /usr/bin/perl
+
+#
+# HTMLƒwƒ‹ƒvƒ\[ƒX‚ª‚ЂƂ‚łàXV‚³‚ê‚Ä‚¢‚é‚©ƒ`ƒFƒbƒN‚·‚é
+#
+# Usage(ActivePerl):
+#  perl htmlhelp_update_check.pl ja chm_file_name
+#
+
+use Cwd;
+ @ dirstack = (); 
+
+$ret = do_main($ARGV[0], $ARGV[1]);
+if ($ret) {
+	print "updated";
+}
+
+exit(0);
+
+sub do_main {
+	my($path, $chm) = @_;
+	my(@filestat) = stat "$path/$chm";
+
+	return get_file_paths($path, $filestat[9]);
+}
+
+
+sub get_file_paths {
+	my ($top_dir, $chmupdated)= @_;
+	my @paths=();
+	my @temp = ();
+
+	#-- ƒJƒŒƒ“ƒg‚̈ꗗ‚ðŽæ“¾ --#
+	opendir(DIR, $top_dir);
+	@temp = readdir(DIR);
+	closedir(DIR);
+	foreach my $path (sort @temp) {
+		next if( $path =~ /^\.{1,2}$/ );              # '.' ‚Æ '..' ‚̓XƒLƒbƒv
+		next if( $path =~ /^\.svn$/ );                # '.svn' ‚̓XƒLƒbƒv
+		next if( $path =~ /^.\.chm$/ );               # '*.chm' ‚̓XƒLƒbƒv
+		
+		my $full_path = "$top_dir" . '/' . "$path";
+		
+		if( -d "$top_dir/$path" ){                      #-- ƒfƒBƒŒƒNƒgƒŠ‚̏ꍇ‚ÍŽ©•ªŽ©g‚ðŒÄ‚яo‚·
+			if (&get_file_paths("$full_path", $chmupdated)) {
+				return 1;
+			}
+		} else {
+			if (&check_file($full_path, $chmupdated)) {
+				return 1;
+			}
+		}
+	}
+	return 0;
+}
+
+sub check_file {
+	my($filename, $chmupdated) = @_;
+	my(@filestat) = stat $filename;
+	
+	if ($filestat[8] > $chmupdated) {
+		return 1;
+	}
+	return 0;
+}

Modified: trunk/doc/makechm.bat
===================================================================
--- trunk/doc/makechm.bat	2011-09-03 02:28:25 UTC (rev 4612)
+++ trunk/doc/makechm.bat	2011-09-03 05:22:04 UTC (rev 4613)
@@ -1,9 +1,16 @@
+set HELP_COMPILER=C:\progra~1\htmlhe~1\hhc.exe
+set updated=
+
 CALL convtext.bat
 
+for /f "delims=" %%i in ('perl htmlhelp_update_check.pl ja teratermj.chm') do @set updated=%%i
+if "%updated%"=="updated" (
 perl htmlhelp_index_make.pl ja html > ja\Index.hhk
+%HELP_COMPILER% ja\teraterm.hhp
+)
+
+for /f "delims=" %%i in ('perl htmlhelp_update_check.pl en teraterm.chm') do @set updated=%%i
+if "%updated%"=="updated" (
 perl htmlhelp_index_make.pl en html > en\Index.hhk
-
-set HELP_COMPILER=C:\progra~1\htmlhe~1\hhc.exe
-
-%HELP_COMPILER% ja\teraterm.hhp
 %HELP_COMPILER% en\teraterm.hhp
+)

Modified: trunk/installer/2sjis.pl
===================================================================
--- trunk/installer/2sjis.pl	2011-09-03 02:28:25 UTC (rev 4612)
+++ trunk/installer/2sjis.pl	2011-09-03 05:22:04 UTC (rev 4613)
@@ -19,3 +19,6 @@
 }
 close OUT;
 close IN;
+
+my(@filestat) = stat $in;
+utime $filestat[8], $filestat[9], $out;



Ttssh2-commit メーリングリストの案内
Back to archive index