8219f0
Update render functionality:
@@ -128,7 +128,7 @@ function render_loadConfig {
|
|
128
128
|
FILE=$(echo $FILE | sed -r 's!^.+/Tpl/!!')
|
129
129
|
|
130
130
|
# Check output directory existence.
|
131
|
-
DIRNAME=$(dirname $
|
131
|
+
DIRNAME=$(dirname $ACTIONVAL/$BOND/$FILE)
|
132
132
|
if [ ! -d $DIRNAME ]; then
|
133
133
|
mkdir -p $DIRNAME
|
134
134
|
fi
|
@@ -139,8 +139,8 @@ function render_loadConfig {
|
|
139
139
|
# This let us reuse translation files using symbolic links
|
140
140
|
# and pointing them to translation template (`Tpl') files.
|
141
141
|
cli_printMessage $TRANSLATION "AsTranslationLine"
|
142
|
-
cli_printMessage $
|
143
|
-
ln -sf $TRANSLATION $
|
142
|
+
cli_printMessage $ACTIONVAL/$BOND/$FILE "AsLinkToLine"
|
143
|
+
ln -sf $TRANSLATION $ACTIONVAL/$BOND/$FILE
|
144
144
|
|
145
145
|
echo '----------------------------------------------------------------------'
|
146
146
|
|
@@ -32,7 +32,7 @@ function render {
|
|
32
32
|
|
33
33
|
# Re-define root directory used to load pre-rendering
|
34
34
|
# configuration scripts based on option value.
|
35
|
-
local ARTCONF=$(echo "$
|
35
|
+
local ARTCONF=$(echo "$ACTIONVAL" \
|
36
36
|
| sed -r -e 's!/(Identity|Translations)!/Scripts/Bash/Functions/Render/Config/\1!' \
|
37
37
|
-e "s!Motifs/$(cli_getThemeName)/?!!")
|
38
38
|
|
@@ -49,11 +49,11 @@ function render_doIdentity {
|
|
49
49
|
render_getIdentityOutputDir
|
50
50
|
|
51
51
|
# Re-define parent directory for current workplace.
|
52
|
-
PARENTDIR=$(basename $
|
52
|
+
PARENTDIR=$(basename $ACTIONVAL)
|
53
53
|
|
54
54
|
# Re-define directory path used as reference to build the list of
|
55
55
|
# files that will be rendered.
|
56
|
-
|
56
|
+
render_getFilesList
|
57
57
|
|
58
58
|
# Define which type of features does centos-art.sh script is able
|
59
59
|
# to performs.
|
@@ -113,7 +113,7 @@ function render_doIdentityGroupByType {
|
|
113
113
|
# last-rendering action. There may be many different files to
|
114
114
|
# process here, so we need to build a list with them all
|
115
115
|
# (without duplications).
|
116
|
-
for FILE in $(find $
|
116
|
+
for FILE in $(find $ACTIONVAL -regextype posix-egrep -type f -regex ${PATTERNS[2]} \
|
117
117
|
| sed -r 's!\.[[:alpha:]]{1,4}$!!' | sort | uniq \
|
118
118
|
| egrep $REGEX);do
|
119
119
|
FILES[$COUNT]="$FILE"
|
@@ -91,7 +91,7 @@ function render_doIdentityImageDm {
|
|
91
91
|
# directories under
|
92
92
|
# trunk/Translations/Identity/Themes/Distro/BootUp/ structure,
|
93
93
|
# using the centos-art.sh script.
|
94
|
-
VERSIONS=$(find $
|
94
|
+
VERSIONS=$(find $ACTIONVAL -regextype posix-egrep \
|
95
95
|
-maxdepth 1 -type d -regex "^.*/${RELEASE_FORMAT}$" \
|
96
96
|
| egrep $REGEX)
|
97
97
|
|
@@ -120,13 +120,13 @@ function render_doIdentityImageDm {
|
|
120
120
|
VERSION=$(basename $VERSION)
|
121
121
|
|
122
122
|
# Define directory to store release-specific images.
|
123
|
-
IMG=$
|
123
|
+
IMG=$ACTIONVAL/$VERSION/Img
|
124
124
|
|
125
125
|
# Check existence of release-specific image directory.
|
126
126
|
cli_checkFiles "$IMG" 'd'
|
127
127
|
|
128
128
|
# Define directory to store release-specific tar.gz files.
|
129
|
-
TGZ=$
|
129
|
+
TGZ=$ACTIONVAL/$VERSION/Tgz
|
130
130
|
|
131
131
|
# Check existence of release-specific tar.gz directory.
|
132
132
|
cli_checkFiles "$TGZ" 'd'
|
@@ -31,7 +31,7 @@ function render_doIdentityImageKsplash {
|
|
31
31
|
local RELDIR=''
|
32
32
|
local KSPLASH_TOP=''
|
33
33
|
local KSPLASH_PREVIEW=''
|
34
|
-
local RELDIRS=$(find $
|
34
|
+
local RELDIRS=$(find $ACTIONVAL -regextype posix-egrep -maxdepth 1 \
|
35
35
|
-type d -regex "^.*/$RELEASE_FORMAT$" | egrep $REGEX)
|
36
36
|
|
37
37
|
# Define font file used to render Preview.png bottom text.
|
@@ -41,8 +41,8 @@ function render_doIdentityImageKsplash {
|
|
41
41
|
# images. Since we are building Preview with active and bottom
|
42
42
|
# splash only, there is no need to include inactive bar on
|
43
43
|
# checking.
|
44
|
-
local KSPLASH_ACTIVE_BAR="$
|
45
|
-
local KSPLASH_BOTTOM="$
|
44
|
+
local KSPLASH_ACTIVE_BAR="$ACTIONVAL/splash_active_bar.png"
|
45
|
+
local KSPLASH_BOTTOM="$ACTIONVAL/splash_bottom.png"
|
46
46
|
|
47
47
|
# Check existence of non-release-specific required image files.
|
48
48
|
cli_checkFiles $KSPLASH_ACTIVE_BAR
|
@@ -28,44 +28,38 @@ function render_getActions {
|
|
28
28
|
|
29
29
|
# Evaluate option name and define which actions does centos-art.sh
|
30
30
|
# script supports.
|
31
|
-
case $
|
31
|
+
case $ACTIONNAM in
|
32
32
|
|
33
|
-
--
|
33
|
+
--directory )
|
34
34
|
|
35
|
-
if [[ $
|
35
|
+
if [[ $ACTIONVAL =~ '^/home/centos/artwork/(trunk|branches|tags)/Identity/.+$' ]];then
|
36
36
|
|
37
37
|
# Define identity rendering support.
|
38
38
|
render_getActionsIdentity
|
39
39
|
|
40
|
-
elif [[ $
|
40
|
+
elif [[ $ACTIONVAL =~ '^/home/centos/artwork/(trunk|branches|tags)/Translations/.+$' ]];then
|
41
41
|
|
42
42
|
# Define translation rendering support.
|
43
43
|
render_getActionsTranslations
|
44
44
|
|
45
45
|
else
|
46
46
|
|
47
|
-
cli_printMessage "`gettext "The path provided can't be processed."`"
|
48
|
-
cli_printMessage
|
47
|
+
cli_printMessage "`gettext "The path provided can't be processed."`" 'AsErrorLine'
|
48
|
+
cli_printMessage "$(caller)" 'AsToKnowMoreLine'
|
49
49
|
|
50
50
|
fi
|
51
51
|
;;
|
52
52
|
|
53
53
|
* )
|
54
54
|
|
55
|
-
cli_printMessage "`eval_gettext "The option provided is not valid."`"
|
55
|
+
cli_printMessage "`eval_gettext "The option provided is not valid."`" 'AsErrorLine'
|
56
|
-
|
57
|
-
if [[ $OPTIONVAL =~ '^/home/centos/artwork/(trunk|branches|tags)/Identity/.+$' ]];then
|
58
|
-
|
59
|
-
cli_printMessage "$OPTIONVAL" "AsToKnowMoreLine"
|
60
|
-
|
61
|
-
elif [[ $OPTIONVAL =~ '^/home/centos/artwork/(trunk|branches|tags)/Translations/.+$' ]];then
|
62
|
-
|
63
|
-
cli_printMessage "$OPTIONVAL" "AsToKnowMoreLine"
|
64
56
|
|
57
|
+
if [[ $ACTIONVAL =~ '^/home/centos/artwork/(trunk|branches|tags)/Identity/.+$' ]];then
|
58
|
+
cli_printMessage "$ACTIONVAL" 'AsToKnowMoreLine'
|
59
|
+
elif [[ $ACTIONVAL =~ '^/home/centos/artwork/(trunk|branches|tags)/Translations/.+$' ]];then
|
60
|
+
cli_printMessage "$ACTIONVAL" 'AsToKnowMoreLine'
|
65
61
|
else
|
66
|
-
|
62
|
+
cli_printMessage "$(caller)" 'AsToKnowMoreLine'
|
67
|
-
cli_printMessage "$(caller)" "AsToKnowMoreLine"
|
68
|
-
|
69
63
|
fi
|
70
64
|
;;
|
71
65
|
|
@@ -50,8 +50,8 @@ function render_getActionsIdentity {
|
|
50
50
|
# directory which currently doesn't exist there is nothing to do
|
51
51
|
# here, so leave a message quit script execution.
|
52
52
|
if [[ ! -d $ARTCONF ]];then
|
53
|
-
cli_printMessage "`gettext "The path provided can't be processed."`"
|
54
|
-
cli_printMessage "$(caller)"
|
53
|
+
cli_printMessage "`gettext "The path provided can't be processed."`" 'AsErrorLine'
|
54
|
+
cli_printMessage "$(caller)" 'AsToKnowMoreLine'
|
55
55
|
fi
|
56
56
|
|
57
57
|
for FILE in $(find $ARTCONF -name 'render.conf.sh');do
|
@@ -81,16 +81,16 @@ function render_getActionsIdentity {
|
|
81
81
|
# configuration scripts and make required transformations.
|
82
82
|
render_checkConfig
|
83
83
|
|
84
|
-
# Re-define option value (
|
84
|
+
# Re-define option value (ACTIONVAL) based on pre-rendering
|
85
85
|
# configuration script path value. Otherwise massive rendering
|
86
86
|
# may fail. Functions like renderImage need to know the exact
|
87
87
|
# artwork path (that is, where images will be stored).
|
88
|
-
|
88
|
+
ACTIONVAL=$(dirname $(echo $FILE | sed -r \
|
89
89
|
-e 's!Scripts/Bash/Functions/Render/Config/Identity/!Identity/!' \
|
90
90
|
-e "s!Themes/!Themes/Motifs/$(cli_getThemeName)/!"))
|
91
91
|
|
92
92
|
# Re-define artwork identification.
|
93
|
-
ARTCOMP=$(echo $
|
93
|
+
ARTCOMP=$(echo $ACTIONVAL | cut -d/ -f6-)
|
94
94
|
|
95
95
|
# Remove motif name from artwork identification in order to reuse
|
96
96
|
# motif artwork identification. There is not need to create one
|
@@ -32,7 +32,7 @@ function render_getActionsTranslations {
|
|
32
32
|
# directory. Translation rendering is based on translation
|
33
33
|
# templates inside 'Tpl/' directory. If that directory doesn't
|
34
34
|
# exist leave a message and quit execution.
|
35
|
-
if [[ ! -d $
|
35
|
+
if [[ ! -d $ACTIONVAL/Tpl ]];then
|
36
36
|
cli_printMessage "`gettext "Can't find translation templates in the directory provided."`"
|
37
37
|
cli_printMessage "$(caller)" "AsToKnowMoreLine"
|
38
38
|
fi
|
@@ -98,7 +98,7 @@ function render_getActionsTranslations {
|
|
98
98
|
# translations directories available in the current location will
|
99
99
|
# be affected.
|
100
100
|
if [[ $REGEX =~ "^$RELEASE_FORMAT$" ]];then
|
101
|
-
RELEASES=$
|
101
|
+
RELEASES=$ACTIONVAL/$REGEX
|
102
102
|
|
103
103
|
# Re-define releases using regular expression value. If you need
|
104
104
|
# to create/update two or more release-specific directories (e.g.,
|
@@ -113,8 +113,8 @@ function render_getActionsTranslations {
|
|
113
113
|
# By default look for available release-specific directories and
|
114
114
|
# use them all.
|
115
115
|
else
|
116
|
-
RELEASES=$(find $
|
117
|
-
-regex "^$
|
116
|
+
RELEASES=$(find $ACTIONVAL -regextype posix-egrep \
|
117
|
+
-regex "^$ACTIONVAL/$RELEASE_FORMAT$" | sort)
|
118
118
|
fi
|
119
119
|
|
120
120
|
# At this point, if there isn't release-specific directories
|
@@ -157,7 +157,7 @@ function render_getActionsTranslations {
|
|
157
157
|
|
158
158
|
# Get translation templates and process them using release
|
159
159
|
# information previously defined.
|
160
|
-
for FILE in $(find $
|
160
|
+
for FILE in $(find $ACTIONVAL/Tpl -name '*.sed');do
|
161
161
|
|
162
162
|
# Define translation file locale.
|
163
163
|
LOCALE=$(echo $FILE | sed -r 's!^/.+/Tpl/([a-z]{2}|[a-z]{2}_[A-Z]{2})/.+$!\1!' )
|
@@ -27,6 +27,31 @@
|
|
27
27
|
|
28
28
|
function render_getFilesList {
|
29
29
|
|
30
|
+
# Define short options we want to support.
|
31
|
+
ARGSS=""
|
32
|
+
|
33
|
+
# Define long options we want to support.
|
34
|
+
ARGSL="filter:"
|
35
|
+
|
36
|
+
# Parse arguments using getopt(1) command parser.
|
37
|
+
cli_doParseArguments
|
38
|
+
|
39
|
+
# Reset positional parameters using output from (getopt) argument
|
40
|
+
# parser.
|
41
|
+
eval set -- "$ARGUMENTS"
|
42
|
+
|
43
|
+
# Define action to take for each option passed.
|
44
|
+
while true; do
|
45
|
+
case "$1" in
|
46
|
+
--filter )
|
47
|
+
REGEX="$2"
|
48
|
+
shift 2
|
49
|
+
;;
|
50
|
+
* )
|
51
|
+
break
|
52
|
+
esac
|
53
|
+
done
|
54
|
+
|
30
55
|
# Define source location to look files for. In order to define
|
31
56
|
# source location we evaluate both matching list and translation
|
32
57
|
# path information, and based on them, we set which is the source
|
@@ -55,7 +55,7 @@ function render_getIdentityDefs {
|
|
55
55
|
# Define the design template absolute path. This definition is
|
56
56
|
# done by interpreting the matching list and translation path
|
57
57
|
# information. This defintion needs to be coherent with those
|
58
|
-
# defined in
|
58
|
+
# defined in render_getFilesList function.
|
59
59
|
if [[ "${MATCHINGLIST}" != "" ]] \
|
60
60
|
&& [[ "${TRANSLATIONPATH}" == "" ]];then
|
61
61
|
|
@@ -345,7 +345,7 @@ function render_getIdentityDefs {
|
|
345
345
|
# Create the design template instance. When building the instance,
|
346
346
|
# take into account the matching list and translation path. It
|
347
347
|
# should be coherent with previous definitions above and in
|
348
|
-
#
|
348
|
+
# render_getFilesList.
|
349
349
|
if [[ "${MATCHINGLIST}" == "" ]] \
|
350
350
|
&& [[ "${TRANSLATIONPATH}" != "" ]];then
|
351
351
|
|
@@ -28,16 +28,16 @@ function render_getIdentityOutputDir {
|
|
28
28
|
|
29
29
|
# By default rendered identity artworks are stored immediatly
|
30
30
|
# under identity entry structure.
|
31
|
-
IMG=$
|
31
|
+
IMG=$ACTIONVAL
|
32
32
|
|
33
33
|
# But if Img/ directory exists, use it instead.
|
34
|
-
if [[ -d $
|
35
|
-
IMG=$
|
34
|
+
if [[ -d $ACTIONVAL/Img ]]; then
|
35
|
+
IMG=$ACTIONVAL/Img
|
36
36
|
fi
|
37
37
|
|
38
38
|
# But if Txt/ directory exists, use it instead.
|
39
|
-
if [[ -d $
|
40
|
-
IMG=$
|
39
|
+
if [[ -d $ACTIONVAL/Txt ]]; then
|
40
|
+
IMG=$ACTIONVAL/Txt
|
41
41
|
fi
|
42
42
|
|
43
43
|
}
|
@@ -28,7 +28,7 @@ function render_getIdentityTemplateDir {
|
|
28
28
|
|
29
29
|
# By default design templates are stored in the artworks identity
|
30
30
|
# entry, under Tpl/ directory.
|
31
|
-
SVG=$
|
31
|
+
SVG=$ACTIONVAL/Tpl
|
32
32
|
|
33
33
|
# If you are rendering theme motifs, design templates are not
|
34
34
|
# stored inside Tpl directory. Instead, we use one common theme
|
@@ -37,7 +37,7 @@ function render_getIdentityTemplateDir {
|
|
37
37
|
# to use before rendering artistic motifs.
|
38
38
|
if [[ ! -d $SVG ]] \
|
39
39
|
&& [[ $SVG =~ "trunk/Identity/Themes/Motifs/$(cli_getThemeName)/" ]]; then
|
40
|
-
SVG=$(echo "$
|
40
|
+
SVG=$(echo "$ACTIONVAL" | sed "s!Motifs/$(cli_getThemeName)!Models/$THEMEMODEL!")
|
41
41
|
fi
|
42
42
|
|
43
43
|
}
|