lxr-commits Mailing List for LXR Cross Referencer (Page 6)
Brought to you by:
ajlittoz
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(11) |
Sep
(13) |
Oct
(11) |
Nov
(19) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(11) |
Feb
(14) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
(8) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
(2) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(26) |
Jul
(83) |
Aug
(4) |
Sep
(4) |
Oct
(9) |
Nov
|
Dec
(17) |
2005 |
Jan
(1) |
Feb
(71) |
Mar
(1) |
Apr
(3) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
(6) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(35) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(12) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(30) |
Apr
(55) |
May
(28) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2013 |
Jan
(35) |
Feb
|
Mar
(7) |
Apr
(12) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(32) |
Oct
|
Nov
(45) |
Dec
(18) |
2014 |
Jan
(9) |
Feb
|
Mar
(10) |
Apr
(2) |
May
(4) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(4) |
Dec
|
Update of /cvsroot/lxr/lxr/templates In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30378/templates Modified Files: datastorage.conf.part global.conf.part lxr.conf lxrkernel.conf Added Files: tree-ignore.conf.part tree-server1.conf.part tree-server2.conf.part Log Message: templates/lxr.conf, lxrkernel.conf, datastorage.conf.part, global.conf.part, tree-ignore.conf.part, tree-server1.conf.part, tree-server2.conf.part Upgrade to new LCL version, create new @ADD'ed files so that there is a better commonality between lxr.conf and lxrkernel.conf --- NEW FILE: tree-ignore.conf.part --- #- -*- mode: perl -*- #- LXR master configuration file #- Tree configuration section #- Subdirectory subsection #- Ignore definitions #- #- $Id: tree-ignore.conf.part,v 1.1 2013/09/03 08:45:12 ajlittoz Exp $ #- #- #- This file fragment is meant to be "included" to form the #- complete configuration file. #- #- #- ############################### #- # Tree configuration sections # #- ############################### #- #- # Subdirectory subsection # #- #=========================# # Tree-specific files to ignore (in every directory of the tree) # Extend and uncomment the following copy of the global # parameter to override: # , 'ignorefiles' => # '^\\.|~$|\\.(o|a|orig)$|^CVS$|^core$' # Directories to always ignore. These usually are the SCM's # private directories which possibly may contain non-public # project history. Note that .xxx directories are hidden # by an internal hard-coded rule. Redundant example: # , 'ignoredirs' => ['CVSROOT', 'CVS', '.git'] #@MSG Some directories may contain non-public project data (binaries, #@MSG compilers caches, SCM control data, ...). They can be hidden from LXR. #@KEEPON --- Directory to ignore, e.g. CVSROOT or CVS? (hit return to stop) #@ ON first , 'ignoredirs' => [qw( #@ ENDON %A% #@ ON epilog )] #@ ENDON #@ENDK --- NEW FILE: tree-server1.conf.part --- #- -*- mode: perl -*- #- LXR master configuration file #- Tree configuration section #- Server configuration subsection part 1 #- #- $Id: tree-server1.conf.part,v 1.1 2013/09/03 08:45:12 ajlittoz Exp $ #- #- #- This file fragment is meant to be "included" to form the #- complete configuration file. #- #- #- ############################### #- # Tree configuration sections # #- ############################### #- #- # Server configuration subsection # #- #=================================# #@LOG Configuring LXR server parameters #- #- NOTE --------------------------------------------------- # #- ---- 'baseurl' and 'baseurl_aliases' are deprecated ---- # #- ---- in favor of 'host_names'. ---- # #- ---- See "Global configuration section" ---- # #- ---- ---- # #- ---- 'host_names' takes precedence if 'baseurl' is ---- # #- ---- also defined. ---- # #- ---- ---- # #- ---- Support for 'baseurl' is maintained for ---- # #- ---- compatibility with existing LXRs. ---- # #- ---- ---- # #- Configuration for http://192.168.1.1/lxr. #- baseurl is used to select configuration block. #- 'baseurl' => 'http://192.168.1.1/lxr' # Put your URL here #- # baseurl_aliases allows other URLs to be used to reach the site #- # comment this out if you do not want any aliases #- , 'baseurl_aliases' => #- [ 'http://localhost/lxr' #- , 'http://mydomain/lxr' #- ] #- ---- ---- # #- ---- End of deprecated parameters ---- # #- ---- If you use them, uncomment the comma below ---- # #- -------------------------------------------------------- # #- , #@DEFINE treeid='' #- #@IF 'H' eq "%_routing%" #@ LOG Configuring individual host name or IP (as http://...) #@ MSG Remember: they must be unique! #@ ASK,hostname --- Host name?; -2 , 'host_names' => [ '%hostname%' #@ KEEPON --- Alias name ? (hit return to stop) , '%A%' #@ ENDK ] , #@ELSEIF 'P' eq "%_routing%" #@ ASK,treeid --- Prefix for host name?; -2 'host_names' => [ '%scheme%//%treeid%.%hostname%' #@ ARRAY schemealiases,S hostaliases,A portaliases,P #@ ON none # Put here aliases for host name, such as # , '//%treeid%.localhost' # , 'http://%treeid%.mycomputer.outside.domain:12345' #@ ENDON , '%S%//%treeid%.%A%:%P%' #@ ENDA ] , #@ELSE #@ENDIF #- #@MSG The virtual root is the fixed URL part after the hostname. #- - Virtual root is slightly different depending on context - - #- - because we want to handle everything with a single LXR instance - - #- - except for the "section" case (though it can through symbolic - - #- - links). - - #@IF 'N' eq "%_routing%" #- - Single tree context - - #@ IF %_shared% #@ DEFINE virtroot="%virtrootbase%" #@ MSG You previously defined the virtual root as %virtroot% #@ ELSE #@ DEFINE virtroot='' #@ MSG No virtual root for dedicated server #@ ENDIF #- #- - Multiple trees context - - #- - a) Routing through section path #@ELSEIF 'S' eq "%_routing%" #@ MSG All section paths must be unique! #@ ASK,virtroot --- Full virtual root? (e.g. /section/project/title); -2 #- - b) Routing through extraction from section path #@ELSEIF 'E' eq "%_routing%" #@ IF 'b' eq "%_virtrootpolicy%" #@ MSG The tree needs to be uniquely identified as e.g. %virtrootbase%/the_tree #@ ASK,treeid --- Tree designation for URL? (e.g. the_tree); -2 #@ DEFINE virtroot="%virtrootbase%/%treeid%" #@ ELSEIF 'c' eq "%_virtrootpolicy%" #@ REMIND The custom multiple trees management method must contain #@ REMIND at least the server section name %virtrootbase% and a unique #@ REMIND tree designation (in an order compatible with the URL magic #@ REMIND in the server configuration files). #@ ASK,virtroot --- Full virtual root? (e.g. %virtrootbase%/something); -2 #@ ELSE #@ ERROR Unknown multiple trees management choice! #@ ERROR If you did not tamper with context file, #@ ERROR report this as a bug. #@ DEFINE virtroot='*** ERROR ***' #@ ENDIF %_virtrootpolicy% #- - c) Other cases: host name, host prefix, argument #@ELSE #@ IF %_shared% #@ IF %_commonvirtroot% #@ DEFINE virtroot="%virtrootbase%" #@ MSG You previously defined the virtual root as %virtroot% #@ ELSE #@ ASK,virtroot --- Virtual root? (i.e. URL part after host); -1; ; %virtrootbase% #@ ENDIF #@ ELSE #@ DEFINE virtroot='' #@ MSG No virtual root for dedicated server #@ ENDIF #@ENDIF #- - End of virtroot differences - - #- #@IF !%_commonvirtroot% 'virtroot' => '%virtroot%' , #@ELSE #@ENDIF #- The following @DEFINE allows automatic transfer of correct 'virtroot' #- into lighttpd-lxrserver.conf. #@IF '' eq "%virtroot%" #@ DEFINE virtroot='/' #@ENDIF --- NEW FILE: tree-server2.conf.part --- #- -*- mode: perl -*- #- LXR master configuration file #- Tree configuration section #- Server configuration subsection part 2 #- #- $Id: tree-server2.conf.part,v 1.1 2013/09/03 08:45:12 ajlittoz Exp $ #- #- #- This file fragment is meant to be "included" to form the #- complete configuration file. #- #- #- ############################### #- # Tree configuration sections # #- ############################### #- #- # Server configuration subsection # #- #=================================# #- #- - In single tree context, just output a reminder in case of change; #- - for multiple trees, generate the speed switch buttons #@IF %_singlecontext% # Button title to switch to this tree when multiple # trees are managed by LXR # , 'shortcaption' => 'Tree' #@ELSE #@ ASK Do you want a speed switch button for this tree ?; 1; yes, no; Y, N #@ IF "%A%" eq 'Y' #@ IF %treeid% #@ ASK --- Short title for button? (e.g. XYZZY); -1; ; %treeid% #@ ELSE #@ ASK --- Short title for button? (e.g. XYZZY); -2 #@ ENDIF , 'shortcaption' => '%A%' #@ ENDIF #@ IF 'A' eq "%_routing%" #@ ASK,treeid --- Tree identification in URL? (e.g. the-tree); -2 , 'treename' => '%treeid%' #@ ENDIF #@ENDIF %_singlecontext% #- #@ASK Do you need a specific encoding for this tree ?; 2; yes, no; Y, N #@IF "%A%" eq 'Y' #@ ASK --- Encoding name? (e.g. iso-8859-1); -2 # Character encoding (overrides default) , 'encoding' => '%A%' #@ENDIF # a link of the form (prefix)($filepath)(postfix) is generated when viewing a file # example for cvsweb: # , 'cvswebprefix' => 'http://cvs.myhost.com/cgi-bin/cvsweb.cgi' # , 'cvswebpostfix' => '?cvsroot=rootname' # example for viewcvs: # , 'cvswebprefix' => 'http://cvs.myhost.com/cgi-bin/viewcvs.cgi/myroot' # , 'cvswebpostfix' => '' Index: datastorage.conf.part =================================================================== RCS file: /cvsroot/lxr/lxr/templates/datastorage.conf.part,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- datastorage.conf.part 11 Jan 2013 12:04:27 -0000 1.1 +++ datastorage.conf.part 3 Sep 2013 08:45:11 -0000 1.2 @@ -24,8 +24,7 @@ #- ----- MySQL ----- #@m: #@ IF !%_globaldb% -#@ ASK --- Database name?; -2 -#@ DEFINE DB_name="%A%" +#@ ASK,DB_name --- Database name?; -2 #@ ENDIF , 'dbname' => 'dbi:mysql:dbname=%DB_name%' #- @@ -36,16 +35,14 @@ #- ----- PostgreSQL ----- #@p: #@ IF !%_globaldb% -#@ ASK --- Database name?; -2 -#@ DEFINE DB_name="%A%" +#@ ASK,DB_name --- Database name?; -2 #@ ENDIF , 'dbname' => 'dbi:Pg:dbname=%DB_name%;host=localhost' #- #- ----- SQLite ----- #@s: #@ IF !%_globaldb% -#@ ASK --- Database file? (e.g. /home/myself/storage.db); -2 -#@ DEFINE DB_name="%A%" +#@ ASK,DB_name --- Database file? (e.g. /home/myself/storage.db); -2 #@ ENDIF , 'dbname' => 'dbi:SQLite:dbname=%DB_name%' #@ENDC %_dbengine% @@ -53,10 +50,8 @@ #- #@IF %_dbengine% ne "s" #@ IF !%_dbuser% -#@ ASK --- DB user name?; -1; ; lxr -#@ DEFINE DB_tree_user="%A%" -#@ ASK --- DB password?; -1; ; lxrpw -#@ DEFINE DB_tree_password="%A%" +#@ ASK,DB_tree_user --- DB user name?; -1; ; lxr +#@ ASK,DB_tree_password --- DB password?; -1; ; lxrpw , 'dbuser' => '%DB_tree_user%' , 'dbpass' => '%DB_tree_password%' @@ -64,10 +59,8 @@ #@ ELSEIF !%_globaldb% #@ ASK,C Do you want to override the global '%DB_user%' user name?; 2; yes,no; Y,N #@ IF %C% eq "Y" -#@ ASK --- DB user name?; -1; ; lxr -#@ DEFINE DB_tree_user="%A%" -#@ ASK --- DB password?; -1; ; lxrpw -#@ DEFINE DB_tree_password="%A%" +#@ ASK,DB_tree_user --- DB user name?; -1; ; lxr +#@ ASK,DB_tree_password --- DB password?; -1; ; lxrpw , 'dbuser' => '%DB_tree_user%' , 'dbpass' => '%DB_tree_password%' @@ -82,8 +75,7 @@ #- #- #@IF !%_dbprefix% -#@ ASK --- DB table prefix?; -1; ; lxr_ -#@ DEFINE DB_tbl_prefix="%A%" +#@ ASK,DB_tbl_prefix --- DB table prefix?; -1; ; lxr_ , 'dbprefix' => '%DB_tbl_prefix%' #- @@ -91,8 +83,7 @@ #@ ASK,C Do you want to override the global '%DB_global_prefix%' table prefix?; 2; yes,no; Y,N #@ IF %C% eq "Y" -#@ ASK --- DB table prefix?; -1; ; lxr_ -#@ DEFINE DB_tbl_prefix="%A%" +#@ ASK,DB_tbl_prefix --- DB table prefix?; -1; ; lxr_ , 'dbprefix' => '%DB_tbl_prefix%' #@ ELSE # If you need multiple lxr configurations in one database, set different table Index: global.conf.part =================================================================== RCS file: /cvsroot/lxr/lxr/templates/global.conf.part,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- global.conf.part 31 Aug 2013 19:30:32 -0000 1.4 +++ global.conf.part 3 Sep 2013 08:45:11 -0000 1.5 @@ -14,12 +14,43 @@ #- ################################ #- { + # + # Master mode (where to find the tree name) # + #===========================================# + + # Possible values are: + # - 'single' single-tree context, no tree name (implicit) + # - 'host' one host per tree + # - 'prefix' generic host prefixed with tree name + # - 'section' one section per tree (to be handled through symbolic + # links or duplication) + # - 'embedded' tree name embedded in section path + # - 'argument' first argument is tree name [PREFERRED] + # CAUTION! + # Changing this parameter after initial configuration may + # require adjustements to other parameters! + +#@CASE %_routing% +#@N: + 'routing' => 'single' +#@H: + 'routing' => 'host' +#@P: + 'routing' => 'prefix' +#@S: + 'routing' => 'section' +#@E: + 'routing' => 'embedded' +#@A: + 'routing' => 'argument' +#@ENDC + # Auxiliary tools subsection # #============================# #@LOG Configuring auxiliary tool paths #- Place where lxr can write temporary files - 'tmpdir' => '/tmp' + , 'tmpdir' => '/tmp' #- Define this OR the swish-e variable depending which search engine you want to use. #- Path to glimpse executables. @@ -44,18 +75,23 @@ # Computer DNS names subsection # #================================ -#@LOG Configuring host name or IP (as http://...) -#-#@ASK --- Host name?; -2 -#- , 'host_names' => [ '%A%' -#@LOG Host name previously defined as %scheme%%hostname% - , 'host_names' => [ '%scheme%%hostname%' -#@KEEPON --- Alias name ? (hit return to stop) - , '%A%' -#@ENDK -#- , //localhost -#- , https://192.168.1.1 -#- , 'http://mycomputer.outside.domain:12345' +#@IF 'H' ne "%_routing%" && 'P' ne "%_routing%" +#@ LOG Host name previously defined as %scheme%//%hostname% + , 'host_names' => [ '%scheme%//%hostname%' +#@ ARRAY schemealiases,S hostaliases,A portaliases,P +#@ ON none + # Put here aliases for host name, such as + # , '//localhost' + # , 'https://192.168.1.1' + # , 'http://mycomputer.outside.domain:12345' +#@ ENDON + , '%S%//%A%:%P%' +#@ ENDA ] +#@ELSE + + # Specific host names are defined in tree sections +#@ENDIF # HTML subsection # #=================# @@ -129,33 +165,33 @@ # , 'iconfolder' => 'small-icons/' # Don't forget the final / above. # , 'icons' => -# { '[gm]?awk' => 'application-x-awk.png' -# , 'c|pc' => 'text-x-csrc.png' -# , 'h|hh' => 'text-x-chdr.png' -# , 'c\+\+|cc|cpp|cxx' => 'text-x-c++src.png' -# , 'hpp|hxx|h\+\+' => 'text-x-c++hdr.png' -# , 'java' => 'text-x-java.png' -# , 'js' => 'application-x-javascript.png' -# , 'ma?k' => 'text-x-makefile.png' -# , 'plx?|pm|perl' => 'application-x-perl.png' -# , 'php3?|phtml' => 'application-x-php.png' -# , 'py|python|px' => 'text-x-python.png' -# , 'sh|ba?sh|ksh|zsh|m4' => 'text-x-script.png' -# , 's?html?' => 'text-html.png' -# , 'css' => 'text-css.png' -# , 'p|pas' => 'text-x-pascal.png' -# , 'patch' => 'text-x-patch.png' -# , 'pdf' => 'application-pdf.png' -# , 'sql|pk(s|b)' => 'text-x-sql.png' -# , 'rb|ruby' => 'application-x-ruby.png' -# , 'txt' => 'text-plain.png' -# , 'ui' => 'text-xml.png' -# , '.*\~' => 'application-x-trash' +# { '[gm]?awk' => 'mimetypes/application-x-awk.png' +# , 'c|pc' => 'mimetypes/text-x-csrc.png' +# , 'h|hh' => 'mimetypes/text-x-chdr.png' +# , 'c\+\+|cc|cpp|cxx' => 'mimetypes/text-x-c++src.png' +# , 'hpp|hxx|h\+\+' => 'mimetypes/text-x-c++hdr.png' +# , 'java' => 'mimetypes/text-x-java.png' +# , 'js' => 'mimetypes/application-x-javascript.png' +# , 'ma?k' => 'mimetypes/text-x-makefile.png' +# , 'plx?|pm|perl' => 'mimetypes/application-x-perl.png' +# , 'php3?|phtml' => 'mimetypes/application-x-php.png' +# , 'py|python|px' => 'mimetypes/text-x-python.png' +# , 'sh|ba?sh|ksh|zsh|m4' => 'mimetypes/text-x-script.png' +# , 's?html?' => 'mimetypes/text-html.png' +# , 'css' => 'mimetypes/text-css.png' +# , 'p|pas' => 'mimetypes/text-x-pascal.png' +# , 'patch' => 'mimetypes/text-x-patch.png' +# , 'pdf' => 'mimetypes/application-pdf.png' +# , 'sql|pk(s|b)' => 'mimetypes/text-x-sql.png' +# , 'rb|ruby' => 'mimetypes/application-x-ruby.png' +# , 'txt' => 'mimetypes/text-plain.png' +# , 'ui' => 'mimetypes/text-xml.png' +# , '.*\~' => 'mimetypes/application-x-trash' # } -# , 'graphicicon' => 'image-x-generic.png' -# , 'defaulticon' => 'unknown.png' -# , 'diricon' => 'inode-directory.png' -## , 'parenticon' => 'go-up.png' # this one, in the actions subdirectory +# , 'graphicicon' => 'mimetypes/image-x-generic.png' +# , 'defaulticon' => 'mimetypes/unknown.png' +# , 'diricon' => 'mimetypes/inode-directory.png' +# , 'parenticon' => 'actions/go-up.png' #- How to map files to languages , 'filetypeconf' => '%LXRroot%/templates/filetype.conf' @@ -172,16 +208,28 @@ # your source trees. # A parameter is "common" if its value must be simultaneously # adjusted in every tree. +#@IF %_shared% +#@ IF 'H' eq "%_routing%" || 'P' eq "%_routing%" || 'A' eq "%_routing%" +#@ IF %_commonvirtroot% + + # Virtual root shared by all trees (or hosts) + , 'virtroot' => '%virtrootbase%' +#@ ENDIF +#@ ENDIF +#@ENDIF # Pattern for extracting tree name from URL, since all # trees are usually served from the same physical server. -#@IF %_singlecontext% +#@IF 'E' ne "%_routing%" # Meaningful only in multiple trees context. Example for # built-in method where tree id is last before script name # , 'treeextract' => '([^/]*)/[^/]*$' #@ELSE # Built-in method where tree id is last before script name , 'treeextract' => '([^/]*)/[^/]*$' +#@ IF 'b' ne "%_virtrootpolicy%" + ##### REPLACE WITH YOUR OWN METHOD ##### +#@ ENDIF #@ENDIF #@IF !%_dbuser% Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- lxr.conf 21 Jan 2013 10:49:36 -0000 1.57 +++ lxr.conf 3 Sep 2013 08:45:12 -0000 1.58 @@ -18,13 +18,15 @@ #- updated for automatic configuration -- ajl 2012/05/05 #- updated to use LCL statements -- ajl 2012/11/30 #- updated for web server config. -- ajl 2013/01/20 +#- updated for change in LCL statements-- ajl 2013/04/28 +#- updated for more common factoring -- ajl 2013/05/13 ( ################################ # Global configuration section # ################################ -#@ADD %LXRtmpldir%/global.conf.part +#@ADD global.conf.part # ------------------------------------------------------------------------ @@ -39,105 +41,13 @@ # Server configuration subsection # #=================================# -#@LOG Configuring LXR server parameters - #- - #- NOTE --------------------------------------------------- # - #- ---- 'baseurl' and 'baseurl_aliases' are deprecated ---- # - #- ---- in favor of 'host_names'. ---- # - #- ---- See "Global configuration section" ---- # - #- ---- ---- # - #- ---- 'host_names' takes precedence if 'baseurl' is ---- # - #- ---- also defined. ---- # - #- ---- ---- # - #- ---- Support for 'baseurl' is maintained for ---- # - #- ---- compatibility with existing LXRs. ---- # - #- ---- ---- # - #- Configuration for http://192.168.1.1/lxr. - #- baseurl is used to select configuration block. -#- 'baseurl' => 'http://192.168.1.1/lxr' # Put your URL here -#- # baseurl_aliases allows other URLs to be used to reach the site -#- # comment this out if you do not want any aliases -#- , 'baseurl_aliases' => -#- [ 'http://localhost/lxr' -#- , 'http://mydomain/lxr' -#- ] - #- ---- ---- # - #- ---- End of deprecated parameters ---- # - #- ---- If you use them, uncomment the comma below ---- # - #- -------------------------------------------------------- # -#- , - -#@MSG The virtual root is the fixed URL part after the hostname. -#- - Virtual root is slightly different depending on context - - -#- - because we want to handle everything with a single LXR instance - - -#@IF %_singlecontext% -#- - Single tree context - - -#-@ ASK --- Virtual root? (i.e. URL part after host); -1; ; /lxr -#@ DEFINE virtroot="%virtrootbase%" -#@ MSG You previously defined the virtual root as %virtroot% -#@ELSE -#- - Multiple trees context - - -#@ IF 'b' eq "%_virtrootpolicy%" -#@ MSG The tree needs to be uniquely identified as e.g. %virtrootbase%/the_tree -#@ ASK --- Tree designation for URL? (e.g. the_tree); -2 -#@ DEFINE virtroot="%virtrootbase%/%A%" -#@ ELSEIF 'c' eq "%_virtrootpolicy%" -#@ REMIND The custom multiple trees management method must contain -#@ MSG at least the server section name %virtrootbase% and a unique -#@ MSG tree designation (in an order compatible with the URL magic -#@ MSG in the server configuration files). -#@ ASK --- Full virtual root? (e.g. %virtrootbase%/something); -2 -#@ DEFINE virtroot="%A%" -#@ ELSE -#@ ERROR Unknown multiple trees management choice! -#@ ERROR If you did not tamper with context file, -#@ ERROR report this as a bug. -#@ DEFINE virtroot='*** ERROR ***' -#@ ENDIF %_virtrootpolicy% -#@ENDIF %_singlecontext% -#- - End of virtroot differences - - +#@ADD tree-server1.conf.part #- - 'virtroot' => '%virtroot%' -#- The following @DEFINE allows automatic transfer of correct 'virtroot' -#- into lighttpd-lxrserver.conf. -#@IF '' eq "%virtroot%" -#@ DEFINE virtroot='/' -#@ENDIF - #- Title for this tree to display in page header area #- if you aren't satisfied with the default #@ASK --- Caption in page header? (e.g. Project XYZZY displayed by LXR); -2 - , 'caption' => '%A%' -#- -#- - In single tree context, just output a reminder in case of change; -#- - for multiple trees, generate the speed switch buttons -#@IF %_singlecontext% - # Button title to switch to this tree when multiple - # trees are managed by LXR -# , 'shortcaption' => 'Tree' -#@ELSE -#@ ASK Do you want a speed switch button for this tree ?; 1; yes, no; Y, N -#@ IF "%A%" eq 'Y' -#@ ASK --- Short title for button? (e.g. XYZZY); -2 - , 'shortcaption' => '%A%' -#@ ENDIF -#@ENDIF %_singlecontext% -#- -#@ASK Do you need a specific encoding for this tree ?; 2; yes, no; Y, N -#@IF "%A%" eq 'Y' - -#@ ASK --- Encoding name? (e.g. iso-8859-1); -2 - # Character encoding (overrides default) - , 'encoding' => '%A%' -#@ENDIF - - # a link of the form (prefix)($filepath)(postfix) is generated when viewing a file - # example for cvsweb: -# , 'cvswebprefix' => 'http://cvs.myhost.com/cgi-bin/cvsweb.cgi' -# , 'cvswebpostfix' => '?cvsroot=rootname' - # example for viewcvs: -# , 'cvswebprefix' => 'http://cvs.myhost.com/cgi-bin/viewcvs.cgi/myroot' -# , 'cvswebpostfix' => '' + 'caption' => '%A%' +#@ADD tree-server2.conf.part # Tree location subsection # #==========================# @@ -177,9 +87,8 @@ #- directories. #@ MSG A Git repository is a directory containing objects, refs, index, ... subdirectories. #@ MSG It is usually named .git in some user directory and is thus not visible. -#@ ASK --- Git repository? (e.g. /home/myself/project-git/.git); -2 -#@ DEFINE GITrepo="%A%" - , 'sourceroot' => 'git:%A%' +#@ ASK,GITrepo --- Git repository? (e.g. /home/myself/project-git/.git); -2 + , 'sourceroot' => 'git:%GITrepo%' #- #- Any parameters to the source access method should be specified below. #- @@ -269,7 +178,7 @@ #@ENDC #- - End of tree storage - - -# # The string to display as the base part of every path in the tree + # The string to display as the base part of every path in the tree #- , 'sourcerootname' => 'Example' #- # Or if you want automatic version insertion #- , 'sourcerootname' => '$v' @@ -304,7 +213,7 @@ #- - Case No. 2: versions given explicitly in a list #@L: , 'range' => [qw( -#@ KEEPON --- Version name? (hit return to stop); -2 +#@ KEEPON --- Version name? (hit return to stop) %A% #@ ENDK )] @@ -522,29 +431,7 @@ # Subdirectory subsection # #=========================# #@LOG Setting directory lists - - # Tree-specific files to ignore (in every directory of the tree) - # Extend and uncomment the following copy of the global - # parameter to override: -# , 'ignorefiles' => -# '^\\.|~$|\\.(o|a|orig)$|^CVS$|^core$' - - # Directories to always ignore. These usually are the SCM's - # private directories which possibly may contain non-public - # project history. Note that .xxx directories are hidden - # by an internal hard-coded rule. Redundant example: -# , 'ignoredirs' => ['CVSROOT', 'CVS', '.git'] -#@MSG Some directories may contain non-public project data (binaries, -#@MSG compilers caches, SCM control data, ...). They can be hidden from LXR. -#@KEEPON --- Directory to ignore, e.g. CVSROOT or CVS? (hit return to stop) -#@ ON first - , 'ignoredirs' => [qw( -#@ ENDON - %A% -#@ ON last - )] -#@ ENDON -#@ENDK +#@ADD tree-ignore.conf.part # Where to look for include files inside the sourcetree. # This is used to hyperlink to included files. Example: @@ -555,7 +442,7 @@ , 'incprefix' => [qw( #@ ENDON %A% -#@ ON last +#@ ON epilog )] #@ ENDON #@ ON none @@ -581,7 +468,7 @@ # Data storage subsection # #=========================# #- -#@ADD %LXRtmpldir%/datastorage.conf.part +#@ADD datastorage.conf.part #- } Index: lxrkernel.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxrkernel.conf,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- lxrkernel.conf 21 Jan 2013 16:35:03 -0000 1.9 +++ lxrkernel.conf 3 Sep 2013 08:45:12 -0000 1.10 @@ -59,13 +59,14 @@ #- updated for automatic configuration -- ajl 2012/05/05 #- updated to use LCL statements -- ajl 2012/11/30 #- updated for web server config. -- ajl 2013/01/20 +#- updated for more common factoring -- ajl 2013/05/13 ( ################################ # Global configuration section # ################################ -#@ADD %LXRtmpldir%/global.conf.part +#@ADD global.conf.part # ------------------------------------------------------------------------ @@ -79,85 +80,17 @@ , { # This kernel LXR configuration is generated from - # a template contributed by André Littoz (C) 2012 + # a template contributed by André Littoz (C) 2012-2013 # Server configuration subsection # #=================================# -#- -#- CAUTION! This section is not common factored in an @ADD file. -#- Remember to forward modifications from lxr.conf -#- -#@LOG Configuring LXR server parameters - -#@MSG The virtual root is the fixed URL part after the hostname. -#- - Virtual root is slightly different depending on context - - -#- - because we want to handle everything with a single LXR instance - - -#@IF %_singlecontext% -#- - Single tree context - - -#@ DEFINE virtroot="%virtrootbase%" -#@ MSG You previously defined the virtual root as %virtroot% -#@ELSE -#- - Multiple trees context - - -#@ IF 'b' eq "%_virtrootpolicy%" -#@ ASK --- Tree designation for URL?; -1; ; kernel -#@ DEFINE virtroot="%virtrootbase%/%A%" -#@ ELSEIF 'c' eq "%_virtrootpolicy%" -#@ REMIND The custom multiple trees management method must contain -#@ MSG at least the server section name %virtrootbase% and a unique -#@ MSG tree designation (in an order compatible with the URL magic -#@ MSG in the server configuration files). -#@ ASK --- Full virtual root? (e.g. %virtrootbase%/kernel); -2 -#@ DEFINE virtroot="%A%" -#@ ELSE -#@ ERROR Unknown multiple trees management choice! -#@ ERROR If you did not tamper with context file, -#@ ERROR report this as a bug. -#@ DEFINE virtroot='*** ERROR ***' -#@ ENDIF %virtrootpolicy% -#@ENDIF %_singlecontext% -#- - End of virtroot differences - - -#- - 'virtroot' => '%virtroot%' -#- The following @DEFINE allows automatic transfer of correct 'virtroot' -#- into lighttpd-lxrserver.conf. -#@IF '' eq "%virtroot%" -#@ DEFINE virtroot='/' -#@ENDIF +#@ADD tree-server1.conf.part #- Title for this tree to display in page header area #- if you aren't satisfied with the default #@ASK --- Caption in page header?; -1; ; Linux kernel cross-references , 'caption' => '%A%' -#- -#- - In single tree context, just output a reminder in case of change; -#- - for multiple trees, generate the speed switch buttons -#@IF %_singlecontext% - # Button title to switch to this tree when multiple - # trees are managed by LXR -# , 'shortcaption' => 'Tree' -#@ELSE -#@ ASK Do you want a speed switch button for this tree ?; 1; yes, no; Y, N -#@ IF "%A%" eq 'Y' -#@ ASK --- Short title for button? (e.g. XYZZY); -2 - , 'shortcaption' => '%A%' -#@ ENDIF -#@ENDIF %_singlecontext% -#- -#@ASK Do you need a specific encoding for this tree ?; 2; yes, no; Y, N -#@IF "%A%" eq 'Y' - -#@ ASK --- Encoding name? (e.g. iso-8859-1); -2 - # Character encoding (overrides default) - , 'encoding' => '%A%' -#@ENDIF - - # a link of the form (prefix)($filepath)(postfix) is generated when viewing a file - # example for cvsweb: -# , 'cvswebprefix' => 'http://cvs.myhost.com/cgi-bin/cvsweb.cgi' -# , 'cvswebpostfix' => '?cvsroot=rootname' - # example for viewcvs: -# , 'cvswebprefix' => 'http://cvs.myhost.com/cgi-bin/viewcvs.cgi/myroot' -# , 'cvswebpostfix' => '' +#@ADD tree-server2.conf.part # Tree location subsection # #==========================# @@ -211,7 +144,11 @@ # | you must manually make the adjustment. { 'v' => - { 'name' => 'Version' +#@ASK Label for version selection menu? ; -1; ; Version + { 'name' => '%A%' +#@MSG Versions are retrieved from file %LXRconfdir%/version_list.txt +#@MSG They are collected into this file by script kernel-vars-grab.sh + # This is the list of versions to index. , 'range' => [ readfile('%LXRconfdir%/version_list.txt') ] #- - Default initial version to display #@MSG By default, first version in list is displayed. You may also indicate @@ -227,7 +164,8 @@ #@ ENDIF } , 'a' => - { 'name' => 'Architecture' +#@ASK Label for architecture selection menu? ; -1; ; Architecture + { 'name' => '%A%' , 'range' => [ readfile('%LXRconfdir%/arch_list.txt') ] , 'default' => 'x86' } @@ -276,29 +214,7 @@ # Subdirectory subsection # #=========================# #@LOG Setting directory lists - - # Tree-specific files to ignore (in every directory of the tree) - # Extend and uncomment the following copy of the global - # parameter to override: -# , 'ignorefiles' => -# '^\\.|~$|\\.(o|a|orig)$|^CVS$|^core$' - - # Directories to always ignore. These usually are the SCM's - # private directories which possibly may contain non-public - # project history. Note that .xxx directories are hidden - # by an internal hard-coded rule. Redundant example: -# , 'ignoredirs' => ['CVSROOT', 'CVS', '.git'] -#@MSG Some directories may contain non-public project data (binaries, -#@MSG compilers caches, SCM control data, ...). They can be hidden from LXR. -#@KEEPON --- Directory to ignore, e.g. CVSROOT or CVS? (hit return to stop) -#@ ON first - , 'ignoredirs' => [qw( -#@ ENDON - %A% -#@ ON last - )] -#@ ENDON -#@ENDK +#@ADD tree-ignore.conf.part # Where to look for include files inside the sourcetree. # This is used to hyperlink to included files. @@ -328,7 +244,7 @@ # Data storage subsection # #=========================# #- -#@ADD %LXRtmpldir%/datastorage.conf.part +#@ADD datastorage.conf.part #- } |
From: Andre-Littoz <ajl...@us...> - 2013-09-02 17:21:35
|
Update of /cvsroot/lxr/lxr/templates In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25987/templates Modified Files: filetype.conf Log Message: filetype.conf: typo in Fortran extensions definition Index: filetype.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/filetype.conf,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- filetype.conf 19 Apr 2013 12:42:14 -0000 1.6 +++ filetype.conf 2 Sep 2013 17:21:32 -0000 1.7 @@ -118,7 +118,7 @@ , 'fortran' => [ 'Fortran' - , '(?i)\.f$|\.for$|\.ftn$|\.f77$$' + , '(?i)\.f$|\.for$|\.ftn$|\.f77$' , 'LXR::Lang::Generic' ] # , |
From: Andre-Littoz <ajl...@us...> - 2013-09-02 17:07:54
|
Update of /cvsroot/lxr/lxr/scripts In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25390/scripts Modified Files: recreatedb.pl Log Message: scripts/recreatedb.pl: synchronise with configuration wizard Index: recreatedb.pl =================================================================== RCS file: /cvsroot/lxr/lxr/scripts/recreatedb.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- recreatedb.pl 22 Jan 2013 16:59:52 -0000 1.7 +++ recreatedb.pl 2 Sep 2013 17:07:51 -0000 1.8 @@ -27,18 +27,20 @@ use Fcntl; use Getopt::Long; use IO::Handle; -use File::MMagic; use File::Path qw(make_path); -use LXR::Files; -use LXR::Index; -use LXR::Common; - use ContextMgr; use LCLInterpreter; -use QuestionAnswer; use VTescape; +# The following use statements are written only to allow to eval +# without error the lxr.conf file is the event it contains sub +# definitions for 'range' with references to allbranches, +# allreleases, allrevisions or alltags functions defined in Files. +# These function calls may use LXR global $pathname defined in Common. +use LXR::Files; +use LXR::Common; + ############################################################## # @@ -46,14 +48,9 @@ # ############################################################## -# This is a nasty trick to fool Perl into accepting the CVS -# revision tag without trying to make sense with a supposed -# variable (sigils may be separated from the variable name -# by spaces! Not documented of course!) -$_ = ''; # Calm down Perl ardour -my $version ="\$Revision$_"; -$version =~ s/Revision: (.*) $/$1/; -$version =~ s/\$//; +my $version = '$Revision$'; +$version =~ s/Revision: (.*) /$1/; +$version =~ s/\$//g; # Who am I? Strip directory path. my $cmdname = $0; @@ -77,6 +74,7 @@ chomp($rootdir); my ($scriptdir) = $0 =~ m!([^/]+)/[^/]+$!; my $tmpldir = 'templates'; +my $ovrdir = 'custom.d/templates'; my $verbose; my $scriptout = 'initdb.sh'; my $lxrconf = 'lxr.conf'; @@ -89,6 +87,7 @@ , 'root-dir=s' => \$rootdir , 'script-out=s'=> \$scriptout , 'tmpl-dir=s' => \$tmpldir + , 'tmpl-ovr=s' => \$ovrdir , 'verbose|v' => \$verbose , 'version' ) @@ -123,6 +122,9 @@ --tmpl-dir=directory Define template directory (default: $tmpldir) + --tmpl-ovr=directory + Define template user-override directory + (default: $ovrdir) -v, --verbose Explain what is being done --version Print version information and quit @@ -139,7 +141,7 @@ if ($option{'version'}) { print <<END_VERSION; ${cmdname} version $version -(C) 2012 A. J. Littoz +(C) 2012-2013 A. J. Littoz This is free software under GPL v3 (or higher) licence. There is NO warranty, not even for MERCHANTABILITY nor FITNESS FOR A PARICULAR PURPOSE to the extent permitted by law. @@ -153,6 +155,7 @@ # "Canonise" directory names $confdir =~ s:/*$::; $tmpldir =~ s:/*$::; +$ovrdir =~ s:/*$::; $rootdir =~ s:/*$::; # Check LXR environment @@ -196,29 +199,41 @@ $lxrctx = $confdir . '/' . $lxrctx; } } -if (! -e "$lxrctx") { +if (! -e $lxrctx) { print "${VTred}ERROR:${VTnorm} configuration context file" . " ${VTred}$lxrctx${VTnorm} does not exist!\n"; } -if (! -e "$tmpldir/initdb/initdb-m-template.sql") { +if ( ! -e $tmpldir.'/initdb/initdb-m-template.sql' + && ! -e $ovrdir .'/initdb/initdb-m-template.sql' + ) { print "${VTred}ERROR:${VTnorm} template file" - . " ${VTred}$tmpldir/initdb/initdb-m-template.sql{VTnorm} does not exist!\n"; + . " ${VTred}initdb/initdb-m-template.sql{VTnorm}" + . " exists neither in override nor in templates directory!\n"; $error = 1; } -if (! -e "$tmpldir/initdb/initdb-o-template.sql") { +if ( ! -e $tmpldir.'/initdb/initdb-o-template.sql' + && ! -e $ovrdir .'/initdb/initdb-o-template.sql' + ) { print "${VTred}ERROR:${VTnorm} template file" - . " ${VTred}$tmpldir/initdb/initdb-o-template.sql{VTnorm} does not exist!\n"; + . " ${VTred}initdb/initdb-o-template.sql{VTnorm}" + . " exists neither in override nor in templates directory!\n"; $error = 1; } -if (! -e "$tmpldir/initdb/initdb-p-template.sql") { +if ( ! -e $tmpldir.'/initdb/initdb-p-template.sql' + && ! -e $ovrdir .'/initdb/initdb-p-template.sql' + ) { print "${VTred}ERROR:${VTnorm} template file" - . " ${VTred}$tmpldir/initdb/initdb-p-template.sql{VTnorm} does not exist!\n"; + . " ${VTred}initdb/initdb-p-template.sql{VTnorm}" + . " exists neither in override nor in templates directory!\n"; $error = 1; } -if (! -e "$tmpldir/initdb/initdb-s-template.sql") { +if ( ! -e $tmpldir.'/initdb/initdb-s-template.sql' + && ! -e $ovrdir .'/initdb/initdb-s-template.sql' + ) { print "${VTred}ERROR:${VTnorm} template file" - . " ${VTred}$tmpldir/initdb/initdb-s-template.sql{VTnorm} does not exist!\n"; + . " ${VTred}initdb/initdb-s-template.sql{VTnorm}" + . " exists neither in override nor in templates directory!\n"; $error = 1; } @@ -331,10 +346,10 @@ if (exists($config[0]{'dbprefix'})) { $dbprefix = $config[0]{'dbprefix'}; } -if (exists($config->{'dbname'})) { - $config->{'dbname'} =~ m/dbi:(.)/; +if (exists($config[0]{'dbname'})) { + $config[0]{'dbname'} =~ m/dbi:(.)/; $dbengine = lc($1); - if ($config->{'dbname'} =~ m/dbname=([^;]+)/) { + if ($config[0]{'dbname'} =~ m/dbname=([^;]+)/) { $dbname = $1; } } @@ -430,29 +445,19 @@ } if ( $dbenginechanged - || $treedbengine ne $dbengine && !$dbengine_seen{$treedbengine} + || $treedbengine ne $dbengine && !$dbengine_seen{$treedbengine} ) { $markers{'%_createglobals%'} = 1; $dbengine_seen{$treedbengine} = 1; } - open(SOURCE, '<', "${tmpldir}/initdb/initdb-${treedbengine}-template.sql") - or die("${VTred}ERROR:${VTnorm} couldn't open script template file \"${tmpldir}/initdb/initdb-${dbengine}-template.sql\"\n"); + my $input = $ovrdir . "/initdb/initdb-${dbengine}-template.sql"; + if (! -e $input) { + $input = $tmpldir . "/initdb/initdb-${dbengine}-template.sql"; + } + open(SOURCE, '<', $input) + or die("${VTred}ERROR:${VTnorm} couldn't open script template file \"${input}\"\n"); - # NOTE: - # The design of the configuration process left the possibility - # to expand the SQL templates without interspersing the results - # with shell commands (so that the result would be a sequence - # of SQL commands only). - # Initially, the sub expand_slash_star was intended to be a script - # to which others would connect through a pipe. - # A shell expander would pass --shell to expand_slash_star to enable - # shell commands, while an SQL expander script would not pass - # this option. - # This is why the 'shell' pseudo-option is created. - # Of course, this statement would be better outside the loop, - # but this comment would be far from expand_slash_star invocation. - $markers{'%_shell%'} = 1; # Expand script model expand_slash_star ( sub{ <SOURCE> } , \*DEST |
From: Andre-Littoz <ajl...@us...> - 2013-09-02 17:06:07
|
Update of /cvsroot/lxr/lxr/scripts In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25291/scripts Modified Files: QuestionAnswer.pm Log Message: scripts/QuestionAnswer.pm: various source minor mprovements Index: QuestionAnswer.pm =================================================================== RCS file: /cvsroot/lxr/lxr/scripts/QuestionAnswer.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- QuestionAnswer.pm 4 Dec 2012 17:42:27 -0000 1.2 +++ QuestionAnswer.pm 2 Sep 2013 17:06:03 -0000 1.3 @@ -43,7 +43,7 @@ my ($list) = @_; my @pats; - my $flat = "#" . join("#", @$list); + my $flat = '#' . join('#', @$list); PAT: foreach my $pat (@$list) { my $pfix = "#"; @@ -52,8 +52,8 @@ $pfix .= $c; if (1 == (@_ = $flat =~ m/$pfix/ig)) { my $sl = @chars; #suffix length - $pfix .= "("x($sl>0) . join("(", @chars) . ")?"x$sl; - push(@pats, "^" . substr($pfix, 1)); + $pfix .= '('x($sl>0) . join('(', @chars) . ')?'x$sl; + push(@pats, '^' . substr($pfix, 1)); next PAT; } } @@ -87,7 +87,7 @@ || !defined($answers) || @$choices != @$answers ) { - print "${VTred}FATAL:${VTnorm} incorrect choices and/or answers for $question!\n"; + print "${VTred}FATAL:${VTnorm} incorrect choices and/or answers for \"$question\"!\n"; exit 2; } if ($default >= @$choices) { @@ -122,13 +122,13 @@ chomp($userentry); # See if user just hit "return"; if this is valid, give # default answer, otherwise ask again. - if ($userentry eq "") { + if ($userentry eq '') { if ($default >= 0) { return $$answers[$default]; } elsif ($default == -2) { return $$answers[0]; } elsif ($default == -4) { - return ""; + return ''; } print "No default choice, try again...\n"; next; |
From: Andre-Littoz <ajl...@us...> - 2013-09-02 16:46:03
|
Update of /cvsroot/lxr/lxr/scripts In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24180/scripts Modified Files: LCLInterpreter.pm Log Message: scripts/LCLInterpreter.pm: new statements New @ARRAY/@ENDA block Better comments Read-only variables now protected against change Fix for bug #235: LCL statements now correctly interpreted in the order they are written Various source improvements Index: LCLInterpreter.pm =================================================================== RCS file: /cvsroot/lxr/lxr/scripts/LCLInterpreter.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- LCLInterpreter.pm 21 Jan 2013 10:49:36 -0000 1.2 +++ LCLInterpreter.pm 2 Sep 2013 16:46:00 -0000 1.3 @@ -79,7 +79,17 @@ # = Statement: @<name> [<arguments>] # <name> is an alphanumeric string. Case is indifferent. # The following sections list the known statements. -# An error is issued for an unknown statement . +# An error is issued for an unknown statement. + +# == Substitution error suppression == +# @U <data line> +# Flags the to-be data line as containing potentially unknown/undefined +# subtitution symbols. +# If substitutions succeed, the data line is output without the @U +# LCL command, as if it had been written as an ordinary line. +# If any substitution fails, the whole line is copied unchanged to output. +# Application example: use it for 'glimpsebin'/'swishbin' parameter +# value since only one of them should be defined. # == Message display == # @LOG message @@ -98,6 +108,8 @@ # @ELSEIF <expr> # @ELSE # @ENDIF +# Note: if <expr> consists of only <var>, it is a test for existence. +# This is handy for probing the presence of an "option". # @CASE <variable> # <Label> @@ -108,7 +120,7 @@ # @ASK[,<var>] <question>; <kind>; <choices>; <answers> # Continuous until empty answer, with input kept in <var>: -# @KEEPON[,<var>] <question>[; -2] +# @KEEPON[,<var>] <question>[; -3] # @ON first # @ENDON # @ON last @@ -139,16 +151,35 @@ # @KEEPON blocks may be nested in other conditional blocks and may # contain arbitrary content, including other @KEEPON blocks. +# == Array content insertion == +# @ARRAY <array>[,<var>] [<array>[,<var>]]... +# @ON prolog +# @ENDON +# @ON epilog +# @ENDON +# @ON none +# @ENDON +# @ENDA +# The lines between @ARRAY and @ENDA are repetitively interpreted +# with <var> containing successive elements of <array>. +# By default, <var> is E if not specified. +# The variable is used in substitutions inside the block +# interpreted for every element in the array. + +# When several arrays are specified in the command, they must have +# the same length. Of course, only one of them can be associated with +# the default variable (otherwise the others are shadowed out). +# In the prolog and epilog blocks, the variables contain the size +# of the arrays. +# In the none block, the variables must not be used since no data is +# available (value of the variables is not specified!, i.e. they are +# not set to any value and retain the one they eventually had before). + # == Variable definition == # @DEFINE <var>=<expr> # Define a %marker% (% characters are internally added) equal to the # value of an expression. # Afterwards, %marker% can be used for substitution. -# NOTE: since the simple parser only allows for A-Za-z0-9_ characters -# in both marker and option, a translation is needed between the -# shell option name and the #@D option name. -# This is done through the hash reference $option_trans, i.e. -# $$option_trans{'option'} gives the value to use. # == Shell command insertion == # @XQT <shell command> @@ -166,7 +197,7 @@ # 2. Consequence of 1., do not open any block (@CASE, @IF, @KEEPON, # @PASS2) in one file and put the closing command in another file. # Due to the possible skip of intervening statements, the @ADD -# containing the opening orclosing statement might be not +# containing the opening or closing statement might be not # interpreted and the stream will appear incorrectly bracketed. # File name path: the current directory is the one in effect when the # configurator is launched. It might be better to use OS-absolute paths. @@ -307,18 +338,20 @@ # User interaction } elsif ( $command eq 'ASK') { - substitute_markers (\$args, $markers, $comstart, $comend); - $$markers{"%$var%"} = ask_question($args); + if (substr($var, 0, 1) eq '_') { + print "${VTred}ERROR:${VTnorm} can't use read-only variable $var in \@ASK!\n"; + } else { + substitute_markers (\$args, $markers, $comstart, $comend); + $$markers{"%$var%"} = ask_question($args); + } next; } elsif ($command eq 'KEEPON') { my %keep; if ($args =~ s/;\s*(-\d+)$//) { - if ($1 != -2 && $1 != -3) { + if ($1 != -3) { print "${VTred}ERROR:${VTnorm} illegal type $1 question for \@KEEPON!\n"; - $args .= ';-3'; - } else { - $args .= ";$1"; } + $args .= ';-3'; } else { $args .= ';-3'; } @@ -336,7 +369,7 @@ my ($type) = $args =~ m/^(\w+)(?:\s|$)/; $type = lc($type); if ( $type ne 'first' - && $type ne 'last' + && $type ne 'epilog' && $type ne 'none' ) { print "${VTred}ERROR:${VTnorm} unknown $type KEEPON action type!\n"; @@ -346,14 +379,14 @@ , $comstart, $comend ) } else { - $keep{$type} = [ grab_block + $keep{"=$type"} = [ grab_block ( $source , qr/ENDON\b/i , 'KEEPON', 'ENDK' , $comstart, $comend ) ]; } - } elsif ($command eq 'KEEP') { + } elsif ($command eq 'KEEPON') { push ( @kbody , grab_block ( $source , qr/ENDK\b/i @@ -368,16 +401,20 @@ push (@kbody, $line); } } - $keep{'body'} = [ @kbody ]; + if (substr($var, 0, 1) eq '_') { + print "${VTred}ERROR:${VTnorm} can't use read-only variable $var in \@KEEPON!\n"; + next; + } + $keep{'=body'} = [ @kbody ]; my $answer = ask_question($keep{'q'}); $$markers{"%${keep{'v'}}%"} = $answer; $keep{'q'} =~ s/;-2$/;-3/; # Ensure loop can be left if ($answer eq '') { # initial answer is empty, block is skipped. # See if action 'none' should be triggered. - if (exists($keep{'none'})) { - @kbody = @{$keep{'none'}}; - expand ( sub { pop(@kbody) } + if (exists($keep{'=none'})) { + @kbody = @{$keep{'=none'}}; + expand ( sub { shift(@kbody) } , $dest , $markers , $verbose @@ -387,9 +424,9 @@ } next; } - if (exists($keep{'first'})) { - @kbody = @{$keep{'first'}}; - expand ( sub { pop(@kbody) } + if (exists($keep{'=first'})) { + @kbody = @{$keep{'=first'}}; + expand ( sub { shift(@kbody) } , $dest , $markers , $verbose @@ -398,8 +435,8 @@ ); } while ($answer ne '') { - @kbody = @{$keep{'body'}}; - expand ( sub { pop(@kbody) } + @kbody = @{$keep{'=body'}}; + expand ( sub { shift(@kbody) } , $dest , $markers , $verbose @@ -409,9 +446,9 @@ $answer = ask_question($keep{'q'}); $$markers{"%${keep{'v'}}%"} = $answer; } - if (exists($keep{'last'})) { - @kbody = @{$keep{'last'}}; - expand ( sub { pop(@kbody) } + if (exists($keep{'=epilog'})) { + @kbody = @{$keep{'=epilog'}}; + expand ( sub { shift(@kbody) } , $dest , $markers , $verbose @@ -422,6 +459,8 @@ next; # Conditional block + # (processing similar to continuous + # user interaction) } elsif ($command eq 'IF') { while ($command ne 'ENDIF') { if ( $command eq 'ELSE' @@ -454,6 +493,15 @@ # Selection block } elsif ($command eq 'CASE') { + if (substr($var, 0, 1) eq '_') + { print "${VTred}ERROR:${VTnorm} can't use read-only variable $var in \@CASE!\n" + ; skip_until ( $source + , qr/ENDC\b/i + , 'CASE', 'ENDC' + , $comstart, $comend + ) + ; next + } my $thecase = evaluate_expr($args, $markers); while (1) { ($args, $var, $command, @labels) @@ -486,6 +534,152 @@ } next; + # Dump array content + } elsif ($command eq 'ARRAY') { + my %array; + my $errorflag; + while ($args =~ m/(\w+)(?:,(\w+))?/g) { + if ( exists($$markers{"%$1%"}) + && ('ARRAY' eq ref($$markers{"%$1%"})) + ) { + if (defined($2)) { + if (substr($2, 0, 1) eq '_') { + print "${VTred}ERROR:${VTnorm} can't use read-only variable $2 in \@ARRAY!\n"; + $errorflag = 1; + } else { + $array{$2} = $1; + } + } else { + $array{'E'} = $1; + } + } else { + print "${VTred}ERROR:${VTnorm} unknown $1 substitution marker or not array!\n"; + $errorflag = 1; + } + } + if ($errorflag) { + skip_until ( $source + , qr/ENDA\b/i + , 'ARRAY', 'ENDA' + , $comstart, $comend + ); + next; + } + my @abody; + while ($command ne 'ENDA') { + $line = &$source(); + if ($line =~ m/${comstart}\@/) { + ($args, $var, $command, @labels) + = parse_statement($line, $comstart, $comend); + last if $command eq 'ENDA'; + if ($command eq 'ON') { + my ($type) = $args =~ m/^(\w+)(?:\s|$)/; + $type = lc($type); + if ( $type ne 'prolog' + && $type ne 'epilog' + && $type ne 'none' + ) { + print "${VTred}ERROR:${VTnorm} unknown $type ARRAY action type!\n"; + skip_until ( $source + , qr/ENDON\b/i + , 'ARRAY', 'ENDA' + , $comstart, $comend + ) + } else { + $array{"=$type"} = [ grab_block + ( $source + , qr/ENDON\b/i + , 'ARRAY', 'ENDA' + , $comstart, $comend + ) ]; + } + } elsif ($command eq 'ARRAY') { + push ( @abody + , grab_block ( $source + , qr/ENDA\b/i + , 'ARRAY', 'ENDA' + , $comstart, $comend + ) + ); + } else { + push (@abody, $line); + } + } else { + push (@abody, $line); + } + } + $array{'=body'} = [ @abody ]; + my $arraylen; + while ((my $v, my $m) = each %array) { + next if '=' eq substr($v, 0, 1); + if (defined($arraylen)) { + if (scalar(@{$$markers{"%$m%"}}) != $arraylen) { + print "${VTred}ERROR:${VTnorm} ARRAY arrays have not all the same length!\n"; + next SCAN; + } + } else { + $arraylen = scalar(@{$$markers{"%$m%"}}); + } + } + if (0 >= $arraylen) { + # See if action 'none' should be triggered. + if (exists($array{'=none'})) { + @abody = @{$array{'=none'}}; + expand ( sub { shift(@abody) } + , $dest + , $markers + , $verbose + , $comstart, $comend + , '~~~TO~EOF~~~' + ); + } + next; + } + + if (exists($array{'=prolog'})) { + while ((my $v, my $m) = each %array) { + next if '=' eq substr($v, 0, 1); + $$markers{"%$v%"} = scalar(@{$$markers{"%$m%"}}); + } + @abody = @{$array{'=prolog'}}; + expand ( sub { shift(@abody) } + , $dest + , $markers + , $verbose + , $comstart, $comend + , '~~~TO~EOF~~~' + ); + } + for my $i (0..$arraylen-1) { + while ((my $v, my $m) = each %array) { + next if '=' eq substr($v, 0, 1); + $$markers{"%$v%"} = ${$$markers{"%$m%"}}[$i]; + } + @abody = @{$array{'=body'}}; + expand ( sub { shift(@abody) } + , $dest + , $markers + , $verbose + , $comstart, $comend + , '~~~TO~EOF~~~' + ); + } + if (exists($array{'=epilog'})) { + while ((my $v, my $m) = each %array) { + next if '=' eq substr($v, 0, 1); + $$markers{"%$v%"} = scalar(@{$$markers{"%$m%"}}); + } + @abody = @{$array{'=epilog'}}; + expand ( sub { shift(@abody) } + , $dest + , $markers + , $verbose + , $comstart, $comend + , '~~~TO~EOF~~~' + ); + } + next; + # Symbol definition } elsif ( $command eq 'DEFINE') { my ($var, $string) = ($args =~ m/^(\w+)\s*=\s*(.+)/); @@ -506,8 +700,30 @@ print "${VTred}ERROR:${VTnorm} too many nested ADD files with \"${args}\"\n"; next; } - my ($string) = ($args =~ m/^["']?(.+)["']?$/); - $string = evaluate_expr("\"$string\"", $markers); + my $string; + if ($args =~ m/^("|')/) { # A delimiter? + my $strdelim = substr($args, 0, 1); + ($string) = ($args =~ m/^$strdelim(.+?)$strdelim$/); + # NOTE: If $args is not correctly delimited, + # $string is undefined and no error is issued here. + } else { + ($string) = ($args =~ m/^(\S+)/); # Keep only first word + }; + if (0 >= length($string)) { + print "${VTred}ERROR:${VTnorm} bad filename syntax on ADD!\n"; + next; + } + substitute_markers (\$string, $markers, $comstart, $comend); + # If filename (in $string) starts with ./, ../ or /, + # this means an "escaped" path, i.e. file is not located + # in the templates directories. + if ($string !~ m:^\.?\.?/:) { + if (-e $$markers{'%LXRovrdir%'}.'/'.$string) { + $string = $$markers{'%LXRovrdir%'}.'/'.$string; + } elsif (-e $$markers{'%LXRtmpldir%'}.'/'.$string){ + $string = $$markers{'%LXRtmpldir%'}.'/'.$string; + } + } if (open(ADD, '<', $string)) { ++$addnesting; expand ( sub { <ADD> } @@ -532,7 +748,7 @@ } $args = 'courtesy_label'; } - # Replace block with a label unlessoption R and adding trees + # Replace block with a label unless option R and adding trees if ( 'R' ne $var || 0 == $$markers{'%_add%'} ) { @@ -547,11 +763,12 @@ } elsif ( $command eq 'ELSE' || $command eq 'ELSEIF' || $command eq 'ENDIF' + || $command eq 'ENDA' || $command eq 'ENDC' || $command eq 'ENDK' || $command eq 'ON' || $command eq 'ENDON' - || $command eq 'PASS2' + || $command eq 'ENDP2' ) { print "${VTred}ERROR:${VTnorm} spurious $command!\n"; next; @@ -664,7 +881,7 @@ $line =~ s/^\s*(\w+)//; # Grab command name my $command = uc($1); my $var = 'A'; # Grab var name - $var = $1 if $line =~ s/^,(\w+)//; + $var = $1 if $line =~ s/^,(\w+)//; my ($args) = ($line =~ m/^\s+(.*)\s*${comend}\s*\n/); return ($args, $var, $command, @labels); } @@ -718,7 +935,7 @@ # List used variables and check for illegal computation # NOTE: $op can be extended for more complex valid expressions - my $op = qr/(?:eq|ne)/; + my $op = qr/(?:eq|ne|==|!=)/; while ($expr =~ m/($op\s*)?%(\w+)%(\s*$op)?/g) { # Make a difference between test for existence/definedness and # usage in a comparison/computation where value is needed @@ -734,7 +951,15 @@ # Build the expression to evaluate $expr =~ s/%(\w+)%/\$\{_${1}_\}/g; foreach my $newvar (keys %exprvars) { - $theeval .= 'my $_' . $newvar . '_ = "' . $$markers{"\%$newvar\%"} . '"; '; + $theeval .= 'my $_' . $newvar . '_ = "'; + if (!ref($$markers{"\%$newvar\%"})) { + $theeval .= $$markers{"\%$newvar\%"}; # get value of ordinary variable + } elsif ('ARRAY' eq ref($$markers{"\%$newvar\%"})) { + $theeval .= scalar(@{$$markers{"\%$newvar\%"}}); # get number of elements + } else { + print "${VTred}ERROR:${VTnorm} $2 substitution marker has an illegal type!\n"; + } + $theeval .= '"; '; } $theeval .= $expr; my $res = eval($theeval); @@ -752,7 +977,14 @@ my ($source, $sentinel, $begin, $end, $comstart, $comend) = @_; my $stop; - if ($sentinel =~ m/\):/) { + # $sentinel may be given as qr/.../, which i somehow rewritten + # and : is internally used in (?...: constructs. Consequently, + # presence of : cannot be simply tested to decide if we are + # targeting a label. We must test for the label name defore + # the colon. + if ( 0 <= index($sentinel, 'w+):') + || 0 <= index($sentinel, 'w+:') + ) { $stop = qr/^${comstart}\@${sentinel}/; } else { $stop = qr/^${comstart}\@\s*${sentinel}/; @@ -790,7 +1022,14 @@ my @blocklines; my $stop; - if ($sentinel =~ m/\):/) { + # $sentinel may be given as qr/.../, which i somehow rewritten + # and : is internally used in (?...: constructs. Consequently, + # presence of : cannot be simply tested to decide if we are + # targeting a label. We must test for the label name defore + # the colon. + if ( 0 <= index($sentinel, 'w+):') + || 0 <= index($sentinel, 'w+:') + ) { $stop = qr/^${comstart}\@${sentinel}/; } else { $stop = qr/^${comstart}\@\s*${sentinel}/; @@ -802,7 +1041,7 @@ while (my $line = &$source()) { if ($line =~ m/$end_block/) { # Finding an end-of-block sentinel before the correct termination -# is an error when recording sample code. This will be catched +# is an error when recording sample code. This will be caught # at EOF (or, at least, I hope). # return @blocklines if $nesting == 0; $nesting--; @@ -820,7 +1059,7 @@ push @blocklines, $line; } print "${VTred}ERROR:${VTnorm} improper sample block limits!\n"; - print "${VTred}ERROR:${VTnorm} still expecting $sentinel sentinel!\n"; + print "${VTred}ERROR:${VTnorm} still expecting $stop sentinel!\n"; die "Sample block overflow"; } |
From: Andre-Littoz <ajl...@us...> - 2013-09-02 16:37:40
|
Update of /cvsroot/lxr/lxr/scripts In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23858/scripts Modified Files: ContextMgr.pm Log Message: scripts/ContextMgr.pm: clearer implementation of URL structuring Add new 'argument' choice Context file format upgraded Various source improvements (more efficient statements, string variant, here-doc, ...) Index: ContextMgr.pm =================================================================== RCS file: /cvsroot/lxr/lxr/scripts/ContextMgr.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ContextMgr.pm 22 Jan 2013 16:59:52 -0000 1.3 +++ ContextMgr.pm 2 Sep 2013 16:37:36 -0000 1.4 @@ -38,9 +38,10 @@ our @EXPORT = qw( $cardinality - $servertype $scheme $hostname - $port $virtrootbase - $virtrootpolicy + $servertype $scheme $hostname $port + @schemealiases @hostaliases @portaliases + $commonvirtroot $virtrootbase $virtrootpolicy + $treematch $dbengine $dbenginechanged $dbpolicy $dbname $dbuser $dbpass $dbprefix $nodbuser @@ -55,12 +56,19 @@ # Single/multiple operation our $cardinality; + # Position of tree name +our $treematch; + # Web server our $servertype; our $scheme; our $hostname; our $port; +our @schemealiases; +our @hostaliases; +our @portaliases; our $virtrootbase; +our $commonvirtroot; our $virtrootpolicy; # Database @@ -76,7 +84,7 @@ # WARNING: remember to increment this number when changing the # set of state variables and/or their meaning. -my $context_version = 2; +my $context_version = 3; ############################################################## @@ -149,16 +157,16 @@ print "Previous configuration was made for:\n"; print "- "; if ('m' eq $cardinality) { - print "multiple trees"; + print 'multiple trees'; } else { - print "single tree"; + print 'single tree'; } print "\n"; print "- "; if ('t' eq $dbpolicy) { - print "per tree"; + print 'per tree'; } else { - print "global"; + print 'global'; } print " database\n"; print "\n"; @@ -182,16 +190,38 @@ } } + print "Tree selection mode was: ${VTbold}"; + if ('N' eq $treematch) { + print 'implicit (single tree)'; + } elsif ('H' eq $treematch) { + print 'hostname'; + } elsif ('P' eq $treematch) { + print 'prefix in hostname'; + } elsif ('S' eq $treematch) { + print 'section name'; + } elsif ('E' eq $treematch) { + print 'embedded in section'; + } elsif ('A' eq $treematch) { + print 'argument'; + } else { + print "???${VTnorm}\n"; + print "${VTred}ERROR:${VTnorm} saved context file damaged or tampered with!\n"; + print "Unknown selection code '$treematch'\n"; + print "Delete or rename file $ctxtfile to remove lock.\n"; + exit 1; + } + print "${VTnorm}\n"; + if ($dbpolicy eq 't') { print "Your DB engine was: ${VTbold}"; - if ("m" eq $dbengine) { - print "MySQL"; - } elsif ("o" eq $dbengine) { - print "Oracle"; - } elsif ("p" eq $dbengine) { - print "PostgreSQL"; - } elsif ("s" eq $dbengine) { - print "SQLite"; + if ('m' eq $dbengine) { + print 'MySQL'; + } elsif ('o' eq $dbengine) { + print 'Oracle'; + } elsif ('p' eq $dbengine) { + print 'PostgreSQL'; + } elsif ('s' eq $dbengine) { + print 'SQLite'; } else { print "???${VTnorm}\n"; print "${VTred}ERROR:${VTnorm} saved context file damaged or tampered with!\n"; @@ -207,6 +237,14 @@ } $reloadstatus = 1; }; + print "${VTnorm}\n"; + } + + if ( 's' eq $cardinality + || 'N' eq $treematch + ) { + print "${VTred}ERROR:${VTnorm} single tree context not compatible with add mode!\n"; + exit 1; } } else { print "${VTyellow}WARNING:${VTnorm} could not reload context file ${VTbold}$ctxtfile${VTnorm}!\n"; @@ -279,6 +317,19 @@ print DEST "\$scheme = '$scheme';\n"; print DEST "\$hostname = '$hostname';\n"; print DEST "\$port = '$port';\n"; + # @hostaliases added in version 3 + print DEST '@schemealiases = qw( '; + print DEST join ('\n , ', @schemealiases); + print DEST "\n );\n"; + print DEST '@hostaliases = qw( '; + print DEST join ('\n , ', @hostaliases); + print DEST "\n );\n"; + print DEST '@portaliases = qw( '; + print DEST join ('\n , ', @portaliases); + print DEST "\n );\n"; + print DEST "\$treematch = '$treematch';\n"; + print DEST "\$commonvirtroot = $commonvirtroot;\n"; + # Set v2 continued print DEST "\$virtrootbase = '$virtrootbase';\n"; print DEST "\$virtrootpolicy = '$virtrootpolicy';\n"; close(DEST) @@ -455,23 +506,72 @@ my ($verbose) = @_; if ($verbose > 1) { - print "LXR can be configured as the default server (the only service in your computer),\n"; - print "a section of this default server or an independent server (with its own\n"; - print "host name).\n"; - print "Refer to the ${VTbold}User's Manual${VTnorm} for a description of the differences.\n"; + print "Many different configurations are possible, they are related to the way\n"; + print "LXR service is accessed, i.e. to the structure of the URL.\n"; + print "Refer to the ${VTbold}User's Manual${VTnorm} for a description of the variants.\n"; } + if ($verbose > 1) { + print "\n"; + print "LXR can be located at the server-root (so called ${VTbold}dedicated${VTnorm})\n"; + print "or lower in the server hierarchy (${VTbold}shared${VTnorm} because there are\n"; + print "usually other pages or sections).\n"; + } $servertype = get_user_choice - ( 'Web server type?' + ( 'Server type?' + , 2 + , [ 'dedicated' + , 'shared' + ] + , [ 'D', 'S' ] + ); + if ('m' eq $cardinality) { + if ($verbose) { + print "\n"; + print "Selecting which tree to display can be done in various ways:\n"; + print " 1. from the host name (all names are different),\n"; + print " 2. from a prefix to a common host name (similar to previous)\n"; + print " 3. from the site section name (all different)\n"; + print " 4. from interpretation of a section name part (similar to previous)\n"; + print " 5. from the head of script arguments\n"; + if ($verbose > 1) { + print "Method 5 is highly recommended because it has no impact on webserver\n"; + print " configuration.\n"; + print "Method 3 is second choice but involves manually setting up many\n"; + print " symbolic links (one per source-tree).\n"; + print "Method 1 & 2 do not involve symbolic links but need populating webserver\n"; + print " configuration with virtual hosts.\n"; + print " Note that method 2 does not work well on //localhost.\n"; + print "Method 4 is deprecated because it has proved not easily portable\n"; + print " under alternate webservers (other than Apache).\n"; + } + print "\n"; + } + $treematch = get_user_choice + ( 'Tree designation?' , 1 - , [ "1.default\n" - , "2.section in default\n" - , "3.indepedent\n" - , "4.section in indepedent\n" + , [ "argument\n" + , "section name\n" + , "prefix in host\n" + , "hostname\n" + , "embedded in section" ] - , [ 'D', 'DS', 'I', 'IS' ] + , [ 'A', 'S', 'P', 'H', 'E' ] # A arg, S section, P prefix, H host, E = embedded ); + } else { + $treematch = 'N'; # N none + } + if ( 'D' eq $servertype + && 'S' eq $treematch + ) { + print "${VTyellow}WARNING:${VTnorm} a dedicated server with tree selection through\n"; + print " section name is effectively a shared server!\n"; + print " Server type changed to ${VTyellow}shared${VTnorm}.\n"; + $servertype = 'S'; + } + if ($verbose) { + print "\n"; print "The computer hosting the server is described by an URL.\n"; print "The form is scheme://host_name:port\n"; } @@ -481,62 +581,105 @@ print " - host_name can be given as an IP address such as 123.45.67.89\n"; print " or a domain name like localhost or lxr.url.example,\n"; print " - port may be omitted if standard for the scheme.\n"; - print "The following question asks for a primary URL. Later, you'll have\n"; - print "the opportunity to give aliases to this primary URL.\n"; + } + + if ('H' eq $treematch) { + print "${VTyellow}Reminder:${VTnorm} Since you chose to give a different hostname\n"; + print " to every tree, you'll be asked for the hostname when describing\n"; + print " yours trees.\n"; + print "\n"; + goto END_HOST; } my $primaryhost; + if ('P' eq $treematch) { + print "${VTyellow}Prefix mode:${VTnorm} hostname will later be prefixed with a tree-unique\n"; + print " prefix defined in the tree descriptions.\n"; + print "${VTred}Important!${VTnorm} Do not use numeric IP in prefix mode.\n"; + } while (!defined($primaryhost)) { $primaryhost = get_user_choice ( '--- Host name or IP?' - , ('D' eq substr($servertype, 0, 1)) ? -1 : -2 + , ('H' ne $treematch) ? -1 : -2 , [ ] - , ('D' eq substr($servertype, 0, 1)) + , ('H' ne $treematch) ? [ '//localhost' ] : [ ] ); - $primaryhost =~ m!^(https?:)?(//[^:]+)(?::(\d+))?!; - $scheme = $1; + $primaryhost =~ m!^(https?:)?//([^:]+)(?::(\d+))?!; + $scheme = $1; $hostname = $2; - $port = $3; - $scheme = undef if 'http:' eq $scheme; - $port = 80 if !defined($1) && !defined($3); - $port = 443 if 'https:' eq $1 && !defined($3); + $port = $3; + $scheme = 'http:' if !defined($1); + $port = 80 if 'http:' eq $scheme && !defined($3); + $port = 443 if 'https:' eq $1 && !defined($3); if (!defined($hostname)) { print "${VTred}ERROR:${VTnorm} invalid host name or scheme, try again ...\n"; $primaryhost = undef; next; } - if ( 'I' eq substr($servertype, 0, 1) - && ( '//localhost' eq $hostname - || '//127.0.0.1' eq $hostname - ) + } + my $aliashost; + @schemealiases = (); + @hostaliases = (); + @portaliases = (); + while ('' ne ($aliashost = get_user_choice + ( '--- Alias name or IP?' + , -3 + , [ ] + , [ ] + ) + ) + ) {; + $aliashost =~ m!^(https?:)?//([^:]+)(?::(\d+))?!; + my $aliasscheme = $1; + my $aliasname = $2; + my $aliasport = $3; + if (!defined($aliasname)) { + print "${VTred}ERROR:${VTnorm} invalid host name or scheme, try again ...\n"; + next; + } + $aliasscheme = 'http:' if !defined($1); + $aliasport = 80 if 'http:' eq $aliasscheme && !defined($3); + $aliasport = 443 if 'https:' eq $1 && !defined($3); + if ( ($aliasscheme ne $scheme) + || ($aliasport != $port) ) { - print "You are configuring for an independent web server and you named it ${hostname},\n"; - print "which is the common name for the default server\n"; - if ( 'y' eq get_user_choice - ( 'Do you want to change its name?' - , 1 - , [ 'yes', 'no' ] - , [ 'y', 'n' ] - ) - ) { - $primaryhost = undef; - } + print "${VTyellow}Reminder:${VTnorm} scheme: or :port are different on the primary host.\n"; + print "This advanced setting needs manual revision of web-server configuration files.\n"; + print "Otherwise, LXR will answer only on the primary URL\n"; } + push (@schemealiases, $aliasscheme); + push (@hostaliases, $aliasname); + push (@portaliases, $aliasport); } - +END_HOST: $virtrootbase = ''; - if (1 < length($servertype)) { + $commonvirtroot = 0; + if ( 'S' eq $servertype + && 'S' ne $treematch + ) { $virtrootbase = get_user_choice ( 'URL section name for LXR in your server?' , -1 , [ ] , [ '/lxr' ] ); + $virtrootbase =~ s:^/*:/:; # Ensure a starting slash + if ( 'E' ne $treematch + && 'N' ne $treematch + ) { + $commonvirtroot = + 'Y' eq get_user_choice + ( 'Will it be shared by all trees?' + , 1 + , [ 'yes', 'no' ] + , [ 'Y', 'N'] + ); + } } - if ('m' eq $cardinality) { + if ('E' eq $treematch) { if (1 < $verbose) { print "The built-in method to manage several trees with a single instance of LXR is to include\n"; print "a designation of the tree in the URL at the end of the section name.\n"; |
From: Andre-Littoz <ajl...@us...> - 2013-09-02 16:29:07
|
Update of /cvsroot/lxr/lxr/scripts In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23437/scripts Modified Files: configure-lxr.pl Log Message: configure-lxr.pl: new features Add template override directory management, nginx and thttpd configuration file generation, Apache configuration file update on tree addition. Various source editing (layout, more efficient statements, use of here-docs instead of print, ...) Index: configure-lxr.pl =================================================================== RCS file: /cvsroot/lxr/lxr/scripts/configure-lxr.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- configure-lxr.pl 23 Jan 2013 16:48:48 -0000 1.13 +++ configure-lxr.pl 2 Sep 2013 16:29:03 -0000 1.14 @@ -39,14 +39,9 @@ # ############################################################## -# This is a nasty trick to fool Perl into accepting the CVS -# revision tag without trying to make sense with a supposed -# variable (sigils may be separated from the variable name -# by spaces! Not documented of course!) -$_ = ''; # Calm down Perl ardour -my $version ="\$Revision$_"; -$version =~ s/Revision: (.*) $/$1/; -$version =~ s/\$//; +my $version = '$Revision$'; +$version =~ s/Revision: (.*) /$1/; +$version =~ s/\$//g; # Who am I? Strip directory path. my $cmdname = $0; @@ -71,6 +66,7 @@ chomp($rootdir); my ($scriptdir) = $0 =~ m!([^/]+)/[^/]+$!; my $tmpldir = 'templates'; +my $ovrdir = 'custom.d/templates'; my $verbose; my $confout; my $scriptout = 'initdb.sh'; @@ -83,6 +79,7 @@ , 'root-dir=s' => \$rootdir , 'script-out=s'=> \$scriptout , 'tmpl-dir=s' => \$tmpldir + , 'tmpl-ovr=s' => \$ovrdir , 'verbose:2' => \$verbose , 'v+' => \$verbose , 'version' @@ -116,7 +113,13 @@ --tmpl-dir=directory Define template directory (default: $tmpldir) + --tmpl-ovr=directory + Define template user-override directory + (default: $ovrdir) -v, --verbose Explain what is being done + full verbosity: -vv or --verbose, + medium verbosity: -v + minimal verbosity: none --version Print version information and quit lxr-conf-template LXR master configuration template name in templates/ @@ -131,7 +134,7 @@ if ($option{'version'}) { print <<END_VERSION; ${cmdname} version $version -(C) 2012 A. J. Littoz +(C) 2012-2013 A. J. Littoz This is free software under GPL v3 (or higher) licence. There is NO warranty, not even for MERCHANTABILITY nor FITNESS FOR A PARICULAR PURPOSE to the extent permitted by law. @@ -145,6 +148,7 @@ # "Canonise" directory names $confdir =~ s:/*$::; $tmpldir =~ s:/*$::; +$ovrdir =~ s:/*$::; $rootdir =~ s:/*$::; # Check LXR environment @@ -165,7 +169,7 @@ $error = 1; } -if ($scriptout =~ m:/:) { +if (0 <= index($scriptout, '/')) { print "${VTred}ERROR:${VTnorm} output script ${VTred}$scriptout${VTnorm} should not contain directory name!\n"; $error = 1; } @@ -176,27 +180,29 @@ } if (@ARGV == 1) { $lxrtmplconf = $ARGV[0]; - if ($lxrtmplconf =~ m:/:) { + if (0 <= index($lxrtmplconf, '/')) { print "${VTred}ERROR:${VTnorm} template ${VTred}$lxrtmplconf${VTnorm} should not contain directory name!\n"; $error = 1; } } -if (! -e "$tmpldir/$lxrtmplconf") { - print "${VTred}ERROR:${VTnorm} template file" - . " ${VTred}$tmpldir/$lxrtmplconf${VTnorm} does not exist!\n"; +if ( ! -e "$ovrdir/$lxrtmplconf" + && ! -e "$tmpldir/$lxrtmplconf" + ) { + print "${VTred}ERROR:${VTnorm} template file ${VTred}$lxrtmplconf${VTnorm}" + . " exists neither in override nor in templates directory!\n"; $error = 1; } $confout = $lxrtmplconf unless defined($confout); -if ($confout =~ m:/:) { +if (0 <= index($confout, '/')) { print "${VTred}ERROR:${VTnorm} output configuration ${VTred}$confout${VTnorm} should not contain directory name!\n"; $error = 1; } -if ($confout =~ m:\.ctxt$:) { +if (substr($confout, -5) eq '.ctxt') { print "${VTred}ERROR:${VTnorm} output configuration file ${VTred}$confout${VTnorm} has a forbidden extension!\n"; $error = 1; } -if ($confout !~ m:\.conf$:) { +if (substr($confout, -5) ne '.conf') { print "${VTyellow}WARNING:${VTnorm} output configuration file ${VTbold}$confout${VTnorm} has an unusual extension!\n"; } @@ -213,10 +219,12 @@ ############################################################## if ($verbose) { - print "${VTyellow}***${VTnorm} ${VTred}L${VTblue}X${VTgreen}R${VTnorm} configurator (version: $version) ${VTyellow}***${VTnorm}\n"; - print "\n"; - print "LXR root directory is ${VTbold}$rootdir${VTnorm}\n"; - print "Configuration will be stored in ${VTbold}$confdir/${VTnorm}\n"; + print <<END_INTRO; +${VTyellow}***${VTnorm} ${VTred}L${VTblue}X${VTgreen}R${VTnorm} configurator (version: $version) ${VTyellow}***${VTnorm} + +LXR root directory is ${VTbold}$rootdir${VTnorm} +Configuration will be stored in ${VTbold}$confdir/${VTnorm} +END_INTRO } if (! -d $confdir) { @@ -254,11 +262,13 @@ } contextServer ($verbose); if ('c' eq $virtrootpolicy) { - print "${VTyellow}Reminder:${VTnorm} do not forget to implement your management in the following files:\n"; - print "- ${confdir}/${VTbold}apache-lxrserver.conf${VTnorm} if using Apache,\n"; - print "- ${confdir}/${VTbold}lighttpd-lxrserver.conf${VTnorm} if using lighttpd,\n"; - print "- ${confdir}/${VTbold}${confout}${VTnorm} for parameter 'treeextract'.\n"; - print "It is wise to thoroughly read the Web server chapter in the User's Manual.\n"; + print <<END_C_VIRT; +${VTyellow}Reminder:${VTnorm} do not forget to implement your management in the following files: +- ${confdir}/${VTbold}apache-lxrserver.conf${VTnorm} if using Apache, +- ${confdir}/${VTbold}lighttpd-lxrserver.conf${VTnorm} if using lighttpd, +- ${confdir}/${VTbold}${confout}${VTnorm} for parameter 'treeextract'. +It is wise to thoroughly read the Web server chapter in the User's Manual. +END_C_VIRT if ('s' eq get_user_choice ( 'Continue or stop?' , 1 @@ -280,55 +290,59 @@ print "\n"; } $addtree += contextReload ($verbose, "$confdir/$contextfile"); - if ($cardinality eq 's') { - print "${VTred}ERROR:${VTnorm} initial configuration was done for a single tree!\n"; - print "This is not compatible with the present web server configuration.\n"; - print "To add more trees, you must reconfigure for multiple trees.\n"; - exit 1; - } - if ($dbpolicy eq 't') { - print "${VTnorm}\n"; - print "Advanced users can configure different DB engines for different trees.\n"; - print "This is not recommended for average users.\n"; - if ('n' eq get_user_choice - ( 'Use previous DB engine?' - , 1 - , [ 'yes', 'no' ] - , [ 'y', 'n' ] - ) ) { - $dbengine = get_user_choice - ( 'New database engine?' - , 3 - , [ 'mysql', 'oracle', 'postgres', 'sqlite' ] - , [ 'm', 'o', 'p', 's' ] - ); - $dbenginechanged = 1; - } + if ($cardinality eq 's') { + print "${VTred}ERROR:${VTnorm} initial configuration was done for a single tree!\n"; + print "This is not compatible with the present web server configuration.\n"; + print "To add more trees, you must reconfigure for multiple trees.\n"; + exit 1; + } + if ($dbpolicy eq 't') { + print "${VTnorm}\n"; + print "Advanced users can configure different DB engines for different trees.\n"; + print "This is not recommended for average users.\n"; + if ('n' eq get_user_choice + ( 'Use previous DB engine?' + , 1 + , [ 'yes', 'no' ] + , [ 'y', 'n' ] + ) ) { + $dbengine = get_user_choice + ( 'New database engine?' + , 3 + , [ 'mysql', 'oracle', 'postgres', 'sqlite' ] + , [ 'm', 'o', 'p', 's' ] + ); + $dbenginechanged = 1; } + } } if ($addtree != 1) { if ($verbose) { - print "\n"; - print "${VTyellow}***${VTnorm} ${VTred}L${VTblue}X${VTgreen}R${VTnorm} database configuration ${VTyellow}***${VTnorm}\n"; - print "\n"; + print <<END_DB; + +${VTyellow}***${VTnorm} ${VTred}L${VTblue}X${VTgreen}R${VTnorm} database configuration ${VTyellow}***${VTnorm} + +END_DB } if ($verbose > 1) { - print "\n"; - print "The choice of the database engine can make a difference in indexing performance,\n"; - print "but resource consumption is also an important factor.\n"; - print " * For a small personal project, try ${VTbold}SQLite${VTnorm} which do not\n"; - print " need a server and is free from configuration burden.\n"; - print " * For medium to large projects, choice is between ${VTbold}MySQL${VTnorm},\n"; - print " ${VTbold}PostgreSQL${VTnorm} and Oracle.\n"; - print " Oracle is not a free software, its interface has not been\n"; - print " tested for a long time.\n"; - print " * ${VTbold}PostgreSQL${VTnorm} databases are smaller than MySQL's\n"; - print " and performance is roughly equivalent.\n"; - print " * ${VTbold}MySQL${VTnorm} is at its best with large-sized projects\n"; - print " (such as kernel cross-referencing) where it is fastest at the cost\n"; - print " of bigger databases.\n"; - print " * Take also in consideration the number of connected users.\n"; + print <<END_DB; + +The choice of the database engine can make a difference in indexing performance, +but resource consumption is also an important factor. + * For a small personal project, try ${VTbold}SQLite${VTnorm} which do not + need a server and is free from configuration burden. + * For medium to large projects, choice is between ${VTbold}MySQL${VTnorm}, + ${VTbold}PostgreSQL${VTnorm} and Oracle. + Oracle is not a free software, its interface has not been + tested for a long time. + * ${VTbold}PostgreSQL${VTnorm} databases are smaller than MySQL's + and performance is roughly equivalent. + * ${VTbold}MySQL${VTnorm} is at its best with large-sized projects + (such as kernel cross-referencing) where it is fastest at the cost + of bigger databases. + * Take also in consideration the number of connected users. +END_DB } contextDB ($verbose); if ($dbuser) { @@ -359,7 +373,10 @@ # From release 1.1 on, both are stuffed in the same hash since # it simplifies processing in the macro interpreter. my %markers = + # Read-only options and parameters + # (mainly from context) ( '%_add%' => $addtree + , '%_shell%' => 0 , '%_singlecontext%' => $cardinality eq 's' , '%_createglobals%' => $cardinality eq 'm' && ( 0 == $addtree @@ -374,18 +391,27 @@ , '%_nodbuser%' => $nodbuser , '%_nodbprefix%' => $nodbprefix , '%_virtrootpolicy%' => $virtrootpolicy - , '%_virthost%' => 'I' eq substr($servertype, 0, 1) + , '%_routing%' => $treematch + , '%_shared%' => 'S' eq $servertype + , '%_commonvirtroot%' => $commonvirtroot + + # Global parameters: directories, server URL + # (may be overwritten, but not recommended!) + , '%LXRconfUser%' => getlogin # OS-user running configuration + , '%LXRroot%' => $rootdir + , '%LXRtmpldir%' => $tmpldir + , '%LXRovrdir%' => $ovrdir + , '%LXRconfdir%' => $confdir + , '%scheme%' => $scheme + , '%hostname%' => $hostname + , '%schemealiases%' => \@schemealiases + , '%hostaliases%' => \@hostaliases + , '%portaliases%' => \@portaliases + , '%port%' => $port + , '%virtrootbase%' => $virtrootbase ); my $sample; -$markers{'%LXRconfUser%'} = getlogin; # OS-user running configuration -$markers{'%LXRroot%'} = $rootdir; -$markers{'%LXRtmpldir%'} = $tmpldir; -$markers{'%LXRconfdir%'} = $confdir; -$markers{'%scheme%'} = $scheme; -$markers{'%hostname%'} = $hostname; -$markers{'%port%'} = $port; -$markers{'%virtrootbase%'} = $virtrootbase; $sample = `command -v glimpse 2>/dev/null`; chomp($sample); $markers{'%glimpse%'} = $sample if $sample; @@ -501,8 +527,12 @@ sub copy_and_configure_template { my ($fin, $fout, $target) = @_; - unless (open(SOURCE, '<', $fin)) { - die("${VTred}ERROR:${VTnorm} couldn't open template file \"$fin\"\n"); + my $input = $ovrdir . '/' . $fin; + if (! -e $input) { + $input = $tmpldir. '/' . $fin; + } + unless (open(SOURCE, '<', $input)) { + die("${VTred}ERROR:${VTnorm} couldn't open template file \"$input\"\n"); } unless (open(DEST, '>', $fout)) { die("${VTred}ERROR:${VTnorm} couldn't open output file \"$fout\n"); @@ -517,9 +547,9 @@ if ($target && $verbose) { print "file ${VTbold}$target${VTnorm} written into "; if ($fout eq $target) { - print "LXR root"; + print 'LXR root'; } else { - print "configuration"; + print 'configuration'; } print " directory\n"; } @@ -528,51 +558,67 @@ if (!$addtree) { print "\n" if $verbose; - chmod(0555, $tmpldir); - if ($verbose) { - print "templates directory ${VTbold}$tmpldir/${VTnorm} now protected read-only\n" - } + chmod(0555, "$tmpldir/Apache/apache2-require.pl"); # Make sure it is executable +# chmod(0555, $tmpldir); +# if ($verbose) { +# print "templates directory ${VTbold}$tmpldir/${VTnorm} now protected read-only\n" +# } my $target; # Apache: per-directory access control file $target = '.htaccess'; - copy_and_configure_template ( "${tmpldir}/Apache/htaccess-generic" + copy_and_configure_template ( 'Apache/htaccess-generic' , ${target} , $target ); # Apache: mod_perl startup file $target = 'apache2-require.pl'; - copy_and_configure_template ( "${tmpldir}/Apache/$target" + copy_and_configure_template ( "Apache/$target" , "${confdir}/${target}" - , $target + , ${target} ); # Apache: LXR server configuration file $target = 'apache-lxrserver.conf'; - copy_and_configure_template ( "${tmpldir}/Apache/$target" + copy_and_configure_template ( "Apache/$target" , "${confdir}/${target}" - , $target + , ${target} ); # lighttpd: LXR server configuration file $target = 'lighttpd-lxrserver.conf'; - copy_and_configure_template ( "${tmpldir}/lighttpd/$target" + copy_and_configure_template ( "lighttpd/$target" , "${confdir}/${target}" - , $target + , ${target} + ); + + # nginx: LXR server configuration file + $target = 'nginx-lxrserver.conf'; + copy_and_configure_template ( "Nginx/${target}" + , "${confdir}/${target}" + , ${target} + ); + + # thttpd: LXR server configuration file + $target = 'thttpd-lxrserver.conf'; + copy_and_configure_template ( ${target} + , "${confdir}/${target}" + , ${target} ); # Mercurial: extension and configuration file - if (-d "${tmpldir}/Mercurial") { - `cp ${tmpldir}/Mercurial/hg-lxr-ext.py ${confdir}/`; - $target = 'hg.rc'; - copy_and_configure_template ( "${tmpldir}/Mercurial/$target" - , "${confdir}/${target}" - ); - if ($verbose) { - print "${VTbold}Mercurial${VTnorm} support files written into configuration directory\n" - } + $target = 'hg-lxr-ext.py'; + copy_and_configure_template ( "Mercurial/$target" + , "${confdir}/${target}" + ); + $target = 'hg.rc'; + copy_and_configure_template ( "Mercurial/$target" + , "${confdir}/${target}" + ); + if ($verbose) { + print "${VTbold}Mercurial${VTnorm} support files written into configuration directory\n" } } ############################################################## @@ -583,12 +629,14 @@ if (!$addtree) { if ($verbose) { - print "\n"; - print "${VTyellow}***${VTnorm} ${VTred}L${VTblue}X${VTgreen}R${VTnorm} master configuration file setup ${VTyellow}***${VTnorm}\n"; - print " Global section part\n"; - print "\n"; + print <<END_GLOBAL; + +${VTyellow}***${VTnorm} ${VTred}L${VTblue}X${VTgreen}R${VTnorm} master configuration file setup ${VTyellow}***${VTnorm} + Global section part + +END_GLOBAL } - copy_and_configure_template ( "${tmpldir}/$lxrtmplconf" + copy_and_configure_template ( $lxrtmplconf , "${confdir}/${confout}" ); } elsif ($dbenginechanged && !$nodbuser) { @@ -611,11 +659,13 @@ ############################################################## if ($verbose) { - print "\n"; - print "${VTyellow}***${VTnorm} ${VTred}L${VTblue}X${VTgreen}R${VTnorm} master configuration file setup ${VTyellow}***${VTnorm}\n"; - print " Tree section part\n"; - print " SQL script for database initialisation\n"; - print "\n"; + print <<END_TREE; + +${VTyellow}***${VTnorm} ${VTred}L${VTblue}X${VTgreen}R${VTnorm} master configuration file setup ${VTyellow}***${VTnorm} + Tree section part + SQL script for database initialisation + +END_TREE } while (1) { @@ -626,8 +676,12 @@ delete $markers{'%DB_tree_password%'}; delete $markers{'%DB_tbl_prefix%'}; - unless (open(SOURCE, '<', "${tmpldir}/$lxrtmplconf")) { - die("${VTred}ERROR:${VTnorm} couldn't open template file \"${tmpldir}/$lxrtmplconf\"\n"); + my $input = $ovrdir . '/' . $lxrtmplconf; + if (! -e $input) { + $input = ${tmpldir} . '/' . $lxrtmplconf; + } + unless (open(SOURCE, '<', $input)) { + die("${VTred}ERROR:${VTnorm} couldn't open template file \"${input}\"\n"); } pass2_hash ( \*SOURCE @@ -638,9 +692,27 @@ close(SOURCE); + # Update Apache configuration with the new 'virtroot' + $input = $ovrdir . '/Apache/apache-lxrserver.conf'; + if (! -e $input) { + $input = ${tmpldir} . '/Apache/apache-lxrserver.conf'; + } + open(SOURCE, '<', ${input}) + or die("${VTred}ERROR:${VTnorm} couldn't open template file \"${input}\"\n"); + pass2_hash ( \*SOURCE + , "${confdir}/apache-lxrserver.conf" + , \%markers + , $verbose + ); + close(SOURCE); + # Update lighttpd configuration with the new 'virtroot' - open(SOURCE, '<', "${tmpldir}/lighttpd/lighttpd-lxrserver.conf") - or die("${VTred}ERROR:${VTnorm} couldn't open template file \"${tmpldir}/lighttpd/lighttpd-lxrserver.conf\"\n"); + $input = $ovrdir . '/lighttpd/lighttpd-lxrserver.conf'; + if (! -e $input) { + $input = ${tmpldir} . '/lighttpd/lighttpd-lxrserver.conf'; + } + open(SOURCE, '<', ${input}) + or die("${VTred}ERROR:${VTnorm} couldn't open template file \"${input}\"\n"); pass2_hash ( \*SOURCE , "${confdir}/lighttpd-lxrserver.conf" , \%markers @@ -648,6 +720,20 @@ ); close(SOURCE); + # Update Nginx configuration with the new 'virtroot' + $input = $ovrdir . '/Nginx/nginx-lxrserver.conf'; + if (! -e $input) { + $input = ${tmpldir} . '/Nginx/nginx-lxrserver.conf'; + } + open(SOURCE, '<', ${input}) + or die("${VTred}ERROR:${VTnorm} couldn't open template file \"${input}\"\n"); + pass2_hash ( \*SOURCE + , "${confdir}/nginx-lxrserver.conf" + , \%markers + , $verbose + ); + close(SOURCE); + # Have new DB user and password been defined? if (exists($markers{'%DB_tree_user%'})) { if (exists($users{$markers{'%DB_tree_user%'}})) { @@ -667,8 +753,12 @@ $markers{'%DB_tbl_prefix%'} = $markers{'%DB_global_prefix%'}; } - open(SOURCE, '<', "${tmpldir}/initdb/initdb-${dbengine}-template.sql") - or die("${VTred}ERROR:${VTnorm} couldn't open script template file \"${tmpldir}/initdb/initdb-${dbengine}-template.sql\"\n"); + $input = $ovrdir . "/initdb/initdb-${dbengine}-template.sql"; + if (! -e $input) { + $input = ${tmpldir} . "/initdb/initdb-${dbengine}-template.sql"; + } + open(SOURCE, '<', ${input}) + or die("${VTred}ERROR:${VTnorm} couldn't open script template file \"${input}\"\n"); if (!$addtree) { unlink "${confdir}/${scriptout}"; }; @@ -695,6 +785,7 @@ , \%markers , $verbose ); + $markers{'%_shell%'} = 0; close(SOURCE); close(DEST); |
From: Andre-Littoz <ajl...@us...> - 2013-08-31 19:30:36
|
Update of /cvsroot/lxr/lxr/templates In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14046/templates Modified Files: global.conf.part Log Message: templates/global.conf.part: fix for bug #241 - HTML templates not found under Ubuntu Use OS-absolute path in lxr.conf since Ubuntu does not seem to set corrrectly the working directory when launching CGI scripts Index: global.conf.part =================================================================== RCS file: /cvsroot/lxr/lxr/templates/global.conf.part,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- global.conf.part 18 Mar 2013 13:20:57 -0000 1.3 +++ global.conf.part 31 Aug 2013 19:30:32 -0000 1.4 @@ -69,31 +69,31 @@ #@MSG to avoid screen cluttering. #@ASK --- Use 'buttons-and-menus' instead of 'link' interface?; 1;yes, no; Y, N #@IF "%A%" eq 'Y' - , 'htmlhead' => 'templates/html/html-head-btn.html' + , 'htmlhead' => '%LXRroot%/templates/html/html-head-btn.html' #@ELSE - , 'htmlhead' => 'templates/html/html-head.html' + , 'htmlhead' => '%LXRroot%/templates/html/html-head.html' #@ENDIF - , 'htmltail' => 'templates/html/html-tail.html' - , 'htmldir' => 'templates/html/html-dir-indexing.html' + , 'htmltail' => '%LXRroot%/templates/html/html-tail.html' + , 'htmldir' => '%LXRroot%/templates/html/html-dir-indexing.html' # If you do not need the "last indexed" column in directory # display (e.g. for a stable unchanging tree), erase the # '-indexing' suffix above. - , 'htmlident' => 'templates/html/html-ident.html' - , 'htmlsearch' => 'templates/html/html-search-%search_engine%.html' - , 'htmlconfig' => 'templates/html/html-config.html' + , 'htmlident' => '%LXRroot%/templates/html/html-ident.html' + , 'htmlsearch' => '%LXRroot%/templates/html/html-search-%search_engine%.html' + , 'htmlconfig' => '%LXRroot%/templates/html/html-config.html' # htmlhead and htmltail can be customised for the various # LXR operations. Just replace html by source (listing file), # sourcedir (displaying directory), diff (difference markup), # ident (identifier search), search (free-text search) # as below (which changes nothing): -# , 'sourcehead' => 'templates/html/html-head.html' -# , 'sourcedirhead' => 'templates/html/html-head.html' +# , 'sourcehead' => '%LXRroot%/templates/html/html-head.html' +# , 'sourcedirhead' => '%LXRroot%/templates/html/html-head.html' # showconfig script is a bit special since "version" has # no meaning for it. Better to wipe out the 'variables' selection # links with an adequate header: - , 'showconfighead' => 'templates/html/config-head-btn-smaller.html' + , 'showconfighead' => '%LXRroot%/templates/html/config-head-btn-smaller.html' # Default character width of left version (for diff) , 'diffleftwidth' => 50 |
From: Andre-Littoz <ajl...@us...> - 2013-06-05 17:01:44
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3547/lib/LXR Modified Files: Template.pm Log Message: Template.pm: looked-for identifier not showing up in ident page title Fix for bug #238 introduced a regression: directly accessing parameter 'sourcerootname' removed variable substitution; this patch restores the feature. Index: Template.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Template.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Template.pm 3 Jun 2013 11:19:01 -0000 1.24 +++ Template.pm 5 Jun 2013 17:01:41 -0000 1.25 @@ -527,13 +527,13 @@ my $ret; if ($who eq 'source' || $who eq 'diff' || $who eq 'sourcedir') { - $ret = $config->{'sourcerootname'} . $pathname; + $ret = $config->sourcerootname . $pathname; } elsif ($who eq 'ident') { - $ret = $config->{'sourcerootname'} . ' identifier search' + $ret = $config->sourcerootname . ' identifier search' . ($identifier ? ": $identifier" : ''); } elsif ($who eq 'search') { my $s = $HTTP->{'param'}{'_string'}; - $ret = $config->{'sourcerootname'} . ' general search' + $ret = $config->sourcerootname . ' general search' . ($s ? ": $s" : ''); } $ret =~ s/&/&/g; |
From: Andre-Littoz <ajl...@us...> - 2013-06-03 11:19:05
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13367/lib/LXR Modified Files: Template.pm Log Message: Template.pm: looked-for identifier not showing up in ident page title Fix for bug #238: when generating <TITLE> element, sub titleexpand uses parameter $HTTP->{'param'}{'_i'} which comes from QUERY_STRING. But this parameter has been deleted during httpinit to prevent XSS attacks. A sanitized version of this variable is available through global variable $identifier. Replaced $HTTP->... by $identifier. Index: Template.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Template.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Template.pm 12 Apr 2013 14:51:57 -0000 1.23 +++ Template.pm 3 Jun 2013 11:19:01 -0000 1.24 @@ -527,16 +527,16 @@ my $ret; if ($who eq 'source' || $who eq 'diff' || $who eq 'sourcedir') { - $ret = $config->sourcerootname . $pathname; + $ret = $config->{'sourcerootname'} . $pathname; } elsif ($who eq 'ident') { - my $i = $HTTP->{'param'}{'_i'}; - $ret = $config->sourcerootname . ' identifier search' - . ($i ? ": $i" : ''); + $ret = $config->{'sourcerootname'} . ' identifier search' + . ($identifier ? ": $identifier" : ''); } elsif ($who eq 'search') { my $s = $HTTP->{'param'}{'_string'}; - $ret = $config->sourcerootname . ' general search' + $ret = $config->{'sourcerootname'} . ' general search' . ($s ? ": $s" : ''); } + $ret =~ s/&/&/g; $ret =~ s/</</g; $ret =~ s/>/>/g; return $ret; |
From: Andre-Littoz <ajl...@us...> - 2013-05-26 15:03:37
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31905/lib/LXR/Lang Modified Files: Pascal.pm Log Message: Lang/Pascal.pm: typo during modification With parser reorganisation for 1.2.0, an extraneous if block was replaced by a sequence of statements. Unhappily, expression in if was incorrectly converted, leaving an ending parenthesis instead of a semicolon. Index: Pascal.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/Pascal.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Pascal.pm 12 Apr 2013 15:01:09 -0000 1.2 +++ Pascal.pm 26 May 2013 15:03:34 -0000 1.3 @@ -124,7 +124,7 @@ //sx) { # Guard against syntax error or variant # Advance past keyword, so that parsing may continue without loop. - $source =~ s/^([\w]+)//) # Erase keyword + $source =~ s/^(\w+)//; # Erase keyword $dirname = $1; $$frag = "<span class='reserved'>$dirname</span>"; &LXR::SimpleParse::requeuefrag($source); |
From: Andre-Littoz <ajl...@us...> - 2013-04-21 07:45:28
|
Update of /cvsroot/lxr/lxr/doc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15243/doc Modified Files: CHANGES INSTALL Log Message: doc/CHANGES & INSTALL: updates before 1.2.0 release Index: CHANGES =================================================================== RCS file: /cvsroot/lxr/lxr/doc/CHANGES,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- CHANGES 25 Jan 2013 14:43:43 -0000 1.5 +++ CHANGES 21 Apr 2013 07:45:25 -0000 1.6 @@ -1,8 +1,35 @@ -This file draws your attention on changes made for +This file draws your attention on changes made +which could impact your existing trees. - ====================== +If they result in an incompatibility, you must reindex your tree. + + ===================== + LXR 1.1 --> LXR 1.2 + ===================== + +Language parsers +---------------- +Include processing restructured to avoid infinite loop if source does +not match internal grammar; now shared between the languages +Syntax of Java import corrected +C/C++ parsing separated from generic parser +Awk parser enabled +New HTML parser to correct a serious flaw in hyperlink generation + => reindexing recommended + +Custom icons +------------ +New parameter 'parenticon' to define an icon for parent directories + => no impact + +User'Manual +----------- +Updated to reflect new 1.2 features; separately downloadable on SourceFourge. +Please, read it; a lot of time has been invested in its writing. + + ===================== LXR 1.0 --> LXR 1.1 - ====================== + ===================== Easy upgrade ------------ @@ -245,9 +272,9 @@ => no impact (unless you developed your own templates and lxr.css) - ======================== - LXR 0.9.9 --> LXR 0.10 - ======================== + ========================= + LXR 0.9.10 --> LXR 0.10 + ========================= This version contains new features. @@ -258,7 +285,7 @@ New and simpler way of entering the URL of your server with 'host_names' 'baseurl' and 'baseurl_aliases' kept for compatibility => no impact (unless you want to use this new feature) -Custom icons may ve used in directory listing => no impact (unless you want to use this new feature) +Custom icons may be used in directory listing => no impact (unless you want to use this new feature) lxr.css ------- @@ -285,6 +312,7 @@ => no impact on indexing Languages +--------- JavaScript and Ruby added => re-index your tree @@ -313,10 +341,6 @@ LXR 0.9.8 --> LXR 0.9.9 ========================= -which could impact your existing trees. - -If they result in an incompatibility, you must reindex your tree. - lxr.conf -------- File restructured for more logical reading => no impact Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/doc/INSTALL,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- INSTALL 25 Jan 2013 14:43:43 -0000 1.2 +++ INSTALL 21 Apr 2013 07:45:25 -0000 1.3 @@ -10,6 +10,9 @@ First time installation for a single source-tree ------------------------------------------------- (revised September 2012 for 1.0 release) +(configuration wizard for release 1.2 modified March 2013 to cope with +a change in Apache configuration; otherwise unchanged) + These instructions are also available on the web site at http://lxr.sourceforge.net |
From: Andre-Littoz <ajl...@us...> - 2013-04-19 12:42:18
|
Update of /cvsroot/lxr/lxr/templates In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27165/templates Modified Files: filetype.conf Log Message: Lang.pm, Lang/HTML.pm, Lang/generic.conf: fix for bug #234 (endless loop on href= in HTML) HTML hyperlink on href= can't be processed by the generic parser through an 'include' => { } due to multiple checks needed to distinguish between the different cases. Separate HTML parser created. Index: filetype.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/filetype.conf,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- filetype.conf 12 Apr 2013 15:13:16 -0000 1.5 +++ filetype.conf 19 Apr 2013 12:42:14 -0000 1.6 @@ -131,7 +131,7 @@ 'html' => [ 'HTML' , '\.s?html?$' - , 'LXR::Lang::Generic' + , 'LXR::Lang::HTML' , 4 ] , |
From: Andre-Littoz <ajl...@us...> - 2013-04-19 12:42:17
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27165/lib/LXR/Lang Modified Files: generic.conf Log Message: Lang.pm, Lang/HTML.pm, Lang/generic.conf: fix for bug #234 (endless loop on href= in HTML) HTML hyperlink on href= can't be processed by the generic parser through an 'include' => { } due to multiple checks needed to distinguish between the different cases. Separate HTML parser created. Index: generic.conf =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/generic.conf,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- generic.conf 12 Apr 2013 15:13:16 -0000 1.38 +++ generic.conf 19 Apr 2013 12:42:14 -0000 1.39 @@ -635,7 +635,7 @@ , { 'string' => [ "&", ";" ] } ] , 'include' => - { 'directive' => '([\\w]+=)()("|\')(.+)(\g{-3})' + { 'directive' => '(\w+=)()("|\')(.+)("|\')' , 'global' => [ '"', '"' , '"', '"', ''', "'" , '(?i)"', '"', '(?i)'', "'" |
From: Andre-Littoz <ajl...@us...> - 2013-04-19 12:39:59
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26973/lib/LXR/Lang Added Files: HTML.pm Log Message: Lang.pm, Lang/HTML.pm, Lang/generic.conf: fix for bug #234 (endless loop on href= in HTML) HTML hyperlink on href= can't be processed by the generic parser through an 'include' => { } due to multiple checks needed to distinguish between the different cases. Separate HTML parser created. --- NEW FILE: HTML.pm --- # -*- tab-width: 4 -*- ############################################### # # $Id: HTML.pm,v 1.1 2013/04/19 12:39:55 ajlittoz Exp $ # # Implements generic support for any language that ectags can parse. # This may not be ideal support, but it should at least work until # someone writes better support. # # This program 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. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ############################################### =head1 HTML language module This module is the HTML language highlighting engine. It is driven by specifications read from file I<generic.conf>. =cut package LXR::Lang::HTML; $CVSID = '$Id: HTML.pm,v 1.1 2013/04/19 12:39:55 ajlittoz Exp $ '; use strict; require LXR::Lang::Generic; our @ISA = ('LXR::Lang::Generic'); =head2 C<processinclude ($frag, $dir)> Method C<processinclude> is invoked to process an HTML I<include> directive (aka target of an C<<E<lt>AE<gt> >> link or C<<E<lt>IMGE<gt> >> designation. =over =item 1 C<$frag> a I<reference to a string> containing the directive =item 1 C<$dir> an optional I<string> containing a preferred directory for the include'd file =back Targets which obviously aren't files (like C<http:...>) are discarded. Since they are contained in a I<string>, they are requeued and the eventual URLs will be highlighted by string markup. =cut sub processinclude { my ($self, $frag, $dir) = @_; my $source = $$frag; my $dirname; # uses directive name and spacing my $file; # language include file my $path; # OS include file # Faster surrogate for 'directive' if ($source !~ s/^ # reminder: no initial space in the grammar (\w+) # reserved keyword for include construct = ("|') # string opening delimiter (.+) # file name \g{2} # string closing delimiter //sx) { # Guard against syntax error or variant # Advance past keyword, so that parsing may continue without loop. $source =~ s/^(\w+)//; # Erase keyword $dirname = $1; $$frag = ( $self->isreserved($dirname) ? "<span class='reserved'>$dirname</span>" : $dirname ); &LXR::SimpleParse::requeuefrag($source); return; } $dirname = $1; my $delim= $2; $file = $3; $path = $file; $path =~ s/"/"/g; # replace character references in OS name $path =~ s/"/"/g; $path =~ s/'/'/g; $path =~ s/"/"/ig; $path =~ s/'/'/ig; $$frag = ( $self->isreserved($dirname) ? "<span class='reserved'>$dirname</span>" : $dirname ) . '='; # Check for non-files (starts with scheme:) if ($file =~ m!^[a-zA-Z]+:!) { &LXR::Markup::freetextmarkup($file); $$frag .= '<span class="string">' . $delim . $file . $delim . '</span>'; return; } # Create the hyperlink $$frag .= $delim . $self->_linkincludedirs ( &LXR::Common::incref ($file, "include", $path, $dir) , $file , '/' , $path , $dir ) . $delim; } 1; |
From: Andre-Littoz <ajl...@us...> - 2013-04-19 12:23:58
|
Update of /cvsroot/lxr/html/prototype In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26308/prototype Modified Files: bugsandlimits.shtml Log Message: bugsandlimits: HTML parser bug for releases 1.0-1.1 Index: bugsandlimits.shtml =================================================================== RCS file: /cvsroot/lxr/html/prototype/bugsandlimits.shtml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- bugsandlimits.shtml 12 Apr 2013 17:05:10 -0000 1.13 +++ bugsandlimits.shtml 19 Apr 2013 12:23:55 -0000 1.14 @@ -39,6 +39,19 @@ Comment for bug #231 contains a patch for release 1.1.0. </p> </li> + <li class="normal">HTML parser may loop endlessly + <p class="comment"> +Bug also present in release 1.0.0 + </p> + <p class="normal"> +When trying to hyperlink <code><A></code> or <code><IMG></code> elements, +the generic-based HTML parser may fail and not recover, +leading to an endless loop. +It is also not protected against "external" URI +(such as <code>http://…</code>) +where the double slash is taken for an empty file path. + </p> + </li> <li class="normal">Depending on Perl interpreter, identifier search may error out <p class="normal"> @@ -193,7 +206,7 @@ can be considered reliable. </p> <p class="comment"> -The present maintainer do not master all languages. +The present maintainer does not master all languages. Do not hesitate to submit bugs. </p> </li> |
From: Andre-Littoz <ajl...@us...> - 2013-04-19 12:21:13
|
Update of /cvsroot/lxr/html/backstore In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26184/backstore Modified Files: header.shtml lang_link.shtml Log Message: backstore/header.shtml & lang_linlk.shtml: minor change for compatibility with nginx Apache and nginx seem to use slighlty differing SSI engines Index: header.shtml =================================================================== RCS file: /cvsroot/lxr/html/backstore/header.shtml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- header.shtml 11 Mar 2012 14:49:15 -0000 1.1 +++ header.shtml 19 Apr 2013 12:21:09 -0000 1.2 @@ -1,6 +1,5 @@ <!-- Common header to be included on every page --> -<!-- $Id$ --> -<!--#if expr="$SCRIPT_NAME = /^\/(..\/)?((.{3,})\/)?([^\/]*)$/" --><!--#endif --> +<!--#if expr="$SCRIPT_NAME = /^\/(..\/)?((.{3,})\/)?([^\/]*)\$/" --><!--#endif --> <!--#set var="langPrefix" value="$1"--> <!--#set var="pageDir" value="$2"--> <!--#set var="pageFile" value="$4"--> Index: lang_link.shtml =================================================================== RCS file: /cvsroot/lxr/html/backstore/lang_link.shtml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lang_link.shtml 3 Apr 2012 07:14:03 -0000 1.2 +++ lang_link.shtml 19 Apr 2013 12:21:09 -0000 1.3 @@ -1,10 +1,10 @@ -<!-- $Id$ --> -<!--#if expr='$lang_arg = /^([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)/' --><!--#endif --> -<!--#set var=langTarget value=$1 --> -<!--#set var=langDir value="$2" --> -<!--#set var=langIcon value=$3 --> -<!--#set var=langCurrent value="$4" --> -<!--#set var=langJump value="$5" --> +<!--#if expr='$lang_arg = /^([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)/' --> +<!--#set var="langTarget" value="$1" --> +<!--#set var="langDir" value="$2" --> +<!--#set var="langIcon" value="$3" --> +<!--#set var="langCurrent" value="$4" --> +<!--#set var="langJump" value="$5" --> +<!--#endif --> <!--#if expr="$pageLang = $langTarget" --><span style="border: thin solid red; background-color: silver; padding: 0 2px" title="<!--#echo var="langCurrent" -->" ><!--#else --><a href="<!--#echo var="langDir" --><!--#echo var="pageDir" --><!--#echo var="pageFile" -->" |
From: Andre-Littoz <ajl...@us...> - 2013-04-12 17:05:13
|
Update of /cvsroot/lxr/html/en In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21291/en Modified Files: bugsandlimits.shtml Log Message: Update 1.2 features and correct small typos in French version Index: bugsandlimits.shtml =================================================================== RCS file: /cvsroot/lxr/html/en/bugsandlimits.shtml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- bugsandlimits.shtml 14 Mar 2013 18:21:53 -0000 1.12 +++ bugsandlimits.shtml 12 Apr 2013 17:05:09 -0000 1.13 @@ -31,13 +31,22 @@ which freezes the screen on the previous line. </p> <p class="comment"> -This bug will be corrected soon in release 1.1.1. +This bug will be corrected soon in release <del>1.1.1</del> +<ins>1.2.0</ins>. If it is a serious concern for you, look at the <a href="http://sourceforge.net/p/lxr/bugs/">LXR bugs page</a>. Comment for bug #231 contains a patch for release 1.1.0. </p> </li> + <li class="normal">Depending on Perl interpreter, +identifier search may error out + <p class="normal"> +Two lines (419 and 485) in <em>ident</em> use relaxed Perl syntax +instead of "bullet-proof" code. +Comment for bug #233 contains a patch. + </p> + </li> </ul> </li> <li>MySQL |
From: Andre-Littoz <ajl...@us...> - 2013-04-12 15:13:20
|
Update of /cvsroot/lxr/lxr/templates In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16164/templates Modified Files: filetype.conf Log Message: filetype.conf, Lang/generic.conf Various improvements in language descriptions Enable C and Awk parsers Index: filetype.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/filetype.conf,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- filetype.conf 11 Jan 2013 12:22:33 -0000 1.4 +++ filetype.conf 12 Apr 2013 15:13:16 -0000 1.5 @@ -38,7 +38,7 @@ 'asm' => [ 'Asm' , '\.((?i)asm|s|A51|29[kK]|[68][68][kKsSxX]|x[68][68])$' - , 'LXR::Lang::Generic' + , 'LXR::Lang::C' , 4 ] # , @@ -47,13 +47,13 @@ # , '\.as[ap]$' # , # ] -# , -# 'awk' -# [ 'Awk' -# , '\.[gm]?awk$' -# , 'LXR::Lang::Generic' -# , -# ] + , + 'awk' => + [ 'Awk' + , '\.[gm]?awk$' + , 'LXR::Lang::Generic' + , 2 + ] # , # 'basic' # [ 'Basic' @@ -66,14 +66,14 @@ 'C' => [ 'C' , '\.c$|\.pc$' - , 'LXR::Lang::Generic' + , 'LXR::Lang::C' , 4 ] , 'C++' => [ 'C++' , '\.C$|((?i)\.c\+\+$|\.cc$|\.cpp$|\.cxx$|\.h$|\.hh$|\.hpp?$|\.hxx$|\.h\+\+$)' #' - , 'LXR::Lang::Generic' + , 'LXR::Lang::C' , 4 ] , |
From: Andre-Littoz <ajl...@us...> - 2013-04-12 15:01:12
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15721/lib/LXR Modified Files: Lang.pm Log Message: Lang.pm & Lang/*: common factor "include" processing New _linkincludedirs method in base Lang object to be used by all parsers based on Generic.pm. For reliability and ease of maintenability, isolate C/C++ parser from generic and create new C.pm. Some changes in Perl.pm (essentially change in configuration parameter names) Index: Lang.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang.pm,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- Lang.pm 14 Nov 2012 18:39:27 -0000 1.48 +++ Lang.pm 12 Apr 2013 15:01:08 -0000 1.49 @@ -278,6 +278,85 @@ } +=head2 C<_linkincludedirs ($link, $file, $path, $dir)> + +Internal function C<_linkincludedirs> builds links for partial paths in C<$link>. + +=over + +=item 1 C<$link> + +a I<string> containing an already processed link, +i.e. the result of an invocation of C<incref> or C<incdirref>. + +=item 1 C<$file> + +a I<string> containing the target file name in the language-specific +dialect (without language-specific separator replacement), + +=item 1 C<$sep> + +a I<string> containing the language-specific path separator, + +=item 1 C<$path> + +a I<string> containing the target file name as an OS file name +(path separator is /), + +=item 1 C<$dir> + +a I<string> containing the last directory argument for C<incdirref>. + +=back + +This function is a utility function reserved for the language parsers. + +=cut + +sub _linkincludedirs { + my ($self, $link, $file, $sep, $path, $dir) = @_; + my ($sp, $l, $r); # various separator positions + my $tail; + + if (!defined($link)) { + $tail = $file if $path !~ m!/!; + } + # If incref or incdiref did not return a link to the file, + # explore however the path to see if directories are + # known along the way. + while ( $path =~ m!/! + && substr($link, 0, 1) ne '<' + ) { + # NOTE: the following rindex never returns -1, because + # we test for the presence of a separator before + # iterating the loop. + $sp = rindex ($file, $sep); + $tail = substr($file, $sp) . $tail; + $file = substr($file, 0, $sp); + $path =~ s!/[^/]+$!!; + $link = &LXR::Common::incdirref($file, "include", $path, $dir); + } + # A known directory (at least) has been found. + # Build links to higher path elements + if (substr($link, 0, 1) eq '<') { + while ($path =~ m!/!) { + # NOTE: see note above about rindex + $l = index ($link, '>'); + $r = rindex ($link, '<'); + $sp = rindex (substr($link, 1+$l, $r-$l-1), $sep); + substr($link, 1+$l, $sp+length($sep)) = ''; +# $link =~ s!^([^>]+>)([^/]*/)+?([^/<]+<)!$1$3!; + $tail = $sep . $link . $tail; + $sp = rindex ($file, $sep); + $file = substr($file, 0, $sp); + $path =~ s!/[^/]+$!!; + $link = &LXR::Common::incdirref($file, "include", $path, $dir); + } + } + return $link . $tail; +} + + =head2 C<processcode ($code)> Method C<processcode> processes the fragment as code. |
From: Andre-Littoz <ajl...@us...> - 2013-04-12 14:52:00
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15272/lib/LXR Modified Files: Template.pm Log Message: Template.pm: optimise for speed Replace regexp match by direct test for substring Index: Template.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Template.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Template.pm 24 Jan 2013 15:09:52 -0000 1.22 +++ Template.pm 12 Apr 2013 14:51:57 -0000 1.23 @@ -981,7 +981,7 @@ , 'off' => $modeoff } ); - } elsif ($who eq 'source' && $pathname !~ m|/$|) { + } elsif ($who eq 'source' && substr($pathname, -1) ne '/') { $modelink = diffref($modename, "modes", $pathname); $modecss = "modes"; $modelink =~ m!href="(.*?)(\?|">)!; # extract href target as action |
From: Andre-Littoz <ajl...@us...> - 2013-04-08 16:11:33
|
Update of /cvsroot/lxr/lxr In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32625 Modified Files: source Log Message: source: wrong test Reverse comparison operator (eq used instead of ne) for directory test Also, replace ambiguous message (file does not exist) by (filename filtered out) in case 'filter' rule discarded the file Index: source =================================================================== RCS file: /cvsroot/lxr/lxr/source,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- source 18 Mar 2013 13:20:57 -0000 1.64 +++ source 8 Apr 2013 16:11:29 -0000 1.65 @@ -774,7 +774,7 @@ if ($config->filter && $pathname !~ $config->filter) { makeheader('source'); - print("<p class=\"error\">\n<i>The file $pathname does not exist.</i>\n</p>\n"); + print("<p class=\"error\">\n<i>Filename $pathname is discarded by the present <code>'filter'</code> rule.</i>\n</p>\n"); makefooter('source'); exit; } @@ -785,7 +785,7 @@ if ($HTTP->{'param'}{'_raw'}) { printfile(1); } else { - my $type = ((substr($pathname, -1) eq '/') ? 'source' : 'sourcedir'); + my $type = ((substr($pathname, -1) ne '/') ? 'source' : 'sourcedir'); makeheader($type); printfile(0); |
From: Andre-Littoz <ajl...@us...> - 2013-04-08 16:05:08
|
Update of /cvsroot/lxr/lxr In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32138 Modified Files: ident Log Message: ident: fix for bug #233 Relaxed syntax may cause error with some Perl interpreters. Change lines 419 & 485 with @{...} to force "reference" value. Index: ident =================================================================== RCS file: /cvsroot/lxr/lxr/ident,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- ident 21 Nov 2012 15:04:44 -0000 1.36 +++ ident 8 Apr 2013 16:05:04 -0000 1.37 @@ -416,7 +416,7 @@ foreach my $i (@defs) { # Group all definitions from a file my @defn = @$i; $defs{$defn[0]} = [] unless defined($defs{$defn[0]}); - push($defs{$defn[0]}, [ @defn[1..3] ]); + push(@{$defs{$defn[0]}}, [ @defn[1..3] ]); } NATIVE_CASE: # Remove uppercase duplicates foreach (@idefs) { @@ -482,7 +482,7 @@ foreach my $i (@uses) { # Group all usages from a file my @ref = @$i; $uses{$ref[0]} = [] unless defined($uses{$ref[0]}); - push ($uses{$ref[0]}, @ref[1]); + push (@{$uses{$ref[0]}}, @ref[1]); } NATIVE_CASE: # Remove uppercase duplicates foreach (@iuses) { |
From: Andre-Littoz <ajl...@us...> - 2013-03-18 18:26:31
|
Update of /cvsroot/lxr/html/fr In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8285/fr Modified Files: bugsandlimits.shtml index.shtml Log Message: fr/index.shtml, fr/bugsandlimits.shtml: spelling corrections Index: bugsandlimits.shtml =================================================================== RCS file: /cvsroot/lxr/html/fr/bugsandlimits.shtml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- bugsandlimits.shtml 14 Mar 2013 18:21:54 -0000 1.12 +++ bugsandlimits.shtml 18 Mar 2013 18:26:28 -0000 1.13 @@ -169,7 +169,7 @@ Il vaut mieux attendre la version 0.11. </p> </li> - <li>Browsing <em>include</em> files + <li>Navigation dans les fichiers <em>include</em> <p class="normal"> Si vous changez la valeur d'une <em>variable</em> (<em>i.e.</em> version, architecture, …) @@ -181,7 +181,7 @@ Corrigé dans 0.11 </p> </li> - <li>Languages gérés + <li>Langages gérés <p class="normal"> Beaucoup de descriptions de langage sont erronées ou, au mieux, incomplètes. Seuls <strong>C</strong>, <strong>C++</strong> et <strong>Perl</strong> Index: index.shtml =================================================================== RCS file: /cvsroot/lxr/html/fr/index.shtml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- index.shtml 26 Jan 2013 09:44:19 -0000 1.9 +++ index.shtml 18 Mar 2013 18:26:28 -0000 1.10 @@ -111,11 +111,13 @@ <li>Version PDF du <a href="LXRUserManual-beta.pdf">manuel utilisateur</a> de la prochaine version "beta" -<span class="comment">(Le lien est cassé quand aucune nouvelle version + <p class="comment"> +Le lien est cassé quand aucune nouvelle version n'est prévue. Il se peut aussi que le manuel "beta" n'ait pas été traduit; voyez alors la <a href="/en/<!--#echo var="pageDir" --><!--#echo var="pageFile" -->">version anglaise</a> -de cette page)</span> +de cette page. + </p> <p class="normal"> La <a href="http://sourceforge.net/projects/lxr/files/doc/" title="Download page for the manual"> @@ -123,13 +125,13 @@ </p> <p class="comment"> Veuillez signaler toute inexactitude, erreur ou ambiguïté -sur le site du projet -( Le <a href="http://sourceforge.net/p/lxr/discussion">forum</a> convient pour les commentaires, +sur le site du projet. +(Le <a href="http://sourceforge.net/p/lxr/discussion">forum</a> convient pour les commentaires, les erreurs doivent être dénoncées dans le <a href="http://sourceforge.net/p/lxr/bug">bug tracker</a> et vous pouvez même demandez des <a href="http://sourceforge.net/p/lxr/feature-requests">évolutions</a> -s'il manque un sujet) +s'il manque un sujet.) </p> </li> <li><a href="Tips/tips.shtml">Trucs et astuces</a> pour une utilisation efficace |
From: Andre-Littoz <ajl...@us...> - 2013-03-18 13:21:00
|
Update of /cvsroot/lxr/lxr In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25422 Modified Files: source Log Message: source, templates/global.conf.part: add 'parenticon' configuration parameter Also, a few speed optimisations on source Index: source =================================================================== RCS file: /cvsroot/lxr/lxr/source,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- source 17 Jan 2013 09:30:00 -0000 1.63 +++ source 18 Mar 2013 13:20:57 -0000 1.64 @@ -75,7 +75,13 @@ my $img; if ($node eq '../') { - $img = "/icons/back.gif"; + if (exists $config->{'iconfolder'} + && exists $config->{'parenticon'} + ) { + $img = $config->{'iconfolder'} . $config->{'parenticon'}; + } else { + $img = "/icons/back.gif"; + } } else { if (exists $config->{'iconfolder'} && exists $config->{'diricon'} @@ -324,7 +330,7 @@ sub _edittime { my ($thetime) = @_; - if ($thetime =~ m/:/) { # Was a formatted string provided? + if (0 <= index($thetime, ':')) { # Was a formatted string provided? return $thetime; } else { my @t = gmtime($thetime); @@ -690,7 +696,7 @@ sub printfile { my $raw = shift; - if ($pathname =~ m|/$|) { + if (substr($pathname, -1) eq '/') { printdir($pathname); } else { @@ -779,7 +785,7 @@ if ($HTTP->{'param'}{'_raw'}) { printfile(1); } else { - my $type = ($pathname !~ m|/$| ? 'source' : 'sourcedir'); + my $type = ((substr($pathname, -1) eq '/') ? 'source' : 'sourcedir'); makeheader($type); printfile(0); |