| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_replaceTMarkers { |
| |
| |
| local -a SRC |
| local -a DST |
| local COUNT=0 |
| local COUNTSRC=0 |
| local COUNTDST=0 |
| local LOCATION='' |
| |
| |
| LOCATION="$1" |
| |
| |
| cli_checkFiles "$LOCATION" 'f' |
| |
| |
| |
| |
| |
| |
| SRC[0]='=COPYRIGHT_YEAR=' |
| SRC[1]='=COPYRIGHT_HOLDER=' |
| SRC[2]='=LICENSE=' |
| SRC[3]='=LICENSE_URL=' |
| SRC[4]='=THEME=' |
| SRC[5]='=THEMENAME=' |
| SRC[6]='=THEMERELEASE=' |
| SRC[7]='=RELEASE=' |
| SRC[8]='=MAJOR_RELEASE=' |
| SRC[9]='=MINOR_RELEASE=' |
| SRC[10]='=URL=' |
| SRC[11]='=ARCH=' |
| SRC[12]='=URL_WIKI=' |
| SRC[13]='=URL_LISTS=' |
| SRC[14]='=URL_FORUMS=' |
| SRC[15]='=URL_MIRRORS=' |
| SRC[16]='=URL_DOCS=' |
| SRC[17]='=MAIL_DOCS=' |
| SRC[18]='=URL_LL=' |
| SRC[19]='=DOMAIN_LL=' |
| SRC[20]='=URL_IRC=' |
| SRC[21]='=LOCALE_LL=' |
| SRC[22]='=LOCALE=' |
| SRC[23]='=REPO_TLDIR=' |
| |
| |
| DST[0]="$(cli_getCopyrightInfo '--copyright-year')" |
| DST[1]="$(cli_getCopyrightInfo '--copyright-holder')" |
| DST[2]="$(cli_getCopyrightInfo '--license')" |
| DST[3]="$(cli_getCopyrightInfo '--license-url')" |
| DST[4]="$(cli_getPathComponent "$OUTPUT" '--theme')" |
| DST[5]="$(cli_getPathComponent "$OUTPUT" '--theme-name')" |
| DST[6]="$(cli_getPathComponent "$OUTPUT" '--theme-release')" |
| DST[7]="$(cli_getPathComponent "$FLAG_RELEASEVER" '--release')" |
| DST[8]="$(cli_getPathComponent "$FLAG_RELEASEVER" '--release-major')" |
| DST[9]="$(cli_getPathComponent "$FLAG_RELEASEVER" '--release-minor')" |
| DST[10]="http://www.centos.org/=URL_LL=" |
| DST[11]="$(cli_getPathComponent "$FLAG_BASEARCH" '--architecture')" |
| DST[12]="http://wiki.centos.org/=URL_LL=" |
| DST[13]="http://lists.centos.org/=URL_LL=" |
| DST[14]="http://forums.centos.org/=URL_LL=" |
| DST[15]="http://mirrors.centos.org/=URL_LL=" |
| DST[16]="http://docs.centos.org/=URL_LL=" |
| DST[17]="centos-docs@centos.org" |
| if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then |
| DST[18]="$(cli_getCurrentLocale '--langcode-only')/" |
| else |
| DST[18]="" |
| fi |
| if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then |
| DST[19]="$(cli_getCurrentLocale '--langcode-only')." |
| else |
| DST[19]="" |
| fi |
| DST[20]='http://www.centos.org/modules/tinycontent/index.php?id=8' |
| DST[21]="$(cli_getCurrentLocale '--langcode-only')" |
| DST[22]="$(cli_getCurrentLocale)" |
| DST[23]="$(cli_getRepoTLDir)" |
| |
| |
| 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 |
| |
| } |