| #!/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 $LOCATION |
| |
| |
| SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR_LAST=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year)" |
| SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year)" |
| SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR_LIST=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year-list)" |
| SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER=' |
| DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-holder)" |
| |
| |
| 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_IRC=' |
| DST[((++${#DST[*]}))]=$(cli_printUrl '--irc') |
| |
| |
| SRC[((++${#SRC[*]}))]='=MAIL_DOCS=' |
| DST[((++${#DST[*]}))]="centos-docs@centos.org" |
| SRC[((++${#SRC[*]}))]='=MAIL_L10N=' |
| DST[((++${#DST[*]}))]="centos-l10n@centos.org" |
| |
| |
| SRC[((++${#SRC[*]}))]='=LOCALE_LL=' |
| DST[((++${#DST[*]}))]="$(cli_getCurrentLocale '--langcode-only')" |
| SRC[((++${#SRC[*]}))]='=LOCALE=' |
| DST[((++${#DST[*]}))]="$(cli_getCurrentLocale)" |
| |
| |
| SRC[((++${#SRC[*]}))]='=DOMAIN_LL=' |
| if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then |
| DST[((++${#DST[*]}))]="$(cli_getCurrentLocale '--langcode-only')." |
| else |
| DST[((++${#DST[*]}))]="" |
| fi |
| |
| |
| SRC[((++${#SRC[*]}))]='=REPO_TLDIR=' |
| DST[((++${#DST[*]}))]="$(cli_getRepoTLDir)" |
| SRC[((++${#SRC[*]}))]='=REPO_HOME=' |
| DST[((++${#DST[*]}))]="${HOME}/artwork" |
| |
| |
| 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 |
| |
| |
| |
| |
| unset SRC |
| unset DST |
| |
| } |