From 3b951515897a8f6089835d3de00b101d5807d07d Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Mar 29 2013 18:24:05 +0000 Subject: Repository's weekly update. - Documentation/Models/Texinfo/Tcar-fs: Remove License directory. Licenses related to Texinfo documentation manuals are reused from Documentation/Models/Texinfo/Default/Licenses directory. - Documentation/Models/Docbook/Tcar-ug/: Rename option from `--sync-changes' to `--synchronize' in all docbook files. This is for consistency with the same change applied to script files. - Scripts/Bash/Functions/Help/help.sh: Set `texinfo' as default documentation format. - Scripts/Bash/Functions/Commons/cli_checkFiles.sh: Update conditional construction used to verify whether files are under version control or not. Don't create another level for error messages here. Instead, use error messages from base (e.g., subversion_isVersioned) functionality. It is important to note here that when version control is disabled in the `centos-art.conf' file, all version control verifications are passed successfully, even when requested locations aren't under version control. - Scripts/Bash/Functions/Help/help_getEntries.sh: Update regular expression used to retrieve the documentation entry from the centos-art.sh command-line with the intention of supporting both Subversion and Git directories layout. In Subversion the first directory level is for trunk, branches and tags. In Git, there is not a need for such special layout in the repository directory structure. - Scripts/Bash/Functions/Help/help_getEntries.sh: Use cli_getRepoName function to define the value of manual's self directory name. This way we reduce the amount of places we need to change, in case the documentation manual used to explain the repository directory structure changes. - Scripts/Bash/Functions/Render/render_doThemeActions.sh: Replace regular expression quotes from "...$" to '...$' in order to prevent security issues as suggested by gettext application. - Scripts/Bash/Functions/Render/Docbook/docbook_expandSystemEntities.sh: Replace regular expression quotes from "...$" to '...$' in order to prevent security issues as suggested by gettext application. - Locales/Scripts/Bash/: Update `es_ES' translation messages. - Scripts/Bash/Functions/: Update `--help' option in _getOptions files in order for documentation entries to be loaded correctly. This change fixes the problem referred as "The documentation entry provided isn't supported.". - Scripts/Bash/Functions/Commons/cli.sh: Don't use eval to execute the function. We aren't doing any conditional evaluation here as to need a return value. Go straight ahead creating a child sub-environment for the new function. - Scripts/Bash/Functions/: Rename environment variable massively from FLAG_SYNC_CHANGES to FLAG_SYNCHRONIZE. Thus, all `--sync-changes' options were also renamed to `--synchronize' as well. - Scripts/Bash/Functions/Vcs/: Don't include getOptions on sub-functionalities. Instead, use the same options layer for both Subversion and Git and write the respective sub-functionalities to perform the same actions based on their specificities. - Scripts/Bash/Functions/Vcs/: Add Vcs functionality and rename functionality from Functions/Svn to Functions/Vcs/Subversion in order to use such name as value on package verification. - Scripts/Bash/Functions/Vcs/vcs.sh: Use vcs_getOptions function as interface to Subversion and Git sub-functionalities. Which version control system is used will depend on the value of package variable inside the `centos-art.conf' file. - Scripts/Bash/Functions/: Rename all invocations related to version control functionality from `svn' to `vcs'. - Start using two digits instead of three on CLI_VERSION variable. - Start using `centos-art.conf' file. This file contains the centos-art.sh script configuration booleans. Here you can determine whether to enable version control tasks or not inside the repository, when using centos-art.sh script. - Scripts/Bash/Functions/Vcs/vcs.sh: Use the `centos-art.conf' file as source to determine whether version control actions should be executed or not. For this it was used the "enabled" variable inside a "version_control" section. - Documentation/Models/Docbook/Tcar-ug/Scripts/Bash.docbook: Update reference title. - Documentation/Models/Docbook/Tcar-ug/Repository/History/2013.docbook: Add file to start documenting repository changes committed in 2013. - Locales/Scripts/Bash/es_ES/Functions/Vcs/: Add es_ES translation files to Vcs functionality. - Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/vcs.docbook: Add file to documetn Vcs functionality. --- diff --git a/Documentation/Models/Docbook/Tcar-ug/Repository.ent b/Documentation/Models/Docbook/Tcar-ug/Repository.ent index e0f889f..8e7526f 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Repository.ent +++ b/Documentation/Models/Docbook/Tcar-ug/Repository.ent @@ -23,3 +23,4 @@ + diff --git a/Documentation/Models/Docbook/Tcar-ug/Repository/History.docbook b/Documentation/Models/Docbook/Tcar-ug/Repository/History.docbook index 6f587c0..ca54c8a 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Repository/History.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Repository/History.docbook @@ -12,5 +12,6 @@ &repo-history-2010; &repo-history-2011; &repo-history-2012; + &repo-history-2013; diff --git a/Documentation/Models/Docbook/Tcar-ug/Repository/History/2013.docbook b/Documentation/Models/Docbook/Tcar-ug/Repository/History/2013.docbook new file mode 100644 index 0000000..8eba393 --- /dev/null +++ b/Documentation/Models/Docbook/Tcar-ug/Repository/History/2013.docbook @@ -0,0 +1,46 @@ +
+ + 2013's + + + &TCAR; development was eventually stopped at November, 2012, + when I moved myself from Cienfuegos to Havana city for working + on the insides restoration of Sagrado Corazón de Jesús + y San Ignacio de Loyola's church (also known + as Reina's church). The first months at Havana were very + difficult, specially at the moment of finding a stable place + to set my personal desktop (I was moved from one apartment to + another, frequently). It wasn't until January, 2013, when I + started to live in the church building itself when more stable + possibilities began to appear. + + + + Update Version Control Back-end + + The version control system functionality was renamed from + svn to in order to handle both Subversion and Git working copies + of &TCAR;. This change prepares the + centos-art.sh script to follow the + suggestion of a complete migration of version control system + from Subversion to Git for &TCAR;, at some point. + + + + + Update DocBook Physical Divisions + + The main purpose of this update is changing the main physical + division of DocBook documents from entities to XInclude. This + change affects both and + functionalities. + + + + ... + + + +
diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts.ent b/Documentation/Models/Docbook/Tcar-ug/Scripts.ent index 5920660..3a8db4c 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts.ent +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts.ent @@ -11,6 +11,6 @@ - + diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash.docbook index 33fcacb..dfb1105 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash.docbook @@ -1,7 +1,8 @@ - The Bash Script Reference - centos-art.sh, version 0.0.4 + The <command>centos-art.sh</command> Reference + Version 0.0.4 + &scripts-bash-intro; &scripts-bash-mission; @@ -16,7 +17,7 @@ &scripts-bash-locale; &scripts-bash-pack; &scripts-bash-tuneup; - &scripts-bash-svn; + &scripts-bash-vcs; &scripts-bash-cli_checkFiles; diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/cliref.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/cliref.docbook index 7763f18..883f9d7 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/cliref.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/cliref.docbook @@ -231,7 +231,7 @@ centos-art render Identity/Images/Themes --with-brands Standardize maintainance tasks inside &TCAR; - + Standardize version control tasks inside &TCAR; diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/funref.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/funref.docbook index 98b7fbc..65e0693 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/funref.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/funref.docbook @@ -880,7 +880,7 @@ splash.svgz = "Symbols/48/=\BRAND=.png:x48+30+20" function is the interface we use inside the centos-art.sh script to execute the Svn functionality described in . + linkend="scripts-bash-vcs" />. Use cli_synchronizeRepoChanges function diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/help.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/help.docbook index 82f1845..55c7e24 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/help.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/help.docbook @@ -19,7 +19,7 @@ -h|--help -q|--quiet --answer-yes - --sync-changes + --synchronize --format="KEYWORD" --search="KEYWORD" --edit @@ -155,7 +155,7 @@ - + Synchronizes available changes between the working copy and @@ -173,8 +173,11 @@ documentation entry, so you always have to provide it in order to reach the documentation entry you want to work with. Possible values for this option are shown in . + linkend="scripts-bash-help-supportedformats" />. When none of + these values is passed as format, Texinfo is used as default + format. + Documentation formats diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/locale.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/locale.docbook index d1a1eed..16c50d4 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/locale.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/locale.docbook @@ -71,7 +71,7 @@ - + Synchronizes available changes between the working copy and diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/prepare.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/prepare.docbook index fc8956a..2c45229 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/prepare.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/prepare.docbook @@ -38,7 +38,7 @@ --links --images --manuals - --sync-changes + --synchronize @@ -62,7 +62,7 @@ --links --images --manuals - --sync-changes + --synchronize diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/render.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/render.docbook index e9ee588..0d98042 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/render.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/render.docbook @@ -27,7 +27,7 @@ --last-rendition="COMMAND" --theme-model="MODELNAME" --with-brands - --sync-changes + --synchronize LOCATION @@ -281,7 +281,7 @@ - + Synchronizes available changes between the working copy and diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/tuneup.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/tuneup.docbook index 1ba5737..5177ca4 100644 --- a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/tuneup.docbook +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/tuneup.docbook @@ -236,7 +236,7 @@ - + Synchronizes available changes between the working copy and diff --git a/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/vcs.docbook b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/vcs.docbook new file mode 100644 index 0000000..d69c5e5 --- /dev/null +++ b/Documentation/Models/Docbook/Tcar-ug/Scripts/Bash/vcs.docbook @@ -0,0 +1,83 @@ + + + + vcs + + Standardize version control tasks inside &TCAR; + + + + + vcs + Standardize version control tasks inside &TCAR; + + + + + ... + + + + + Description + + ... + + + + + Usage + + ... + + + + + Function Specific Environment + + ... + + + + + Authors + + + + ... + + + + + + + License + + + Copyright © =COPYRIGHT_YEAR_LIST= The CentOS Project + + + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + + + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more details. + + + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, + USA. + + + + + diff --git a/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter-menu.texinfo b/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter-menu.texinfo deleted file mode 100755 index b8240ba..0000000 --- a/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter-menu.texinfo +++ /dev/null @@ -1,4 +0,0 @@ -@menu -* GNU General Public License:: -* GNU Free Documentation License:: -@end menu diff --git a/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter-nodes.texinfo b/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter-nodes.texinfo deleted file mode 100755 index da69108..0000000 --- a/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter-nodes.texinfo +++ /dev/null @@ -1,9 +0,0 @@ -@node GNU General Public License -@section GNU General Public License -@cindex GNU General Public License -@include Licenses/GPL.texinfo - -@node GNU Free Documentation License -@section GNU Free Documentation License -@cindex GNU Free Documentation License -@include Licenses/GFDL.texinfo diff --git a/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter.texinfo b/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter.texinfo deleted file mode 100755 index e5ffcbd..0000000 --- a/Documentation/Models/Texinfo/Tcar-fs/en_US/Licenses/chapter.texinfo +++ /dev/null @@ -1,5 +0,0 @@ -@node Licenses -@appendix Licenses -@cindex Licenses -@include Licenses/chapter-menu.texinfo -@include Licenses/chapter-nodes.texinfo diff --git a/Locales/Scripts/Bash/es_ES/Functions/Commons/messages.po b/Locales/Scripts/Bash/es_ES/Functions/Commons/messages.po index 9924fd9..0241fe5 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Commons/messages.po +++ b/Locales/Scripts/Bash/es_ES/Functions/Commons/messages.po @@ -19,11 +19,11 @@ # ---------------------------------------------------------------------- msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" -"Last-Translator: Alain Reguera Delgado \n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" +"Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" "Content-Type: textplain; charset=UTF-8\n" @@ -43,46 +43,41 @@ msgstr "no es un directorio." msgid "doesn't exist." msgstr "no existe." -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:82 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:83 msgid "isn't a regular file." msgstr "no es un fichero regular." -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:89 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:90 msgid "isn't a symbolic link." msgstr "no es un enlace simbólico." -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:96 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:97 msgid "isn't an executable file." msgstr "no es un fichero ejecutable." -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:104 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:105 #, sh-format msgid "isn't a \"$MIME\" file." msgstr "isn't a \"$MIME\" file." -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:111 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:112 #, sh-format msgid "doesn't match its pattern." msgstr "no coincide con su patrón." -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:118 -msgid "isn't under version control." -msgstr "no está bajo control de versión." +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:126 +msgid "isn't installed in the system." +msgstr "no está instalado en el sistema." -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:167 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:176 msgid "The condition command provided isn't supported." msgstr "El comando condicional suministrado no está soportado." #: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:35 -msgid "The export id must be passed as first argument." -msgstr "" -"El identificador de exportación debe ser suministrado como primer argumento." - -#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:37 msgid "The export id doesn't match its pattern." msgstr "El identificador de exportación no coincide su patrón." -#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:72 +#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:70 msgid "No function file was found." msgstr "Ningún fichero de función fue encontrado." @@ -240,3 +235,11 @@ msgstr "Paleta" #: Scripts/Bash/Functions/Commons/cli_unsetFunctions.sh:37 msgid "The export id was not provided." msgstr "El identificador de exportación no fue suministrado." + +#~ msgid "isn't under version control." +#~ msgstr "no está bajo control de versión." + +#~ msgid "The export id must be passed as first argument." +#~ msgstr "" +#~ "El identificador de exportación debe ser suministrado como primer " +#~ "argumento." diff --git a/Locales/Scripts/Bash/es_ES/Functions/Commons/messages.pot b/Locales/Scripts/Bash/es_ES/Functions/Commons/messages.pot index 35597f9..4fbb32f 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Commons/messages.pot +++ b/Locales/Scripts/Bash/es_ES/Functions/Commons/messages.pot @@ -1,15 +1,15 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR The CentOS Project -# This file is distributed under the same license as the centos-art-0.0.4 package. +# This file is distributed under the same license as the centos-art-0.4 package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" "Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" @@ -30,45 +30,41 @@ msgstr "" msgid "doesn't exist." msgstr "" -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:82 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:83 msgid "isn't a regular file." msgstr "" -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:89 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:90 msgid "isn't a symbolic link." msgstr "" -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:96 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:97 msgid "isn't an executable file." msgstr "" -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:104 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:105 #, sh-format msgid "isn't a \"$MIME\" file." msgstr "" -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:111 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:112 #, sh-format msgid "doesn't match its pattern." msgstr "" -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:118 -msgid "isn't under version control." +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:126 +msgid "isn't installed in the system." msgstr "" -#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:167 +#: Scripts/Bash/Functions/Commons/cli_checkFiles.sh:176 msgid "The condition command provided isn't supported." msgstr "" #: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:35 -msgid "The export id must be passed as first argument." -msgstr "" - -#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:37 msgid "The export id doesn't match its pattern." msgstr "" -#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:72 +#: Scripts/Bash/Functions/Commons/cli_exportFunctions.sh:70 msgid "No function file was found." msgstr "" diff --git a/Locales/Scripts/Bash/es_ES/Functions/Help/messages.po b/Locales/Scripts/Bash/es_ES/Functions/Help/messages.po index 996d48a..4d0be94 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Help/messages.po +++ b/Locales/Scripts/Bash/es_ES/Functions/Help/messages.po @@ -19,11 +19,11 @@ # ---------------------------------------------------------------------- msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" -"Last-Translator: Alain Reguera Delgado \n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" +"Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -31,7 +31,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: Scripts/Bash/Functions/Help/Texinfo/texinfo.sh:35 -#: Scripts/Bash/Functions/Help/help_getEntries.sh:102 +#: Scripts/Bash/Functions/Help/help_getEntries.sh:116 msgid "The documentation entry provided isn't supported." msgstr "La entrada de documentación suministrada no está soportada." diff --git a/Locales/Scripts/Bash/es_ES/Functions/Help/messages.pot b/Locales/Scripts/Bash/es_ES/Functions/Help/messages.pot index 40278f2..1be710d 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Help/messages.pot +++ b/Locales/Scripts/Bash/es_ES/Functions/Help/messages.pot @@ -1,15 +1,15 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR The CentOS Project -# This file is distributed under the same license as the centos-art-0.0.4 package. +# This file is distributed under the same license as the centos-art-0.4 package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" "Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: Scripts/Bash/Functions/Help/Texinfo/texinfo.sh:35 -#: Scripts/Bash/Functions/Help/help_getEntries.sh:102 +#: Scripts/Bash/Functions/Help/help_getEntries.sh:116 msgid "The documentation entry provided isn't supported." msgstr "" diff --git a/Locales/Scripts/Bash/es_ES/Functions/Locale/messages.po b/Locales/Scripts/Bash/es_ES/Functions/Locale/messages.po index 163e115..65de374 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Locale/messages.po +++ b/Locales/Scripts/Bash/es_ES/Functions/Locale/messages.po @@ -19,11 +19,11 @@ # ---------------------------------------------------------------------- msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" -"Last-Translator: Alain Reguera Delgado \n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" +"Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -1747,7 +1747,7 @@ msgstr "" msgid "Zulu" msgstr "" -#: Scripts/Bash/Functions/Locale/locale_getOptions.sh:110 +#: Scripts/Bash/Functions/Locale/locale_getOptions.sh:116 msgid "You need to provide one action at least." msgstr "Es necesario que suministre una acción al menos." diff --git a/Locales/Scripts/Bash/es_ES/Functions/Locale/messages.pot b/Locales/Scripts/Bash/es_ES/Functions/Locale/messages.pot index 2f0b940..5391308 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Locale/messages.pot +++ b/Locales/Scripts/Bash/es_ES/Functions/Locale/messages.pot @@ -1,15 +1,15 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR The CentOS Project -# This file is distributed under the same license as the centos-art-0.0.4 package. +# This file is distributed under the same license as the centos-art-0.4 package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" "Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" @@ -1733,7 +1733,7 @@ msgstr "" msgid "Zulu" msgstr "" -#: Scripts/Bash/Functions/Locale/locale_getOptions.sh:110 +#: Scripts/Bash/Functions/Locale/locale_getOptions.sh:116 msgid "You need to provide one action at least." msgstr "" diff --git a/Locales/Scripts/Bash/es_ES/Functions/Prepare/messages.po b/Locales/Scripts/Bash/es_ES/Functions/Prepare/messages.po index 17bdb82..24fe24c 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Prepare/messages.po +++ b/Locales/Scripts/Bash/es_ES/Functions/Prepare/messages.po @@ -19,11 +19,11 @@ # ---------------------------------------------------------------------- msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" -"Last-Translator: Alain Reguera Delgado \n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" +"Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/Locales/Scripts/Bash/es_ES/Functions/Prepare/messages.pot b/Locales/Scripts/Bash/es_ES/Functions/Prepare/messages.pot index e17c806..d65d630 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Prepare/messages.pot +++ b/Locales/Scripts/Bash/es_ES/Functions/Prepare/messages.pot @@ -1,15 +1,15 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR The CentOS Project -# This file is distributed under the same license as the centos-art-0.0.4 package. +# This file is distributed under the same license as the centos-art-0.4 package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" "Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" diff --git a/Locales/Scripts/Bash/es_ES/Functions/Render/messages.po b/Locales/Scripts/Bash/es_ES/Functions/Render/messages.po index 9f26dd0..608da8d 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Render/messages.po +++ b/Locales/Scripts/Bash/es_ES/Functions/Render/messages.po @@ -19,11 +19,11 @@ # ---------------------------------------------------------------------- msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" -"Last-Translator: Alain Reguera Delgado \n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" +"Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -108,6 +108,10 @@ msgstr "El camino suministrado no soporta la producción." msgid "The \"$RENDER_EXTENSION\" file extension is not supported yet." msgstr "La extensión de ficheros \"$RENDER_EXTENSION\" no está soportado aún." +#: Scripts/Bash/Functions/Render/render_doThemeActions.sh:50 +msgid " --type=" +msgstr "" + #: Scripts/Bash/Functions/Render/render_getConfigOption.sh:42 msgid "There is no action string to work with." msgstr "No hay cadena de acción con la cual trabajar." diff --git a/Locales/Scripts/Bash/es_ES/Functions/Render/messages.pot b/Locales/Scripts/Bash/es_ES/Functions/Render/messages.pot index 9296150..b47e46c 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Render/messages.pot +++ b/Locales/Scripts/Bash/es_ES/Functions/Render/messages.pot @@ -1,15 +1,15 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR The CentOS Project -# This file is distributed under the same license as the centos-art-0.0.4 package. +# This file is distributed under the same license as the centos-art-0.4 package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" "Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" @@ -94,6 +94,10 @@ msgstr "" msgid "The \"$RENDER_EXTENSION\" file extension is not supported yet." msgstr "" +#: Scripts/Bash/Functions/Render/render_doThemeActions.sh:50 +msgid " --type=" +msgstr "" + #: Scripts/Bash/Functions/Render/render_getConfigOption.sh:42 msgid "There is no action string to work with." msgstr "" diff --git a/Locales/Scripts/Bash/es_ES/Functions/Tuneup/messages.po b/Locales/Scripts/Bash/es_ES/Functions/Tuneup/messages.po index 9670930..a22d42a 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Tuneup/messages.po +++ b/Locales/Scripts/Bash/es_ES/Functions/Tuneup/messages.po @@ -19,11 +19,11 @@ # ---------------------------------------------------------------------- msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" -"Last-Translator: Alain Reguera Delgado \n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" +"Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/Locales/Scripts/Bash/es_ES/Functions/Tuneup/messages.pot b/Locales/Scripts/Bash/es_ES/Functions/Tuneup/messages.pot index 218e183..117b401 100644 --- a/Locales/Scripts/Bash/es_ES/Functions/Tuneup/messages.pot +++ b/Locales/Scripts/Bash/es_ES/Functions/Tuneup/messages.pot @@ -1,15 +1,15 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR The CentOS Project -# This file is distributed under the same license as the centos-art-0.0.4 package. +# This file is distributed under the same license as the centos-art-0.4 package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: centos-art-0.0.4\n" +"Project-Id-Version: centos-art-0.4\n" "Report-Msgid-Bugs-To: Documentation SIG \n" -"POT-Creation-Date: 2012-12-14 19:34-0500\n" -"PO-Revision-Date: 2012-12-14 19:34-0500\n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" "Last-Translator: Documentation SIG\n" "Language-Team: Español\n" "MIME-Version: 1.0\n" diff --git a/Locales/Scripts/Bash/es_ES/Functions/Vcs/messages.po b/Locales/Scripts/Bash/es_ES/Functions/Vcs/messages.po new file mode 100644 index 0000000..a9ac9f3 --- /dev/null +++ b/Locales/Scripts/Bash/es_ES/Functions/Vcs/messages.po @@ -0,0 +1,90 @@ +# Spanish translations for centos-art-0.4 package +# Traducciones al español para el paquete centos-art-0.4. +# Copyright (C) 2013 The CentOS Project +# This file is distributed under the same license as the centos-art-0.4 package. +# Automatically generated, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: centos-art-0.4\n" +"Report-Msgid-Bugs-To: Documentation SIG \n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" +"Last-Translator: Documentation SIG\n" +"Language-Team: Español\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:47 +msgid "Checking changes in the working copy" +msgstr "Comprobando cambios en la copia de trabajo" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:80 +msgid "Modified" +msgstr "Modificados" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:81 +msgid "Unversioned" +msgstr "Sin versionar" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:82 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:60 +msgid "Deleted" +msgstr "Eliminado" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:83 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:59 +msgid "Added" +msgstr "Adicionado" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:103 +msgid "file in the working copy" +msgid_plural "files in the working copy" +msgstr[0] "fichero en la copia de trabajo" +msgstr[1] "ficheros en la copia de trabajo" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:119 +msgid "Do you want to see changes now?" +msgstr "¿Desea ver los cambios ahora?" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:123 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:140 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:150 +msgid "Do you want to commit changes now?" +msgstr "¿Desea enviar los cambios ahora?" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:134 +msgid "Do you want to add unversioned files now?" +msgstr "¿Desea adicionar ficheros sin versionar ahora?" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_isVersioned.sh:41 +msgid "isn't under version control." +msgstr "no está bajo control de versión." + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:46 +msgid "Bringing changes from the repository into the working copy" +msgstr "Acarreando cambios desde el repositorio hacia la copia de trabajo" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:61 +msgid "Updated" +msgstr "Actualizado" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:62 +msgid "Conflicted" +msgstr "En conflicto" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:63 +msgid "Merged" +msgstr "Mezclado" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:83 +msgid "file from the repository" +msgid_plural "files from the repository" +msgstr[0] "fichero desde el repositorio" +msgstr[1] "ficheros desde el repositorio" + +#: Scripts/Bash/Functions/Vcs/vcs.sh:59 +msgid "isn't supported as version control system." +msgstr "no está soportado como sistema de control de versión." diff --git a/Locales/Scripts/Bash/es_ES/Functions/Vcs/messages.pot b/Locales/Scripts/Bash/es_ES/Functions/Vcs/messages.pot new file mode 100644 index 0000000..4f0dcd8 --- /dev/null +++ b/Locales/Scripts/Bash/es_ES/Functions/Vcs/messages.pot @@ -0,0 +1,90 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR The CentOS Project +# This file is distributed under the same license as the centos-art-0.4 package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: centos-art-0.4\n" +"Report-Msgid-Bugs-To: Documentation SIG \n" +"POT-Creation-Date: 2013-03-23 23:26-0400\n" +"PO-Revision-Date: 2013-03-23 23:26-0400\n" +"Last-Translator: Documentation SIG\n" +"Language-Team: Español\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:47 +msgid "Checking changes in the working copy" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:80 +msgid "Modified" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:81 +msgid "Unversioned" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:82 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:60 +msgid "Deleted" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:83 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:59 +msgid "Added" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:103 +msgid "file in the working copy" +msgid_plural "files in the working copy" +msgstr[0] "" +msgstr[1] "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:119 +msgid "Do you want to see changes now?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:123 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:140 +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:150 +msgid "Do you want to commit changes now?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh:134 +msgid "Do you want to add unversioned files now?" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_isVersioned.sh:41 +msgid "isn't under version control." +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:46 +msgid "Bringing changes from the repository into the working copy" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:61 +msgid "Updated" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:62 +msgid "Conflicted" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:63 +msgid "Merged" +msgstr "" + +#: Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh:83 +msgid "file from the repository" +msgid_plural "files from the repository" +msgstr[0] "" +msgstr[1] "" + +#: Scripts/Bash/Functions/Vcs/vcs.sh:59 +msgid "isn't supported as version control system." +msgstr "" diff --git a/Scripts/Bash/Functions/Commons/cli.sh b/Scripts/Bash/Functions/Commons/cli.sh index 365a6fd..9332bbe 100755 --- a/Scripts/Bash/Functions/Commons/cli.sh +++ b/Scripts/Bash/Functions/Commons/cli.sh @@ -56,10 +56,10 @@ function cli { local FLAG_ANSWER='false' # Initialize default value to commit changes flag. This flag - # (--sync-changes) controls whether subversion is triggered or - # not after realizing changes to source files under version - # control. - local FLAG_SYNC_CHANGES='false' + # (--synchronize) controls whether version control system is + # triggered or not after realizing changes to source files under + # version control. + local FLAG_SYNCHRONIZE='false' # Initialize list of common functionalities to load. local FILES=$(ls ${CLI_FUNCDIR}/Commons/*.sh) @@ -131,6 +131,6 @@ function cli { cli_exportFunctions "${CLI_FUNCDIRNAM}/${CLI_FUNCNAME}" # Execute function. - eval $CLI_FUNCNAME + $CLI_FUNCNAME } diff --git a/Scripts/Bash/Functions/Commons/cli_checkFiles.sh b/Scripts/Bash/Functions/Commons/cli_checkFiles.sh index c172504..24bbec4 100755 --- a/Scripts/Bash/Functions/Commons/cli_checkFiles.sh +++ b/Scripts/Bash/Functions/Commons/cli_checkFiles.sh @@ -31,10 +31,10 @@ function cli_checkFiles { # Define short options. - local ARGSS='i:,r,m:,d,e,f,h,x' + local ARGSS='i:,r,m:,n,d,e,f,h,x' # Define long options. - local ARGSL='mime:,is-versioned,match:' + local ARGSL='mime:,is-versioned,match:,is-installed' # Initialize array variables. local -a CONDITION_COMMAND @@ -74,6 +74,7 @@ function cli_checkFiles { CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]='test' CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='-e' CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "doesn't exist."`" + shift 1 ;; -f ) @@ -110,12 +111,19 @@ function cli_checkFiles { CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="$2" CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`eval_gettext "doesn't match its pattern."`" shift 2 - ;; + ;; -r | --is-versioned ) - CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]="Svn" - CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]='svn_isVersioned' - CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't under version control."`" + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]="centos-art" + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="vcs --is-versioned" + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="" + shift 1 + ;; + + -n | --is-installed ) + CONDITION_COMMAND[((++${#CONDITION_COMMAND[*]}))]="rpm" + CONDITION_PATTERN[((++${#CONDITION_PATTERN[*]}))]="-q --quiet" + CONDITION_MESSAGE[((++${#CONDITION_MESSAGE[*]}))]="`gettext "isn't installed in the system."`" shift 1 ;; @@ -123,6 +131,7 @@ function cli_checkFiles { shift 1 break ;; + esac done @@ -134,23 +143,23 @@ function cli_checkFiles { for FILE in $FILES;do - while [[ ${COUNTER} -lt ${#CONDITION_PATTERN[*]} ]];do + until [[ ${COUNTER} -eq ${#CONDITION_PATTERN[*]} ]];do case ${CONDITION_COMMAND[$COUNTER]} in - "Svn" ) - cli_exportFunctions "${CONDITION_COMMAND[${COUNTER}]}/${CONDITION_PATTERN[$COUNTER]}" - if [[ $(${CONDITION_PATTERN[$COUNTER]} ${FILE}) -ne 0 ]];then \ - cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line - fi - cli_unsetFunctions "${CONDITION_COMMAND[${COUNTER}]}/${CONDITION_PATTERN[$COUNTER]}" - ;; - - "test" ) + "test" | "rpm" ) ${CONDITION_COMMAND[$COUNTER]} ${CONDITION_PATTERN[$COUNTER]} ${FILE} \ || cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line ;; + "centos-art" ) + # Don't create another level for error messages here + # (that would duplicate them unnecessarily). Instead, + # set error messages inside specific functionalities + # and use them directly from there. + cli_runFnEnvironment ${CONDITION_PATTERN[$COUNTER]} ${FILE} + ;; + "file" ) if [[ ! $(${CONDITION_COMMAND[$COUNTER]} ${CONDITION_PATTERN[$COUNTER]} ${FILE}) == "$MIME" ]];then cli_printMessage "${FILE} ${CONDITION_MESSAGE[$COUNTER]}" --as-error-line @@ -166,6 +175,7 @@ function cli_checkFiles { * ) cli_printMessage "`gettext "The condition command provided isn't supported."`" --as-error-line ;; + esac COUNTER=$(($COUNTER + 1)) diff --git a/Scripts/Bash/Functions/Commons/cli_checkRepoDirSource.sh b/Scripts/Bash/Functions/Commons/cli_checkRepoDirSource.sh index e853214..cb107d8 100755 --- a/Scripts/Bash/Functions/Commons/cli_checkRepoDirSource.sh +++ b/Scripts/Bash/Functions/Commons/cli_checkRepoDirSource.sh @@ -42,6 +42,10 @@ function cli_checkRepoDirSource { local LOCATION=${1} + # Remove the working directory absolute path from location to + # avoid path duplications here. + LOCATION=$(echo "$LOCATION" | sed "s,${TCAR_WORKDIR}/,,g") + # When we use Subversion as version control system, we follow the # `trunk', `branches', `tags' convention to organize files inside # the repository and need to redefine the source path in order to diff --git a/Scripts/Bash/Functions/Commons/cli_exportFunctions.sh b/Scripts/Bash/Functions/Commons/cli_exportFunctions.sh index 30a6272..7f11ca2 100755 --- a/Scripts/Bash/Functions/Commons/cli_exportFunctions.sh +++ b/Scripts/Bash/Functions/Commons/cli_exportFunctions.sh @@ -36,7 +36,7 @@ function cli_exportFunctions { fi # Define the source location where function files are placed in. - local LOCATION=${CLI_BASEDIR}/Functions/$(dirname ${EXPORTID}) + local LOCATION=${CLI_FUNCDIR}/$(dirname ${EXPORTID}) # Define suffix used to retrieve function files. local SUFFIX=$(basename "$EXPORTID") diff --git a/Scripts/Bash/Functions/Commons/cli_runFnEnvironment.sh b/Scripts/Bash/Functions/Commons/cli_runFnEnvironment.sh index 3a0925e..7bc53a0 100755 --- a/Scripts/Bash/Functions/Commons/cli_runFnEnvironment.sh +++ b/Scripts/Bash/Functions/Commons/cli_runFnEnvironment.sh @@ -34,7 +34,7 @@ function cli_runFnEnvironment { local STATUS=$? # Finish script execution based on exit status. - if [[ ${STATUS} -eq 1 ]];then + if [[ ${STATUS} -ne 0 ]];then exit ${STATUS} fi diff --git a/Scripts/Bash/Functions/Commons/cli_synchronizeRepoChanges.sh b/Scripts/Bash/Functions/Commons/cli_synchronizeRepoChanges.sh index a9a9da8..d23d2f0 100755 --- a/Scripts/Bash/Functions/Commons/cli_synchronizeRepoChanges.sh +++ b/Scripts/Bash/Functions/Commons/cli_synchronizeRepoChanges.sh @@ -27,8 +27,8 @@ function cli_synchronizeRepoChanges { - # Verify syncronization flag. - if [[ ! $FLAG_SYNC_CHANGES == 'true' ]];then + # Verify synchronization flag. + if [[ ! $FLAG_SYNCHRONIZE == 'true' ]];then return fi @@ -36,6 +36,6 @@ function cli_synchronizeRepoChanges { cli_checkFiles -e $@ # Synchronize changes. - cli_runFnEnvironment svn --sync $@ + cli_runFnEnvironment vcs --synchronize $@ } diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh index 7c7d2ac..2ad58a6 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_checkEntrySrcDst.sh @@ -46,7 +46,7 @@ function texinfo_checkEntrySrcDst { # Verify source location to be sure it is under version control # and there isn't pending change to be committed first. cli_checkFiles ${MANUAL_ENTRY_SRC} --is-versioned - if [[ $(cli_runFnEnvironment svn --get-status ${MANUAL_ENTRY_SRC}) != '' ]];then + if [[ $(cli_runFnEnvironment vcs --get-status ${MANUAL_ENTRY_SRC}) != '' ]];then cli_printMessage "`gettext "The source location has pending changes."`" --as-error-line fi @@ -55,7 +55,7 @@ function texinfo_checkEntrySrcDst { # location into it. If it doesn't exist, use subversion to create # it it. if [[ ! -d $(dirname ${MANUAL_ENTRY_DST}) ]];then - cli_runFnEnvironment svn --mkdir $(dirname ${MANUAL_ENTRY_DST}) + cli_runFnEnvironment vcs --mkdir $(dirname ${MANUAL_ENTRY_DST}) fi # Verify existence of target location. diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh index b1e1ba3..fa45632 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh @@ -59,7 +59,7 @@ function texinfo_copyEntryChapter { for MANUAL_ENTRY in $MANUAL_ENTRIES;do # Copy sections from source chapter to target chapter. - cli_runFnEnvironment svn --copy $MANUAL_ENTRY $MANUAL_ENTRY_DST + cli_runFnEnvironment vcs --copy $MANUAL_ENTRY $MANUAL_ENTRY_DST # Update section menu, nodes and cross reference definitions # to all sections inside the documentation manual. diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntryManual.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntryManual.sh index 14ff1a6..80aa5f1 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntryManual.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntryManual.sh @@ -60,7 +60,7 @@ function texinfo_copyEntryManual { # Copy chapter directory from source to target using # subversion. - cli_runFnEnvironment svn --copy ${MANUAL_CHAPTER} ${MANUAL_BASEDIR_L10N} + cli_runFnEnvironment vcs --copy ${MANUAL_CHAPTER} ${MANUAL_BASEDIR_L10N} # Define manual chapter name. local MANUAL_CHAPTER_NAME=$(basename ${MANUAL_CHAPTER}) diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntrySection.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntrySection.sh index fcec788..e4b6473 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntrySection.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_copyEntrySection.sh @@ -59,7 +59,7 @@ function texinfo_copyEntrySection { texinfo_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" # Copy section entry from source to target using subversion. - cli_runFnEnvironment svn --quiet --copy "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" + cli_runFnEnvironment vcs --quiet --copy "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" # Redefine chapter name using chapter name passed to # `centos-art.sh' script as second non-option argument. diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh index d142442..55a12dc 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_createChapter.sh @@ -63,7 +63,7 @@ function texinfo_createChapter { # where all chapter-specific files will be stored in. if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then cli_printMessage "${MANUAL_CHAPTER_DIR}" --as-creating-line - cli_runFnEnvironment svn --quiet --mkdir ${MANUAL_CHAPTER_DIR} + cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_CHAPTER_DIR} fi # Create chapter-specific files using template files as reference. @@ -79,7 +79,7 @@ function texinfo_createChapter { cli_printMessage "${MANUAL_CHAPTER_DIR}/$(basename ${FILE})" --as-creating-line # Copy template files into the chapter directory. - cli_runFnEnvironment svn --quiet --copy ${FILE} ${MANUAL_CHAPTER_DIR} + cli_runFnEnvironment vcs --quiet --copy ${FILE} ${MANUAL_CHAPTER_DIR} done diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh index 0e7de26..2c7e017 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructure.sh @@ -57,17 +57,18 @@ function texinfo_createStructure { cli_printMessage "`gettext "The manual title cannot be empty."`" --as-error-line fi - # Create manual's top-level directory using subversion. This is - # the place where all texinfo documentation manuals are stored in. + # Create manual's top-level directory using default version + # control system. This is the place where all texinfo + # documentation manuals are stored in. if [[ ! -d ${MANUAL_BASEDIR} ]];then cli_printMessage "${MANUAL_BASEDIR}" --as-creating-line - cli_runFnEnvironment svn --quiet --mkdir ${MANUAL_BASEDIR} + cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR} fi # Create manual's base directory. This is the place where # language-specific documentation source files are stored in. cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line - cli_runFnEnvironment svn --quiet --mkdir ${MANUAL_BASEDIR_L10N} + cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR_L10N} # Define file names required to build the manual. local FILE='' @@ -94,7 +95,7 @@ function texinfo_createStructure { cli_printMessage "${DST}" --as-creating-line # Copy using subversion to register this action. - cli_runFnEnvironment svn --quiet --copy ${FILE} ${DST} + cli_runFnEnvironment vcs --quiet --copy ${FILE} ${DST} # Expand common translation markers inside target file. cli_expandTMarkers ${DST} diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructureChapters.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructureChapters.sh index 4b21640..8ed7a7d 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructureChapters.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_createStructureChapters.sh @@ -56,11 +56,11 @@ function texinfo_createStructureChapters { # Verify chapter's directory. If it doesn't exist, create it. if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then - cli_runFnEnvironment svn --quiet --mkdir ${MANUAL_CHAPTER_DIR} + cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_CHAPTER_DIR} fi # Copy template files into chapter's directory. - cli_runFnEnvironment svn --quiet --copy ${FILE} ${MANUAL_CHAPTER_DIR} + cli_runFnEnvironment vcs --quiet --copy ${FILE} ${MANUAL_CHAPTER_DIR} done diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh index 56f4319..0a8fc5e 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh @@ -2,10 +2,10 @@ # # texinfo_deleteCrossReferences.sh -- This function looks inside # texinfo source files, from section level on, and removes all cross -# referece definitions related to a documentation entry. Use this +# reference definitions related to a documentation entry. Use this # function in coordination with texinfo_deleteEntry function, in order # to keep cross reference information, inside the documentation -# manual, syncronized. +# manual, synchronized. # # Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project # diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh index 6ee7241..be3d398 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh @@ -51,7 +51,7 @@ function texinfo_deleteEntryChapter { # Remove chapter directory using subversion to register the # change. - cli_runFnEnvironment svn --quiet --delete ${MANUAL_CHAPTER_DIR} + cli_runFnEnvironment vcs --quiet --delete ${MANUAL_CHAPTER_DIR} # Update chapter menu and nodes inside manual structure. texinfo_updateChapterMenu --delete-entry diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh index 8f64efd..cf08b28 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh @@ -35,7 +35,7 @@ function texinfo_deleteEntryManual { # Remove locale-specific documentation manual directory from the # working copy. Using subversion to register the change. Be sure # that related output files are removed too. - cli_runFnEnvironment svn --quiet --delete ${MANUAL_BASEDIR_L10N} + cli_runFnEnvironment vcs --quiet --delete ${MANUAL_BASEDIR_L10N} # Verify manual base directory. When the locale-specific # documentation manual is the last one inside the manual base @@ -45,11 +45,11 @@ function texinfo_deleteEntryManual { if [[ $(ls -1 $MANUAL_BASEDIR | wc -l) -le 1 ]];then # Remove manual base directory. - cli_runFnEnvironment svn --delete ${MANUAL_BASEDIR} + cli_runFnEnvironment vcs --delete ${MANUAL_BASEDIR} # Redefine absolute paths to changed directory. This is - # required in order for `svn_commitRepoChanges' to be aware - # that we are deleting MANUAL_BASEDIR, not + # required in order for `subversion_commitRepoChanges' to be + # aware that we are deleting MANUAL_BASEDIR, not # MANUAL_BASEDIR_L10N. MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR}" diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh index 7a9e137..211e018 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh @@ -27,7 +27,7 @@ function texinfo_deleteEntrySection { # Remove documentation entry using subversion to register the # change. - cli_runFnEnvironment svn --delete "${MANUAL_ENTRY}" + cli_runFnEnvironment vcs --delete "${MANUAL_ENTRY}" # Update section menu, nodes and cross references. texinfo_updateStructureSection "${MANUAL_ENTRY}" --delete diff --git a/Scripts/Bash/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh b/Scripts/Bash/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh index b850d46..4b60bdc 100755 --- a/Scripts/Bash/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh +++ b/Scripts/Bash/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh @@ -46,7 +46,7 @@ function texinfo_updateSectionNodes { # deletion, they will be created again from texinfo template # to working copy and that might create confusion. if [[ ! -f ${MANUAL_BASEDIR_L10N}/$INCL ]] \ - && [[ $(cli_runFnEnvironment svn --get-status ${MANUAL_BASEDIR_L10N}/$INCL) != 'D' ]];then + && [[ $(cli_runFnEnvironment vcs --get-status ${MANUAL_BASEDIR_L10N}/$INCL) != 'D' ]];then # Retrive configuration lines from configuration file. Be # sure no line begining with `#' or space remain in the @@ -91,7 +91,7 @@ function texinfo_updateSectionNodes { # Create documentation entry using texinfo template as # reference. - cli_runFnEnvironment svn --copy ${TEMPLATE} ${MANUAL_BASEDIR_L10N}/$INCL + cli_runFnEnvironment vcs --copy ${TEMPLATE} ${MANUAL_BASEDIR_L10N}/$INCL fi diff --git a/Scripts/Bash/Functions/Help/help.sh b/Scripts/Bash/Functions/Help/help.sh index effcb89..e51c2c7 100755 --- a/Scripts/Bash/Functions/Help/help.sh +++ b/Scripts/Bash/Functions/Help/help.sh @@ -44,11 +44,10 @@ function help { # kind of source files we work with inside the documentation # manual as well as the kind of actions required by them to # perform actions related to document management (e.g., creation, - # edition, deletion, copying, renaming, etc.). By default no - # documentation format is specified, so it needs to be specified - # later, either through the `--format' option, or direct request - # to user. - local FLAG_FORMAT='' + # edition, deletion, copying, renaming, etc.). By default texinfo + # format is used. Other formats can be specified in the + # command-line using the `--format' option. + local FLAG_FORMAT='texinfo' # Initialize specific function export id. This value is redefined # later once we know which is the documentation format. diff --git a/Scripts/Bash/Functions/Help/help_getEntries.sh b/Scripts/Bash/Functions/Help/help_getEntries.sh index 02f53ac..14d800c 100755 --- a/Scripts/Bash/Functions/Help/help_getEntries.sh +++ b/Scripts/Bash/Functions/Help/help_getEntries.sh @@ -55,38 +55,52 @@ function help_getEntries { # Manual self name. MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $1 }') -f \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $1 }') -f \ | tr '[:upper:]' '[:lower:]') # Manual self directory name. MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $1 }') -d ) + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $1 }') -d ) # Manual part name. MANUAL_PART[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $2 }') -d ) + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $2 }') -d ) # Manual chapter name. MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $3 }') -d ) + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $3 }') -d ) # Manual section name. MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $4 }' | tr '/' '-') -f ) - - elif [[ ${MANUAL_DOCENTRY} =~ '^(trunk|branches|tags)' ]];then - - # When `path/to/dir' is used as format to documentation - # entry, you cannot specify the manual chapter or section - # where documentation actions will take place on. Instead, - # they are predefined for you here. Use this format to - # document directories inside your working copy. + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $4 }' | tr '/' '-') -f ) + + elif [[ ${MANUAL_DOCENTRY} =~ "^(trunk|branches|tags)?(/)?($(ls ${TCAR_WORKDIR} \ + | tr '[[:space:]]' '|' | sed 's/|$//'))" ]];then + + # When we use the `path/to/dir' as format to reach + # documentation entries, you cannot specify the manual + # chapter or section where documentation actions will take + # place on. Instead, they are predefined for you here. Use + # this format to quickly document directories inside your + # working copy. + # + # When we use the `path/to/dir' format to reach + # documentation entries, there is a distinction between + # Subversion and Git version control system we need to be + # aware of. This is the directory structure layout used + # in the repository. In Subversion, we use a trunk/, + # branches/, tags/ layout as first level in the repository + # directory structure but, in Git, we don't need such + # special layout in the repository's first directory + # level. The script must be able to understand both + # directory structures. # Manual's self name. MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' # Manual's self directory name. - MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]='Tcar-fs' + MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + ${MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]} -d) # Manual's chapter name. MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ diff --git a/Scripts/Bash/Functions/Help/help_getOptions.sh b/Scripts/Bash/Functions/Help/help_getOptions.sh index 0c0d49e..a5882ca 100755 --- a/Scripts/Bash/Functions/Help/help_getOptions.sh +++ b/Scripts/Bash/Functions/Help/help_getOptions.sh @@ -30,7 +30,7 @@ function help_getOptions { local ARGSS="h,q" # Define long options we want to support. - local ARGSL="help,quiet,answer-yes,read,search:,format:,edit,update-output,update-structure,copy,delete,rename,sync-changes" + local ARGSL="help,quiet,answer-yes,read,search:,format:,edit,update-output,update-structure,copy,delete,rename,synchronize" # Redefine ARGUMENTS using getopt(1) command parser. cli_parseArguments @@ -44,7 +44,7 @@ function help_getOptions { case "$1" in -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" Scripts/Bash/Functions/Help + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-help" shift 1 exit ;; @@ -59,8 +59,8 @@ function help_getOptions { shift 1 ;; - --sync-changes ) - FLAG_SYNC_CHANGES="true" + --synchronize ) + FLAG_SYNCHRONIZE="true" shift 1 ;; diff --git a/Scripts/Bash/Functions/Locale/locale_getOptions.sh b/Scripts/Bash/Functions/Locale/locale_getOptions.sh index 6cc3a39..5cd53b1 100755 --- a/Scripts/Bash/Functions/Locale/locale_getOptions.sh +++ b/Scripts/Bash/Functions/Locale/locale_getOptions.sh @@ -27,10 +27,10 @@ function locale_getOptions { # Define short options we want to support. - local ARGSS="q" + local ARGSS="h,q" # Define long options we want to support. - local ARGSL="quiet,filter:,answer-yes,update,edit,delete,dont-create-mo,is-localizable,sync-changes" + local ARGSL="help,quiet,filter:,answer-yes,update,edit,delete,dont-create-mo,is-localizable,synchronize" # Redefine ARGUMENTS using getopt(1) command parser. cli_parseArguments @@ -43,9 +43,10 @@ function locale_getOptions { while true; do case "$1" in - --filter ) - FLAG_FILTER="$2" - shift 2 + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-locale" + shift 1 + exit ;; -q | --quiet ) @@ -53,6 +54,11 @@ function locale_getOptions { shift 1 ;; + --filter ) + FLAG_FILTER="$2" + shift 2 + ;; + --answer-yes ) FLAG_ANSWER="true" shift 1 @@ -83,8 +89,8 @@ function locale_getOptions { shift 1 ;; - --sync-changes ) - FLAG_SYNC_CHANGES="true" + --synchronize ) + FLAG_SYNCHRONIZE="true" shift 1 ;; diff --git a/Scripts/Bash/Functions/Prepare/prepare_getOptions.sh b/Scripts/Bash/Functions/Prepare/prepare_getOptions.sh index 6062925..dcada92 100755 --- a/Scripts/Bash/Functions/Prepare/prepare_getOptions.sh +++ b/Scripts/Bash/Functions/Prepare/prepare_getOptions.sh @@ -28,10 +28,10 @@ function prepare_getOptions { # Define short options we want to support. - local ARGSS="q,h" + local ARGSS="h,q" # Define long options we want to support. - local ARGSL="quiet,help,answer-yes,packages,locales,links,images,manuals,set-environment,see-environment,sync-changes" + local ARGSL="help,quiet,answer-yes,packages,locales,links,images,manuals,set-environment,see-environment,synchronize" # Redefine ARGUMENTS using getopt(1) command parser. cli_parseArguments @@ -45,7 +45,7 @@ function prepare_getOptions { case "$1" in -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" Scripts/Bash/Functions/Prepare + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-prepare" shift 1 exit ;; @@ -95,8 +95,8 @@ function prepare_getOptions { shift 1 ;; - --sync-changes ) - FLAG_SYNC_CHANGES="true" + --synchronize ) + FLAG_SYNCHRONIZE="true" shift 1 ;; diff --git a/Scripts/Bash/Functions/Prepare/prepare_updateEnvironment.sh b/Scripts/Bash/Functions/Prepare/prepare_updateEnvironment.sh index 1253953..c5c5bc6 100755 --- a/Scripts/Bash/Functions/Prepare/prepare_updateEnvironment.sh +++ b/Scripts/Bash/Functions/Prepare/prepare_updateEnvironment.sh @@ -31,7 +31,7 @@ function prepare_updateEnvironment { # Verify that centos-art.sh script is run using an absolute path. # We use this information to determine the exact working copy # location to use, later when `bash_profile' file is created. - if [[ ! $0 =~ "^/[[:alnum:]/_-]+${CLI_NAME}.sh$" ]];then + if [[ ! $0 =~ "^${HOME}/.+/${CLI_NAME}.sh$" ]];then cli_printMessage "`gettext "To set environment variables you should run centos-art.sh using its abosolute path."`" --as-error-line fi @@ -39,11 +39,15 @@ function prepare_updateEnvironment { local SOURCE=${PREPARE_CONFIG_DIR}/${PROFILE}.conf local TARGET=${HOME}/.${PROFILE} - # Determine which is the absolute path the script has been - # executed from. This information will be used to construct the - # working copy absolute path and will easy the procedure to follow - # when a new absolute path should be defined for the working copy. - local TCAR_WORKDIR=$(dirname "$0") + # Determine the repository absolute path using the script absolute + # path the script has been executed from. Be careful when you use + # the centos-art command. It points to ~/bin directory which is + # not (and must not be) the repository working copy absolute path. + if [[ $TCAR_WORKDIR =~ "^${HOME}/bin" ]];then + cli_printMessage "`eval_gettext "The repository working directory cannot be $HOME/bin"`" --as-error-line + else + local TCAR_WORKDIR=$(dirname "$0" | sed "s,${TCAR_BASHSCRIPTS},,") + fi # Determine which is the brand information that will be used as # repository brand information. By default we are using `centos' diff --git a/Scripts/Bash/Functions/Render/Docbook/docbook_expandSystemEntities.sh b/Scripts/Bash/Functions/Render/Docbook/docbook_expandSystemEntities.sh index 4d6c768..01e9a6d 100755 --- a/Scripts/Bash/Functions/Render/Docbook/docbook_expandSystemEntities.sh +++ b/Scripts/Bash/Functions/Render/Docbook/docbook_expandSystemEntities.sh @@ -33,7 +33,7 @@ function docbook_expandSystemEntities { # Define absolute path to both common and specific system # entities. local ENTITIES_PATHS="$(cli_getFilesList ${DOCBOOK_MODELS}/Default/Book $(dirname ${TEMPLATE}) \ - --pattern="^.*/[[:alpha:]-]+\.ent$" --maxdepth=1 --mindepth=1 --type='f')" + --pattern='^.*/[[:alpha:]-]+\.ent$' --maxdepth=1 --mindepth=1 --type='f')" # Build definition of both common and specific system entities. local ENTITIES="$(\ diff --git a/Scripts/Bash/Functions/Render/Svg/svg_convertPngToGrub.sh b/Scripts/Bash/Functions/Render/Svg/svg_convertPngToGrub.sh index 28a5a1c..74cae60 100755 --- a/Scripts/Bash/Functions/Render/Svg/svg_convertPngToGrub.sh +++ b/Scripts/Bash/Functions/Render/Svg/svg_convertPngToGrub.sh @@ -102,7 +102,7 @@ function svg_convertPngToGrub { # of the change) and expand translation markers in the copied # instance. if [[ ! -f $PALETTE_GPL ]];then - cli_runFnEnvironment svn --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/grub.gpl ${PALETTE_GPL} + cli_runFnEnvironment vcs --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/grub.gpl ${PALETTE_GPL} cli_expandTMarkers ${PALETTE_GPL} fi diff --git a/Scripts/Bash/Functions/Render/Svg/svg_convertPngToSyslinux.sh b/Scripts/Bash/Functions/Render/Svg/svg_convertPngToSyslinux.sh index 4ee30e2..3fc86ac 100755 --- a/Scripts/Bash/Functions/Render/Svg/svg_convertPngToSyslinux.sh +++ b/Scripts/Bash/Functions/Render/Svg/svg_convertPngToSyslinux.sh @@ -116,7 +116,7 @@ function svg_convertPngToSyslinux { # of the change) and expand translation markers in the copied # instance. if [[ ! -f $PALETTE_GPL ]];then - cli_runFnEnvironment svn --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL} + cli_runFnEnvironment vcs --copy ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL} cli_expandTMarkers ${PALETTE_GPL} fi diff --git a/Scripts/Bash/Functions/Render/render_doThemeActions.sh b/Scripts/Bash/Functions/Render/render_doThemeActions.sh index e0c20b5..fac4cb5 100755 --- a/Scripts/Bash/Functions/Render/render_doThemeActions.sh +++ b/Scripts/Bash/Functions/Render/render_doThemeActions.sh @@ -47,7 +47,7 @@ function render_doThemeActions { # the FLAG_FILTER value be. local MODEL_DIR='' local MODEL_DIRS="$(cli_getFilesList ${MODEL_BASEDIR}/${FLAG_THEME_MODEL} \ - --pattern="^/[^.svn][[:alnum:]_/-]+$" --type="d" \ + --pattern='^/[^.svn][[:alnum:]_/-]+$' --type="d" \ | sed -e "s!^.*/${FLAG_THEME_MODEL}!!" \ -e '/^[[:space:]]*$/d' \ -e 's!^/!!')" diff --git a/Scripts/Bash/Functions/Render/render_getOptions.sh b/Scripts/Bash/Functions/Render/render_getOptions.sh index c94eff0..06e907b 100755 --- a/Scripts/Bash/Functions/Render/render_getOptions.sh +++ b/Scripts/Bash/Functions/Render/render_getOptions.sh @@ -29,7 +29,7 @@ function render_getOptions { local ARGSS="h,q" # Define long options we want to support. - local ARGSL="help,quiet,filter:,answer-yes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:,with-brands,sync-changes" + local ARGSL="help,quiet,filter:,answer-yes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:,with-brands,synchronize" # Redefine ARGUMENTS using getopt(1) command parser. cli_parseArguments @@ -43,7 +43,7 @@ function render_getOptions { case "$1" in -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" Scripts/Bash/Functions/Render + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-render" shift 1 exit ;; @@ -104,8 +104,8 @@ function render_getOptions { shift 1 ;; - --sync-changes ) - FLAG_SYNC_CHANGES='true' + --synchronize ) + FLAG_SYNCHRONIZE='true' shift 1 ;; diff --git a/Scripts/Bash/Functions/Svn/svn.sh b/Scripts/Bash/Functions/Svn/svn.sh deleted file mode 100755 index 9605bee..0000000 --- a/Scripts/Bash/Functions/Svn/svn.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# -# svn.sh -- This function standardizes subversion tasks inside the -# repository. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn { - - local ACTIONNAM='' - local ACTIONNAMS='' - local ACTIONVAL='' - - # Define absolute path to Subversion command. - SVN=/usr/bin/svn - - # Interpret arguments and options passed through command-line. - svn_getOptions - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" - - # Don't realize action value verification here. There are actions - # like `copy' and `rename' that require two arguments from which - # the last one doesn't exist at the moment of executing the - # command. This will provoke the second action value verification - # to fail when indeed is should not. Thus, go to action names - # processing directly. - - # Execute action names. This is required in order to realize - # actions like copy and rename which need two values as argument. - # Otherwise, it wouldn't be possible to execute them because - # action values would be processed one a time. Thus, lets work - # with `$@' instead. - for ACTIONNAM in $ACTIONNAMS;do - $ACTIONNAM "$@" - done - -} diff --git a/Scripts/Bash/Functions/Svn/svn_commitRepoChanges.sh b/Scripts/Bash/Functions/Svn/svn_commitRepoChanges.sh deleted file mode 100755 index 7e5ba43..0000000 --- a/Scripts/Bash/Functions/Svn/svn_commitRepoChanges.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/bash -# -# svn_commitRepoChanges.sh -- This function explores the working copy -# and commits changes up to central repository after checking changes -# and adding files which aren't under version control. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_commitRepoChanges { - - local -a FILES - local -a INFO - local -a FILESNUM - local COUNT=0 - local STATUSOUT='' - local PREDICATE='' - local CHNGTOTAL=0 - local LOCATION=$(cli_checkRepoDirSource "$1") - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Print action message. - cli_printMessage "`gettext "Checking changes in the working copy"`" --as-banner-line - - # Build list of files that have received changes in its version - # status. Be sure to keep output files off from this list. - # Remember, output files are not version inside the working copy, - # so they are not considered for evaluation here. But take care, - # sometimes output files are in the same format of source files, - # so we need to differentiate them using their locations. - - # Process location based on its path information. - if [[ ${LOCATION} =~ 'Documentation/Manuals/Texinfo)' ]];then - STATUSOUT="$(${SVN} status ${LOCATION} | egrep -v '(pdf|txt|xhtml|xml|docbook|bz2)$')\n$STATUSOUT" - elif [[ $LOCATION =~ 'Documentation/Manuals/Docbook' ]];then - STATUSOUT="$(${SVN} status ${LOCATION} | egrep -v '(pdf|txt|xhtml)$')\n$STATUSOUT" - elif [[ $LOCATION =~ 'Identity' ]];then - STATUSOUT="$(${SVN} status ${LOCATION} | egrep -v '(pdf|png|jpg|rc|xpm|xbm|tif|ppm|pnm|gz|lss|log)$')\n$STATUSOUT" - else - STATUSOUT="$(${SVN} status ${LOCATION})\n$STATUSOUT" - fi - - # Sanitate status output. Expand new lines, remove leading spaces - # and empty lines. - STATUSOUT=$(echo -e "$STATUSOUT" | sed -r 's!^[[:space:]]*!!' | egrep -v '^[[:space:]]*$') - - # Define path to files considered recent modifications from - # working copy up to central repository. - FILES[0]=$(echo "$STATUSOUT" | egrep "^M" | sed -r "s,^.+${TCAR_WORKDIR}/,,") - FILES[1]=$(echo "$STATUSOUT" | egrep "^\?" | sed -r "s,^.+${TCAR_WORKDIR}/,,") - FILES[2]=$(echo "$STATUSOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR}/,,") - FILES[3]=$(echo "$STATUSOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR}/,,") - - # Define description of files considered recent modifications from - # working copy up to central repository. - INFO[0]="`gettext "Modified"`" - INFO[1]="`gettext "Unversioned"`" - INFO[2]="`gettext "Deleted"`" - INFO[3]="`gettext "Added"`" - - while [[ $COUNT -ne ${#FILES[*]} ]];do - - # Define total number of files. Avoid counting empty line. - if [[ "${FILES[$COUNT]}" == '' ]];then - FILESNUM[$COUNT]=0 - else - FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) - fi - - # Calculate total amount of changes. - CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) - - # Build report predicate. Use report predicate to show any - # information specific to the number of files found. For - # example, you can use this section to show warning messages, - # notes, and so on. By default we use the word `file' or - # `files' at ngettext's consideration followed by change - # direction. - PREDICATE[$COUNT]=`ngettext "file in the working copy" \ - "files in the working copy" $((${FILESNUM[$COUNT]} + 1))` - - # Output report line. - cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line - - # Increase counter. - COUNT=$(($COUNT + 1)) - - done - - # When files have changed in the target location, show which these - # files are and request user to see such changes and then, for - # commtting them up to the central repository. - if [[ ${FILESNUM[0]} -gt 0 ]];then - - cli_printMessage "`gettext "Do you want to see changes now?"`" --as-yesornorequest-line - ${SVN} diff ${LOCATION} | less - - # Commit changes up to central repository. - cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line - ${SVN} commit ${LOCATION} - - fi - - # When there are unversioned files in the target location, show - # which these files are and request user to add such files into - # the working copy. - if [[ ${FILESNUM[1]} -gt 0 ]];then - - cli_printMessage '-' --as-separator-line - cli_printMessage "`gettext "Do you want to add unversioned files now?"`" --as-yesornorequest-line - for FILE in ${FILES[1]};do - ${SVN} add "${TCAR_WORKDIR}/$FILE" - done - - # Commit changes up to central repository. - cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line - ${SVN} commit ${LOCATION} - - fi - - # When there are added files in the target location, show which - # these files are and request user to commit them up to central - # repository. - if [[ ${FILESNUM[3]} -gt 0 ]];then - cli_printMessage '-' --as-separator-line - cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line - ${SVN} commit ${LOCATION} - fi - -} diff --git a/Scripts/Bash/Functions/Svn/svn_copyRepoFile.sh b/Scripts/Bash/Functions/Svn/svn_copyRepoFile.sh deleted file mode 100755 index 070dadc..0000000 --- a/Scripts/Bash/Functions/Svn/svn_copyRepoFile.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# svn_copyRepoFile.sh -- This function standardizes the way files -# (including directories) are duplicated inside the working copy. This -# function is an interface for subversion's `copy' command. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_copyRepoFile { - - local SOURCE=$(cli_checkRepoDirSource ${1}) - local TARGET=$(cli_checkRepoDirSource ${2}) - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${SOURCE} -e --is-versioned - - # Print action reference. - if [[ -f ${SOURCE} ]];then - cli_printMessage "${TARGET}/$(basename ${SOURCE})" --as-creating-line - else - cli_printMessage "${TARGET}" --as-creating-line - fi - - # Copy source location to its target using version control. - ${SVN} copy ${SOURCE} ${TARGET} --quiet - -} diff --git a/Scripts/Bash/Functions/Svn/svn_deleteRepoFile.sh b/Scripts/Bash/Functions/Svn/svn_deleteRepoFile.sh deleted file mode 100755 index b153786..0000000 --- a/Scripts/Bash/Functions/Svn/svn_deleteRepoFile.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# svn_deleteRepoFile.sh -- This function standardizes the way -# centos-art.sh script deletes files and directories inside the -# working copy. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_deleteRepoFile { - - local TARGET=$(cli_checkRepoDirSource ${1}) - - # Print action reference. - cli_printMessage "${TARGET}" --as-deleting-line - - # Verify target existence. Be sure it is under version control. - cli_checkFiles "${TARGET}" --is-versioned - - # Revert changes before deleting related files. - ${SVN} revert ${TARGET} --quiet --recursive - - # Delete source location. - ${SVN} delete ${TARGET} --quiet --force - -} diff --git a/Scripts/Bash/Functions/Svn/svn_getOptions.sh b/Scripts/Bash/Functions/Svn/svn_getOptions.sh deleted file mode 100755 index 8422154..0000000 --- a/Scripts/Bash/Functions/Svn/svn_getOptions.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -# -# svn_getOptions.sh -- This function interprets option parameters -# passed to `svn' functionality and calls actions accordingly. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,sync-changes,update,commit,is-versioned,get-status,mkdir,copy,delete" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" Scripts/Bash/Functions/Svn - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --sync-changes ) - ACTIONNAMS="${ACTIONNAMS} svn_syncroRepoChanges" - shift 1 - ;; - - --commit ) - ACTIONNAMS="${ACTIONNAMS} svn_commitRepoChanges" - shift 1 - ;; - - --update ) - ACTIONNAMS="${ACTIONNAMS} svn_updateRepoChanges" - shift 1 - ;; - - --is-versioned ) - ACTIONNAMS="${ACTIONNAMS} svn_isVersioned" - shift 1 - ;; - - --get-status ) - ACTIONNAMS="${ACTIONNAMS} svn_getRepoStatus" - shift 1 - ;; - - --copy ) - ACTIONNAMS="${ACTIONNAMS} svn_copyRepoFile" - shift 1 - ;; - - --mkdir ) - ACTIONNAMS="${ACTIONNAMS} svn_mkRepoDirectory" - shift 1 - ;; - - --delete ) - ACTIONNAMS="${ACTIONNAMS} svn_deleteRepoFile" - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # begining of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - esac - done - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -} diff --git a/Scripts/Bash/Functions/Svn/svn_getRepoStatus.sh b/Scripts/Bash/Functions/Svn/svn_getRepoStatus.sh deleted file mode 100755 index 1a991ad..0000000 --- a/Scripts/Bash/Functions/Svn/svn_getRepoStatus.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# svn_getRepoStatus.sh -- This function requests the working copy -# using the svn status command and returns the first character in the -# output line, as described in svn help status, for the LOCATION -# specified. Use this function to perform verifications based a -# repository LOCATION status. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_getRepoStatus { - - local LOCATION=$(cli_checkRepoDirSource "$1") - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Define regular expression pattern to retrieve first column, - # returned by subversion status command. This column is one - # character column as describes `svn help status' command. - local PATTERN='^( |A|C|D|I|M|R|X|!|~).+$' - - # Output specific state of location using subversion `status' - # command. - ${SVN} status "$LOCATION" -N --quiet | sed -r "s/${PATTERN}/\1/" - -} diff --git a/Scripts/Bash/Functions/Svn/svn_isVersioned.sh b/Scripts/Bash/Functions/Svn/svn_isVersioned.sh deleted file mode 100755 index 0eb9509..0000000 --- a/Scripts/Bash/Functions/Svn/svn_isVersioned.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# svn_isVersioned.sh -- This function determines whether a location is -# under version control or not. When the location is under version -# control, this function returns `true'. when the location isn't under -# version control, this function returns `false'. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_isVersioned { - - # Define location we want to find out it is under version control - # or not. Only the first non-option argument passed to - # centos-art.sh command-line will be used. - local LOCATION=$(cli_checkRepoDirSource "${1}") - - # Use subversion to determine whether the location is under - # version control or not. - ${SVN} info $LOCATION > /dev/null 2>&1 - - # Verify subversion exit status and print output. - echo $? - -} diff --git a/Scripts/Bash/Functions/Svn/svn_mkRepoDirectory.sh b/Scripts/Bash/Functions/Svn/svn_mkRepoDirectory.sh deleted file mode 100755 index 56a89d1..0000000 --- a/Scripts/Bash/Functions/Svn/svn_mkRepoDirectory.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# svn_mkRepoDirectory.sh -- This function standardizes the way -# centos-art.sh script creates directories inside the working copy. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_mkRepoDirectory { - - local TARGET=$(cli_checkRepoDirSource ${1}) - - # Print action reference. - cli_printMessage "${TARGET}" --as-creating-line - - # Copy source location to its target using version control. - ${SVN} mkdir ${TARGET} --quiet - -} diff --git a/Scripts/Bash/Functions/Svn/svn_syncroRepoChanges.sh b/Scripts/Bash/Functions/Svn/svn_syncroRepoChanges.sh deleted file mode 100755 index 07ed151..0000000 --- a/Scripts/Bash/Functions/Svn/svn_syncroRepoChanges.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# svn_syncroRepoChanges.sh -- This function syncronizes both central -# repository and working copy directory structures by performing a -# subversion update command first and a subversion commit command -# later. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_syncroRepoChanges { - - local LOCATION='' - local LOCATIONS="${@}" - - for LOCATION in $LOCATIONS;do - - # Verify whether the location is valid or not. - LOCATION=$(cli_checkRepoDirSource ${LOCATION}) - - # Verify source location absolute path. It should point either - # to existent files or directories both under version control - # inside the working copy. Otherwise, if it doesn't point to - # an existent file under version control, finish the script - # execution with an error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Bring changes from the repository into the working copy. - svn_updateRepoChanges ${LOCATION} - - # Check changes in the working copy. - svn_commitRepoChanges ${LOCATION} - - done - -} diff --git a/Scripts/Bash/Functions/Svn/svn_updateRepoChanges.sh b/Scripts/Bash/Functions/Svn/svn_updateRepoChanges.sh deleted file mode 100755 index fb01451..0000000 --- a/Scripts/Bash/Functions/Svn/svn_updateRepoChanges.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# -# svn_updateRepoChanges.sh -- This function realizes a subversion -# update command against the working copy in order to bring changes -# from the central repository into the working copy. -# -# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function svn_updateRepoChanges { - - local -a FILES - local -a INFO - local -a FILESNUM - local COUNT=0 - local UPDATEOUT='' - local PREDICATE='' - local CHNGTOTAL=0 - local LOCATION=$(cli_checkRepoDirSource "$1") - - # Verify source location absolute path. It should point either to - # existent files or directories both under version control inside - # the working copy. Otherwise, if it doesn't point to an existent - # file under version control, finish the script execution with an - # error message. - cli_checkFiles ${LOCATION} -e --is-versioned - - # Update working copy and retrieve update output. - cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line - UPDATEOUT=$(${SVN} update ${LOCATION} --quiet) - - # Define path of files considered recent modifications from - # central repository to working copy. - FILES[0]=$(echo "$UPDATEOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR},,") - FILES[1]=$(echo "$UPDATEOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR},,") - FILES[2]=$(echo "$UPDATEOUT" | egrep "^U" | sed -r "s,^.+${TCAR_WORKDIR},,") - FILES[3]=$(echo "$UPDATEOUT" | egrep "^C" | sed -r "s,^.+${TCAR_WORKDIR},,") - FILES[4]=$(echo "$UPDATEOUT" | egrep "^G" | sed -r "s,^.+${TCAR_WORKDIR},,") - - # Define description of files considered recent modifications from - # central repository to working copy. - INFO[0]="`gettext "Added"`" - INFO[1]="`gettext "Deleted"`" - INFO[2]="`gettext "Updated"`" - INFO[3]="`gettext "Conflicted"`" - INFO[4]="`gettext "Merged"`" - - while [[ $COUNT -ne ${#FILES[*]} ]];do - - # Define total number of files. Avoid counting empty line. - if [[ "${FILES[$COUNT]}" == '' ]];then - FILESNUM[$COUNT]=0 - else - FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) - fi - - # Calculate total amount of changes. - CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) - - # Build report predicate. Use report predicate to show any - # information specific to the number of files found. For - # example, you can use this section to show warning messages, - # notes, and so on. By default we use the word `file' or - # `files' at ngettext's consideration followed by change - # direction. - PREDICATE[$COUNT]=`ngettext "file from the repository" \ - "files from the repository" $((${FILESNUM[$COUNT]} + 1))` - - # Output report line. - cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line - - # Increase counter. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Scripts/Bash/Functions/Tuneup/tuneup.sh b/Scripts/Bash/Functions/Tuneup/tuneup.sh index cfbe20f..f4ce95e 100755 --- a/Scripts/Bash/Functions/Tuneup/tuneup.sh +++ b/Scripts/Bash/Functions/Tuneup/tuneup.sh @@ -39,7 +39,7 @@ function tuneup { local TUNEUP_BASEDIR="${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" # Initialize list of supported file extensions. This is, the file - # extensions we want to perform maintainance tasks for. + # extensions we want to perform maintenance tasks for. local TUNEUP_EXTENSIONS='svg xhtml sh' # Interpret arguments and options passed through command-line. diff --git a/Scripts/Bash/Functions/Tuneup/tuneup_getOptions.sh b/Scripts/Bash/Functions/Tuneup/tuneup_getOptions.sh index 19a8b95..924fe0c 100755 --- a/Scripts/Bash/Functions/Tuneup/tuneup_getOptions.sh +++ b/Scripts/Bash/Functions/Tuneup/tuneup_getOptions.sh @@ -26,10 +26,10 @@ function tuneup_getOptions { # Define short options we want to support. - local ARGSS="q" + local ARGSS="h,q" # Define long options we want to support. - local ARGSL="quiet,filter:,answer-yes,sync-changes" + local ARGSL="help,quiet,filter:,answer-yes,synchronize" # Redefine ARGUMENTS using getopt(1) command parser. cli_parseArguments @@ -42,9 +42,10 @@ function tuneup_getOptions { case "$1" in - --filter ) - FLAG_FILTER="$2" - shift 2 + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-tuneup" + shift 1 + exit ;; -q | --quiet ) @@ -52,13 +53,18 @@ function tuneup_getOptions { shift 1 ;; + --filter ) + FLAG_FILTER="$2" + shift 2 + ;; + --answer-yes ) FLAG_ANSWER="true" shift 1 ;; - --answer-yes ) - FLAG_SYNC_CHANGES="true" + --synchronize ) + FLAG_SYNCHRONIZE="true" shift 1 ;; diff --git a/Scripts/Bash/Functions/Vcs/Git/git.sh b/Scripts/Bash/Functions/Vcs/Git/git.sh new file mode 100755 index 0000000..2eb22ed --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Git/git.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# git.sh -- This function standardizes Git tasks inside the +# repository. +# +# Copyright (C) 2013 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function git { + + local ACTIONNAM='' + local ACTIONNAMS='' + local ACTIONVAL='' + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "$ARGUMENTS" + + # Don't realize action value verification here. There are actions + # like `copy' and `rename' that require two arguments from which + # the last one doesn't exist at the moment of executing the + # command. This will provoke the second action value verification + # to fail when indeed is should not. Thus, go to action names + # processing directly. + + # Execute action names. This is required in order to realize + # actions like copy and rename which need two values as argument. + # Otherwise, it wouldn't be possible to execute them because + # action values would be processed one a time. Thus, lets work + # with `$@' instead. + for ACTIONNAM in $ACTIONNAMS;do + $ACTIONNAM "$@" + done + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion.sh new file mode 100755 index 0000000..1ac1e43 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# subversion.sh -- This function standardizes Subversion tasks inside +# the repository. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion { + + # Redefine positional parameters using ARGUMENTS. At this point, + # option arguments have been removed from ARGUMENTS variable and + # only non-option arguments remain in it. + eval set -- "$ARGUMENTS" + + # Don't realize action value verification here. There are actions + # like `copy' and `rename' that require two arguments from which + # the last one doesn't exist at the moment of executing the + # command. This will provoke the second action value verification + # to fail when indeed is should not. Thus, go to action names + # processing directly. + + # Execute action names. This is required in order to realize + # actions like copy and rename which need two values as argument. + # Otherwise, it wouldn't be possible to execute them because + # action values would be processed one a time. Thus, lets work + # with `$@' instead. + for ACTIONNAM in $ACTIONNAMS;do + $ACTIONNAM "$@" + done + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh new file mode 100755 index 0000000..c565ec0 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_commitRepoChanges.sh @@ -0,0 +1,154 @@ +#!/bin/bash +# +# subversion_commitRepoChanges.sh -- This function explores the +# working copy and commits changes up to central repository after +# checking changes and adding files which aren't under version +# control. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_commitRepoChanges { + + local -a FILES + local -a INFO + local -a FILESNUM + local COUNT=0 + local STATUSOUT='' + local PREDICATE='' + local CHNGTOTAL=0 + local LOCATION=$(cli_checkRepoDirSource "$1") + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Print action message. + cli_printMessage "`gettext "Checking changes in the working copy"`" --as-banner-line + + # Build list of files that have received changes in its version + # status. Be sure to keep output files off from this list. + # Remember, output files are not version inside the working copy, + # so they are not considered for evaluation here. But take care, + # sometimes output files are in the same format of source files, + # so we need to differentiate them using their locations. + + # Process location based on its path information. + if [[ ${LOCATION} =~ 'Documentation/Manuals/Texinfo)' ]];then + STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|txt|xhtml|xml|docbook|bz2)$')\n$STATUSOUT" + elif [[ $LOCATION =~ 'Documentation/Manuals/Docbook' ]];then + STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|txt|xhtml)$')\n$STATUSOUT" + elif [[ $LOCATION =~ 'Identity' ]];then + STATUSOUT="$(${COMMAND} status ${LOCATION} | egrep -v '(pdf|png|jpg|rc|xpm|xbm|tif|ppm|pnm|gz|lss|log)$')\n$STATUSOUT" + else + STATUSOUT="$(${COMMAND} status ${LOCATION})\n$STATUSOUT" + fi + + # Sanitate status output. Expand new lines, remove leading spaces + # and empty lines. + STATUSOUT=$(echo -e "$STATUSOUT" | sed -r 's!^[[:space:]]*!!' | egrep -v '^[[:space:]]*$') + + # Define path to files considered recent modifications from + # working copy up to central repository. + FILES[0]=$(echo "$STATUSOUT" | egrep "^M" | sed -r "s,^.+${TCAR_WORKDIR}/,,") + FILES[1]=$(echo "$STATUSOUT" | egrep "^\?" | sed -r "s,^.+${TCAR_WORKDIR}/,,") + FILES[2]=$(echo "$STATUSOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR}/,,") + FILES[3]=$(echo "$STATUSOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR}/,,") + + # Define description of files considered recent modifications from + # working copy up to central repository. + INFO[0]="`gettext "Modified"`" + INFO[1]="`gettext "Unversioned"`" + INFO[2]="`gettext "Deleted"`" + INFO[3]="`gettext "Added"`" + + while [[ $COUNT -ne ${#FILES[*]} ]];do + + # Define total number of files. Avoid counting empty line. + if [[ "${FILES[$COUNT]}" == '' ]];then + FILESNUM[$COUNT]=0 + else + FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) + fi + + # Calculate total amount of changes. + CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) + + # Build report predicate. Use report predicate to show any + # information specific to the number of files found. For + # example, you can use this section to show warning messages, + # notes, and so on. By default we use the word `file' or + # `files' at ngettext's consideration followed by change + # direction. + PREDICATE[$COUNT]=`ngettext "file in the working copy" \ + "files in the working copy" $((${FILESNUM[$COUNT]} + 1))` + + # Output report line. + cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line + + # Increase counter. + COUNT=$(($COUNT + 1)) + + done + + # When files have changed in the target location, show which these + # files are and request user to see such changes and then, for + # commtting them up to the central repository. + if [[ ${FILESNUM[0]} -gt 0 ]];then + + cli_printMessage "`gettext "Do you want to see changes now?"`" --as-yesornorequest-line + ${COMMAND} diff ${LOCATION} | less + + # Commit changes up to central repository. + cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line + ${COMMAND} commit ${LOCATION} + + fi + + # When there are unversioned files in the target location, show + # which these files are and request user to add such files into + # the working copy. + if [[ ${FILESNUM[1]} -gt 0 ]];then + + cli_printMessage '-' --as-separator-line + cli_printMessage "`gettext "Do you want to add unversioned files now?"`" --as-yesornorequest-line + for FILE in ${FILES[1]};do + ${COMMAND} add "${TCAR_WORKDIR}/$FILE" + done + + # Commit changes up to central repository. + cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line + ${COMMAND} commit ${LOCATION} + + fi + + # When there are added files in the target location, show which + # these files are and request user to commit them up to central + # repository. + if [[ ${FILESNUM[3]} -gt 0 ]];then + cli_printMessage '-' --as-separator-line + cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line + ${COMMAND} commit ${LOCATION} + fi + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_copyRepoFile.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_copyRepoFile.sh new file mode 100755 index 0000000..2e3d0ac --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_copyRepoFile.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# subversion_copyRepoFile.sh -- This function standardizes the way +# files (including directories) are duplicated inside the working +# copy. This function is an interface for subversion's `copy' command. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_copyRepoFile { + + local SOURCE=$(cli_checkRepoDirSource ${1}) + local TARGET=$(cli_checkRepoDirSource ${2}) + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${SOURCE} -e --is-versioned + + # Print action reference. + if [[ -f ${SOURCE} ]];then + cli_printMessage "${TARGET}/$(basename ${SOURCE})" --as-creating-line + else + cli_printMessage "${TARGET}" --as-creating-line + fi + + # Copy source location to its target using version control. + ${COMMAND} copy ${SOURCE} ${TARGET} --quiet + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_deleteRepoFile.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_deleteRepoFile.sh new file mode 100755 index 0000000..97936d3 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_deleteRepoFile.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# subversion_deleteRepoFile.sh -- This function standardizes the way +# centos-art.sh script deletes files and directories inside the +# working copy. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_deleteRepoFile { + + local TARGET=$(cli_checkRepoDirSource ${1}) + + # Print action reference. + cli_printMessage "${TARGET}" --as-deleting-line + + # Verify target existence. Be sure it is under version control. + cli_checkFiles "${TARGET}" --is-versioned + + # Revert changes before deleting related files. + ${COMMAND} revert ${TARGET} --quiet --recursive + + # Delete source location. + ${COMMAND} delete ${TARGET} --quiet --force + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_getOptions.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_getOptions.sh new file mode 100755 index 0000000..d2149f8 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_getOptions.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# +# subversion_getOptions.sh -- This function interprets option +# parameters passed to `svn' functionality and calls actions +# accordingly. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_getOptions { + + # Define short options we want to support. + local ARGSS="h,q" + + # Define long options we want to support. + local ARGSL="help,quiet,synchronize,update,commit,is-versioned,get-status,mkdir,copy,delete" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + + case "$1" in + + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-vcs-subversion" + shift 1 + exit + ;; + + -q | --quiet ) + FLAG_QUIET="true" + shift 1 + ;; + + --synchronize ) + ACTIONNAMS="${ACTIONNAMS} subversion_syncRepoChanges" + shift 1 + ;; + + --commit ) + ACTIONNAMS="${ACTIONNAMS} subversion_commitRepoChanges" + shift 1 + ;; + + --update ) + ACTIONNAMS="${ACTIONNAMS} subversion_updateRepoChanges" + shift 1 + ;; + + --is-versioned ) + ACTIONNAMS="${ACTIONNAMS} subversion_isVersioned" + shift 1 + ;; + + --get-status ) + ACTIONNAMS="${ACTIONNAMS} subversion_getRepoStatus" + shift 1 + ;; + + --copy ) + ACTIONNAMS="${ACTIONNAMS} subversion_copyRepoFile" + shift 1 + ;; + + --mkdir ) + ACTIONNAMS="${ACTIONNAMS} subversion_mkRepoDirectory" + shift 1 + ;; + + --delete ) + ACTIONNAMS="${ACTIONNAMS} subversion_deleteRepoFile" + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + esac + done + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_getRepoStatus.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_getRepoStatus.sh new file mode 100755 index 0000000..aab1646 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_getRepoStatus.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# subversion_getRepoStatus.sh -- This function requests the working +# copy using the svn status command and returns the first character in +# the output line, as described in svn help status, for the LOCATION +# specified. Use this function to perform verifications based a +# repository LOCATION status. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_getRepoStatus { + + local LOCATION=$(cli_checkRepoDirSource "$1") + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Define regular expression pattern to retrieve first column, + # returned by subversion status command. This column is one + # character column as describes `svn help status' command. + local PATTERN='^( |A|C|D|I|M|R|X|!|~).+$' + + # Output specific state of location using subversion `status' + # command. + ${COMMAND} status "$LOCATION" -N --quiet | sed -r "s/${PATTERN}/\1/" + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_isVersioned.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_isVersioned.sh new file mode 100755 index 0000000..f4bf2b5 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_isVersioned.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# subversion_isVersioned.sh -- This function determines whether a +# location is under version control or not. When the location is under +# version control, this function returns `0'. When the location isn't +# under version control, this function returns `1'. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_isVersioned { + + # Define the location absolute path we want to determine whether + # it is under version control or not. Only the first non-option + # argument passed to centos-art.sh command-line will be used. + local LOCATION=$(cli_checkRepoDirSource "${1}") + + # Use Subversion to determine whether the location is under + # version control or not. + ${COMMAND} info ${LOCATION} > /dev/null 2>&1 + + # Verify Subversion's exit status. + if [[ $? -ne 0 ]];then + cli_printMessage "${LOCATION} `gettext "isn't under version control."`" --as-error-line + fi + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_mkRepoDirectory.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_mkRepoDirectory.sh new file mode 100755 index 0000000..2b7eab1 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_mkRepoDirectory.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# subversion_mkRepoDirectory.sh -- This function standardizes the way +# centos-art.sh script creates directories inside the working copy. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_mkRepoDirectory { + + local TARGET=$(cli_checkRepoDirSource ${1}) + + # Print action reference. + cli_printMessage "${TARGET}" --as-creating-line + + # Copy source location to its target using version control. + ${COMMAND} mkdir ${TARGET} --quiet + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_syncRepoChanges.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_syncRepoChanges.sh new file mode 100755 index 0000000..6520c2a --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_syncRepoChanges.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# subversion_syncRepoChanges.sh -- This function syncnizes both +# central repository and working copy directory structures by +# performing a subversion update command first and a subversion commit +# command later. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_syncRepoChanges { + + local LOCATION='' + local LOCATIONS="${@}" + + for LOCATION in $LOCATIONS;do + + # Verify whether the location is valid or not. + LOCATION=$(cli_checkRepoDirSource ${LOCATION}) + + # Verify source location absolute path. It should point either + # to existent files or directories both under version control + # inside the working copy. Otherwise, if it doesn't point to + # an existent file under version control, finish the script + # execution with an error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Bring changes from the repository into the working copy. + subversion_updateRepoChanges ${LOCATION} + + # Check changes in the working copy. + subversion_commitRepoChanges ${LOCATION} + + done + +} diff --git a/Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh b/Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh new file mode 100755 index 0000000..827fa86 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/Subversion/subversion_updateRepoChanges.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# subversion_updateRepoChanges.sh -- This function realizes a +# subversion update command against the working copy in order to bring +# changes from the central repository into the working copy. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function subversion_updateRepoChanges { + + local -a FILES + local -a INFO + local -a FILESNUM + local COUNT=0 + local UPDATEOUT='' + local PREDICATE='' + local CHNGTOTAL=0 + local LOCATION=$(cli_checkRepoDirSource "$1") + + # Verify source location absolute path. It should point either to + # existent files or directories both under version control inside + # the working copy. Otherwise, if it doesn't point to an existent + # file under version control, finish the script execution with an + # error message. + cli_checkFiles ${LOCATION} -e --is-versioned + + # Update working copy and retrieve update output. + cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line + UPDATEOUT=$(${COMMAND} update ${LOCATION} --quiet) + + # Define path of files considered recent modifications from + # central repository to working copy. + FILES[0]=$(echo "$UPDATEOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR},,") + FILES[1]=$(echo "$UPDATEOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR},,") + FILES[2]=$(echo "$UPDATEOUT" | egrep "^U" | sed -r "s,^.+${TCAR_WORKDIR},,") + FILES[3]=$(echo "$UPDATEOUT" | egrep "^C" | sed -r "s,^.+${TCAR_WORKDIR},,") + FILES[4]=$(echo "$UPDATEOUT" | egrep "^G" | sed -r "s,^.+${TCAR_WORKDIR},,") + + # Define description of files considered recent modifications from + # central repository to working copy. + INFO[0]="`gettext "Added"`" + INFO[1]="`gettext "Deleted"`" + INFO[2]="`gettext "Updated"`" + INFO[3]="`gettext "Conflicted"`" + INFO[4]="`gettext "Merged"`" + + while [[ $COUNT -ne ${#FILES[*]} ]];do + + # Define total number of files. Avoid counting empty line. + if [[ "${FILES[$COUNT]}" == '' ]];then + FILESNUM[$COUNT]=0 + else + FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) + fi + + # Calculate total amount of changes. + CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) + + # Build report predicate. Use report predicate to show any + # information specific to the number of files found. For + # example, you can use this section to show warning messages, + # notes, and so on. By default we use the word `file' or + # `files' at ngettext's consideration followed by change + # direction. + PREDICATE[$COUNT]=`ngettext "file from the repository" \ + "files from the repository" $((${FILESNUM[$COUNT]} + 1))` + + # Output report line. + cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" --as-stdout-line + + # Increase counter. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Scripts/Bash/Functions/Vcs/vcs.sh b/Scripts/Bash/Functions/Vcs/vcs.sh new file mode 100755 index 0000000..2a646a0 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/vcs.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# +# vcs.sh -- This function standardizes version control tasks inside +# the repository. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function vcs { + + local ACTIONNAM='' + local ACTIONNAMS='' + local ACTIONVAL='' + + # Verify whether version control actions should be performed or + # not inside the repository directory structure. + local ENABLED=$(cli_getConfigValue "${CLI_BASEDIR}/${CLI_NAME}.conf" "version_control" "enabled") + if [[ ! ${ENABLED} =~ '^(yes|ye|y|0)$' ]];then + return + fi + + # Initialize version control system to use inside the repository. + local PACKAGE=$(cli_getConfigValue "${CLI_BASEDIR}/${CLI_NAME}.conf" "version_control" "package") + + # Set possible values to packages used as version control system. + if [[ ${PACKAGE} =~ '^(git|subversion)$' ]];then + + # Initialize the absolute path to commands we'll use as + # version control system in the working copy. + case ${PACKAGE} in + + 'git' ) + COMMAND=/usr/bin/git + ;; + + 'subversion' ) + COMMAND=/usr/bin/svn + ;; + esac + + else + cli_printMessage "${PACKAGE} `gettext "isn't supported as version control system."`" --as-error-line + fi + + # Verify whether the related package is installed or not. + cli_checkFiles ${PACKAGE} --is-installed + + # Interpret arguments and options passed through command-line. + vcs_getOptions + + # Initialize function specific export id. + local EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${PACKAGE} -d)/$(cli_getRepoName ${PACKAGE} -f)" + + # Export specific functionalities to the script environment. + cli_exportFunctions "${EXPORTID}" + + # Execute version control. + ${PACKAGE} + + # Unset specific functionalities from the script environment. + cli_unsetFunctions "${EXPORTID}" + +} diff --git a/Scripts/Bash/Functions/Vcs/vcs_getOptions.sh b/Scripts/Bash/Functions/Vcs/vcs_getOptions.sh new file mode 100755 index 0000000..5b95914 --- /dev/null +++ b/Scripts/Bash/Functions/Vcs/vcs_getOptions.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# +# vcs_getOptions.sh -- This function interprets option parameters +# passed to `vcs' functionality and calls actions accordingly. It +# serves as interface to Subversion and Git sub-functionalities. +# +# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function vcs_getOptions { + + # Define short options we want to support. + local ARGSS="h,q" + + # Define long options we want to support. + local ARGSL="help,quiet,synchronize,update,commit,is-versioned,get-status,mkdir,copy,delete" + + # Redefine ARGUMENTS using getopt(1) command parser. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + + case "$1" in + + -h | --help ) + cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-vcs" + shift 1 + exit + ;; + + -q | --quiet ) + FLAG_QUIET="true" + shift 1 + ;; + + --synchronize ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_syncRepoChanges" + shift 1 + ;; + + --commit ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_commitRepoChanges" + shift 1 + ;; + + --update ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_updateRepoChanges" + shift 1 + ;; + + --is-versioned ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_isVersioned" + shift 1 + ;; + + --get-status ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_getRepoStatus" + shift 1 + ;; + + --copy ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_copyRepoFile" + shift 1 + ;; + + --mkdir ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_mkRepoDirectory" + shift 1 + ;; + + --delete ) + ACTIONNAMS="${ACTIONNAMS} ${PACKAGE}_deleteRepoFile" + shift 1 + ;; + + -- ) + # Remove the `--' argument from the list of arguments + # in order for processing non-option arguments + # correctly. At this point all option arguments have + # been processed already but the `--' argument still + # remains to mark ending of option arguments and + # beginning of non-option arguments. The `--' argument + # needs to be removed here in order to avoid + # centos-art.sh script to process it as a path inside + # the repository, which obviously is not. + shift 1 + break + ;; + esac + done + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + +} diff --git a/Scripts/Bash/centos-art.conf b/Scripts/Bash/centos-art.conf new file mode 100644 index 0000000..1e89b02 --- /dev/null +++ b/Scripts/Bash/centos-art.conf @@ -0,0 +1,17 @@ +# +# Welcome to centos-art configuration file. Here you can customize +# the way most automation scripts behave inside The CentOS Artwork +# Repository. +# + +[identity] + +[documentation] + +[scripts] + +[locales] + +[version_control] +package = "git" +enabled = "1" diff --git a/Scripts/Bash/centos-art.sh b/Scripts/Bash/centos-art.sh index 344a83c..bc0fa2e 100755 --- a/Scripts/Bash/centos-art.sh +++ b/Scripts/Bash/centos-art.sh @@ -22,13 +22,39 @@ # $Id$ # ---------------------------------------------------------------------- -# Initialize absolute path to the working copy. -if [[ ! $TCAR_WORKDIR ]] || [[ $TCAR_WORKDIR == "" ]];then - TCAR_WORKDIR=${HOME}/artwork +# Initialize relative path (from repository first directory level on) +# used to store bash scripts. +TCAR_BASHSCRIPTS='Scripts/Bash' + +# Verify the working copy absolute path using the command path. It is +# not possible to consider relative paths here because we are using a +# symbolic link to create the connection between the centos-art.sh +# script and the centos-art command. The link location is stored +# inside ~/bin directory which is outside the repository directory +# structure. So we cannot use the command path as reference to define +# the repository working directory each time we run the command. +# Instead, in order to get the correct working directory path, it is +# required to finish the script execution when the absolute path +# points to the ~/bin directory and print an error message explaining +# the issue. This message cannot be translated to other languages +# because the TEXTDOMAINDIR variable hasn't been defined yet (it +# requires the working copy directory path to be defined first). +if [[ ! $TCAR_WORKDIR ]] || [[ $TCAR_WORKDIR == '' ]] ;then + + if [[ $0 =~ "^${HOME}/bin" ]];then + echo "To run centos-art correctly, you need to prepare your workstation first." + exit 1 + else + + # Initialize absolute path to the working copy. + TCAR_WORKDIR=$(dirname $0 | sed "s,/${TCAR_BASHSCRIPTS},,") + + fi + fi -# Redefine the working copy absolute path considering the previous -# directory structures used in the repository. +# Redefine the working copy absolute path considering the (Subversion) +# previous directory structures used in the repository. if [[ -d ${TCAR_WORKDIR}/trunk ]];then TCAR_WORKDIR=${TCAR_WORKDIR}/trunk fi @@ -40,17 +66,17 @@ fi # Initialize script-specific configuration variables. declare -xr CLI_NAME="${TCAR_BRAND}-art" -declare -xr CLI_VERSION='0.0.4' +declare -xr CLI_VERSION='0.4' declare -xr CLI_LANG_LC=$(echo ${LANG} | cut -d'.' -f1) declare -xr CLI_LANG_LL=$(echo ${CLI_LANG_LC} | cut -d'_' -f1) declare -xr CLI_LANG_CC=$(echo ${CLI_LANG_LC} | cut -d'_' -f2) -declare -xr CLI_BASEDIR="${TCAR_WORKDIR}/Scripts/Bash" +declare -xr CLI_BASEDIR="${TCAR_WORKDIR}/${TCAR_BASHSCRIPTS}" declare -xr CLI_FUNCDIR="${CLI_BASEDIR}/Functions" # Initialize internationalization through GNU gettext. . gettext.sh declare -xr TEXTDOMAIN=${CLI_NAME}.sh -declare -xr TEXTDOMAINDIR=${TCAR_WORKDIR}/Locales/Scripts/Bash +declare -xr TEXTDOMAINDIR=${TCAR_WORKDIR}/Locales/${TCAR_BASHSCRIPTS} # Initialize absolute path to temporal directory. declare -xr TMPDIR="$(mktemp -p /tmp -d ${CLI_NAME}.sh-XXXXXX)"