| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_expandTMarkers { |
| |
| |
| local -a SRC |
| local -a DST |
| local COUNT=0 |
| local COUNTSRC=0 |
| local COUNTDST=0 |
| local LOCATION='' |
| |
| |
| LOCATION="$1" |
| |
| |
| cli_checkFiles -e ${LOCATION} |
| |
| |
| SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(_LAST)?=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --year)" |
| SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(S)?_LIST=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --years-list)" |
| SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --holder)" |
| SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER_PREDICATE=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --holder-predicate)" |
| |
| |
| |
| |
| |
| SRC[((++${#SRC[*]}))]='=BRAND=' |
| DST[((++${#DST[*]}))]="${TCAR_BRAND}" |
| |
| |
| SRC[((++${#SRC[*]}))]='=LICENSE=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license)" |
| SRC[((++${#SRC[*]}))]='=LICENSE_URL=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license-url)" |
| |
| |
| SRC[((++${#SRC[*]}))]='=THEME=' |
| DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif)" |
| SRC[((++${#SRC[*]}))]='=THEMENAME=' |
| DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-name)" |
| SRC[((++${#SRC[*]}))]='=THEMERELEASE=' |
| DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-release)" |
| |
| |
| SRC[((++${#SRC[*]}))]='=RELEASE=' |
| DST[((++${#DST[*]}))]="$FLAG_RELEASEVER" |
| SRC[((++${#SRC[*]}))]='=MAJOR_RELEASE=' |
| DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f1)" |
| SRC[((++${#SRC[*]}))]='=MINOR_RELEASE=' |
| DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f2)" |
| |
| |
| SRC[((++${#SRC[*]}))]='=ARCH=' |
| DST[((++${#DST[*]}))]="$(cli_getPathComponent $FLAG_BASEARCH --architecture)" |
| |
| |
| SRC[((++${#SRC[*]}))]='=URL=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--home' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_WIKI=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--wiki' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_LISTS=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--lists' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_FORUMS=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--forums' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_MIRRORS=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--mirrors' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_DOCS=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--docs' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_PROJECTS=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--projects' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_BUGS=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--bugs' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_SVN=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--svn' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_TRAC=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--trac' '--with-locale') |
| SRC[((++${#SRC[*]}))]='=URL_PLANET=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--planet' '--with-locale') |
| |
| |
| SRC[((++${#SRC[*]}))]='=MAIL_DOCS=' |
| DST[((++${#DST[*]}))]="$(cli_printMailingList --docs)" |
| |
| |
| SRC[((++${#SRC[*]}))]='=LOCALE=' |
| DST[((++${#DST[*]}))]="${CLI_LANG_LC}" |
| SRC[((++${#SRC[*]}))]='=LOCALE_LL=' |
| DST[((++${#DST[*]}))]="${CLI_LANG_LL}" |
| SRC[((++${#SRC[*]}))]='=LOCALE_CC=' |
| DST[((++${#DST[*]}))]="${CLI_LANG_CC}" |
| |
| |
| SRC[((++${#SRC[*]}))]='=DOMAIN_LL=' |
| if [[ ! ${CLI_LANG_LL} =~ '^en' ]];then |
| DST[((++${#DST[*]}))]="${CLI_LANG_LL}" |
| else |
| DST[((++${#DST[*]}))]="" |
| fi |
| |
| |
| SRC[((++${#SRC[*]}))]='=REPO_TLDIR=' |
| DST[((++${#DST[*]}))]="${TCAR_WORKDIR}/trunk" |
| SRC[((++${#SRC[*]}))]='=(REPO_HOME|TCAR_WORKDIR)=' |
| DST[((++${#DST[*]}))]="${TCAR_WORKDIR}" |
| |
| |
| while [[ $COUNTDST -lt ${#DST[@]} ]];do |
| |
| |
| |
| |
| if [[ ! ${DST[$COUNTDST]} =~ '=[A-Z_]+=' ]];then |
| |
| COUNTDST=$(($COUNTDST + 1)) |
| |
| |
| |
| continue |
| fi |
| |
| while [[ $COUNTSRC -lt ${#SRC[*]} ]];do |
| |
| |
| DST[$COUNTDST]=$(echo ${DST[$COUNTDST]} \ |
| | sed -r "s!${SRC[$COUNTSRC]}!${DST[$COUNTSRC]}!g") |
| |
| |
| COUNTSRC=$(($COUNTSRC + 1)) |
| |
| done |
| |
| |
| COUNTSRC=0 |
| |
| |
| COUNTDST=$(($COUNTDST + 1)) |
| |
| done |
| |
| |
| while [[ ${COUNT} -lt ${#SRC[*]} ]];do |
| |
| |
| |
| sed -r -i "s!${SRC[$COUNT]}!${DST[$COUNT]}!g" ${LOCATION} |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| |
| |
| |
| |
| |
| sed -r -i 's/(=)\\([A-Z_]+=)/\1\2/g' ${LOCATION} |
| |
| |
| |
| |
| unset SRC |
| unset DST |
| |
| } |