1 # ===================================================================== 2 # gencat.rc: W-TW category list generator applet front-end. 3 # 4 # Copyright (c) 2007,2008,2009,2010 Carlo Strozzi 5 # 6 # This program is free software; you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; version 2 dated June, 1991. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with this program; if not, write to the Free Software 17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 # 19 # ===================================================================== 20 21 # ===================================================================== 22 # This program must be run after the group+cf has been read. 23 # ===================================================================== 24 25 ~ $'tbl_group.k_group' () && csaExit.fault 0041 tbl_group.k_group 26 ~ $tw_gstem () && csaExit.fault 0041 tw_gstem 27 28 ~ $gencat_mt () && csaExit.fault 0041 gencat_mt 29 ~ $gencat_mt_rcs () && csaExit.fault 0041 gencat_mt_rcs 30 ~ $gencat_mw () && csaExit.fault 0041 gencat_mw 31 ~ $gencat_mw_rcs () && csaExit.fault 0041 gencat_mw_rcs 32 33 csaIsFullPath --exits --quiet $gencat_pages || 34 csaExit.fault 0037 1 gencat_pages 35 36 csaIsFullPath --exits --quiet $gencat_out || 37 csaExit.fault 0037 1 gencat_out 38 39 csaMkTemp gencat_in 40 41 awktable -i $gencat_pages -- '$k_page ~ /\./ { 42 # Handle page expiration dates, accounting for older 43 # versions of page+dat which may lack that field. 44 if (p_etime/=1) { 45 # Set default expiration date. 46 if ($p_etime == "") $p_etime = "9999-12-31 23:59:59" 47 if ("'$CSA_TIME_ISO'" >= $p_etime && \ 48 $p_descr !~ /^ *-/) $p_descr = "-" $p_descr 49 } 50 # Handle explicit exclusions from static views first. 51 if ($p_descr ~ /^ *!/) next 52 # Exclude hidden/redirected pages. Redirections which are 53 # NOT to be excluded must be *immediately* preceeded by "+" . 54 sub(/\+\(:redirect /,"(:+redirect ",$p_descr) 55 if ($p_descr ~ /(^ *-|\(:redirect )/) next 56 sub(/\(:\+redirect /,"(:redirect ",$p_descr) 57 sub(/\..*/,"",$k_page) 58 sub(/\..*/,"",$p_name) 59 print $k_page, $p_name, $p_descr 60 }' | sort -u -k1,1 > $gencat_in 61 62 csaStatus || csaExit.fault 0003 awktable/sort 63 64 csaAwkCmd genCatlist.awk 65 $CSA_RESULT < $gencat_in > $gencat_out || csaExit.fault 0003 AWK:gencat_xml 66 67 csaAwkCmd mwGetCategories.awk 68 $CSA_RESULT < $gencat_in > $gencat_mw || csaExit.fault 0003 AWK:gencat_mw 69 70 csaAwkCmd mtGetCategoryList.awk 71 $CSA_RESULT < $gencat_in > $gencat_mt || csaExit.fault 0003 AWK:gencat_mt 72 73 csaTrapFile $gencat_mw_rcs $gencat_mt_rcs 74 75 CSA_STATUS = 0 # always recommended. 76 77 # End of program.