source: branches/unified_backend/devutils/svn_commit.pl.in @ 594

Last change on this file since 594 was 72, checked in by yermol, 16 years ago

work-in-progress commit to Unified Backend branch.

added devutils directory for server side convenience scripts

svn_commit.pl front-end to svn commit to update about.html on submit.
makedocs.pl to generates JSDoc and PHPDoc documentation.

added Configure.php script to generate cli script paths and to set perms.
added index.html
added README, INSTALL, README_DEVELOPERS
added examples/simple_example.html
added ddt.js debug trace message to text area class.
htmlarea.js reworked

  • reorganized to group related pieces together.
  • JSDoc headers added to all methods
  • debugging trace messages added to entry points of most methods.
  • Property svn:executable set to *
File size: 2.9 KB
Line 
1#![@@PERL@@]
2
3# [NOSTRIP
4# -----------------------------------------------------------------
5# Copyright (C) DTLink, LLC.
6# http://www.dtlink.com and http://www.formvista.com
7# -----------------------------------------------------------------
8# This code is distributed under the the sames terms as Xinha
9# itself. (HTMLArea license based on the BSD license)
10#
11# Please read license.txt in this package for details.
12#
13# All software distributed under the Licenses is provided strictly on
14# an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
15# IMPLIED, AND DTLINK LLC HEREBY DISCLAIMS ALL SUCH
16# WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
17# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT,
18# OR NON-INFRINGEMENT.
19# ------------------------------------------------------------------
20# NOSTRIP]
21
22
23# Preprocess popups/about.html
24#
25# Preprocess popups/about.html so that it is out of date by incrementing
26# a commit index in the file. This will force the SVN revision history
27# variables to be updated on commit making those values reflect the actual
28# version of the repository we're dealing with.
29#
30# This was originally written in PHP until we discovered, to our dismay,
31# that PHP's CLI system() call can't handle running vi.
32#
33# Currently this only runs under Unix/Linux.
34#
35# FIXME: We need to verify that supported webservers call use the HTTP_HOST variable
36#
37
38# make sure we're not running from a webserver.
39
40if ( $_ENV{ "HTTP_HOST" } != NULL )
41   {
42   print( "No\n" );
43   exit -1;
44   }
45
46# -----------------------------------------------------------------
47# incrememt_commit_count()
48#
49
50sub increment_commit_count
51{
52
53my( $inpath, $outpath ) = @_;
54
55print( "Attempting to pull in '$inpath' to '$outpath'\n" );
56
57unless ( open( INFILE, $inpath ) )
58   {
59   print( "ERROR - unable open file '$inpath'\n" );
60   return( false );
61   }
62
63my( $content ) = "";
64
65while ( <INFILE> )
66   {
67   $content .= $_;
68   }
69
70# find the number
71
72$content =~ s/\[@@(.*?)@@\]/$a=$1+1;"[@@" . $a . "@@]"/e;
73
74# write the file out.
75
76unless ( open( OUTFILE, ">" . $outpath ))
77   {
78   print( "ERROR - unable to open '$outpath'\n" );
79   return( false );
80   }
81
82print OUTFILE $content;
83
84}       # end of increment_commit_count()
85
86# ------------------------------------------------------
87# make sure we are running from the xinha root directory
88
89if ( ! -e ".xinha_root" )
90   {
91   print( "svn_commit must be run from the Xinha root directory.\n" );
92   print( "Usage: ./utils/svn_commit.pl\n" );
93   exit -1;
94   }
95
96# before we go updating the about.html file make sure that we're out
97# of date
98
99if ( `svn status -q` eq "" )
100   {
101   print( "XINHA is up to date with the Subversion repository\n" );
102   exit -1;
103   }
104
105# update popups/about.html
106
107if ( increment_commit_count( "./popups/about.html", "./popups/about.html" ))
108        {
109   print( "popups/about.html updated.\n" );
110   }
111else
112   {
113   print( "popups/about.html NOT updated due to error\n" );
114   }
115
116# run the commit.
117
118system( "svn commit" );
119
120# END
Note: See TracBrowser for help on using the repository browser.