diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-menu.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-menu.texinfo deleted file mode 100644 index e69de29..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-menu.texinfo +++ /dev/null diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-nodes.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-nodes.texinfo deleted file mode 100644 index 3e2dc0b..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-nodes.texinfo +++ /dev/null @@ -1 +0,0 @@ -@include =INCL= diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter.texinfo deleted file mode 100644 index 33e9993..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter.texinfo +++ /dev/null @@ -1,12 +0,0 @@ -@node =CHAPTER_NODE= -@chapter =CHAPTER_TITLE= -@cindex =CHAPTER_CIND= - -@c -- Chapter Introduction -... - -@c -- Chapter Menu -@include =CHAPTER_NAME=/chapter-menu.texinfo - -@c -- Chapter Nodes -@include =CHAPTER_NAME=/chapter-nodes.texinfo diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/section-functions.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/section-functions.texinfo deleted file mode 100644 index 7bf3dfd..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/section-functions.texinfo +++ /dev/null @@ -1,34 +0,0 @@ -@section =SECT= -@cindex =CIND= - -@subheading Name - -The @file{=SECT=} directory organizes @dots{} - -@subheading Synopsis - -@dots{} - -@subheading Description - -@dots{} - -@subheading Examples - -@dots{} - -@subheading Author - -Written by @dots{} - -@subheading Reporting bugs - -Report bugs to @email{centos-artwork@@centos.org} mailing list. - -@subheading Copyright - -Copyright @copyright{} =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER= - -This is free software. You may redistribute copies of it under the -terms of the @ref{GNU General Public License}. There is NO WARRANTY, -to the extent permitted by law. diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/section.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/section.texinfo deleted file mode 100644 index 9461faa..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/Chapters/section.texinfo +++ /dev/null @@ -1,8 +0,0 @@ -@node =NODE= -@section =SECT= -@cindex =CIND= - -... - -@c -- <[centos-art(SeeAlso) -@c -- ]> diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GFDL.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GFDL.texinfo deleted file mode 100755 index c40cf38..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GFDL.texinfo +++ /dev/null @@ -1,414 +0,0 @@ -Version 1.2, November 2002 - -@verbatim -Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA -@end verbatim - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -@subheading Preamble - -The purpose of this License is to make a manual, textbook, or other -functional and useful document ``free'' in the sense of freedom: to -assure everyone the effective freedom to copy and redistribute it, -with or without modifying it, either commercially or noncommercially. -Secondarily, this License preserves for the author and publisher a way -to get credit for their work, while not being considered responsible -for modifications made by others. - -This License is a kind of ``copyleft'', which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - -@subheading 1. Applicability and definitions - -This License applies to any manual or other work, in any medium, that -contains a notice placed by the copyright holder saying it can be -distributed under the terms of this License. Such a notice grants a -world-wide, royalty-free license, unlimited in duration, to use that -work under the conditions stated herein. The ``Document'', below, -refers to any such manual or work. Any member of the public is a -licensee, and is addressed as ``you''. You accept the license if you -copy, modify or distribute the work in a way requiring permission -under copyright law. - -A ``Modified Version'' of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A ``Secondary Section'' is a named appendix or a front-matter section of -the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall -subject (or to related matters) and contains nothing that could fall -directly within that overall subject. (Thus, if the Document is in -part a textbook of mathematics, a Secondary Section may not explain -any mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The ``Invariant Sections'' are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. If a -section does not fit the above definition of Secondary then it is not -allowed to be designated as Invariant. The Document may contain zero -Invariant Sections. If the Document does not identify any Invariant -Sections then there are none. - -The ``Cover Texts'' are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. A Front-Cover Text may -be at most 5 words, and a Back-Cover Text may be at most 25 words. - -A ``Transparent'' copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, that is suitable for revising the document -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup, or absence of markup, has been arranged to thwart -or discourage subsequent modification by readers is not Transparent. -An image format is not Transparent if used for any substantial amount -of text. A copy that is not ``Transparent'' is called ``Opaque''. - -Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input format, SGML -or XML using a publicly available DTD, and standard-conforming simple -HTML, PostScript or PDF designed for human modification. Examples of -transparent image formats include PNG, XCF and JPG. Opaque formats -include proprietary formats that can be read and edited only by -proprietary word processors, SGML or XML for which the DTD and/or -processing tools are not generally available, and the -machine-generated HTML, PostScript or PDF produced by some word -processors for output purposes only. - -The ``Title Page'' means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, ``Title Page'' means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. - -A section ``Entitled XYZ'' means a named subunit of the Document whose -title either is precisely XYZ or contains XYZ in parentheses following -text that translates XYZ in another language. (Here XYZ stands for a -specific section name mentioned below, such as ``Acknowledgements'', -``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the -Title'' of such a section when you modify the Document means that it -remains a section ``Entitled XYZ'' according to this definition. - -The Document may include Warranty Disclaimers next to the notice which -states that this License applies to the Document. These Warranty -Disclaimers are considered to be included by reference in this -License, but only as regards disclaiming warranties: any other -implication that these Warranty Disclaimers may have is void and has -no effect on the meaning of this License. - -@subheading 2. Verbatim copying - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no -other conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section @emph{3. -Copying in quantity}. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. - -@subheading 3. Copying in quantity - -If you publish printed copies (or copies in media that commonly have -printed covers) of the Document, numbering more than 100, and the -Document's license notice requires Cover Texts, you must enclose the -copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a computer-network location from which the general network-using -public has access to download using public-standard network protocols -a complete Transparent copy of the Document, free of added material. -If you use the latter option, you must take reasonably prudent steps, -when you begin distribution of Opaque copies in quantity, to ensure -that this Transparent copy will remain thus accessible at the stated -location until at least one year after the last time you distribute an -Opaque copy (directly or through your agents or retailers) of that -edition to the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to -give them a chance to provide you with an updated version of the -Document. - -@subheading 4. Modifications - -You may copy and distribute a Modified Version of the Document under -the conditions of sections @emph{2. Verbatim copying} and @emph{3. -Copying in quantity} above, provided that you release the Modified -Version under precisely this License, with the Modified Version -filling the role of the Document, thus licensing distribution and -modification of the Modified Version to whoever possesses a copy of -it. In addition, you must do these things in the Modified Version: - -A. Use in the Title Page (and on the covers, if any) a title distinct -from that of the Document, and from those of previous versions (which -should, if there were any, be listed in the History section of the -Document). You may use the same title as a previous version if the -original publisher of that version gives permission. - -B. List on the Title Page, as authors, one or more persons or entities -responsible for authorship of the modifications in the Modified -Version, together with at least five of the principal authors of the -Document (all of its principal authors, if it has fewer than five), -unless they release you from this requirement. - -C. State on the Title page the name of the publisher of the Modified -Version, as the publisher. - -D. Preserve all the copyright notices of the Document. - -E. Add an appropriate copyright notice for your modifications adjacent -to the other copyright notices. - -F. Include, immediately after the copyright notices, a license notice -giving the public permission to use the Modified Version under the -terms of this License, in the form shown in the Addendum below. - -G. Preserve in that license notice the full lists of Invariant -Sections and required Cover Texts given in the Document's license -notice. - -H. Include an unaltered copy of this License. - -I. Preserve the section Entitled ``History'', Preserve its Title, and -add to it an item stating at least the title, year, new authors, and -publisher of the Modified Version as given on the Title Page. If -there is no section Entitled ``History'' in the Document, create one -stating the title, year, authors, and publisher of the Document as -given on its Title Page, then add an item describing the Modified -Version as stated in the previous sentence. - -J. Preserve the network location, if any, given in the Document for -public access to a Transparent copy of the Document, and likewise the -network locations given in the Document for previous versions it was -based on. These may be placed in the ``History'' section. You may -omit a network location for a work that was published at least four -years before the Document itself, or if the original publisher of the -version it refers to gives permission. - -K. For any section Entitled ``Acknowledgements'' or ``Dedications'', -Preserve the Title of the section, and preserve in the section all the -substance and tone of each of the contributor acknowledgements and/or -dedications given therein. - -L. Preserve all the Invariant Sections of the Document, unaltered in -their text and in their titles. Section numbers or the equivalent are -not considered part of the section titles. - -M. Delete any section Entitled ``Endorsements''. Such a section may -not be included in the Modified Version. - -N. Do not retitle any existing section to be Entitled ``Endorsements'' -or to conflict in title with any Invariant Section. - -O. Preserve any Warranty Disclaimers. - -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section Entitled ``Endorsements'', provided it contains -nothing but endorsements of your Modified Version by various -parties--for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. - -@subheading 5. Combining documents - -You may combine the Document with other documents released under this -License, under the terms defined in section @emph{4. Modifications} -above for modified versions, provided that you include in the -combination all of the Invariant Sections of all of the original -documents, unmodified, and list them all as Invariant Sections of your -combined work in its license notice, and that you preserve all their -Warranty Disclaimers. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections Entitled ``History'' -in the various original documents, forming one section Entitled -``History''; likewise combine any sections Entitled -``Acknowledgements'', -and any sections Entitled ``Dedications''. You must delete all sections -Entitled ``Endorsements''. - -@subheading 6. Collections of documents - -You may make a collection consisting of the Document and other -documents released under this License, and replace the individual -copies of this License in the various documents with a single copy -that is included in the collection, provided that you follow the rules -of this License for verbatim copying of each of the documents in all -other respects. - -You may extract a single document from such a collection, and -distribute it individually under this License, provided you insert a -copy of this License into the extracted document, and follow this -License in all other respects regarding verbatim copying of that -document. - -@subheading 7. Aggregation with independent works - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, is called an ``aggregate'' if the copyright -resulting from the compilation is not used to limit the legal rights -of the compilation's users beyond what the individual works permit. -When the Document is included in an aggregate, this License does not -apply to the other works in the aggregate which are not themselves -derivative works of the Document. - -If the Cover Text requirement of section @emph{3. Copying in quantity} -is applicable to these copies of the Document, then if the Document is -less than one half of the entire aggregate, the Document's Cover Texts -may be placed on covers that bracket the Document within the -aggregate, or the electronic equivalent of covers if the Document is -in electronic form. Otherwise they must appear on printed covers that -bracket the whole aggregate. - -@subheading 8. Translations - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section -@emph{4. Modifications}. Replacing Invariant Sections with -translations requires special permission from their copyright holders, -but you may include translations of some or all Invariant Sections in -addition to the original versions of these Invariant Sections. You -may include a translation of this License, and all the license notices -in the Document, and any Warranty Disclaimers, provided that you also -include the original English version of this License and the original -versions of those notices and disclaimers. In case of a disagreement -between the translation and the original version of this License or a -notice or disclaimer, the original version will prevail. - -If a section in the Document is Entitled ``Acknowledgements'', -``Dedications'', or ``History'', the requirement (section @emph{4. -Modifications}) to Preserve its Title (section @emph{1. Applicability -and definitions}) will typically require changing the actual title. - -@subheading 9. Termination - -You may not copy, modify, sublicense, or distribute the Document -except as expressly provided for under this License. Any other -attempt to copy, modify, sublicense or distribute the Document is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - -@subheading Future Revisions of this License - -The Free Software Foundation may publish new, revised versions of the -GNU Free Documentation License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in -detail to address new problems or concerns. See -@url{http://www.gnu.org/copyleft/}. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License ``or any later version'' applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. - -@subheading How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - -@verbatim - Copyright (C) YEAR YOUR NAME. - - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation License, - Version 1.2 or any later version published by the Free Software - Foundation; with no Invariant Sections, no Front-Cover Texts, - and no Back-Cover Texts. A copy of the license is included in - the section entitled ``GNU Free Documentation License''. -@end verbatim - -If you have Invariant Sections, Front-Cover Texts and Back-Cover -Texts, replace the ``with...Texts''. line with this: - -@verbatim - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts - being LIST. -@end verbatim - -If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, to -permit their use in free software. diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GPL.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GPL.texinfo deleted file mode 100755 index 3349125..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GPL.texinfo +++ /dev/null @@ -1,376 +0,0 @@ -Version 2, June 1991 - -@verbatim -Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA -@end verbatim - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -@subheading Preamble - -The licenses for most software are designed to take away your freedom -to share and change it. By contrast, the GNU General Public License -is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - -To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the software, or if you modify it. - -For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - -We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - -Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, -we want its recipients to know that what they have is not the -original, so that any problems introduced by others will not reflect -on the original authors' reputations. - -Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at -all. - -The precise terms and conditions for copying, distribution and -modification follow. - -@subheading TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -@subsubheading Section 0 - -This License applies to any program or other work which contains a -notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The ``Program'', -below, refers to any such program or work, and a ``work based on the -Program'' means either the Program or any derivative work under -copyright law: that is to say, a work containing the Program or a -portion of it, either verbatim or with modifications and/or translated -into another language. (Hereinafter, translation is included without -limitation in the term ``modification''.) Each licensee is addressed -as ``you''. - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - -@subsubheading Section 1 - -You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - -@subsubheading Section 2 - -You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - -a) You must cause the modified files to carry prominent notices -stating that you changed the files and the date of any change. - -b) You must cause any work that you distribute or publish, that in -whole or in part contains or is derived from the Program or any part -thereof, to be licensed as a whole at no charge to all third parties -under the terms of this License. - -c) If the modified program normally reads commands interactively when -run, you must cause it, when started running for such interactive use -in the most ordinary way, to print or display an announcement -including an appropriate copyright notice and a notice that there is -no warranty (or else, saying that you provide a warranty) and that -users may redistribute the program under these conditions, and telling -the user how to view a copy of this License. (Exception: if the -Program itself is interactive but does not normally print such an -announcement, your work based on the Program is not required to print -an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - -@subsubheading Section 3 - -You may copy and distribute the Program (or a work based on it, under -Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - -a) Accompany it with the complete corresponding machine-readable -source code, which must be distributed under the terms of Sections 1 -and 2 above on a medium customarily used for software interchange; or, - -b) Accompany it with a written offer, valid for at least three years, -to give any third party, for a charge no more than your cost of -physically performing source distribution, a complete machine-readable -copy of the corresponding source code, to be distributed under the -terms of Sections 1 and 2 above on a medium customarily used for -software interchange; or, - -c) Accompany it with the information you received as to the offer to -distribute corresponding source code. (This alternative is allowed -only for noncommercial distribution and only if you received the -program in object code or executable form with such an offer, in -accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - -@subsubheading Section 4 - -You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - -@subsubheading Section 5 - -You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - -@subsubheading Section 6 - -Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - -@subsubheading Section 7 - -If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - -@subsubheading Section 8 - -If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original -copyright holder who places the Program under this License may add an -explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - -@subsubheading Section 9 - -The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in -detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and ``any -later version'', you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - -@subsubheading Section 10 - -If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the -author to ask for permission. For software which is copyrighted by -the Free Software Foundation, write to the Free Software Foundation; -we sometimes make exceptions for this. Our decision will be guided by -the two goals of preserving the free status of all derivatives of our -free software and of promoting the sharing and reuse of software -generally. - -@subsubheading NO WARRANTY - -BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT -WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER -PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, -EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -@subsubheading Section 12 - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - -@strong{END OF TERMS AND CONDITIONS} - -@subheading How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. - -To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the ``copyright'' line and a pointer to where the full notice is -found. - -@verbatim - - Copyright (C) 19yy - - 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. -@end verbatim - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - -@verbatim - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. -@end verbatim - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a ``copyright disclaimer'' for the program, if -necessary. Here is a sample; alter the names: - -@verbatim - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice -@end verbatim - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-menu.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-menu.texinfo deleted file mode 100755 index b8240ba..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/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/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-nodes.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-nodes.texinfo deleted file mode 100755 index 2a33229..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/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 trunk/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GPL.texinfo - -@node GNU Free Documentation License -@section GNU Free Documentation License -@cindex GNU Free Documentation License -@include trunk/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GFDL.texinfo diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter.texinfo deleted file mode 100755 index e5ffcbd..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/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/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-index.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-index.texinfo deleted file mode 100755 index b197b13..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-index.texinfo +++ /dev/null @@ -1,8 +0,0 @@ -@node Index -@unnumbered Index -@syncodeindex fn cp -@syncodeindex vr cp -@syncodeindex ky cp -@syncodeindex pg cp -@syncodeindex tp cp -@printindex cp diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-init.pl b/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-init.pl deleted file mode 100755 index c6eff54..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-init.pl +++ /dev/null @@ -1,7 +0,0 @@ -# This file extends the `../manual-init.pl' initialization file to -# provide English specific initializations for `texi2html-1.76-4.fc6'. -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -return 1; diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-menu.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-menu.texinfo deleted file mode 100644 index 0afc9ff..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-menu.texinfo +++ /dev/null @@ -1,4 +0,0 @@ -@menu -* Licenses:: -* Index:: -@end menu diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-nodes.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-nodes.texinfo deleted file mode 100644 index e69de29..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual-nodes.texinfo +++ /dev/null diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.conf b/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.conf deleted file mode 100755 index 061f17f..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.conf +++ /dev/null @@ -1,36 +0,0 @@ -# This file controls the manual configuration. This file is divided -# in configuration sections (e.g., `main' and `templates') which, in -# turn, are organized in the form `variable = value'. -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -[main] - -# Specify documentation backend used by documentation manual. This is -# the format used to write documentation manual source files. -manual_backend = "texinfo" - -# Specify title style used by sections inside the manual. Possible -# values to this option are `cap-each-word' to capitalize each word in -# the section title, `cap-first-word' to capitalize the first word in -# the section title only and `directory' to transform each word in the -# section title into a directory path. From all these options, -# `cap-each-word' is the one used as default. -manual_section_style = "cap-each-word" - -# Specify the order used by sections inside the manual. By default new -# sections added to the manual are put on the end to follow the -# section `created' order. Other possible values to this option are -# `ordered' and `reversed' to sort the list of sections alphabetically -# from A-Z and Z-A, respectively. -manual_section_order = "created" - -[templates] - -# Specify relation between template files and section definition files -# inside the manual. Template definition is set on the left side using -# relative path. The section main definition file is described on the -# right using a regular expression. The first match wins. -Chapters/section-functions.texinfo = "^.+-functions-[[:alnum:]]+\.texinfo$" -Chapters/section.texinfo = "^.+\.texinfo$" diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.sed b/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.sed deleted file mode 100755 index 474a78f..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.sed +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sed -# -# repository.sed -- This file provide English transformations for -# texi2html outupt, based on The CentOS Project CSS definitions. -# -# Copyright (C) 2009-2010 Alain Reguera Delgado -# -# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -# Quotations. -s!

Note!

Info

Note

!g - -s!

Warning!

Warning

Warning

!g - -s!

Important!

Important

Important

!g - -s!

Tip!

Tip

Tip

!g - -s!

Caution!

Caution

Caution

!g - -s!

Convention!

Convention

Convention

!g - -s!

Redirection!

Redirection

Redirection

!g diff --git a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.texinfo b/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.texinfo deleted file mode 100644 index 4565623..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/en_US/manual.texinfo +++ /dev/null @@ -1,74 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c -- Header -------------------------------------------------- - -@setfilename =MANUAL_NAME=.info -@settitle =MANUAL_TITLE= -@documentlanguage =LOCALE_LL= -@afourpaper -@finalout - -@c -- Variables ----------------------------------------------- - -@set TCENTOS The Community Enterprise Operating System -@set TCPROJ @url{http://www.centos.org/, The CentOS Project} -@set TCWIKI @url{http://wiki.centos.org/, The CentOS Wiki} -@set TCMLISTS @url{http://lists.centos.org/, The CentOS Mailing Lists} -@set TCBUGS @url{http://bugs.centos.org/, The CentOS Bugs} -@set TCMIRRORS @url{http://mirrors.centos.org/, The CentOS Mirrors} -@set TCPLANET @url{http://planet.centos.org/, The CentOS Planet} -@set TCFORUMS @url{http://forums.centos.org/, The CentOS Forums} -@set TCINFOML @email{centos-info@@centos.org, The CentOS Information Mailing List} -@set TCDEVSML @email{centos-devel@@centos.org, The CentOS Developers Mailing List} -@set TCDOCSML @email{centos-docs@@centos.org, The CentOS Documentation Mailing List} -@set TCARTWML @email{centos-artwork@@centos.org, The CentOS Artwork Mailing List} -@set TCL10NML @email{centos-l10n@@centos.org, The CentOS Localization Mailing List} -@set TCAR @url{https://projects.centos.org/svn/artwork/, The CentOS Artwork Repository} -@set TCAS @url{https://projects.centos.org/trac/artwork/, The CentOS Artwork SIG} - -@c -- Summary description and copyright ----------------------- - -@copying -=MANUAL_ABSTRACT= - -Copyright @copyright{} =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER= - -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no -Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A -copy of the license is included in the section entitled @ref{GNU Free -Documentation License}. -@end copying - -@c -- Titlepage, contents, copyright --------------------------- - -@titlepage -@title =MANUAL_TITLE= -@subtitle =MANUAL_SUBTITLE= -@author =COPYRIGHT_HOLDER= -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage -@contents - -@c -- `Top' node and master menu ------------------------------- - -@ifnottex -@node Top -@top =MANUAL_TITLE= -@insertcopying -@end ifnottex - -@include =MANUAL_NAME=-menu.texinfo - -@c -- The body of the document -------------------------------- - -@include =MANUAL_NAME=-nodes.texinfo - -@c -- The end of the document --------------------------------- - -@include Licenses/chapter.texinfo -@include =MANUAL_NAME=-index.texinfo - -@bye diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GFDL.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GFDL.texinfo deleted file mode 100755 index 8f789ec..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GFDL.texinfo +++ /dev/null @@ -1,372 +0,0 @@ -@subheading Preámbulo - -El propósito de esta Licencia es permitir que un manual, libro de -texto, u otro documento escrito sea «libre» en el sentido de libertad: -asegurar a todo el mundo la libertad efectiva de copiarlo y -redistribuirlo, con o sin modificaciones, de manera comercial o no. En -segundo término, esta Licencia proporciona al autor y al editor una -manera de obtener reconocimiento por su trabajo, sin que se le -considere responsable de las modificaciones realizadas por otros. - -Esta Licencia es de tipo «copyleft», lo que significa que los trabajos -derivados del documento deben a su vez ser libres en el mismo sentido. -Complementa la Licencia Pública General de GNU, que es una licencia -tipo copyleft diseñada para el software libre. - -Hemos diseñado esta Licencia para usarla en manuales de software -libre, ya que el software libre necesita documentación libre: Un -programa libre debe venir con los manuales que ofrezcan la mismas -libertades que da el software. Pero esta licencia no se limita a -manuales de software; puede ser usada para cualquier trabajo textual, -sin tener en cuenta su temática o si se publica como libro impreso. -Recomendamos esta licencia principalmente para trabajos cuyo fin sea -instructivo o de referencia. - -@subheading 1. Aplicación y definiciones - -Esta Licencia se aplica a cualquier manual u otro trabajo que contenga -un aviso colocado por el poseedor del copyright diciendo que puede -distribuirse bajo los términos de esta Licencia. El «Documento», -abajo, se refiere a cualquier manual o trabajo. Cualquier miembro del -público es un licenciatario,y será referido como «Usted». - -Una «Versión Modificada» del Documento significa cualquier trabajo que -contenga el Documento o una porción del mismo, ya sea una copia -literal o con modificaciones y/o traducciones a otro idioma. - -Una «Sección Secundaria» es un apéndice con título o una sección -preliminar del Documento que trata exclusivamente de la relación entre -los autores o editores y el tema general delDocumento que trata -exclusivamente con la relación entre los editores o autores del -Documento con el asunto general del Documento (o asuntos relacionados) -y no contiene nada que pueda considerarse dentro del tema principal. -(Por ejemplo, si el Documento es en parte un libro de texto de -matemáticas, una Sección Secundaria no explicará nada de matemáticas.) -La relación puede ser una conexión histórica con el asunto o temas -relacionados, o una opinión legal, comercial, filosófica, ética o -política acerca de ellos. - -Las «Secciones Invariantes» son ciertas Secciones Secundarias cuyos -títulos son designados como Secciones Invariantes en la nota que -indica que el Documento se publica bajo esta Licencia. - -Los «Textos de Cubierta» son ciertos pasajes cortos de texto que se -listan como Textos de Cubierta Delantera o Textos de Cubierta Trasera -en la nota que indica que el Documento se publica bajo esta Licencia. - -Una copia «Transparente» del Documento, significa una copia para -lectura en máquina, representada en un formato cuya especificación -está disponible al público en general, cuyo contenido puede ser visto -y editados directamente con editores de texto genéricos o (para -imágenes compuestas por píxeles) con programas genéricos de -manipulación de imágenes o (para dibujos) con algún editor de dibujos -ampliamente disponible, y que sea adecuado como entrada para -formateadores de texto o para su traducción automática a formatos -adecuados para formateadores de texto. Una copia hecha en un formato -definido como Transparente, pero cuyo marcaje o ausencia de él haya -sido diseñado para impedir o dificultar modificaciones posteriores por -parte de los lectores no es Transparente. Una copia que no es -«Transparente» se denomina «Opaca». - -Como ejemplos de formatos adecuados para copias Transparentes están -ASCII puro sin marcaje, formato de entrada de Texinfo, formato de -entrada de LaTeX, SGML o XML usando una DTD disponible públicamente, y -HTML, PostScript o PDF simples, que sigan los estándares y diseños -para que los modifiquen personas.Los formatos Opacos incluyen formatos -propietarios que pueden ser leídos y editados únicamente en -procesadores de textos propietarios, SGML o XML para los cuáles las -DTD y/o herramientas de procesamiento no estén ampliamente -disponibles, y HTML, PostScript o PDF generados por algunos -procesadores de textos sólo como salida. - -La «Portada» significa, en un libro impreso, la página de título, más -las páginas siguientes que sean necesarias para mantener legiblemente -el material que esta Licencia requiere en la portada. Para trabajos en -formatos que no tienen página de portada como tal, «Portada»significa -el texto cercano a la aparición más prominente del título del -trabajo,precediendo el comienzo del cuerpo del texto. - -@subheading 2. Copia literal - -Usted puede copiar y distribuir el Documento en cualquier medio, sea -en forma comercial o no, siempre y cuando proporcione esta Licencia, -las notas de copyright y la nota que indica que esta Licencia se -aplica al Documento reproduciéndola en todas las copias y que usted no -añada ninguna otra condición a las expuestas en esta Licencia. Usted -no puede usar medidas técnicas para obstruir o controlar la lectura o -copia posterior de las copias que usted haga o distribuya. Sin -embargo, usted puede aceptar compensación a cambio de las copias. Si -distribuye un número suficientemente grande de copias también deberá -seguir las condiciones de la sección 3. - -Usted también puede prestar copias, bajo las mismas condiciones -establecidas anteriormente, y puede exhibir copias públicamente. - -@subheading 3. Copiando en cantidad - -Si publica copias impresas del Documento que sobrepasen las 100, y la -nota de licencia del Documento exige Textos de Cubierta, debe -incluirlas copias con cubiertas que lleven en forma clara y legible -todos esos Textos de Cubierta: Textos de Cubierta Delantera en la -cubierta delantera y Textos de Cubierta Trasera en la cubierta -trasera. Ambas cubiertas deben identificarlo a Usted clara y -legiblemente como editor de tales copias. La cubierta debe mostrar el -título completo con todas las palabras igualmente prominentes y -visibles. Además puede añadir otro material en las cubiertas. Las -copias con cambios limitados a las cubiertas, siempre que conserven el -título del Documento y satisfagan estas condiciones, pueden -considerarse como copias literales en todos los aspectos. - -Si los textos requeridos para la cubierta son muy voluminosos para que -ajusten legiblemente, debe colocar los primeros (tantos como sea -razonable colocar) en la verdadera cubierta y situar el resto en -páginas adyacentes. - -Si Usted publica o distribuye copias Opacas del Documento cuya -cantidad exceda las 100, debe incluir una copia Transparente, que -pueda ser leída por una máquina, con cada copia Opaca, o bien mostrar, -en cada copia Opaca, una dirección de red donde cualquier usuario de -la misma tenga acceso por medio de protocolos públicos y -estandarizados a una copia Transparente del Documento completa, sin -material adicional. Si usted hace uso de la última opción, deberá -tomar las medidas necesarias, cuando comience la distribución de las -copias Opacas en cantidad, para asegurar que esta copia Transparente -permanecerá accesible en el sitio establecido por lo menos un año -después de la última vez que distribuya una copia Opaca de esa edición -al público (directamente o a través de sus agentes o distribuidores). - -Se solicita, aunque no es requisito, que se ponga en contacto con los -autores del Documento antes de redistribuir gran número de copias, -para darles la oportunidad de que le proporcionen una versión -actualizada del Documento. - -@subheading 4. Modificaciones - -Puede copiar y distribuir una Versión Modificada del Documento bajo -las condiciones de las secciones 2 y 3 anteriores, siempre que Usted -libere la Versión Modificada bajo esta misma Licencia, con la Versión -Modificada haciendo el rol del Documento, por lo tanto dando Licencia -de distribución y modificación de la Versión Modificada a quienquiera -posea una copia de la misma. Además, debe hacer lo siguiente en la -Versión Modificada: - -A. Usar en la Portada (y en las cubiertas, si hay alguna) un título -distinto al del Documento y de sus versiones anteriores (que deberían, -si hay alguna, estar listadas en la sección de Historia del -Documento). Puede usar el mismo título de versiones anteriores al -original siempre y cuando quien las publicó originalmente otorgue -permiso. - -B. Listar en la Portada, como autores, una o más personas o entidades -responsables de la autoría de las modificaciones de la Versión -Modificada, junto con por lo menos cinco de los autores principales -del Documento (todos sus autores principales, si hay menos de cinco), -a menos que le eximan de tal requisito. - -C. Mostrar en la Portada como editor el nombre del editor de la -Versión Modificada - -D. Conservar todas las notas de copyright del Documento. - -E. Añadir una nota de copyright apropiada a sus modificaciones, -adyacente a las otras notas de copyright. - -F. Incluir, inmediatamente después de los avisos de copyright, una -nota de licencia dando el permiso público para usar la Versión -Modificada bajo los términos de esta Licencia, de la forma mostrada en -el Adenda de más abajo. - -G. Incluir, inmediatamente después de ese aviso de licencia, la lista -completa de Secciones invariantes y de los Textos de Cubierta que sean -requeridos en el aviso de Licencia del Documento original. - -H. Incluir una copia sin modificación de esta Licencia. - -I. Conservar la sección titulada «Historia», conservar su Título y -añadirle un elemento que declare al menos el título, el año, los -nuevos autores y el editor de la Versión Modificada, tal como figuran -en la Portada. Si no hay una sección titulada «Historia» en el -Documento, crear una estableciendo el título, el año, los autores y el -editor del Documento, tal como figuran en su Portada, añadiendo además -un elemento describiendo la Versión Modificada, como se estableció en -la sentencia anterior. - -J. Conservar la dirección en red, si la hay, dada en el Documento para -el acceso público a una copia Transparente del mismo, así como las -otras direcciones de red dadas en el Documento para versiones -anteriores en las que estuviese basado. Pueden ubicarse en la sección -«Historia». Se puede omitir la ubicación en red de un trabajo que haya -sido publicado por lo menos cuatro años antes que el Documento mismo, -o si el editor original de dicha versión da permiso. - -K. En cualquier sección titulada «Agradecimientos» o «Dedicatorias», -conservar el título de la sección y conservar en ella toda la -sustancia y el tono de los agradecimientos y/o dedicatorias incluidas -por cada contribuyente. - -L. Conservar todas las Secciones Invariantes del Documento, sin -alterar su texto ni sus títulos. Los números de sección o equivalentes -no se consideran parte de los títulos de la sección. - -M. Borrar cualquier sección titulada «Aprobaciones». Tales secciones -no pueden estar incluidas en las Versiones Modificadas. - -N. No cambiar el título de ninguna sección existente a «Aprobaciones» -ni a uno que entre en conflicto con el de alguna Sección Invariante. - -Si la Versión Modificada incluye secciones o apéndices nuevos que -cualifiquen como Secciones Secundarias y no contienen ningún material -copiado del Documento, puede opcionalmente designar algunas o todas -esas secciones como invariantes. Para hacerlo, añada sus títulos a la -lista de Secciones Invariantes en el aviso de licencia de la Versión -Modificada. Tales títulos deben ser distintos de cualquier otro título -de sección. - -Puede añadir una sección titulada «Aprobaciones», siempre que contenga -únicamente aprobaciones de su Versión Modificada por otras fuentes ---por ejemplo, observaciones de compañeros o que el texto ha sido -aprobado por una organización como definición oficial de un estándar. - -Puede añadir un pasaje de hasta cinco palabras como Texto de Cubierta -Delantera y un pasaje de hasta 25 palabras como Texto de Cubierta -Trasera al final de la lista de Texto de Cubierta en la Versión -Modificada. Una entidad sólo puede añadir (o hacer que se añada) un -pasaje al Texto de Cubierta Delantera y uno al de Cubierta Trasera. Si -el Documento ya incluye un textos de cubiertas añadidos previamente -por usted o por acuerdo previo con la entidad que usted representa, -usted no puede añadir otro; pero puede reemplazar el anterior, con -permiso explícito del editor anterior que agregó el texto anterior. - -Con esta Licencia ni los autores ni los editores del Documento dan -permiso para usar sus nombres para publicidad ni para asegurar o -implicar aprobación de cualquier Versión Modificada. - -@subheading 5. Combinación de documentos - -Usted puede combinar el Documento con otros documentos liberados bajo -esta Licencia, bajo los términos definidos en la sección section 4 más -arriba para versiones modificadas, siempre que incluya en la -combinación todas las Secciones Invariantes de todos los documentos -originales, sin modificaciones, y las liste todas como Secciones -Invariantes de su trabajo combinado en su aviso de licencia. - -El trabajo combinado necesita contener solamente una copia de esta -Licencia, y múltiples Secciones Invariantes idénticas pueden -reemplazarse por una sola copia. Si hay múltiples Secciones -Invariantes con el mismo nombre pero con contenidos diferentes, haga -el título de cada una de estas secciones único añadiéndolo al final de -este, entre paréntesis, el nombre del autor o de quien editó -originalmente esa sección, si es conocido, o si no, un número único. -Haga el mismo ajuste a los títulos de sección en la lista de Secciones -Invariantes en la nota de licencia del trabajo combinado. - -En la combinación, debe combinar cualquier sección titulada «Historia» -de los distintos documentos originales, formando una sección titulada -«Historia»; de la misma forma, combine cualquier sección titulada -«Reconocimientos» y cualquier sección titulada «Dedicatorias». Debe -borrar todas las secciones tituladas «Aprobaciones». - -@subheading 6. Colecciones de documentos - -Puede hacer una colección que conste del Documento y de otros -documentos publicados bajo esta Licencia, y reemplazar las copias -individuales de esta Licencia en todos los documentos por una sola -copia que esté incluida en la colección, siempre que siga las reglas -de esta Licencia para cada copia literal de cada uno de los documentos -en cualquiera de los demás aspectos. - -Puede extraer un solo documento de una de tales colecciones y -distribuirlo individualmente bajo esta Licencia, siempre que inserte -una copia de esta Licencia en el documento extraído, y siga esta -Licencia en todos los demás aspectos relativos a la copia literal de -dicho documento. - -@subheading 7. Agregación con trabajos independientes - -Una recopilación que conste del Documento o sus derivados y de otros -documentos o trabajos separados e independientes, en cualquier soporte -de almacenamiento o distribución, no cuenta como un todo como una -Versión Modificada del Documento, siempre que no se reclame ningún -derecho de copyright por la compilación. Dicha compilación se denomina -un «agregado», y esta Licencia no se aplica a otros trabajos -autocontenidos incluidos con el Documento. teniendo en cuenta que son -compilados, si no son los mismos trabajos derivados del Documento. Si -el requisito de Texto de Cubierta de la sección 3 es aplicable a estas -copias del Documento, entonces si el Documento es menor que un cuarto -del agregado completo, los Textos de Cubierta del Documento pueden -colocarse en cubiertas que enmarquen solamente el Documento dentro del -agregado. En caso contrario deben aparecer en cubiertas impresas -enmarcando todo el agregado. - -@subheading 8. Traducción - -La Traducción se considera como un tipo de modificación, por lo que -usted puede distribuir traducciones del Documento bajo los términos de -la sección 4. El reemplazo las Secciones Invariantes por traducciones -requiere permiso especial de los poseedores del copyright, pero usted -puede incluir traducciones de algunas o todas las Secciones -Invariantes junto con las versiones originales de las mismas. Puede -incluir una traducción de esta Licencia, siempre que incluya también -la versión original en inglés de esta Licencia. En caso de desacuerdo -entre la traducción y la versión original en inglés de esta Licencia, -la versión original en Inglés prevalecerá. - -@subheading 9. Terminación - -Usted no puede copiar, modificar, sublicenciar o distribuir el -Documento salvo por lo permitido expresamente por esta Licencia. -Cualquier otro intento de copia, modificación, sublicenciamiento o -distribución del Documento es nulo, y dará por terminados -automáticamente sus derechos bajo esa Licencia. Sin embargo, los -terceros que hayan recibido copias, o derechos, de usted bajo esta -Licencia no verán terminadas sus licencias, siempre que permanezcan en -total conformidad con ella. - -@subheading Revisiones futuras de esta licencia - -La Free Software Foundation puede publicar versiones nuevas y -revisadas de la Licencia de Documentación Libre GNU de vez en cuando. -Dichas versiones nuevas serán similares en espíritu a la presente -versión, pero pueden diferir en detalles para solucionar nuevos -problemas o preocupaciones. Vea @url{http://www.gnu.org/copyleft/}. - -Cada versión de la Licencia tiene un número de versión que la -distingue. Si el Documento especifica que se aplica una versión -numerada en particular de esta licencia o «cualquier versión -posterior», usted tiene la opción de seguir los términos y condiciones -de la versión especificada o cualquiera posterior que haya sido -publicada (no como borrador) por la Free Software Foundation. Si el -Documento no especifica un número de versión de esta Licencia, puede -escoger cualquier versión que haya sido publicada (no como borrador) -por la Free Software Foundation. - -@subheading Adenda - -Para usar esta licencia en un documento que usted haya escrito, -incluya una copia de la Licencia en el documento y ponga el siguiente -copyright y notificación de licencia justo después de la página de -título: - -@example -Copyright © AÑO SU NOMBRE. - -Se otorga permiso para copiar, distribuir y/o modificar este documento -bajo los términos de la Licencia de Documentación Libre de GNU, -Versión 1.1 o cualquier otra versión posterior publicada por la -Free Software Foundation; con las Secciones Invariantes siendo su -LISTE SUS TÍTULOS, con Textos de Cubierta Delantera siendo LISTA, y -con los Textos de Cubierta Trasera siendo LISTA. Una copia de la -licencia está incluida en la sección titulada «GNU Free -Documentation License». -@end example - -Si no tiene Secciones Invariantes, escriba «sin Secciones Invariantes» -en vez de decir cuáles son invariantes. Si no tiene Textos de Cubierta -Frontal, escriba «sin Textos de Cubierta Frontal»; de la misma manera -para Textos de Cubierta Trasera. - -Si su documento contiene ejemplos de código de programa no triviales, -recomendamos liberar estos ejemplos en paralelo bajo la licencia de -software libre que usted elija, como la Licencia Pública General de -GNU (@pxref{GNU General Public License}), para permitir su uso en -software libre. diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GPL.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GPL.texinfo deleted file mode 100755 index 79680fe..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GPL.texinfo +++ /dev/null @@ -1,329 +0,0 @@ -@subheading Preámbulo - -Las licencias que cubren la mayor parte del software están diseñadas -para quitarle a usted la libertad de compartirlo y modificarlo. Por el -contrario, la Licencia Pública General de GNU pretende garantizarle la -libertad de compartir y modificar software libre, para asegurar que el -software es libre para todos sus usuarios. Esta Licencia Pública -General se aplica a la mayor parte del software del la Free Software -Foundation y a cualquier otro programa si sus autores se comprometen a -utilizarla. (Existe otro software de la Free Software Foundation que -está cubierto por la Licencia Pública General de GNU para -Bibliotecas). Si quiere, también puede aplicarla a sus propios -programas. - -Cuando hablamos de software libre, estamos refiriéndonos a libertad, -no a precio. Nuestras Licencias Públicas Generales están diseñadas -para asegurarnos de que tenga la libertad de distribuir copias de -software libre (y cobrar por ese servicio si quiere), de que reciba el -código fuente o que pueda conseguirlo si lo quiere, de que pueda -modificar el software o usar fragmentos de él en programas nuevos -libres, y de que sepa que puede hacer todas estas cosas. - -Para proteger sus derechos necesitamos algunas restricciones que -prohíban a cualquiera negarle a usted estos derechos o pedirle que -renuncie a ellos. Estas restricciones se traducen en ciertas -obligaciones que le afectan si distribuye copias del software, o si lo -modifica. - -Por ejemplo, si distribuye copias de uno de estos programas, sea -gratuitamente, o a cambio de una contraprestación, debe dar a los -receptores todos los derechos que tiene. Debe asegurarse de que ellos -también reciben, o pueden conseguir, el código fuente. Y debe -mostrarles estas condiciones de forma que conozcan sus derechos. - -Protegemos sus derechos con la combinación de dos medidas: - -@itemize -@item Derechos de copia del software (copyright), y -@item Le ofrecemos esta licencia, que le da permiso legal para copiar, -distribuir y/o modificar el software. -@end itemize - -También, para la protección de cada autor y la nuestra propia, -queremos asegurarnos de que todo el mundo comprende que no se -proporciona ninguna garantía para este software libre. Si el software -se modifica por cualquiera y éste a su vez lo distribuye, queremos que -sus receptores sepan que lo que tienen no es el original, de forma que -cualquier problema introducido por otros no afecte a la reputación de -los autores originales. - -Finalmente, cualquier programa libre está constantemente amenazado por -patentes sobre el software. Queremos evitar el peligro de que los -redistribuidores de un programa libre obtengan patentes por su cuenta, -convirtiendo de facto el programa en propietario. Para evitar esto, -hemos dejado claro que cualquier patente debe ser pedida para el uso -libre de cualquiera, o no ser pedida. - -Los términos precisos y las condiciones para la copia, distribución y -modificación se exponen a continuación. - -@subheading TÉRMINOS Y CONDICIONES PARA LA COPIA, DISTRIBUCIÓN Y MODIFICACIÓN - -@subsubheading Sección 0 - -Esta Licencia se aplica a cualquier programa u otro tipo de obra que -contenga una notificación colocada por el propietario del copyright -diciendo que puede distribuirse bajo los términos de esta Licencia -Pública General. El «Programa», en adelante, se referirá a cualquier -programa u obra, y «obra basada en el Programa» se referirá bien al -Programa o a cualquier trabajo derivado de él según la ley de derechos -de autor (copyright): Esto es, una obra o trabajo que contenga el -programa o una porción de él, bien en forma literal o con -modificaciones y/o traducido en otro lenguaje. Aquí y después, la -traducción está incluida sin limitación en el término «modificación». -Cada concesionario (licenciatario) será denominado «usted». - -Cualquier otra actividad que no sea la copia, distribución o -modificación no está cubierta por esta Licencia, está fuera de su -ámbito. El acto de ejecutar el Programa no está restringido, y los -resultados del Programa están cubiertos únicamente si sus contenidos -constituyen un trabajo basado en el Programa, independientemente de -haberlo producido mediante la ejecución del programa. El que esto se -cumpla, depende de lo que haga el programa. - -@subsubheading Sección 1 - -Usted puede copiar y distribuir copias literales del código fuente del -Programa, según lo has recibido, en cualquier medio, supuesto que de -forma adecuada y bien visible publique en cada copia un anuncio de -copyright adecuado y un repudio de garantía, mantenga intactos todos -los anuncios que se refieran a esta Licencia y a la ausencia de -garantía, y proporcione a cualquier otro receptor del programa una -copia de esta Licencia junto con el Programa. - -Puede cobrar un precio por el acto físico de transferir una copia, y -puede, según su libre albedrío, ofrecer garantía a cambio de unos -honorarios. - -@subsubheading Sección 2 - -Puede modificar su copia o copias del Programa o de cualquier porción -de él, formando de esta manera un trabajo basado en el Programa, y -copiar y distribuir esa modificación o trabajo bajo los términos de la -Sección 1 anterior, probado que además usted cumpla con todas las -siguientes condiciones: - -@enumerate -@item Debe hacer que los ficheros modificados lleven anuncios -prominentes indicando que los ha cambiado y la fecha de cualquier -cambio. - -@item Debe hacer que cualquier trabajo que distribuya o publique y que -en todo o en parte contenga o sea derivado del Programa o de cualquier -parte de él sea licenciada como un todo, sin carga alguna, a todas las -terceras partes y bajo los términos de esta Licencia. - -@item If the modified program normally reads commands interactively -when run, you must cause it, when started running for such interactive -use in the most ordinary way, to print or display an announcement -including an appropriate copyright notice and a notice that there is -no warranty (or else, saying that you provide a warranty) and that -users may redistribute the program under these conditions, and telling -the user how to view a copy of this License. - -Excepción: Si el propio Programa es interactivo pero normalmente no -muestra ese anuncio, no se requiere que su trabajo basado en el -Programa muestre ningún anuncio. - -@end enumerate - -Estos requisitos se aplican al trabajo modificado como un todo. Si -partes identificables de ese trabajo no son derivadas del Programa, y -pueden, razonablemente, ser consideradas trabajos independientes y -separados por ellos mismos, entonces esta Licencia y sus términos no -se aplican a esas partes cuando sean distribuidas como trabajos -separados. Pero cuando distribuya esas mismas secciones como partes de -un todo que es un trabajo basado en el Programa, la distribución del -todo debe ser según los términos de esta licencia, cuyos permisos para -otros licenciatarios se extienden al todo completo, y por lo tanto a -todas y cada una de sus partes, con independencia de quién la -escribió. - -Por lo tanto, no es la intención de este apartado reclamar derechos o -desafiar sus derechos sobre trabajos escritos totalmente por usted -mismo. El intento es ejercer el derecho a controlar la distribución de -trabajos derivados o colectivos basados en el Programa. - -Además, el simple hecho de reunir un trabajo no basado en el Programa -con el Programa (o con un trabajo basado en el Programa) en un volumen -de almacenamiento o en un medio de distribución no hace que dicho -trabajo entre dentro del ámbito cubierto por esta Licencia. - -@subsubheading Sección 3 - -Puede copiar y distribuir el Programa (o un trabajo basado en él, -según se especifica en la Sección 2, como código objeto o en formato -ejecutable según los términos de las Secciones 1 y 2 anteriores, -supuesto que además cumpla una de las siguientes condiciones: - -@enumerate - -@item Acompañarlo con el código fuente leíble completo -correspondiente, leíble por máquinas, que debe ser distribuido según -los términos las Secciones 1 y 2 mencionadas antes en un medio -habitualmente utilizado para el intercambio de software, o, - -@item Acompañarlo con una oferta por escrito, válida durante al menos -tres años, de proporcionar a cualquier tercera parte una copia -completa en formato electrónico del código fuente correspondiente, a -un coste no mayor que el de realizar físicamente la distribución del -fuente, que será distribuido bajo las condiciones descritas en los -apartados 1 y 2 anteriores, en un medio habitualmente utilizado para -el intercambio de programas, o - -@item Acompañarlo con la información que recibiste ofreciendo -distribuir el código fuente correspondiente. (Esta opción se permite -sólo para distribución no comercial y sólo si usted recibió el -programa como código objeto o en formato ejecutable con tal oferta, de -acuerdo con la Subsección b anterior). -@end enumerate - -Por código fuente de un trabajo se entiende la forma preferida del -trabajo cuando se le hacen modificaciones. Para un trabajo ejecutable, -se entiende por código fuente completo todo el código fuente para -todos los módulos que contiene, más cualquier fichero asociado de -definición de interfaces, más los guiones utilizados para controlar la -compilación e instalación del ejecutable. Como excepción especial el -código fuente distribuido no necesita incluir nada que sea distribuido -normalmente (bien como fuente, bien en forma binaria) con los -componentes principales (compilador, núcleo y similares) del sistema -operativo en el cual funciona el ejecutable, a no ser que el propio -componente acompañe al ejecutable. - -Si la distribución del ejecutable o del código objeto se hace mediante -la oferta acceso para copiarlo de un cierto lugar, entonces se -considera la oferta de acceso para copiar el código fuente del mismo -lugar como distribución del código fuente, incluso aunque terceras -partes no estén forzadas a copiar el fuente junto con el código -objeto. - -@subsubheading Sección 4 - -No puede copiar, modificar, sublicenciar o distribuir el Programa -excepto como prevé expresamente esta Licencia. Cualquier intento de -copiar, modificar sublicenciar o distribuir el Programa de otra forma -es inválida, y hará que cesen automáticamente los derechos que te -proporciona esta Licencia. En cualquier caso, las partes que hayan -recibido copias o derechos de usted bajo esta Licencia no cesarán en -sus derechos mientras esas partes continúen cumpliéndola. 5Sección 5 - -No está obligado a aceptar esta licencia, ya que no la ha firmado. Sin -embargo, no hay hada más que le proporcione permiso para modificar o -distribuir el Programa o sus trabajos derivados. Estas acciones están -prohibidas por la ley si no acepta esta Licencia. Por lo tanto, si -modifica o distribuye el Programa (o cualquier trabajo basado en el -Programa), está indicando que acepta esta Licencia para poder hacerlo, -y todos sus términos y condiciones para copiar, distribuir o modificar -el Programa o trabajos basados en él. 6Sección 6 - -Cada vez que redistribuya el Programa (o cualquier trabajo basado en -el Programa), el receptor recibe automáticamente una licencia del -licenciatario original para copiar, distribuir o modificar el -Programa, de forma sujeta a estos términos y condiciones. No puede -imponer al receptor ninguna restricción más sobre el ejercicio de los -derechos aquí garantizados. No es usted responsable de hacer cumplir -esta licencia por terceras partes. 7Sección 7 - -Si como consecuencia de una resolución judicial o de una alegación de -infracción de patente o por cualquier otra razón (no limitada a -asuntos relacionados con patentes) se le imponen condiciones (ya sea -por mandato judicial, por acuerdo o por cualquier otra causa) que -contradigan las condiciones de esta Licencia, ello no le exime de -cumplir las condiciones de esta Licencia. Si no puede realizar -distribuciones de forma que se satisfagan simultáneamente sus -obligaciones bajo esta licencia y cualquier otra obligación pertinente -entonces, como consecuencia, no puede distribuir el Programa de -ninguna forma. Por ejemplo, si una patente no permite la -redistribución libre de derechos de autor del Programa por parte de -todos aquellos que reciban copias directa o indirectamente a través de -usted, entonces la única forma en que podría satisfacer tanto esa -condición como esta Licencia sería evitar completamente la -distribución del Programa. - -Si cualquier porción de este apartado se considera inválida o -imposible de cumplir bajo cualquier circunstancia particular ha de -cumplirse el resto y la sección por entero ha de cumplirse en -cualquier otra circunstancia. - -No es el propósito de este apartado inducirle a infringir ninguna -reivindicación de patente ni de ningún otro derecho de propiedad o -impugnar la validez de ninguna de dichas reivindicaciones. Este -apartado tiene el único propósito de proteger la integridad del -sistema de distribución de software libre, que se realiza mediante -prácticas de licencia pública. Mucha gente ha hecho contribuciones -generosas a la gran variedad de software distribuido mediante ese -sistema con la confianza de que el sistema se aplicará -consistentemente. Será el autor/donante quien decida si quiere -distribuir software mediante cualquier otro sistema y una licencia no -puede imponer esa elección. - -Este apartado pretende dejar completamente claro lo que se cree que es -una consecuencia del resto de esta Licencia. - -@subsubheading Sección 8 - -Si la distribución y/o uso de el Programa está restringida en ciertos -países, bien por patentes o por interfaces bajo copyright, el tenedor -del copyright que coloca este Programa bajo esta Licencia puede añadir -una limitación explícita de distribución geográfica excluyendo esos -países, de forma que la distribución se permita sólo en o entre los -países no excluidos de esta manera. En ese caso, esta Licencia -incorporará la limitación como si estuviese escrita en el cuerpo de -esta Licencia. 9Sección 9 - -La Free Software Foundation puede publicar versiones revisadas y/o -nuevas de la Licencia Pública General de tiempo en tiempo. Dichas -nuevas versiones serán similares en espíritu a la presente versión, -pero pueden ser diferentes en detalles para considerar nuevos -problemas o situaciones. - -Cada versión recibe un número de versión que la distingue de otras. Si -el Programa especifica un número de versión de esta Licencia que se -aplica aplica a éste y a «cualquier versión posterior», usted tiene la -opción de seguir los términos y condiciones, bien de esa versión, bien -de cualquier versión posterior publicada por la Free Software -Foundation. Si el Programa no especifica un número de versión de esta -Licencia, usted puede escoger cualquier versión publicada por la Free -Software Foundation. - -@subsubheading Sección 10 - -Si quiere incorporar partes del Programa en otros programas libres -cuyas condiciones de distribución son diferentes, escribe al autor -para pedirle permiso. Si el software tiene copyright de la Free -Software Foundation, escribe a la Free Software Foundation: algunas -veces hacemos excepciones en estos casos. Nuestra decisión estará -guiada por el doble objetivo de de preservar la libertad de todos los -derivados de nuestro software libre y promover el que se comparta y -reutilice el software en general. - -@subsubheading AUSENCIA DE GARANTÍA - -Sección 11 - -DEBIDO A QUE EL PROGRAMA SE LICENCIA LIBRE DE CARGAS, NO SE OFRECE -NINGUNA GARANTÍA SOBRE EL PROGRAMA, EN TODA LA EXTENSIÓN PERMITIDA POR -LA LEGISLACIÓN APLICABLE. EXCEPTO CUANDO SE INDIQUE DE OTRA FORMA POR -ESCRITO, LOS PROPIETARIOS DEL COPYRIGHT Y/U OTRAS PARTES PROPORCIONAN -EL PROGRAMA «TAL CUAL», SIN GARANTÍA DE NINGUNA CLASE, BIEN EXPRESA O -IMPLÍCITA, CON INCLUSIÓN, PERO SIN LIMITACIÓN A LAS GARANTÍAS -MERCANTILES IMPLÍCITAS O A LA CONVENIENCIA PARA UN PROPÓSITO -PARTICULAR. CUALQUIER RIESGO REFERENTE A LA CALIDAD Y PRESTACIONES DEL -PROGRAMA ES ASUMIDO POR USTED. SI SE PROBASE QUE EL PROGRAMA ES -DEFECTUOSO, USTED ASUME EL COSTE DE CUALQUIER SERVICIO, REPARACIÓN O -CORRECCIÓN NECESARIO. - -@subsubheading Sección 12 - -EN NINGÚN CASO, SALVO QUE LO REQUIERA LA LEGISLACIÓN APLICABLE O HAYA -SIDO ACORDADO POR ESCRITO, NINGÚN TENEDOR DEL COPYRIGHT NI NINGUNA -OTRA PARTE QUE MODIFIQUE Y/O REDISTRIBUYA EL PROGRAMA SEGÚN SE PERMITE -EN ESTA LICENCIA SERÁ RESPONSABLE ANTE USTED POR DAÑOS, INCLUYENDO -CUALQUIER DAÑO GENERAL, ESPECIAL, INCIDENTAL O RESULTANTE PRODUCIDO -POR EL USO O LA IMPOSIBILIDAD DE USO DEL PROGRAMA (CON INCLUSIÓN, PERO -SIN LIMITACIÓN A LA PÉRDIDA DE DATOS O A LA GENERACIÓN INCORRECTA DE -DATOS O A PÉRDIDAS SUFRIDAS POR USTED O POR TERCERAS PARTES O A UN -FALLO DEL PROGRAMA AL FUNCIONAR EN COMBINACIÓN CON CUALQUIER OTRO -PROGRAMA), INCLUSO SI DICHO TENEDOR U OTRA PARTE HA SIDO ADVERTIDO DE -LA POSIBILIDAD DE DICHOS DAÑOS. diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-menu.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-menu.texinfo deleted file mode 100755 index b8240ba..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-menu.texinfo +++ /dev/null @@ -1,4 +0,0 @@ -@menu -* GNU General Public License:: -* GNU Free Documentation License:: -@end menu diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-nodes.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-nodes.texinfo deleted file mode 100755 index 7148d15..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-nodes.texinfo +++ /dev/null @@ -1,9 +0,0 @@ -@node GNU General Public License -@section Licencia Pública General de GNU -@cindex Licencia pública general GNU -@include trunk/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GPL.texinfo - -@node GNU Free Documentation License -@section Licencia de Documentación Libre de GNU -@cindex Licencia documentación libre GNU -@include trunk/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GFDL.texinfo diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter.texinfo deleted file mode 100755 index fed7e22..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter.texinfo +++ /dev/null @@ -1,5 +0,0 @@ -@node Licenses -@appendix Licencias -@cindex Licencias -@include Licenses/chapter-menu.texinfo -@include Licenses/chapter-nodes.texinfo diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-index.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-index.texinfo deleted file mode 100755 index bed8139..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-index.texinfo +++ /dev/null @@ -1,8 +0,0 @@ -@node Index -@unnumbered Índice -@syncodeindex fn cp -@syncodeindex vr cp -@syncodeindex ky cp -@syncodeindex pg cp -@syncodeindex tp cp -@printindex cp diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-init.pl b/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-init.pl deleted file mode 100755 index d8e2045..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-init.pl +++ /dev/null @@ -1,119 +0,0 @@ -# This file extends the '../manual-init.pl' initialization file to # provide Spanish translation messages for `texi2html-1.76-4.fc6'. -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -$LANGUAGES->{'es'} = { - ' The buttons in the navigation panels have the following meaning:' => 'Los botones en el panel de navegación tienen el significado siguiente:', - ' where the @strong{ Example } assumes that the current position is at @strong{ Subsubsection One-Two-Three } of a document of the following structure:' => 'donde el @strong{Ejemplo} asume que la posición actual es en @strong{Subsubsección Uno-Dos-Tres}', - ' Up ' => 'Arriba', - '%{acronym_like} (%{explanation})' => '', - '%{month}, %{day} %{year}' => '', - '%{name} of %{class}' => '%{name} de %{class}', - '%{name} on %{class}' => '%{name} en %{class}', - '%{node_file_href}' => '', - '%{node_file_href} @cite{%{book}}' => '', - '%{node_file_href} section `%{section}\' in @cite{%{book}}' => 'sección %{node_file_href} `%{section}\' en @cite{%{book}}', - '%{reference_name}' => '', - '%{style} %{number}' => '', - '%{style}: %{caption_first_line}' => '', - '%{style}: %{shortcaption_first_line}' => '', - '@b{%{quotation_arg}:} ' => '', - '@cite{%{book}}' => '', - 'About This Document' => 'Acerca de este documento', - 'April' => 'abril', - 'August' => 'agosto', - 'Button' => 'Botón', - 'Contents' => 'Contenidos', - 'Current Position' => 'Posición actual', - 'December' => 'diciembre', - 'February' => 'febrero', - 'Footnotes' => 'Pie de página', - 'From 1.2.3 go to' => 'Desde 1.2.3 va a', - 'Go to' => 'Ir a', - 'Index' => 'Índice', - 'Index Entry' => 'Entrada índice', - 'January' => 'enero', - 'July' => 'julio', - 'Jump to' => 'Saltar a', - 'June' => 'junio', - 'March' => 'marzo', - 'May' => 'mayo', - 'Menu:' => 'Menú:', - 'Name' => 'Nombre', - 'Next' => 'Siguiente', - 'November' => 'noviembre', - 'October' => 'octubre', - 'Overview' => 'Introducción', - 'Overview:' => 'Introducción:', - 'Prev' => 'Anterior', - 'Section' => 'Sección', - 'Section One' => 'Sección Uno', - 'See %{node_file_href}' => 'Véase %{node_file_href}', - 'See %{node_file_href} @cite{%{book}}' => 'Véase %{node_file_href} @cite{%{book}}', - 'See %{node_file_href} section `%{section}\' in @cite{%{book}}' => 'Véase la sección %{node_file_href} `%{section}\' en @cite{%{book}}', - 'See %{reference_name}' => 'Véase %{reference_name}', - 'See @cite{%{book}}' => 'Véase @cite{%{book}}', - 'See section %{reference_name}' => 'Véase la sección %{reference_name}', - 'See section `%{section}\' in @cite{%{book}}' => 'Véase la sección `%{section}\' en @cite{%{book}}', - 'September' => 'septiembre', - 'Short Table of Contents' => 'Resumen del Contenido', - 'Subsection One-Four' => 'Subsección Uno-Cuatro', - 'Subsection One-One' => 'Subsección Uno-Uno', - 'Subsection One-Three' => 'Subsección Uno-Tres', - 'Subsection One-Two' => 'Subsección Uno-Dos', - 'Subsubsection One-Two-Four' => 'Subsubsección Uno-Dos-Cuatro', - 'Subsubsection One-Two-One' => 'Subsubsección Uno-Dos-Uno', - 'Subsubsection One-Two-Three' => 'Subsubsección Uno-Dos-Tress', - 'Subsubsection One-Two-Two' => 'Subsubsección Uno-Dos-Dos', - 'T2H_today' => '', - 'Table of Contents' => 'Tabla de contenidos', - 'This document was generated by @emph{%{user}} on @emph{%{date}} using @uref{%{program_homepage}, @emph{%{program}}}.' => 'Este documento fue generado pr @emph{%{user}} en @emph{%{date}} usando @uref{%{program_homepage}, @emph{%{program}}}.', - 'This document was generated by @emph{%{user}} using @uref{%{program_homepage}, @emph{%{program}}}.' => 'Este documento fue generado por @emph{%{user}} usando @uref{%{program_homepage}, @emph{%{program}}}.', - 'This document was generated on @i{%{date}} using @uref{%{program_homepage}, @i{%{program}}}.' => 'Este documento fue generado en @i{%{date}} usando @uref{%{program_homepage}, @i{%{program}}}.', - 'This document was generated using @uref{%{program_homepage}, @emph{%{program}}}.' => 'Este documento fue generado usando @uref{%{program_homepage}, @emph{%{program}}}.', - 'Top' => 'Inicio', - 'Untitled Document' => 'Documento sintítulo', - 'about (help)' => 'Acerca de (ayuda)', - 'beginning of this chapter or previous chapter' => 'Inicio del capítulo o capítulo anterior', - 'by @emph{%{user}}' => 'por @emph{%{user}}', - 'by @emph{%{user}} on @emph{%{date}}' => 'por @emph{%{user}} el @emph{%{date}}', - 'cover (top) of document' => 'Cubierta (inicio) del documento', - 'current' => 'actual', - 'current section' => 'Sección actual', - 'first section in reading order' => 'Primera sección en orden de lectura', - 'following node' => 'Nodo siguiente', - 'index' => 'Índice', - 'last section in reading order' => 'Última sección en orden de lectura', - 'next chapter' => 'Capítulo siguiente', - 'next node' => 'Nodo siguiente', - 'next section in reading order' => 'Sección siguiente en order de lectura', - 'next section on same level' => 'Sección siguiente en el mismo nivel', - 'node following in node reading order' => 'siguiente nodo en orden de lectura', - 'node up' => 'nodo arriba', - 'on @emph{%{date}}' => 'el @emph{%{date}}', - 'previous node' => 'nodo anterior', - 'previous section in reading order' => 'Sección anterior en orden de lectura', - 'previous section on same level' => 'Sección anterior en el mismo nivel', - 'section `%{section}\' in @cite{%{book}}' => 'sección `%{section}\' en @cite{%{book}}', - 'see %{node_file_href}' => 'Véase %{node_file_href}', - 'see %{node_file_href} @cite{%{book}}' => 'Véase %{node_file_href} @cite{%{book}}', - 'see %{node_file_href} section `%{section}\' in @cite{%{book}}' => 'Véase %{node_file_href} sección `%{section}\' en @cite{%{book}}', - 'see %{reference_name}' => 'Véase %{reference_name}', - 'see @cite{%{book}}' => 'Véase @cite{%{book}}', - 'see section %{reference_name}' => 'véase sección %{reference_name}', - 'see section `%{section}\' in @cite{%{book}}' => 'véase sección `%{section}\' en @cite{%{book}}', - 'short table of contents' => 'resumen del contenido', - 'table of contents' => 'Tabla de contenidos', - 'unknown' => 'desconocido', - 'up node' => 'nodo superior', - 'up section' => 'Sección superior' - }; - -$T2H_OBSOLETE_STRINGS->{'es'} = { - 'See' => 'Véase', - 'section' => 'sección', - 'see' => 'véase' - }; - -return 1; diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-menu.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-menu.texinfo deleted file mode 100644 index 0afc9ff..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-menu.texinfo +++ /dev/null @@ -1,4 +0,0 @@ -@menu -* Licenses:: -* Index:: -@end menu diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-nodes.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-nodes.texinfo deleted file mode 100644 index e69de29..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual-nodes.texinfo +++ /dev/null diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.conf b/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.conf deleted file mode 100755 index 488ad84..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.conf +++ /dev/null @@ -1,43 +0,0 @@ -# Este fichero controla la configuración del manual. Este fichero -# está dividido en diferentes secciones de configuración (e.g., `main' -# para organizar la configuración principal y `templates' para -# organizar la relación de asiganación plantillas-sección). Cada -# sección de configuración está organizada en pares de valores -# `variable = valor' usados para describir las preferencias de -# configuración. -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -[main] - -# Especifica el trasfondo de documentación usado por el manual. Este -# es el formato utilizado para redactar los ficheros fuentes del -# manual de documentación. -manual_backend = "texinfo" - -# Especifica el estilo de títulos utilizados por las secciones del -# manual. Los valores posibles para esta opción son `cap-each-word' -# para escribir la primera letra de cada palabra en el título con -# mayúscula y el resto en minúscula, `cap-first-word' para escribir -# solo la primera letra del título en mayúscula y el resto en -# minúscula; y `directory' para transformar el título en un camino de -# directorio. -manual_section_style = "cap-each-word" - -# Especifica el order con que se muestran las secciones en el manual. -# Los valores posibles para esta opción son `created' para ubicar las -# nuevas secciones creadas en orden de creación, `ordered' para -# ordenar las secciones alfabéticamente sin importar el orden con el -# cual fueron creadas; y `reversed' lo contrario the `ordered'. -manual_section_order = "created" - -[templates] - -# Especifica la relación entre los ficheros de plantilla y los -# ficheros de definición de secciones en el manual. La definición de -# las plantillas se escriben en forma de camino relativo en el -# izquierdo y la definición de secciones en forma de expresión regular -# en el lado derecho. -Chapters/section-functions.texinfo = "^.+-functions-[[:alnum:]]+\.texinfo$" -Chapters/section.texinfo = "^.+\.texinfo$" diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.sed b/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.sed deleted file mode 100644 index 1887582..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.sed +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sed -# -# repository.sed -- This file provide Spanish transformations for -# texi2html outupt, based on The CentOS Project CSS definitions. -# -# Copyright (C) 2009-2010 Alain Reguera Delgado -# -# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -# Quotations. -s!

Nota!

Info

Nota

!g - -s!

Advertencia!

Advertencia

Advertencia

!g - -s!

Importante!

Importante

Importante

!g - -s!

Idea!

Idea

Idea

!g - -s!

Precaución!

Precaución

Precaución

!g - -s!

Convensión!

Convensión

Convensión

!g - -s!

Redirección!

Redirección

Redirección

!g diff --git a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.texinfo b/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.texinfo deleted file mode 100644 index 991a60d..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/es_ES/manual.texinfo +++ /dev/null @@ -1,75 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c -- Header -------------------------------------------------- - -@setfilename =MANUAL_NAME=.info -@settitle =MANUAL_TITLE= -@documentlanguage es -@afourpaper -@finalout - -@c -- Variables ----------------------------------------------- - -@set TCENTOS The Community Enterprise Operating System -@set TCPROJ @url{http://www.centos.org/, The CentOS Project} -@set TCWIKI @url{http://wiki.centos.org/, The CentOS Wiki} -@set TCMLISTS @url{http://lists.centos.org/, The CentOS Mailing Lists} -@set TCBUGS @url{http://bugs.centos.org/, The CentOS Bugs} -@set TCMIRRORS @url{http://mirrors.centos.org/, The CentOS Mirrors} -@set TCPLANET @url{http://planet.centos.org/, The CentOS Planet} -@set TCFORUMS @url{http://forums.centos.org/, The CentOS Forums} -@set TCINFOML @email{centos-info@@centos.org, The CentOS Information Mailing List} -@set TCDEVSML @email{centos-devel@@centos.org, The CentOS Developers Mailing List} -@set TCDOCSML @email{centos-docs@@centos.org, The CentOS Documentation Mailing List} -@set TCARTWML @email{centos-artwork@@centos.org, The CentOS Artwork Mailing List} -@set TCL10NML @email{centos-l10n@@centos.org, The CentOS Localization Mailing List} -@set TCAR @url{https://projects.centos.org/svn/artwork/, The CentOS Artwork Repository} -@set TCAS @url{https://projects.centos.org/trac/artwork/, The CentOS Artwork SIG} - -@c -- Summary description and copyright ----------------------- - -@copying -=MANUAL_ABSTRACT= - -Copyright @copyright{} =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER= - -Se otorga permiso para copiar, distribuir y/o modificar este documento -bajo los términos de la Licencia de Documentación Libre de GNU, -Versión 1.1 o cualquier otra versión posterior publicada por la Free -Software Foundation; con las Secciones Invariantes, con Textos de -Cubierta Delantera, y con los Textos de Cubierta Trasera. Una copia de -la licencia está incluida en la sección titulada @ref{GNU Free -Documentation License}. -@end copying - -@c -- Titlepage, contents, copyright --------------------------- - -@titlepage -@title =MANUAL_TITLE= -@subtitle =MANUAL_SUBTITLE= -@author =COPYRIGHT_HOLDER= -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage -@contents - -@c -- `Top' node and master menu ------------------------------- - -@ifnottex -@node Top -@top =MANUAL_TITLE= -@insertcopying -@end ifnottex - -@include =MANUAL_NAME=-menu.texinfo - -@c -- The body of the document -------------------------------- - -@include =MANUAL_NAME=-nodes.texinfo - -@c -- The end of the document --------------------------------- - -@include Licenses/chapter.texinfo -@include =MANUAL_NAME=-index.texinfo - -@bye diff --git a/Scripts/Functions/Help/Texinfo/Templates/manual-init.pl b/Scripts/Functions/Help/Texinfo/Templates/manual-init.pl deleted file mode 100755 index 6dfc09d..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/manual-init.pl +++ /dev/null @@ -1,389 +0,0 @@ -#!/usr/bin/perl -# -# repository.init -- This file initializes Texi2HTML program to -# produce the repository documentation manual using the CentOS Web -# Environment XHTML and CSS standard definition. -# -# Copyright (C) 2009, 2010, 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -# -iso -# if set, ISO8859 characters are used for special symbols (like -# copyright, etc) -$USE_ISO = 1; - -# -I -# add a directory to the list of directories where @include files are -# searched for (besides the directory of the file). additional '-I' -# args are appended to this list. (APA: Don't implicitely search ., -# to conform with the docs!) my @INCLUDE_DIRS = ("."); -@INCLUDE_DIRS = ("/home/centos/artwork"); - -# Extension used on output files. -$EXTENSION = "xhtml"; - -# Horizontal rules. -$DEFAULT_RULE = '


'; -$SMALL_RULE = $DEFAULT_RULE; -$MIDDLE_RULE = $DEFAULT_RULE; -$BIG_RULE = $DEFAULT_RULE; - -# -split section|chapter|node|none -# if $SPLIT is set to 'section' (resp. 'chapter') one html file per -# section (resp. chapter) is generated. If $SPLIT is set to 'node' one -# html file per node or sectionning element is generated. In all these -# cases separate pages for Top, Table of content (Toc), Overview and -# About are generated. Otherwise a monolithic html file that contains -# the whole document is created. -$SPLIT = 'section'; - -# -sec-nav|-nosec-nav -# if this is set then navigation panels are printed at the beginning -# of each section. If the document is split at nodes then navigation -# panels are printed at the end if there were more than $WORDS_IN_PAGE -# words on page. -# -# If the document is split at sections this is ignored. -# -# This is most useful if you do not want to have section navigation -# with -split chapter. There will be chapter navigation panel at the -# beginning and at the end of chapters anyway. -$SECTION_NAVIGATION = 1; - -# Layout control -$print_page_head = \&T2H_XHTML_print_page_head; -$print_page_foot = \&T2H_XHTML_print_page_foot; -$print_frame = \&T2H_XHTML_print_frame; -$button_icon_img = \&T2H_XHTML_button_icon_img; -$print_navigation = \&T2H_XHTML_print_navigation; - -#FIXME update once it is more stabilized in texi2html.init -sub T2H_XHTML_print_page_head -{ - my $fh = shift; - my $longtitle = "$Texi2HTML::THISDOC{'title_unformatted'}"; - $longtitle .= ": $Texi2HTML::UNFORMATTED{'This'}" if exists $Texi2HTML::UNFORMATTED{'This'}; - print $fh < - - - - - $longtitle - - - - - - - - - - - - - - - - - -
- -
- -
- - -EOT -} - -sub T2H_XHTML_print_page_foot -{ - my $fh = shift; - my @date=localtime(time); - my $year=$date[5] += 1900; - my $program_string = program_string(); - print $fh <$program_string

- -
- -
- - -
- - - - -EOT -} - -# / in -sub T2H_XHTML_button_icon_img -{ - my $button = shift; - my $icon = shift; - my $name = shift; - return '' if (!defined($icon)); - if (defined($name) && $name) - { - $name = ": $name"; - } - else - { - $name = ''; - } - $button = "" if (!defined ($button)); - return qq{$button$name}; -} - -$simple_map{'*'} = '
'; - -# formatting functions - -$def_line = \&t2h_xhtml_def_line; -$index_summary = \&t2h_xhtml_index_summary; -$image = \&t2h_xhtml_image; - -# need / in -sub t2h_xhtml_image($$$) -{ - my $file = shift; - my $base = shift; - my $preformatted = shift; - return "[ $base ]" if ($preformatted); - return "\"$base\""; -} - -# process definition commands line @deffn for example -# replaced by -sub t2h_xhtml_def_line($$$$$) -{ - my $category = shift; - my $name = shift; - my $type = shift; - my $arguments = shift; - my $index_label = shift; - $index_label = '' if (!defined($index_label)); - $name = '' if (!defined($name) or ($name =~ /^\s*$/)); - $type = '' if (!defined($type) or $type =~ /^\s*$/); - if (!defined($arguments) or $arguments =~ /^\s*$/) - { - $arguments = ''; - } - else - { - $arguments = '' . $arguments . ''; - } - my $type_name = ''; - $type_name = " $type" if ($type ne ''); - $type_name .= ' ' . $name . '' if ($name ne ''); - $type_name .= $arguments . "\n"; - if (! $DEF_TABLE) - { - return '
'. '' . $category . ':' . $type_name . $index_label . "
\n"; - } - else - { - - return "\n" . $type_name . - "\n" . $category . $index_label . "\n" . "\n"; - } -} - -# There is a br which needs / -sub t2h_xhtml_index_summary($$) -{ - my $alpha = shift; - my $nonalpha = shift; - my $join = ''; - my $nonalpha_text = ''; - my $alpha_text = ''; - $join = "   \n
\n" if (@$nonalpha and @$alpha); - if (@$nonalpha) - { - $nonalpha_text = join("\n   \n", @$nonalpha) . "\n"; - } - if (@$alpha) - { - $alpha_text = join("\n   \n", @$alpha) . "\n   \n"; - } - #I18n - return "
" . &$I('Jump to') . ":   " . - $nonalpha_text . $join . $alpha_text . '
'; -} - -# Layout of navigation panel -sub T2H_XHTML_print_navigation -{ - my $fh = shift; - my $buttons = shift; - my $vertical = shift; - print $fh '' . "\n"; - - print $fh "" unless $vertical; - for my $button (@$buttons) - { - print $fh qq{\n} if $vertical; - print $fh qq{\n"; - print $fh "\n" if $vertical; - } - print $fh "" unless $vertical; - print $fh "\n"; -} - -# Use icons for navigation. -$ICONS = 0; - -# insert here name of icon images for buttons -# Icons are used, if $ICONS and resp. value are set -%ACTIVE_ICONS = - ( - 'Top', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-top.png', - 'Contents', 'file:///usr/share/icons/Bluecurve/24x24/stock/help-contents.png', - 'Overview', '', - 'Index', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-find.png', - 'This', '', - 'Back', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', - 'FastBack', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-first.png', - 'Prev', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', - 'Up', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-up.png', - 'Next', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', - 'NodeUp', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-up.png', - 'NodeNext', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', - 'NodePrev', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', - 'Following', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', - 'Forward', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', - 'FastForward', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-last.png', - 'About' , 'file:///usr/share/icons/Bluecurve/24x24/stock/gtk-about.png', - 'First', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-first.png', - 'Last', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-last.png', - ' ', '' - ); - -# Insert here name of icon images for these, if button is inactive -%PASSIVE_ICONS = - ( - 'Top', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-top.png', - 'Contents', 'file:///usr/share/icons/Bluecurve/24x24/stock/help-contents.png', - 'Overview', '', - 'Index', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-find.png', - 'This', '', - 'Back', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', - 'FastBack', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-first.png', - 'Prev', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', - 'Up', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-up.png', - 'Next', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', - 'NodeUp', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-up.png', - 'NodeNext', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', - 'NodePrev', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', - 'Following', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', - 'Forward', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', - 'FastForward', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-last.png', - 'About' , 'file:///usr/share/icons/Bluecurve/24x24/stock/gtk-about.png', - 'First', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-first.png', - 'Last', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-last.png', - ' ', '' - ); - -return 1; diff --git a/Scripts/Functions/Help/Texinfo/Templates/manual.sed b/Scripts/Functions/Help/Texinfo/Templates/manual.sed deleted file mode 100644 index 2b89341..0000000 --- a/Scripts/Functions/Help/Texinfo/Templates/manual.sed +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sed -# -# repository.sed -- This file provides common transformations for -# texi2html output, based on The CentOS Project CSS definitions. -# -# Copyright (C) 2009, 2010, 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -# Links -#s!
${MANUAL_CHAPTER_DIR}/chapter-nodes.${MANUAL_EXTENSION} - - # Print action maessage. - cli_printMessage "`gettext "Updating chapter menu and nodes inside manual structure."`" --as-response-line - - # Update chapter information inside the manual's texinfo - # structure. - texinfo_updateChapterMenu - texinfo_updateChapterNodes - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_createStructure.sh b/Scripts/Functions/Help/Texinfo/texinfo_createStructure.sh deleted file mode 100755 index a267e28..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_createStructure.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# -# texinfo_createStructure.sh -- This function creates the -# documentation structure of a manual using the current language as -# reference. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_createStructure { - - # Verify manual base directory. The manual base directory is where - # the whole documentation manual is stored in. If it already - # exist, assume it was correctly created in the past. - if [[ -d $MANUAL_BASEDIR ]];then - return - else - cli_printMessage "-" --as-separator-line - cli_printMessage "`eval_gettext "The following documentation manual will be created:"`" - cli_printMessage "${MANUAL_BASEFILE}.texinfo" --as-response-line - cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line - fi - - # Initialize manual's information (e.g., title, subtitle, abstract). - local MANUAL_TITLE='' - local MANUAL_SUBTITLE='' - local MANUAL_ABSTRACT='' - - # Create manual's top-level directory using subversion. This is - # the place where all texinfo documentation manuals is stored in. - if [[ ! -d ${MANUAL_BASEDIR} ]];then - svn mkdir ${MANUAL_BASEDIR} --quiet - fi - - # Create manual's base directory. This is the place where - # language-specific documentation source files are stored in. - svn mkdir ${MANUAL_BASEDIR_L10N} --quiet - - # Retrive manual's information from standard input. - cli_printMessage "`gettext "Manual Title"`" --as-request-line - read MANUAL_TITLE - cli_printMessage "`gettext "Manual Subtitle"`" --as-request-line - read MANUAL_SUBTITLE - cli_printMessage "`gettext "Manual Abstract"`" --as-request-line - read MANUAL_ABSTRACT - - # Print action message. - cli_printMessage "-" --as-separator-line - cli_printMessage "`gettext "Creating manual structure in texinfo format."`" --as-response-line - - # Verify manual's information. The title information must be - # non-empty value. - if [[ $MANUAL_TITLE == '' ]];then - cli_printMessage "`gettext "The manual title cannot be empty."`" --as-error-line - fi - - # Define file names required to build the manual. - local FILE='' - local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ - --maxdepth='1' \ - --pattern="manual((-menu|-nodes|-index)?\.${MANUAL_EXTENSION}|\.conf)") - - # Verify manual base file. The manual base file is where the - # documentation manual is defined in the backend format. Assuming - # no file exists (e.g., a new language-specific manual is being - # created), use texinfo templates for it. - for FILE in $FILES;do - if [[ ! -f ${MANUAL_BASEDIR_L10N}/$(basename ${FILE}) ]];then - - # Be sure the file is inside the working copy and under - # version control. - cli_checkFiles ${FILE} -wn - - # Define target file. - local DST=${MANUAL_BASEDIR_L10N}/$(basename ${FILE} \ - | sed -r "s!manual!${MANUAL_NAME}!") - - # Copy using subversion to register this action. - svn cp ${FILE} ${DST} --quiet - - # Expand common translation markers inside target file. - cli_expandTMarkers ${DST} - - # Expand specific translation markers inside target file. - sed -r -i -e "s!=MANUAL_NAME=!${MANUAL_NAME}!g" \ - -e "s!=MANUAL_TITLE=!${MANUAL_TITLE}!g" \ - -e "s!=MANUAL_SUBTITLE=!${MANUAL_SUBTITLE}!g" \ - -e "s!=MANUAL_ABSTRACT=!${MANUAL_ABSTRACT}!g" $DST - - fi - done - - # Initialize chapter structure inside the manual. - texinfo_createStructureChapters - - # Redefine absolute path to changed directory. - MANUAL_CHANGED_DIRS=${MANUAL_BASEDIR} - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_createStructureChapters.sh b/Scripts/Functions/Help/Texinfo/texinfo_createStructureChapters.sh deleted file mode 100755 index 37a3a38..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_createStructureChapters.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# texinfo_createStructureChapters.sh -- This function initiates the -# chapter documentation structure of a manual, using the current -# language and template files as reference. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_createStructureChapters { - - local MANUAL_CHAPTER_DIR='' - - # Define list of chapter templates files used to build the - # documentation manual. Do not include the `Chapters' directory - # here. It is used to build chapters based on value passed though - # `--chapter' option passed in the command-line. - local FILE='' - local FILES=$(cli_getFilesList ${MANUAL_TEMPLATE_L10N} \ - --pattern='chapter(-menu|-nodes)?\.texinfo' --mindepth='2' \ - | grep -v '/Chapters/') - - # Loop through chapter structures and create them inside the - # manual. - for FILE in $FILES;do - - # Redefine manual's chapter directory based on template files. - MANUAL_CHAPTER_DIR=${MANUAL_BASEDIR_L10N}/$(basename $(dirname ${FILE})) - - # Verify texinfo templates used as based to build the chapter. - # Be sure they are inside the working copy of CentOS Artwork - # Repository (-w) and under version control (-n), too. - cli_checkFiles ${FILE} -wn - - # Verify chapter's directory. If it doesn't exist, create it. - if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then - svn mkdir ${MANUAL_CHAPTER_DIR} --quiet - fi - - # Copy template files into chapter's directory. - svn cp ${FILE} ${MANUAL_CHAPTER_DIR} --quiet - - done - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh b/Scripts/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh deleted file mode 100755 index dbbd981..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# -# 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 -# function in coordination with texinfo_deleteEntry function, in order -# to keep cross reference information, inside the documentation -# manual, syncronized. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. If documentation entry is empty, - # stop script execution with an error message. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Build the node string using entry location. - local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Define regular expression patterns for texinfo cross reference - # commands. - PATTERN[0]="@(pxref|xref|ref)\{(${NODE})\}" - REPLACE[0]='--- @strong{'`gettext "Removed"`'}(\1:\2) ---' - - # Define replacement string for missing entries. It is convenient - # to keep missing entries in documentation for documentation team - # to know. Removing the missing cross reference may intorudce - # confussion. Imagine that! you are spending lots of hours in an - # article and suddenly one of your cross refereces disappears with - # no visible reason, with the next working copy update you - # perform. That's frustrating. Instead, when centos-art.sh script - # finds a missing cross reference it removes the link and remark - # the issue for you to act on it. - PATTERN[1]="^(\* ${NODE}:(.*):(.*))$" - REPLACE[1]='\@comment --- '`gettext "Removed"`'(\1) ---' - - # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern=".+\.${MANUAL_EXTENSION}") - - # Update node-related cross references. The node-related cross - # reference definition, long ones specially, could require more - # than one line to be set. By default, GNU sed does not matches - # newline characters in the pattern space, so we need to make use - # of `label' feature and the `N' command in order to build a - # pattern space that includes the newline character in it. Here we - # use the `a' letter to name the label we use, followed by N - # command to add a newline to the pattern space, the s command to - # make the pattern replacement using the `g' flag to make it - # global and finaly the command `b' to branch label named `a'. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu-related cross references. Menu-related cross - # references hardly appear in more than one line, so there is no - # need to complicate much the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_deleteEntry.sh b/Scripts/Functions/Help/Texinfo/texinfo_deleteEntry.sh deleted file mode 100755 index 897722e..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_deleteEntry.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntry.sh -- This function removes a documentation -# manuals, chapters or sections from the working copy. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteEntry { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Remove manual, chapter or section based on documentation entry - # provided as non-option argument to `centos-art.sh' script. - if [[ ${MANUAL_SECT[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a section is deleted, documentation entry points to a - # section name. In this configuration, documentation entry is - # deleted through subversion in order to register the change. - # Once the documentation entry is deleted, the section menu - # and nodes definition files are updated to keep manual in a - # consistent state. - texinfo_deleteEntrySection - - elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a chapter is deleted, documentation entry doesn't point - # to a section name but a chapter name. In this configuration, - # it is necessary to build a list of all the section entries - # available inside the chapter before deleting it. Once the - # chapter has been marked for deletion, it is time to update - # chapter definition files and later section definition files - # using the list of section entries previously defined. - # Actualization of section definition files must be done one - # at a time because menu entries related to section - # definitions are updated one at a time. - texinfo_deleteEntryChapter - - elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a manual is deleted, documentation entry doesnt' point - # to either a section or chapter but a manual name only. In - # this configuration the entire manual directory is marked for - # deletion, and that way processed. - texinfo_deleteEntryManual - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh b/Scripts/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh deleted file mode 100755 index 64983c8..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntryChapter.sh -- This function standardizes chapter -# deletion inside the manual structure. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteEntryChapter { - - # Print action message. - cli_printMessage "$MANUAL_CHAPTER_DIR" --as-deleting-line - - # Verify existence of documentation entry before deleting it. We - # cannot delete an entry which doesn't exist. - cli_checkFiles "$MANUAL_CHAPTER_DIR" - - # Build list of section entries inside the chapter. This is - # required to delete cross references from other section entries - # that point to section entries inside the chapter that will be - # deleted. Take care don't include the chapter definition files. - local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_CHAPTER_DIR \ - --pattern=".+\.${MANUAL_EXTENSION}" \ - | egrep -v '/chapter') - - # Revert pending changes before deleting. - svn revert ${MANUAL_CHAPTER_DIR} --quiet --recursive - - # Remove chapter directory using subversion to register the - # change. - svn del ${MANUAL_CHAPTER_DIR} --quiet - - # Update chapter menu and nodes inside manual structure. - texinfo_updateChapterMenu --delete-entry - texinfo_updateChapterNodes - - # Loop through section entries retrived from chapter, before - # deleting it, in order to remove cross references pointing to - # those section entries. Since the chapter and all its sections - # have been removed, cross references pointing them will point to - # non-existent section entries. This way, all cross references - # pointing to non-existent section entries will be transformed in - # order for documentors to advertise the section entry state. - for MANUAL_ENTRY in $MANUAL_ENTRIES;do - texinfo_deleteCrossReferences ${MANUAL_ENTRY} - done - -} - diff --git a/Scripts/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh b/Scripts/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh deleted file mode 100755 index 381fea5..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntryManual.sh -- This function standardized manual -# deletion inside the working copy. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteEntryManual { - - # Print action message. - cli_printMessage "$MANUAL_ENTRY" --as-deleting-line - - # Verify existence of documentation entry before deleting it. We - # cannot delete an entry which doesn't exist. - cli_checkFiles "$MANUAL_ENTRY" - - # Revert pending changes before deleting. - svn revert ${MANUAL_BASEDIR_L10N} --quiet --recursive - - # 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. - svn del ${MANUAL_BASEDIR_L10N} --quiet --force - - # Verify manual base directory. When the locale-specific - # documentaion manual is the last one inside the manual base - # directory, remove the manual base directory from the working - # copy. There is no need to have an empty manual base directories - # inside the working copy. - if [[ $(ls -1 $MANUAL_BASEDIR | wc -l) -le 1 ]];then - - # Remove manual base directory. - svn del ${MANUAL_BASEDIR} --quiet --force - - # Redefine absolute paths to changed directory. This is - # required in order for `cli_commitRepoChanges' to be aware - # that we are deleting MANUAL_BASEDIR, not - # MANUAL_BASEDIR_L10N. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR}" - - fi - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh b/Scripts/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh deleted file mode 100755 index f681282..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntrySection.sh -- This function standardized section -# deletion inside the manual structure. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteEntrySection { - - # Print action message. - cli_printMessage "$MANUAL_ENTRY" --as-deleting-line - - # Verify existence of documentation entry before deleting it. We - # cannot delete an entry which doesn't exist. - cli_checkFiles "$MANUAL_ENTRY" - - # Revert pending changes inside the section entry in order to - # prepare the file for deletion. - svn revert $MANUAL_ENTRY --quiet - - # Remove documentation entry using subversion to register the - # change. - svn del $MANUAL_ENTRY --quiet - - # Update section menu, nodes and cross references. - texinfo_updateStructureSection "${MANUAL_ENTRY}" --delete - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_editEntry.sh b/Scripts/Functions/Help/Texinfo/texinfo_editEntry.sh deleted file mode 100755 index 0a85fae..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_editEntry.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# texinfo_editEntry.sh -- This function implements the edition flow of -# documentation entries inside the working copy. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_editEntry { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Verify section definition inside chapters. - if [[ ! -f $MANUAL_ENTRY ]];then - - # Verify chapter related to documentation entry. Inside - # manuals, all documentation entries are stored directly under - # its chapter directory. There is no more levels deep so it is - # possible to perform a direct chapter verification here. - if [[ ! -a $(dirname $MANUAL_ENTRY)/chapter.${MANUAL_EXTENSION} ]];then - texinfo_createChapter - fi - - # Print confirmation question. - cli_printMessage "`gettext "The following documentation section will be created:"`" - cli_printMessage "$MANUAL_ENTRY" --as-response-line - cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line - - # Update section menu, nodes and cross references based on - # changes in order for manual structure to remain cosistent. - texinfo_updateStructureSection "$MANUAL_ENTRY" - - # Use default text editor to write changes on documentation entry. - $EDITOR $MANUAL_ENTRY - - else - - # Print action message. - cli_printMessage "$MANUAL_ENTRY" --as-updating-line - - # Rebuild section menu definitions before editing the - # documentation entry. This way, if there is any change in the - # section menu definition, it will be visible to you on - # edition. - texinfo_makeSeeAlso "$MANUAL_ENTRY" - - # Use default text editor to write changes on documentation entry. - $EDITOR $MANUAL_ENTRY - - # Rebuild section menu definitions after editing the - # documentation entry. This way, if there is any change or - # expansion to realize in the section menu definition, it be - # applied right now. Don't see a reason for waiting until the - # next edition for expansions to happen. - texinfo_makeSeeAlso "$MANUAL_ENTRY" - - fi - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_getEntry.sh b/Scripts/Functions/Help/Texinfo/texinfo_getEntry.sh deleted file mode 100755 index 2f4162e..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_getEntry.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntry.sh -- This function builds a documentation entry -# based on location specified as first positional parameter. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_getEntry { - - local MANUAL_ENTRY='' - local MANUAL_SECTION_NAME='' - local MANUAL_SECTION_NAMES="$@" - - # Loop through list of section names. - for MANUAL_SECTION_NAME in $MANUAL_SECTION_NAMES;do - - # Define absolute path to documentation entry. - MANUAL_ENTRY=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}/${MANUAL_SECTION_NAME}.${MANUAL_EXTENSION} - - # Output entry's absolute path. - echo ${MANUAL_ENTRY} - - done - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_getEntryIndex.sh b/Scripts/Functions/Help/Texinfo/texinfo_getEntryIndex.sh deleted file mode 100755 index 4e5762e..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_getEntryIndex.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryTitle.sh -- This function standardizes the way -# values for chapter and section index definitions are printed out. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_getEntryIndex { - - # Initialize phrase we want to transform based on style provided. - local PHRASE="$1" - - # In the entire phrase provided, capitalize the first word only. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!^([[:alpha:]])!\u\1!') - - # Output transformed phrase. - echo "$PHRASE" - -} - diff --git a/Scripts/Functions/Help/Texinfo/texinfo_getEntryNode.sh b/Scripts/Functions/Help/Texinfo/texinfo_getEntryNode.sh deleted file mode 100755 index 5472959..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_getEntryNode.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryNode.sh -- This function cleans up the action value -# (ACTIONVAL) directory to make a node name from it. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_getEntryNode { - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Define node from documentation entry. - local NODE=$(echo "$MANUAL_ENTRY" | sed -r \ - -e "s!^${MANUAL_BASEDIR_L10N}/!!" \ - -e "s/\.${MANUAL_EXTENSION}$//" \ - -e "s!chapter!!" \ - -e 's!(/|-)! !g' \ - -e 's!\<([[:alpha:]]+)\>!\u\1!g' \ - -e 's!^[[:space:]]+!!') - - echo "$NODE" - -} - diff --git a/Scripts/Functions/Help/Texinfo/texinfo_getEntryTitle.sh b/Scripts/Functions/Help/Texinfo/texinfo_getEntryTitle.sh deleted file mode 100755 index a733095..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_getEntryTitle.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryTitle.sh -- This function standardizes the way entry -# titles for chapters and sections are printed out. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_getEntryTitle { - - # Initialize phrase we want to transform based on style provided. - local PHRASE="$1" - - # Define section style. Through this property you can customize - # the section title in predefined ways. By default, section - # titles are printed with each word capitalized (`cap-each-word'). - # Other values to this option are `cap-first-only' (to capitalize - # just the first word in the title) or `directory' to transform - # each word to a directory path. - local MANUAL_SECTION_STYLE=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_style") - if [[ ! $MANUAL_SECTION_STYLE =~ '^(cap-each-word|cap-first-only|directory)$' ]];then - MANUAL_SECTION_STYLE='cap-each-word' - fi - - # Verify section style provided and transform the phrase value in - # accordance with it. - case $MANUAL_SECTION_STYLE in - - 'cap-first-only' ) - - # In the entire phrase provided, capitalize the first word - # only. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!^([[:alpha:]])!\u\1!') - ;; - - 'directory' ) - - # In the entire phrase provided, concatenate all words - # with slash (/) character and remark the fact it is a - # directory. - PHRASE=$(echo "${PHRASE}" | sed -r \ - -e 's/(Trunk|Branches|Tags)/\l\1/' \ - -e 's/ /\//g' \ - -e 's/\/([[:alpha:]])/\/\u\1/g') - - PHRASE="@file{$PHRASE}" - ;; - - 'cap-each-word' | * ) - - # In the entire phrase provided, capitalize all words. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!\<([[:alpha:]]+)\>!\u\1!g') - ;; - - esac - - # Output transformed phrase. - echo "$PHRASE" - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh b/Scripts/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh deleted file mode 100755 index 310d95d..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash -# -# texinfo_makeSeeAlso.sh -- This function creates a list of links with -# section entries one level ahead from the current section entry being -# processed. Desition of what of these texinfo definitions to use is -# set inside the section entry itself, through the following -# construction: -# -# @c -- <[centos-art(SeeAlso,TYPE) -# @c -- ]> -# -# In this construction, the TYPE variable can be either `itemize', -# `enumerate' or `menu'. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_makeSeeAlso { - - # Initialize variables. - local CHILD_ENTRIES='' - local CHILD_ENTRY='' - local ENTRY_PATTERN='' - local LIST_DEF='' - local LIST_ENTRIES='' - local LIST_TYPE='' - local LIST_TYPE_PATTERN='' - local MANUAL_ENTRY='' - local TMARK='' - local TMARK_PATTERN='' - local TMARKS='' - - # Define absolute path to section entry. - MANUAL_ENTRY="$1" - - # Verify section entry. When section entries are deleted, there is - # no menu definition to set. - if [[ ! -f $MANUAL_ENTRY ]];then - return - fi - - # Define `SeeAlso' transltaion marker regular expression pattern. - TMARK_PATTERN="^@c -- <\[${CLI_PROGRAM}\(SeeAlso(,(itemize|enumerate|menu))?\)$" - - # Retrive `SeeAlso' translation marker definition lines. Be sure - # to retrive unique definitions only. If the same definition is - # present more than once, it will be expanded in one pass. There's - # no need to go through different passes in order to expand - # repeated translation marker definition. - TMARKS=$(egrep "${TMARK_PATTERN}" $MANUAL_ENTRY | sort | uniq) - - # Remove spaces from translation marker definition lines in order - # to process them correctly. Otherwise the definition line would - # be broken on each space character and then that wouldn't be the - # definition line we initially conceived. - TMARKS=$(echo "$TMARKS" | sed -r 's/ /\\040/g') - - # Define pattern used to build list of child sections. A child - # section shares the same path information of its parent with out - # file extension. For example, if you have the `identity', - # `identity-images' and `identity-images-themes' section entries, - # `identity-images' is a child entry of `identity' likewise - # `identity-images-themes' is a child entry of `identity-images'. - ENTRY_PATTERN=$(echo "$MANUAL_ENTRY" | sed -r "s/\.${MANUAL_EXTENSION}$//") - - # Define list of child entries we'll use as reference to build the - # menu nodes. Reverse the output here to produce the correct value - # based on menu nodes definition set further. - CHILD_ENTRIES=$(cli_getFilesList $(dirname ${MANUAL_ENTRY}) \ - --pattern="${ENTRY_PATTERN}-[[:alnum:]]+\.${MANUAL_EXTENSION}" | sort -r | uniq ) - - # Loop through translation marker definition lines. - for TMARK in $TMARKS;do - - # Define list type based on translation marker definition. - # Remember to revert back the space character transformation - # we previously did, in order for the translation marker - # regular expression pattern to match. - LIST_TYPE=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\2/") - - # Define list type default value. This is, the list type used - # when no list type is specified in the translation marker - # construction properties field. - if [[ $LIST_TYPE == '' ]];then - LIST_TYPE="itemize" - fi - - # Define list properties (type included). - LIST_PROP=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\1/") - - # Define `SeeAlso' transltaion marker regular expression - # pattern that matches the translation marker definition. - # Notice that we cannot use TMARK_PATTERN here because it - # includes a selection list of all possible translation - # markers that can provided and here we need to precisely set - # the one being currently processed, not those whose could be - # processed. - LIST_TYPE_PATTERN="^@c -- <\[${CLI_PROGRAM}\(SeeAlso${LIST_PROP}\)$" - - # Redefine list's entry based on translation marker definition. - if [[ $LIST_TYPE =~ '^menu$' ]];then - for CHILD_ENTRY in $CHILD_ENTRIES;do - LIST_ENTRIES="* $(texinfo_getEntryNode "$CHILD_ENTRY")::\n${LIST_ENTRIES}" - done - elif [[ $LIST_TYPE =~ '^(itemize|enumerate)$' ]];then - for CHILD_ENTRY in $CHILD_ENTRIES;do - LIST_ENTRIES="@item @ref{$(texinfo_getEntryNode "$CHILD_ENTRY")}\n${LIST_ENTRIES}" - done - else - # When an translation marker isn't recognize, go on with - # the next one in the list. - continue - fi - - # Define menu using menu nodes. - LIST_DEF="@c -- <[${CLI_PROGRAM}(SeeAlso${LIST_PROP})\n@${LIST_TYPE}\n${LIST_ENTRIES}@end ${LIST_TYPE}\n@c -- ]>" - - # Expand list definition using translation marker and list - # definition itself. Be sure that no expansion be done when - # the closing tag of translation marker isn't specified. - # Otherwise, there might be lost of content. - sed -r -i "/${LIST_TYPE_PATTERN}/{:a;N;/\n@c -- ]>$/!ba;s/.*/${LIST_DEF}/;}" $MANUAL_ENTRY - - # Clean up both list definition and list entries. Otherwise - # undesired concatenations happen. - LIST_DEF='' - LIST_ENTRIES='' - LIST_TYPE='' - - done - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh b/Scripts/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh deleted file mode 100755 index 0ffc543..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# texinfo_renameCrossReferences.sh -- This function renames menu, -# nodes and cross references related to chapters and sections that -# have been renamed previously. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_renameCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Build source and target node definitions. - local NODE_SRC="$(texinfo_getEntryNode "$MANUAL_ENTRY_SRC")" - local NODE_DST="$(texinfo_getEntryNode "$MANUAL_ENTRY_DST")" - - # Define regular expression pattern and its replacement for node - # definitions that have been previously removed. - PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):\<${NODE_SRC}\>(.*)\) ---" - REPLACE[0]="\@\1{${NODE_DST}\2}" - - # Define regular expression pattern and its replacement for menu - # definitions that have been previously removed. - PATTERN[1]="^@comment --- `gettext "Removed"`\(\* \<${NODE_SRC}\>(.*)\) ---$" - REPLACE[1]="* ${NODE_DST}\1" - - # Define list of entries to process. This is, all the texinfo - # source files the documentation manual is made of. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern=".+\.${MANUAL_EXTENSION}") - - # Update node cross references. The node-related cross reference - # definition, long ones specially, could require more than one - # line to be set. By default, GNU sed does not matches newline - # characters in the pattern space, so we need to make use of - # `label' feature and the `N' command in order to build a pattern - # space that includes the newline character in it. Here we use the - # `a' letter to name the label we use, followed by N command to - # add a newline to the pattern space, the s command to make the - # pattern replacement using the `g' flag to make it global and - # finaly the command `b' to branch label named `a'. - # - # Inside the pattern space, the `\<' and `\>' are used to restrict - # the match pattern to a word boundary. The word boundary - # restriction applied here is required to avoid undesired - # replacements when we replace singular words with their plurals. - # For example, if we need to change the node `Manual' to its - # plular (i.e., `Manuals'), and no boundary restriction is used in - # the pattern space to do that, we might end up having nodes like - # `Manualsssss' which probably doesn't exist. This is because this - # sed command might be applied to the same file more than once; - # and each time it is applied, a new `Manuals' replaces the - # previous `Manuals' replacement to form `Manualss', `Manualsss', - # and so on for each interaction. Using word boundaries - # restrictions prevent such issue from happening. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu cross references. Menu cross reference definitions - # hardly appear in more than one line, so there is no need to - # complicate the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_renameEntry.sh b/Scripts/Functions/Help/Texinfo/texinfo_renameEntry.sh deleted file mode 100755 index 8497a31..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_renameEntry.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntry.sh -- This function standardizes renaming tasks -# related to manual, chapters and sections inside the working copy. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_renameEntry { - - # Initialize source and target locations. - local MANUAL_ENTRY_SRC='' - local MANUAL_ENTRY_DST='' - - # Define both source and target documentation entries. To build - # the source and target documentation entries we take into - # consideration the manual's main definition file, the chapter's - # main definition file and non-option arguments passed to - # centos-art.sh script through the command-line. - if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then - - # When a section is renamed, the section source location is - # duplicated into the section target location and later - # removed from the working copy. Once the section source - # location has been renamed, the section menu, nodes and cross - # references are updated to keep consistency inside the - # manual. - texinfo_renameEntrySection - - elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]] \ - && [[ ${MANUAL_CHAP[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]];then - - # When a chapter is renamed, the chapter source location is - # duplicated into the chapter source location and later - # removed from the working copy. Once the chapter source - # location has been renamed, the chapter and section menu, - # nodes and cross references are updated to keep consistency - # inside the manual. - texinfo_renameEntryChapter - - elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]] \ - && [[ ${MANUAL_DIRN[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]] ;then - - # When a manual is renamed, a new manual structure is created - # in the manual target location and all chapters and sections - # are duplicated from manual source location to manual target - # location. Once the source manual has been renamed, chapter - # and section menu, nodes and cross references are updated to - # keep consistency inside the manual. - texinfo_renameEntryManual - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh b/Scripts/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh deleted file mode 100755 index f0ab38c..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntryChapter.sh -- This function standardizes renaming -# tasks related to manual chapters inside documentation manuals -# written in texinfo format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_renameEntryChapter { - - # Copy section source entry to target location. - texinfo_copyEntryChapter - - # Delete section source entry. - texinfo_deleteEntryChapter - - # Rename menu, nodes and cross references related entries. - texinfo_renameCrossReferences - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_renameEntryManual.sh b/Scripts/Functions/Help/Texinfo/texinfo_renameEntryManual.sh deleted file mode 100755 index 4a4f7f9..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_renameEntryManual.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntryManual.sh -- This function standardizes renaming -# tasks related to documenation manuals written in texinfo format -# inside the working copy. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_renameEntryManual { - - # Copy section source entry to target location. - texinfo_copyEntryManual - - # Delete section source entry. - texinfo_deleteEntryManual - - # Redefine absolute paths to changed directories. This is - # required in order for `cli_commitRepoChanges' to be aware of - # manual source and target locations we've just renamed. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR} $(echo $MANUAL_BASEDIR \ - | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" - - # From this time on, the manual information set so far is no - # longer useful. Redefine it to start using the new manual - # information instead. - - # Redefine manual name using manual name passed to `centos-art.sh' - # script as second non-option argument. - MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \ - | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" - - # Redefine absolute path to base file using manual name passed to - # `centos-art.sh' script as second non-option argument. - MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_renameEntrySection.sh b/Scripts/Functions/Help/Texinfo/texinfo_renameEntrySection.sh deleted file mode 100755 index a0694cb..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_renameEntrySection.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntrySection.sh -- This function standardizes renaming -# tasks related to chapter sections inside documentation manuals -# written in texinfo format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_renameEntrySection { - - # Copy section source entry to target location. - texinfo_copyEntrySection - - # Delete section source entry. - texinfo_deleteEntrySection - - # Rename menu, nodes and cross references related entries. - texinfo_renameCrossReferences - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh b/Scripts/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh deleted file mode 100755 index cc7713d..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# texinfo_restoreCrossReferences.sh -- This function looks inside -# texinfo source files, from section level on, and restores any cross -# reference related to a documentation entry. This function is used in -# those cases where documentation entries are created/recreated to -# documentation structure. It is a verification that looks for -# matching documentation entries previously defined as removed by -# texinfo_deleteCrossReferences function. The -# texinfo_restoreCrossReferences function relays in the removed -# message format produced by texinfo_deleteCrossReferences -# function, in order to return them back into the link format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_restoreCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. If documentation entry is empty, - # stop script execution with an error message. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Build the node string using entry location. - local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Define regular expression patterns to match removed message - # format produced by message_removeCrossReferences function. - PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):(${NODE})\) ---" - PATTERN[1]="^@comment --- `gettext "Removed"`\((\* ${NODE}:(.*)?:(.*)?)\) ---$" - - # Define replacement string to turn removed message back to cross - # reference link. - REPLACE[0]='\@\1{\2}' - REPLACE[1]='\1' - - # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern=".+\.${MANUAL_EXTENSION}") - - # Update node-related cross references. The node-related cross - # reference definition, long ones specially, could require more - # than one line to be set. By default, GNU sed does not matches - # newline characters in the pattern space, so we need to make use - # of `label' feature and the `N' command in order to build a - # pattern space that includes the newline character in it. Here we - # use the `a' letter to name the label we use, followed by N - # command to add a newline to the pattern space, the s command to - # make the pattern replacement using the `g' flag to make it - # global and finaly the command `b' to branch label named `a'. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu-related cross references. Menu-related cross - # references hardly appear in more than one line, so there is no - # need to complicate the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_searchIndex.sh b/Scripts/Functions/Help/Texinfo/texinfo_searchIndex.sh deleted file mode 100755 index 5b1b145..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_searchIndex.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# texinfo_searchIndex.sh -- This function does an index search inside the -# info document. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_searchIndex { - - # Verify manual output files and, if they don't exist, create - # them. - if [[ ! -f ${MANUAL_BASEFILE}.info.bz2 ]];then - texinfo_updateOutputFiles - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message. - cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-reading-line - - # Execute info command to perform an index-search. - /usr/bin/info --index-search="$FLAG_SEARCH" --file=${MANUAL_BASEFILE}.info.bz2 - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_searchNode.sh b/Scripts/Functions/Help/Texinfo/texinfo_searchNode.sh deleted file mode 100755 index 1004858..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_searchNode.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# -# texinfo_searchNode.sh -- This function converts the documentation -# entry provided to `centos-art.sh' script command-line into a node -# and tries to read it from the manual's `.info' output file. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_searchNode { - - # Verify documentation entry and, if it doesn't exist, prompt out - # its creation. - if [[ ! -f "$MANUAL_ENTRY" ]];then - texinfo_editEntry - fi - - # Verify manual output files and, if they don't exist, create - # them. - if [[ ! -f ${MANUAL_BASEFILE}.info.bz2 ]];then - texinfo_updateOutputFiles - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message. - cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-reading-line - - # Define manual node that will be read. - local MANUAL_NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Verify manual node that will be read. When the manual name is - # the only value passed as documentation entry, then use the `Top' - # node as manual node to be read. - if [[ $MANUAL_NODE =~ $(texinfo_getEntryNode "$MANUAL_NAME") ]];then - MANUAL_NODE='Top' - fi - - # Use info reader to read the manual node. - info --node="${MANUAL_NODE}" --file="${MANUAL_BASEFILE}.info.bz2" - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh deleted file mode 100755 index e0631c8..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# -# texinfo_updateChapterMenu.sh -- This function updates chapter menu. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateChapterMenu { - - local ACTION=$1 - local MENUCHAPTERS='' - - # Build menu of chapters. The Index node is not included as other - # nodes are. The Index node is defined inside the master texinfo - # file (repository.texinfo) as an included file. To create the final - # .info file correctly, the Index line in the menu should remain, - # even no other node exist. - if [[ -f ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} ]];then - MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ - | egrep -v "^@(end )?menu$" \ - | egrep -v '^\* (Licenses|Index)::$') - fi - - # Re-defined menu of chapters based on action. - case $ACTION in - - --delete-entry ) - # Remove chapter from menu. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" \ - | egrep -v '^\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') - ;; - - --add-entry | * ) - # Update chapter menu using texinfo format. Be sure the - # chapter node itself is not included here, that would - # duplicate it inside the menu definition file which end - # up being a definition error. Take care the way you quote - # egrep's pattern, prevent to end up using the syntax - # `$"..."' which has security risks. - MENUCHAPTERS="$(echo "${MENUCHAPTERS}" \ - | egrep -v '\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') - * ${MANUAL_CHAPTER_NAME}::" - ;; - esac - - # Remove opening spaces/tabs and empty line from the menu of - # chapters. Empty lines may occur the first time the menu of - # chapters is created. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ - | egrep -v '^[[:space:]]*$') - - # Organize menu of chapters alphabetically and verify that no - # duplicated line be included on the list. Notice that organizing - # menu this way supresses the idea of putting the last chapter - # created at the end of the list. - #MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sort | uniq) - - # Give format to final menu output. - MENUCHAPTERS="@menu - ${MENUCHAPTERS} - * Licenses:: - * Index:: - @end menu" - - # Remove opening space/tabs from menu's final definition. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ - | egrep -v '^[[:space:]]*$') - - # Dump organized menu of chapters into file. - echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh deleted file mode 100755 index 06b3acb..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# texinfo_updateChapterNodes.sh -- This function updates nodes of -# chapters based on menu of chapters. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateChapterNodes { - - # Build chapter nodes using entries from chapter menu as - # reference. Don't include `Licenses' or `Index' chapters here. - # These chapters are part of our manual's main defintion file and - # shouldn't be handled as regular chapters. - local CHAPTERNODES=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ - | egrep -v '^@(end )?menu$' | egrep -v '^\* (Licenses|Index)::$'\ - | sed -r 's!^\* !!' | sed -r 's!::[[:print:]]*$!!g' \ - | sed -r 's! !_!g') - - # Build list of inclusions from chapter nodes. - local FILENODE=$(\ - for CHAPTERNODE in ${CHAPTERNODES};do - INCL=$(echo ${CHAPTERNODE} \ - | sed -r "s!(${CHAPTERNODE})!\1/chapter\.${MANUAL_EXTENSION}!") - # Output inclusion line using texinfo format. - echo "@include $INCL" - done) - - # Dump organized nodes of chapters into file. - echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION} - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh deleted file mode 100755 index 2ab4a56..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileDocbook.sh -- This function exports -# documentation manual to DocBook format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFileDocbook { - - # Print action message. - cli_printMessage "${MANUAL_BASEFILE}.docbook" --as-response-line - - # Update xml output format. - /usr/bin/makeinfo --docbook --output=${MANUAL_BASEFILE}.docbook \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --no-warn - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh deleted file mode 100755 index 116e3a9..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileInfo.sh -- This function exports -# documentation manual to info format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFileInfo { - - # Output action message. - cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-response-line - - # Update info file. - /usr/bin/makeinfo --output=${MANUAL_BASEFILE}.info \ - --enable-encoding \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} - - # Compress info file. - if [[ $? -eq 0 ]];then - bzip2 -f ${MANUAL_BASEFILE}.info - fi - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh deleted file mode 100755 index 9d33698..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFilePdf.sh -- This function exports documentation -# manual to PDF format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFilePdf { - - # Output action message. - cli_printMessage "${MANUAL_BASEFILE}.pdf" --as-response-line - - # Update plaintext output directory. - /usr/bin/texi2pdf --quiet \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.pdf - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh deleted file mode 100755 index 27bfb0e..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFilePlaintext.sh -- This function exports -# documentation manual to plain-text format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFilePlaintext { - - # Output action message. - cli_printMessage "${MANUAL_BASEFILE}.txt.bz2" --as-response-line - - # Update plaintext output directory. - /usr/bin/makeinfo --plaintext \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.txt - - # Compress plaintext output file. - if [[ -f ${MANUAL_BASEFILE}.txt ]];then - bzip2 ${MANUAL_BASEFILE}.txt --force - fi - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh deleted file mode 100755 index 44d5e66..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileXhtml.sh -- This function exports -# documentation manual to HTML format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFileXhtml { - - # Output action message. - cli_printMessage "${MANUAL_BASEFILE}.xhtml.tar.bz2" --as-response-line - - # Verify initialization files used by texi2html. - cli_checkFiles ${MANUAL_TEMPLATE}/manual-init.pl - cli_checkFiles ${MANUAL_TEMPLATE_L10N}/manual-init.pl - - # Verify transformation files used to modify texi2html output. - cli_checkFiles ${MANUAL_TEMPLATE}/manual.sed - cli_checkFiles ${MANUAL_TEMPLATE_L10N}/manual.sed - - # Redefine manual base file to use just the file base name. - local MANUAL_BASEFILE=$(basename "$MANUAL_BASEFILE") - - # Add manual base directory path into directory stack to make it - # the current working directory. This is done to reduce the path - # information packaged inside `repository.xhtml.tar.bz2' file. - pushd ${MANUAL_BASEDIR_L10N} > /dev/null - - # Clean up directory structure where xhtml files will be stored. - # We don't want to have unused files inside it. - if [[ -d ${MANUAL_NAME}-xhtml ]];then - rm -r ${MANUAL_NAME}-xhtml - fi - - # Prepare directory structure where xhtml files will be stored in. - mkdir ${MANUAL_NAME}-xhtml - - # Add directory where xhtml files will be sotred in into directory - # stack to make it the current working directory. This is required - # in order for include paths to be constructed correctly. - pushd ${MANUAL_NAME}-xhtml > /dev/null - - # Update xhtml files. Use texi2html to export from texinfo file - # format to xhtml using The CentOS Web default visual style. - texi2html --lang=$(cli_getCurrentLocale --langcode-only) \ - --init-file=${MANUAL_TEMPLATE}/manual-init.pl \ - --init-file=${MANUAL_TEMPLATE_L10N}/manual-init.pl \ - --output=${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}-xhtml \ - ${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}.${MANUAL_EXTENSION} - - # Remove directory where xhtml files are stored from directory - # stack. The xhtml files have been already created. - popd > /dev/null - - # Apply xhtml transformations. This transformation cannot be built - # inside the initialization script (repository-init.pl). For example, - # Would it be a possible way to produce different quotation HTML - # outputs from the same texinfo quotation definition? Instead, - # once the HTML code is produced we can take que quotation HTML - # definition plus the first letters inside it and transform the - # structure to a completly different thing that can be handle - # through classed inside CSS definitions. - sed -r -i \ - -f ${MANUAL_TEMPLATE}/manual.sed \ - -f ${MANUAL_TEMPLATE_L10N}/manual.sed \ - ${MANUAL_BASEFILE}-xhtml/*.xhtml - - # Compress directory structure where xhtml files are stored in. - # This compressed version is the one we put under version control. - # The directory used to build the compressed version is left - # unversion for the matter of human revision. - tar -cjf ${MANUAL_BASEFILE}.xhtml.tar.bz2 ${MANUAL_BASEFILE}-xhtml - - # Remove manual base directory from directory stack. - popd > /dev/null - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh deleted file mode 100755 index 3fbe661..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileXml.sh -- This function exports documentation -# manual to XML format. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFileXml { - - # Print action message. - cli_printMessage "${MANUAL_BASEFILE}.xml" --as-response-line - - # Update xml output format. - /usr/bin/makeinfo --xml \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.xml \ - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh deleted file mode 100755 index 97f4472..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFiles.sh -- This function exports documentation -# manual to different output formats. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFiles { - - # Verify manual base file. We can update manual outputs only if - # its base file exists. For example, we cannot update manual - # outputs if the manual has been deleted previously. - if [[ ! -a ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then - return - fi - - # Print separator line. - cli_printMessage "`gettext "Updating output files"`" --as-banner-line - - # Add the working copy root directory to directory stack to make - # path construction correctly. Otherwise, makeinfo may produce - # paths incorrectly. - pushd ${CLI_WRKCOPY} > /dev/null - - texinfo_updateOutputFileInfo - texinfo_updateOutputFileXhtml - texinfo_updateOutputFileXml - texinfo_updateOutputFileDocbook - texinfo_updateOutputFilePdf - texinfo_updateOutputFilePlaintext - - # Remove the working copy root directory from directory stack. - popd > /dev/null - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh deleted file mode 100755 index 2e71a5c..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# -# texinfo_updateSectionMenu.sh -- This function updates the section's -# menu definition file of a chapter. If this function is called with -# the '--delete-entry' string as first argument, the menu line related -# to the entry being processed is removed. Otherwise, if this function -# is called with the '--add-entry' string as first argument, the menu -# line related to the entry being processed is added to menu's bottom. -# If no argument is passed to this function, the '--add-entry' action -# is assumed. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateSectionMenu { - - # Specify which action to do with documentation entry inside the - # chapter menu. - local ACTION="$1" - - # Define section order. Through this property you can customize - # the section order inside the manual. Possible arguments to this - # option are `ordered', `reversed', `created'. From these three - # values `created' is used by default (i.e., new menu entries are - # added to menu's bottom as last entry.). Notice that, once - # you've sorted the menu using `ordered' or `reversed' values, it - # is hard to sort the list back to former creation orders. Go - # sorted or not sorted at all. - local MANUAL_SECTION_ORDER=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_order") - if [[ ! $MANUAL_SECTION_ORDER =~ '^(created|ordered|reversed)$' ]];then - MANUAL_SECTION_ORDER='created' - fi - - # Build node information used inside chapter menu. - local MENUNODE=$(texinfo_getEntryNode "$MANUAL_ENTRY") - - # Define menu entry using texinfo style and node information as - # reference. - local MENULINE="* ${MENUNODE}::" - - # Retrive list of menu entries from chapter menu and exclude - # `@menu', `@end menu' and empty lines from output. - local MENU=$(cat $(dirname ${MANUAL_ENTRY})/chapter-menu.${MANUAL_EXTENSION} \ - | egrep -v '^[[:space:]]*$' | egrep -v '^@(end )?menu') - - # Re-defined chapter menu entries based on action provided to this - # function as first positional parameter. - case $ACTION in - - --delete-entry ) - # Remove menu entry from chapter menu. - MENU="$(echo "$MENU" | egrep -v "$MENULINE")" - ;; - - --add-entry | * ) - # Add menu entry to chapter menu list as last entry. - MENU="$(echo "$MENU" | egrep -v "$MENULINE" ) - ${MENULINE}" - ;; - - esac - - # Remove opening spaces/tabs and empty lines from final menu - # entries. - MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ - | egrep -v '^[[:space:]]*$') - - # Sort menu entries based on section order property. - case $MANUAL_SECTION_ORDER in - - 'ordered' ) - MENU="$(echo "$MENU" | sort )" - ;; - - 'reversed' ) - MENU="$(echo "$MENU" | sort -r )" - ;; - - esac - - # Rebuild list of chapter menu entries including '@menu' and '@end - # menu' lines back into chapter menu. - MENU="@menu - $MENU - @end menu" - - # Remove opening spaces/tabs and empty lines from final menu - # structure. - MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ - | egrep -v '^[[:space:]]*$') - - # Dump chapter menu entries back into chapter's menu definition - # file. - echo "$MENU" > $(dirname ${MANUAL_ENTRY})/chapter-menu.${MANUAL_EXTENSION} - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh deleted file mode 100755 index 0914c93..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/bash -# -# texinfo_updateSectionNodes.sh -- This function updates section's -# nodes definition files using section's menu definition file both -# inside the same chapter. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateSectionNodes { - - # Build list of chapter nodes using entries from chapter menu as - # reference. - local NODES=$(cat $(dirname ${MANUAL_ENTRY})/chapter-menu.${MANUAL_EXTENSION} \ - | sed -r 's!^\* !!' | sed -r 's!:{1,2}.*$!!g' \ - | egrep -v '^@(end )?menu$' | sed -r 's! !:!g') - - # Build chapter nodes based on chapter menu. - for NODE in $NODES;do - - local NODE=$(echo "${NODE}" | sed -r 's!:! !g') - local INCL=$(echo "${NODE}" | sed -r 's! !/!' | sed -r 's! !-!g' | sed -r 's!/(.+)!/\L\1!').${MANUAL_EXTENSION} - local SECT=$(texinfo_getEntryTitle "$NODE") - local CIND=$(texinfo_getEntryIndex "$NODE") - - # Create texinfo section file using templates, only if the - # section file doesn't exist and hasn't been marked for - # deletion. Otherwise, when the files have been marked for - # deletion, they will be created again from texinfo template - # to working copy and that might create confusion. - if [[ ! -f ${MANUAL_BASEDIR_L10N}/$INCL ]] \ - && [[ $(cli_getRepoStatus ${MANUAL_BASEDIR_L10N}/$INCL) != 'D' ]];then - - # Retrive configuration lines from configuration file. Be - # sure no line begining with `#' or space remain in the - # line. Otherwise, it would be difficult to loop through - # configuration lines. - local CONFLINE='' - local CONFLINES=$(cli_getConfigLines "${MANUAL_CONFIG_FILE}" "templates") - - # Initialize both left hand side and right hand side - # configuration values. - local CONFLHS='' - local CONFRHS='' - - # Initialize absolute path to final texinfo template. - local TEMPLATE='' - - # Define what section template to apply using - # documentation entry absolute path and values provided by - # configuration line. Be sure to break the loop in the - # first match. - for CONFLINE in $CONFLINES;do - - CONFLHS=$(echo $CONFLINE \ - | gawk 'BEGIN{FS="="}; { print $1 }' \ - | sed -r 's![[:space:]]*!!g') - - CONFRHS=$(echo $CONFLINE \ - | gawk 'BEGIN{FS="="}; { print $2 }' \ - | sed -r 's![[:space:]]*!!g' | sed -r 's!^"(.+)"$!\1!') - - if [[ ${MANUAL_BASEDIR_L10N}/${INCL} =~ $CONFRHS ]];then - TEMPLATE="${MANUAL_TEMPLATE_L10N}/${CONFLHS}" - break - fi - - done - - # Verify existence of texinfo template file. If no - # template is found, stop script execution with an error - # message. We cannot continue without it. - cli_checkFiles $TEMPLATE - - # Create documentation entry using texinfo template as - # reference. - svn cp ${TEMPLATE} ${MANUAL_BASEDIR_L10N}/$INCL --quiet - - fi - - # Expand common translation markers in documentation entry. - cli_expandTMarkers "${MANUAL_BASEDIR_L10N}/$INCL" - - # Replace node, section and concept index definitions already - # defined with node, section and concept index translation - # markers. Otherwise, incorrect sectioning may happen. Take - # care with index definitions, more than one index definition - # might be found in the section file but only the first - # concept index entry (i.e., `cindex') will be updated, the - # rest will remain as they are. - sed -i -r \ - -e '/^@node/c@node =NODE=' \ - -e '/^@section/c@section =SECT=' \ - -e '0,/^@cindex/c@cindex =CIND=' \ - "${MANUAL_BASEDIR_L10N}/$INCL" - - # Before expading node, section and concept index, be sure - # that all slash characters (`/') be escaped. Otherwise, they - # might be interpreted as separators and that isn't - # desireable in anyway. - NODE=$(echo "$NODE" | sed -r 's/\//\\\//g') - SECT=$(echo "$SECT" | sed -r 's/\//\\\//g') - CIND=$(echo "$CIND" | sed -r 's/\//\\\//g') - - # Expand node, section and concept index translation - # markers in documentation entry. - sed -i -r \ - -e "s/=NODE=/${NODE}/g" \ - -e "s/=SECT=/${SECT}/g" \ - -e "s/=CIND=/${CIND}/g" \ - "${MANUAL_BASEDIR_L10N}/$INCL" - - # Verify existence of chapter-nodes template file. If no - # chapter-nodes template is found, stop script execution with - # an error message. We cannot continue without it. - cli_checkFiles ${MANUAL_TEMPLATE_L10N}/Chapters/chapter-nodes.${MANUAL_EXTENSION} - - # Expand chapter node inclusion definition. - cat ${MANUAL_TEMPLATE_L10N}/Chapters/chapter-nodes.${MANUAL_EXTENSION} \ - | sed -r "s!=INCL=!${INCL}!g" - - # Dump chapter node definition into manual structure. - done > $(dirname ${MANUAL_ENTRY})/chapter-nodes.${MANUAL_EXTENSION} - -} diff --git a/Scripts/Functions/Help/Texinfo/texinfo_updateStructureSection.sh b/Scripts/Functions/Help/Texinfo/texinfo_updateStructureSection.sh deleted file mode 100755 index 6545524..0000000 --- a/Scripts/Functions/Help/Texinfo/texinfo_updateStructureSection.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash -# -# texinfo_updateStructureSection.sh -- This function looks for all -# section entry files inside manual's base directory and updates menu, -# nodes and cross references definitions for them all, one at a time. -# -# Copyright (C) 2009, 2010, 2011 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 texinfo_updateStructureSection { - - # Print action message. These actions might consume some time to - # finish. The more section entries the regular expression pattern - # matches, the more time it will take to finish. - cli_printMessage "`gettext "Updating section menus, nodes and cross references"`" --as-banner-line - - local PATTERN='' - local MANUAL_ENTRIES='' - local ACTIONNAM_SECMENU='' - local ACTIONNAM_CROSREF='' - - # Define regular expression pattern used to build the list of - # section entries that will be processed. - if [[ "$1" != '' ]];then - PATTERN="$1" - else - PATTERN="${MANUAL_ENTRY}" - fi - - # Verify the pattern value considering both the chapter and - # section names. This is required when no chapter or section name - # is provided to `centos-art.sh' script, as non-option argument in - # the command-line (e.g., `centos-art help --update-structure'). - if [[ $PATTERN =~ "${MANUAL_NAME}\.${MANUAL_EXTENSION}$" ]] \ - || [[ $PATTERN =~ "chapter\.${MANUAL_EXTENSION}$" ]];then - PATTERN="$(dirname ${MANUAL_ENTRY})/.+\.${MANUAL_EXTENSION}" - fi - - # Define action to perform on menu, nodes and cross references - # definitions. - case "$2" in - - --delete ) - - # Remove menu and node definitions for sections inside - # manual, in order to reflect the changes. - ACTIONNAM_SECMENU='updateSectionMenu --delete-entry' - - # Remove cross reference definitions inside manual - # structure. - ACTIONNAM_CROSREF='deleteCrossReferences' - ;; - - --update | * ) - - # Update menu and node definitions for sections inside - # manual, in order to reflect the changes. - ACTIONNAM_SECMENU='updateSectionMenu --add-entry' - - # Resotre cross reference definitions inside manual - # structure. If a documentation entry has been removed by - # mistake and that mistake is later fixed by adding the - # removed documentation entry back into the manual - # structure, it is necessary to rebuild the missing cross - # reference information inside the manual structure in - # order to reactivate the removed cross refereces, as - # well. - ACTIONNAM_CROSREF='restoreCrossReferences' - ;; - - esac - - # Define list of target entries using find's regular expression - # pattern as reference. Notice that, when we update section - # definition files, the files already exist in the working copy so - # the pattern can be its absolute path without any problem. If the - # pattern is built correctly, it will match the location and so be - # returned to build the list of entries to process. Notice also - # that, when updating, it is possible to use a regular expression - # to match more than one location and build the list of entries - # based on such matching. In this last configuration, let you to - # update menu, nodes and cross references to many section - # definitions (i.e., all those section definition file that match - # the pattern you specified). - MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="${PATTERN}" | egrep -v "/(${MANUAL_NAME}|chapter)") - - # Verify list of target entries. Assuming is is empty, define - # list of target documentation entries using pattern as reference - # instead. When we delete a section entry from the working copy, - # using find to retrive its path isn't possible because the - # section definition file is removed before executing find and by - # consequence no match is found. This issue provokes no section - # entry to be removed from menu, nodes and cross references. In - # order to solve this, use the pattern value as list of target - # entries. Notice that, in this case, the pattern value must be - # the absolute path to that documentation entry which doesn't - # exist and we want to update menu, nodes and cross references - # information for. - if [[ $MANUAL_ENTRIES == '' ]] && [[ $PATTERN =~ '^[[:alnum:]./_-]+$' ]];then - MANUAL_ENTRIES=${PATTERN} - fi - - # Verify list of target entries. Assumming it is still empty, - # there is nothing else to do here but printing an error message - # describing the fact that no section entry was found to process. - if [[ $MANUAL_ENTRIES == '' ]];then - cli_printMessage "`gettext "No section entry found to process."`" --as-error-line - fi - - # Loop through target documentation entries in order to update the - # documentation structure (e.g., it is not enough with copying - # documentation entry files, it is also needed to update menu, - # nodes and related cross-references). - for MANUAL_ENTRY in ${MANUAL_ENTRIES};do - cli_printMessage "${MANUAL_ENTRY}" --as-response-line - texinfo_${ACTIONNAM_SECMENU} - texinfo_updateSectionNodes - texinfo_makeSeeAlso "${MANUAL_ENTRY}" - texinfo_${ACTIONNAM_CROSREF} "${MANUAL_ENTRY}" - done - -} diff --git a/Scripts/Functions/Help/help.sh b/Scripts/Functions/Help/help.sh deleted file mode 100755 index 31d43b2..0000000 --- a/Scripts/Functions/Help/help.sh +++ /dev/null @@ -1,237 +0,0 @@ -#!/bin/bash -# -# help.sh -- This function initializes the interface used by -# centos-art.sh script to perform documentation tasks through -# different documentation backends. -# -# Copyright (C) 2009, 2010, 2011 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 help { - - # Initialize action name with an empty value. - local ACTIONNAM='' - - # Initialize search option (`--search'). This option is used to - # look for documentation inside documentation backends. - local FLAG_SEARCH="" - - # Initialize manual's language. - local MANUAL_L10N=$(cli_getCurrentLocale) - - # Initialize manuals's top-level directory. This is the place - # where the manual will be stored in. To provide flexibility, the - # current directory where the `centos-art.sh' script was called - # from is used as manual's top-level directory. Notice that this - # relaxation is required because we need to create/maintain - # manuals both under `trunk/Manuals/' and `branches/Manuals/' - # directories. - local MANUAL_TLDIR=${PWD} - - # Verify manual's top-level directory. To prevent messing the - # things up, we need to restrict the possible locations - # where documentation manuals can be created in the working copy. - # When manual's top-level location is other but the ones - # permitted, use `trunk/Manuals' directory structure as default - # location to store documentation manuals. - if [[ ! $MANUAL_TLDIR =~ "^${CLI_WRKCOPY}/(trunk/Manuals|branches/Manuals/[[:alnum:]-]+)$" ]];then - MANUAL_TLDIR="${CLI_WRKCOPY}/trunk/Manuals" - fi - - # Initialize documentation entries arrays. Arrays defined here - # contain all the information needed to process documentation - # entries (e.g., manual, part, chapter and section). - local -a MANUAL_SLFN - local -a MANUAL_DIRN - local -a MANUAL_PART - local -a MANUAL_CHAP - local -a MANUAL_SECT - - # Initialize documentation entries counter. - local MANUAL_DOCENTRY_COUNT=0 - local MANUAL_DOCENTRY_ID=0 - - # Interpret option arguments passed through the command-line. - help_getOptions - - # Redefine arrays related to documentation entries using - # non-option arguments passed through the command-line. At this - # point all options have been removed from ARGUMENTS and - # non-option arguments remain. Evaluate ARGUMENTS to retrive the - # information related documentation entries from there. - help_getEntries - - # Execute backend-specific documentation tasks for each - # documentation entry specified in the command-line, individually. - # Notice that we've stored all documentation entries passed as - # non-option arguments in array variables in order to process them - # now, one by one. This is particularily useful when we need to - # reach items in the array beyond the current iteration cycle. For - # example, when we perform actions that require source and target - # locations (e.g., copying and renaming): we use the current value - # as source location and the second value in the array as target - # location; both defined from the first iteration cycle. - while [[ $MANUAL_DOCENTRY_ID -lt $MANUAL_DOCENTRY_COUNT ]];do - - # Define name used by manual's main definition file. - MANUAL_NAME=${MANUAL_SLFN[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to directory holding language-specific - # directories. - MANUAL_BASEDIR="${MANUAL_TLDIR}/${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}" - - # Define absolute path to directory holding language-specific - # texinfo source files. - MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" - - # Define absolute path to changed directories inside the - # manual. For example, when a section entry is edited, copied - # or renamed inside the same manual there is only one - # aboslute path to look for changes, the one holding the - # section entry. However, when an entire manual is renamed, - # there might be two different locations to look changes for, - # the source location deleted and the target location added. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR_L10N}" - - # Define absolute path to base file. This is the main file - # name (without extension) we use as reference to build output - # files in different formats (.info, .pdf, .xml, etc.). - MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - - # Define manual's part name. - MANUAL_PART_NAME=${MANUAL_PART[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to manual's part directory. - MANUAL_PART_DIR="${MANUAL_BASEDIR_L10N}/${MANUAL_PART_NAME}" - - # Define manual's chapter name. - MANUAL_CHAPTER_NAME=${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to chapter's directory. This is the - # place where chapter-specific files are stored in. Be sure no - # extra slash be present in the value (e.g., when the part - # name isn't provided). - MANUAL_CHAPTER_DIR="$(echo ${MANUAL_PART_DIR}/${MANUAL_CHAPTER_NAME} \ - | sed -r 's!/{2,}!/!g' )" - - # Define section name. - MANUAL_SECTION_NAME=${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to manual's configuration file. This - # is the file that controls the way template files are applied - # to documentation entries once they have been created as well - # as the style and order used for printing sections. - MANUAL_CONFIG_FILE="${MANUAL_BASEFILE}.conf" - - # Define documentation backend. This information defines the - # 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.). - if [[ -f ${MANUAL_CONFIG_FILE} ]];then - - # Retrive documentation backend from configuration file. - MANUAL_BACKEND=$(cli_getConfigValue \ - "${MANUAL_CONFIG_FILE}" "main" "manual_backend") - - # Verify documentation backend. This is required in order - # to prevent malformed values from being used. Be sure - # only supported documentation backends can be provided as - # value to `manual_backend' option inside configuration - # files. - if [[ ! $MANUAL_BACKEND =~ '^(texinfo)$' ]];then - cli_printMessage "`gettext "The documentation backend provided isn't supported."`" --as-error-line - fi - - else - - # When the current documentation manual is being created - # for first time, there's no way to get the documentation - # backend to use in the future manual, but asking the user - # creating it which one to use. - cli_printMessage "`gettext "Select one of the following documentation backends:"`" - MANUAL_BACKEND=$(cli_printMessage "texinfo" --as-selection-line) - - fi - - # Notice that, because we are processing non-option arguments - # one by one, there is no need to sycronize changes or - # initialize functionalities to the same manual time after - # time (assuming all documentation entries passed as - # non-option arguments refer the same manual directory name). - # That would be only necessary when documentation entries - # refer to different manual directory names that could be - # written in different documentation backends. - if [[ ${MANUAL_DOCENTRY_ID} -eq 0 \ - || ( ( ${MANUAL_DOCENTRY_ID} -gt 0 ) && ( \ - ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} - 1))]} ) ) ]];then - - # Syncronize changes between repository and working copy. - # At this point, changes in the repository are merged in - # the working copy and changes in the working copy - # committed up to repository. - if [[ -d ${MANUAL_CHANGED_DIRS} ]];then - cli_syncroRepoChanges ${MANUAL_CHANGED_DIRS} - fi - - # Initialize documentation backend functionalities. At - # this point we load all functionalities required into - # `centos-art.sh''s execution environment and make them - # available, this way, to perform backend-specific - # documentation tasks. - cli_exportFunctions "${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/$(cli_getRepoName \ - ${MANUAL_BACKEND} -d)" "${MANUAL_BACKEND}" - - fi - - # Execute backend-specific documentation tasks. - ${MANUAL_BACKEND} - - # Unset the exported functions before go on with the next - # documentation entry provided as non-option argument to - # `centos-art.sh' script. Different documentation entries may - # be written in different documentation backends. Each - # documentation backend is loaded in order to perform their - # related documentation tasks. Assuming more that one - # documentation entry be passed as non-option argument to - # `centos-art.sh' script and they are written in different - # formats, we might end up loading documentation backend - # functionalities that aren't used in the current - # documentation entry being processed. In that sake, unset - # documentation bakend functionalities when the next - # documentation entry refers to a manual directory different - # to that one being currently processed. - if [[ ${MANUAL_DOCENTRY_ID} -gt 0 \ - && ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} ]];then - cli_unsetFunctions "${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/$(cli_getRepoName \ - ${MANUAL_BACKEND} -d)" "${MANUAL_BACKEND}" - fi - - # Increment documentation entry counter id. - MANUAL_DOCENTRY_ID=$(($MANUAL_DOCENTRY_ID + 1)) - - done - - # Syncronize changes between repository and working copy. At this - # point, changes in the repository are merged in the working copy - # and changes in the working copy committed up to repository. - cli_syncroRepoChanges ${MANUAL_CHANGED_DIRS} - -} diff --git a/Scripts/Functions/Help/help_getEntries.sh b/Scripts/Functions/Help/help_getEntries.sh deleted file mode 100755 index a1c0ec8..0000000 --- a/Scripts/Functions/Help/help_getEntries.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# -# help_getEntries.sh -- This function interpretes non-option -# arguments passed to `help' functionality through the command-line -# and redefines array variables related to documentation entries. -# -# Copyright (C) 2009, 2010, 2011 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 help_getEntries { - - # Initialize manual's documentation entry as an empty value local - # to this function. - local MANUAL_DOCENTRY='' - - # 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" - - if [[ $@ == '' ]];then - - # Define default documentation entry. This happens when - # non-option arguments aren't provided to centos-art.sh - # script. Default documentation entry defined here points to - # manual's main definition file, so only the manual's self - # name and manual's directory name need to be defined here. - MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' - MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]='Tcar-fs' - MANUAL_DOCENTRY_COUNT=$(($MANUAL_DOCENTRY_COUNT + 1)) - - else - - # Retrive documentation entries passed to `centos-art.sh' - # script as non-option arguments and store them in array - # variables in order to describe their parts (e.g., manual - # name, chapter name and section name) that way. - # Documentation entries passed as non-opiton arguments must be - # written either in `MANUAL:PART:CHAPTER:SECTION' or - # `path/to/dir' formats in order to be processed correctly - # here. Empty spaces are not permitted. To separate words, use - # the minus sign (e.g., hello-world) or cammel case (e.g., - # HelloWorld). - for MANUAL_DOCENTRY in $@;do - - if [[ ${MANUAL_DOCENTRY} =~ '^([A-Za-z0-9-]+)(:[A-Za-z0-9-]*){0,3}$' ]];then - - # When `MANUAL:PART:CHAPTER:SECTION' is used as format - # to documentation entry, you can specify the manual, - # chapter and section where documentation actions will - # take place on. - - # Manual self name. - MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(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 ) - - # Manual part name. - MANUAL_PART[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(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 ) - - # Manual section name. - MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $4 }') -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. - - # Manual's self name. - MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' - - # Manual's self directory name. - MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]='Tcar-fs' - - # Manual's chapter name. - MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 1 ) print $1 }' ) -d ) - - # Manual's section name. - MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 2 ) print $0 }' \ - | cut -d/ -f2- | tr '/' '-') -f ) - - else - cli_printMessage "`gettext "The documentation entry provided isn't supported."`" --as-error-line - fi - - # Increment counting of non-option arguments. - MANUAL_DOCENTRY_COUNT=$(($MANUAL_DOCENTRY_COUNT + 1)) - - done - - fi - -} diff --git a/Scripts/Functions/Help/help_getOptions.sh b/Scripts/Functions/Help/help_getOptions.sh deleted file mode 100755 index c76116e..0000000 --- a/Scripts/Functions/Help/help_getOptions.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash -# -# help_getOptions.sh -- This function interpretes option arguments -# passed to `help' functionality through the command-line and defines -# action names accordingly. -# -# Copyright (C) 2009, 2010, 2011 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 help_getOptions { - - # Define short options we want to support. - local ARGSS="" - - # Define long options we want to support. - local ARGSL="quiet,answer-yes,dont-commit-changes,read,search:,edit,update-output,update-structure,copy,delete,rename" - - # Parse arguments using getopt(1) command parser. - cli_parseArguments - - # Reset positional parameters using output from (getopt) argument - # parser. - eval set -- "$ARGUMENTS" - - # Define action to take for each option passed. - while true; do - case "$1" in - - --quiet ) - FLAG_QUIET="true" - FLAG_DONT_COMMIT_CHANGES="true" - shift 1 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --dont-commit-changes ) - FLAG_DONT_COMMIT_CHANGES="true" - shift 1 - ;; - - --search ) - ACTIONNAM="searchIndex" - FLAG_SEARCH="$2" - shift 2 - ;; - - --edit ) - ACTIONNAM="editEntry" - shift 1 - ;; - - --copy ) - ACTIONNAM="copyEntry" - shift 1 - ;; - - --delete ) - ACTIONNAM="deleteEntry" - shift 1 - ;; - - --rename ) - ACTIONNAM="renameEntry" - shift 1 - ;; - - --update-output ) - ACTIONNAM="updateOutputFiles" - shift 1 - ;; - - --update-structure ) - ACTIONNAM="updateStructureSection" - shift 1 - ;; - - --read ) - ACTIONNAM="searchNode" - 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/Functions/Locale/locale.sh b/Scripts/Functions/Locale/locale.sh deleted file mode 100755 index 5eb64c7..0000000 --- a/Scripts/Functions/Locale/locale.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash -# -# locale.sh -- This function provides internationalization features -# for centos-art.sh script through GNU gettext standard processes. -# -# Copyright (C) 2009, 2010, 2011 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 locale { - - # Verify current locale information to avoid English messages from - # being localized to themselves. The English language is used as - # reference to write translatable strings inside the source files. - if [[ $(cli_getCurrentLocale) =~ '^en' ]];then - cli_printMessage "`gettext "The English language cannot be localized to itself."`" --as-error-line - fi - - local ACTIONNAMS='' - local ACTIONNAM='' - local ACTIONVAL='' - - # Initialize machine object flag (`--dont-create-mo'). This flag - # controls whether the centos-art.sh script does create/update - # machine object (MO) files from related portable object (PO) - # files or not. By default, MO files are created. - local FLAG_DONT_CREATE_MO='false' - - # Define localization (l10n) base directory. This is the place - # where all translation messages are organized in. Translation - # messages are organized herein using the same layout of the - # components they represent under the `trunk/Identity', - # `trunk/Manuals' or `trunk/Scripts' directory structures. The - # localization base directory must be used as source location for - # subversion operations (e.g., status, update, commit, etc.). - # Otherwise, it would be difficult to add directory structures - # that have several levels down from the localization base - # directory up to the repository (e.g., it is not possible in - # subversion to add a directory which parent directory hasn't been - # added to the repository previously.). - L10N_BASEDIR="$(cli_getRepoTLDir)/L10n" - - # Interpret arguments and options passed through command-line. - locale_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}" - - # Syncronize changes between repository and working copy. At this - # point, changes in the repository are merged in the working copy - # and changes in the working copy committed up to repository. - cli_syncroRepoChanges "${L10N_BASEDIR}" - - # Loop through non-option arguments passed to centos-art.sh script - # through its command-line. - for ACTIONVAL in "$@";do - - # Sanitate non-option argument to be sure it matches the - # directory convenctions stablished by centos-art.sh script - # against source locations in the working copy. - ACTIONVAL=$(cli_checkRepoDirSource "${ACTIONVAL}") - - # Verify directory passed as non-option argument to be sure it - # supports localization. - if [[ ! $(cli_isLocalized "${ACTIONVAL}") == 'true' ]];then - cli_printMessage "`gettext "The path provided does not support localization."`" --as-error-line - fi - - # Define localization working directory using directory passed - # as non-option argument. The localization working directory - # is the place where POT and PO files are stored inside the - # working copy. - L10N_WORKDIR=$(echo "${ACTIONVAL}" \ - | sed -r -e "s!trunk/(Identity|Scripts|Manuals)!trunk/L10n/\1!")/$(cli_getCurrentLocale) - - # Execute localization actions provided to centos-art.sh - # script through its command-line. Notice that localization - # actions will be executed in the same order they were - # provided in the command-line. - for ACTIONNAM in ${ACTIONNAMS};do - ${ACTIONNAM} - done - - done - - # Syncronize changes between repository and working copy. At this - # point, changes in the repository are merged in the working copy - # and changes in the working copy committed up to repository. - cli_syncroRepoChanges "${L10N_BASEDIR}" - -} diff --git a/Scripts/Functions/Locale/locale_deleteMessages.sh b/Scripts/Functions/Locale/locale_deleteMessages.sh deleted file mode 100755 index be98e0a..0000000 --- a/Scripts/Functions/Locale/locale_deleteMessages.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# locale_deleteMessages.sh -- This function deletes the source files' -# localization directory from the working copy in conjunction with all -# portable objects and machine objects inside it. -# -# Copyright (C) 2009, 2010, 2011 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 locale_deleteMessages { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message. - cli_printMessage "$L10N_WORKDIR" --as-deleting-line - - # Verify existence of localization working directory. We cannot - # remove translation files that don't exist. - cli_checkFiles "$L10N_WORKDIR" - - # Delete localization working directory using subversion quietly. - svn del "$L10N_WORKDIR" --quiet - -} diff --git a/Scripts/Functions/Locale/locale_editMessages.sh b/Scripts/Functions/Locale/locale_editMessages.sh deleted file mode 100755 index 313b832..0000000 --- a/Scripts/Functions/Locale/locale_editMessages.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -# -# locale_editMessages.sh -- This function edits portable objects (.po) -# using default text editor. -# -# Copyright (C) 2009, 2010, 2011 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 locale_editMessages { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - local PO_FILE='' - local PO_FILES='' - - # Prepare localization working directory for receiving translation - # files. - if [[ ! -d ${L10N_WORKDIR} ]];then - - # Print separator line. - cli_printMessage "-" --as-separator-line - - # Output action message. - cli_printMessage "${L10N_WORKDIR}" --as-creating-line - - # Create localization working directory making parent - # directories as needed. Subversion doesn't create directories - # recursively, so we use the system's `mkdir' command and then - # subversion to register the changes. - mkdir -p ${L10N_WORKDIR} - - # Commit changes from working copy to central repository only. - # At this point, changes in the repository are not merged in - # the working copy, but chages in the working copy do are - # committed up to repository. - cli_commitRepoChanges "${L10N_BASEDIR}" - - fi - - # Define list of PO files to process based on paths provided as - # non-option arguments through centos-art.sh script command-line. - if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/(Manuals|Identity/Models)/.*$" ]];then - - # Define list of PO files for XML-based files. - PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --pattern=".*/messages\.po") - - # Do not create MO files for XML-based files. - FLAG_DONT_CREATE_MO='true' - - elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Scripts$" ]];then - - # Define list of PO files for shell scripts. - PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --pattern=".*/${TEXTDOMAIN}\.po") - - else - cli_printMessage "`gettext "The path provided does not support localization."`" --as-error-line - fi - - # Loop through list of PO files to process in order to edit them - # one by one using user's default text editor. - for PO_FILE in ${PO_FILES};do - - # Print the file we are editing. - cli_printMessage "${PO_FILE}" --as-updating-line - - # Use default text editor to edit the PO file. - eval ${EDITOR} ${PO_FILE} - - # At this point some changes might be realized inside the PO - # file, so we need to update the related MO files based on - # recently updated PO files here in order for `centos-art.sh' - # script to print out the most up to date revision of - # localized messages. Notice that this is required only if we - # were localizaing shell scripts. - locale_updateMessageBinary ${PO_FILE} - - done - -} diff --git a/Scripts/Functions/Locale/locale_getOptions.sh b/Scripts/Functions/Locale/locale_getOptions.sh deleted file mode 100755 index 3c232ff..0000000 --- a/Scripts/Functions/Locale/locale_getOptions.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash -# -# locale_getOptions.sh -- This function interprets option parameters -# passed to `locale' functionality and defines action names -# accordingly. -# -# Copyright (C) 2009, 2010, 2011 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 locale_getOptions { - - # Define short options we want to support. - local ARGSS="" - - # Define long options we want to support. - local ARGSL="filter:,quiet,answer-yes,dont-commit-changes,update,edit,delete,dont-create-mo" - - # Parse arguments using getopt(1) command parser. - cli_parseArguments - - # Reset positional parameters using output from (getopt) argument - # parser. - eval set -- "${ARGUMENTS}" - - # Look for options passed through command-line. - while true; do - case "$1" in - - --filter ) - FLAG_FILTER="$2" - shift 2 - ;; - - --quiet ) - FLAG_QUIET="true" - FLAG_DONT_COMMIT_CHANGES="true" - shift 1 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --dont-commit-changes ) - FLAG_DONT_COMMIT_CHANGES="true" - shift 1 - ;; - - --update ) - ACTIONNAMS="$ACTIONNAMS locale_updateMessages" - shift 1 - ;; - - --edit ) - ACTIONNAMS="$ACTIONNAMS locale_editMessages" - shift 1 - ;; - - --delete ) - ACTIONNAMS="$ACTIONNAMS locale_deleteMessages" - shift 1 - ;; - - --dont-create-mo ) - FLAG_DONT_CREATE_MO="true" - 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 - - # Verify action names. When no action name is specified, use - # edition as default action name. - if [[ $ACTIONNAMS == '' ]];then - ACTIONNAMS="locale_editMessages" - fi - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Verify non-option arguments passed to command-line. If there - # isn't any, redefine the ARGUMENTS variable to use the current - # location the functionality was called from. - if [[ $ARGUMENTS == '' ]];then - ARGUMENTS=${PWD} - fi - -} diff --git a/Scripts/Functions/Locale/locale_updateMessageBinary.sh b/Scripts/Functions/Locale/locale_updateMessageBinary.sh deleted file mode 100755 index 4b593ee..0000000 --- a/Scripts/Functions/Locale/locale_updateMessageBinary.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageBinary.sh -- This function creates/updates -# machine objects (.mo) from portable objects (.po). -# -# Copyright (C) 2009, 2010, 2011 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 locale_updateMessageBinary { - - # Verify machine object creation flag. - if [[ ${FLAG_DONT_CREATE_MO} == 'true' ]];then - return - fi - - # Define absolute path to portable object file. - local PO_FILE="$1" - - # Verify existence of portable object file. - cli_checkFiles "${PO_FILE}" - - # Define absolute path to machine object directory. - local MO_DIR="${L10N_WORKDIR}/LC_MESSAGES" - - # Define absolute path to machine object file. - local MO_FILE="${MO_DIR}/${CLI_PROGRAM}.sh.mo" - - # Print action message. - cli_printMessage "${MO_FILE}" --as-creating-line - - # Verify absolute path to machine object directory, if it doesn't - # exist create it. - if [[ ! -d ${MO_DIR} ]];then - mkdir -p ${MO_DIR} - fi - - # Create machine object from portable object. - msgfmt --check ${PO_FILE} --output-file=${MO_FILE} - -} diff --git a/Scripts/Functions/Locale/locale_updateMessageMetadata.sh b/Scripts/Functions/Locale/locale_updateMessageMetadata.sh deleted file mode 100755 index 2ed19e0..0000000 --- a/Scripts/Functions/Locale/locale_updateMessageMetadata.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageMetadata.sh -- This function sanitates .pot and -# .po files to use common translation markers inside top comment. -# Later, replacement of common translation markers is applied to set -# the final information. -# -# Copyright (C) 2009, 2010, 2011 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 locale_updateMessageMetadata { - - local COUNT=0 - local -a SRC - local -a DST - - # Retrive absolute path of portable object we'll work with. - local FILE="$1" - - # Define current locale. - local CURRENTLOCALE=$(cli_getCurrentLocale) - - # Define language name from current locale. - local LANGNAME=$(cli_getLangName ${CURRENTLOCALE}) - - # Check existence of file before work with it. - cli_checkFiles "${FILE}" - - # Define pattern lines. The pattern lines are put inside portable - # objects through xgettext and xml2po commands . - SRC[0]="\"Project-Id-Version:" - SRC[1]="\"Report-Msgid-Bugs-To:" - SRC[2]="\"Last-Translator:" - SRC[3]="\"Language-Team:" - SRC[4]="\"PO-Revision-Date:" - - # Define replacement lines for pattern line. - DST[0]="\"Project-Id-Version: ${CLI_PROGRAM}.sh\\\n\"" - DST[1]="\"Report-Msgid-Bugs-To: The CentOS L10n SIG <=MAIL_L10N=>\\\n\"" - DST[2]="\"Last-Translator: The CentOS L10n SIG <=MAIL_L10N=>\\\n\"" - DST[3]="\"Language-Team: ${LANGNAME}\\\n\"" - DST[4]="\"PO-Revision-Date: $(date "+%F %H:%M%z")\\\n\"" - - # Change pattern lines with their replacement lines. - while [[ $COUNT -lt ${#SRC[*]} ]];do - sed -i -r "/${SRC[$COUNT]}/c${DST[$COUNT]}" ${FILE} - COUNT=$(($COUNT + 1)) - done - - # When the .pot file is created using xml2po the - # `Report-Msgid-Bugs-To:' metadata field isn't created like it - # does when xgettext is used. So, in order to have such metadata - # field in all .pot files, verify its existence and add it if it - # doesn't exist. - egrep "^\"${SRC[1]}" $FILE > /dev/null - if [[ $? -ne 0 ]];then - sed -i -r "/^\"${SRC[0]}/a${DST[1]}" $FILE - fi - - # Replace package information using gettext domain information. - sed -i -r "s/PACKAGE/${TEXTDOMAIN}/g" ${FILE} - - # Expand translation markers inside file. - cli_expandTMarkers ${FILE} - - # Unset array variables to avoid undesired concatenations. - unset SRC - unset DST - -} diff --git a/Scripts/Functions/Locale/locale_updateMessagePObjects.sh b/Scripts/Functions/Locale/locale_updateMessagePObjects.sh deleted file mode 100755 index 416b5e2..0000000 --- a/Scripts/Functions/Locale/locale_updateMessagePObjects.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# locale_updateMessagePObjects.sh -- This function initializes the -# portable object when it doesn't exist. When the portable object does -# exist, it is updated instead. In both cases, the portable object -# template is used as source to merge changes inside the portable -# object. -# -# Copyright (C) 2009, 2010, 2011 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 locale_updateMessagePObjects { - - local FILE="$1" - - # Verify the portable object template. The portable object - # template is used to create the portable object. We cannot - # continue without it. - cli_checkFiles "${FILE}.pot" - - # Print action message. - cli_printMessage "${FILE}.po" --as-creating-line - - # Verify existence of portable object. The portable object is the - # file translators edit in order to make translation works. - if [[ -f ${FILE}.po ]];then - - # Update portable object merging both portable object and - # portable object template. - msgmerge --output="${FILE}.po" "${FILE}.po" "${FILE}.pot" --quiet - - else - - # Initiate portable object using portable object template. - # Do not print msginit sterr output, use centos-art action - # message instead. - msginit -i ${FILE}.pot -o ${FILE}.po --width=70 \ - --no-translator 2> /dev/null - - fi - - # Sanitate metadata inside the PO file. - locale_updateMessageMetadata "${FILE}.po" - -} diff --git a/Scripts/Functions/Locale/locale_updateMessageShell.sh b/Scripts/Functions/Locale/locale_updateMessageShell.sh deleted file mode 100755 index 5d671c7..0000000 --- a/Scripts/Functions/Locale/locale_updateMessageShell.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageShell.sh -- This function parses shell scripts -# source files under action value and retrives translatable strings in -# order to creates/updates both the portable object template (.pot) -# and the portable object (.po) related. -# -# Copyright (C) 2009, 2010, 2011 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 locale_updateMessageShell { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Define absolute path to file used as reference to create - # portable object templates (.pot), portable objects (.po) and - # machine objects (.mo). - local MESSAGES="${L10N_WORKDIR}/${TEXTDOMAIN}" - - # Define regular expression to match extensions of shell scripts - # we use inside the repository. - local EXTENSION='sh' - - # Build list of files to process. When building the patter, be - # sure the value passed through `--filter' be exactly evaluated - # with the extension as prefix. Otherwise it would be difficult to - # match files that share the same characters in their file names - # (e.g., it would be difficult to match only `hello.sh' if - # `hello-world.sh' also exists in the same location). - local FILES=$(cli_getFilesList ${ACTIONVAL} --pattern="${FLAG_FILTER}\.${EXTENSION}") - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Retrive translatable strings from shell script files and create - # the portable object template (.pot) from them. - xgettext --output=${MESSAGES}.pot \ - --copyright-holder="The CentOS L10n SIG" \ - --width=70 --sort-by-file ${FILES} - - # Sanitate metadata inside the POT file. - locale_updateMessageMetadata "${MESSAGES}.pot" - - # Verify, initialize or update portable objects from portable - # object templates. - locale_updateMessagePObjects "${MESSAGES}" - -} diff --git a/Scripts/Functions/Locale/locale_updateMessageXml.sh b/Scripts/Functions/Locale/locale_updateMessageXml.sh deleted file mode 100755 index f3a72bf..0000000 --- a/Scripts/Functions/Locale/locale_updateMessageXml.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash -# -# locale_updateMessageXml.sh -- This function parses XML-based files -# (e.g., scalable vector graphics), retrives translatable strings and -# creates/update gettext portable objects. -# -# Copyright (C) 2009, 2010, 2011 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 locale_updateMessageXml { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Define filename used to create both portable object templates - # (.pot) and portable objects (.po) files. - local MESSAGES="${L10N_WORKDIR}/messages" - - # Define regular expression to match the file extension of all - # XML-based source files that can be localized inside the working - # copy. Be aware that sometimes, source files and output files - # are stored in the same location (e.g., when rendering - # `tcar-ug.docbook' file the `tcar-ug.xhtml' is saved in the same - # location). Avoid using output files as if they were source - # files, when retriving translatable strings. - local EXTENSION='(svg|docbook)' - - # Build list of files to process. When building the patter, be - # sure the value passed through `--filter' be exactly evaluated - # with the extension as prefix. Otherwise it would be difficult to - # match files that share the same characters in their file names - # (e.g., it would be difficult to match only `hello.docbook' if - # `hello-world.docbook' also exists in the same location). - local FILES=$(cli_getFilesList ${ACTIONVAL} \ - --pattern="${FLAG_FILTER}\.${EXTENSION}" \ - --maxdepth='1' --type="f" \ - | egrep -v '/[[:alpha:]]{2}_[[:alpha:]]{2}/') - - # Print action message. - cli_printMessage "${MESSAGES}.pot" --as-updating-line - - # Normalize XML files, expand entities before retriving - # translatable strings and create the portable object template - # (.pot) from such output. The translatable strings are retrived - # from the normalized output of files, not files themselves - # (because of this, we don't include `#: filename:line' output on - # .pot files). Entity expansion is also necessary for DocBook - # documents to be processed correctly. Notice that some long - # DocBook document structures might use entities to split the - # document structure into smaller pieces so they could be easier - # to maintain. Also, don't validate svg files the same way you - # validate docbook files; Docbook files have a DOCTYPE definition - # while svg files don't. Without a DOCTYPE definition, it isn't - # possible for `xmllint' to validate the document. - if [[ $ACTIONVAL =~ '^.+/(branches|trunk)/Manuals/.+$' ]];then - - # Another issue to consider is the amount of source files that - # are being processed through xml2po. When there are more than - # one file, xml2po interprets only the first one and discards - # the rest in the list. This way, when more than one file - # exists in the list, it isn't convenient to provide xmllint's - # output to xml2po's input. Once here, we can say that - # in order to expand DocBook entities it is required that only - # one file must be provided at localization time (e.g., using - # the `--filter' option). Otherwise translation messages are - # retrived from all files, but no entity expansion is realized - # because xmllint wouldn't be used in such case. - if [[ $(echo "$FILES" | wc -l) -eq 1 ]];then - - xmllint --valid --noent ${FILES} | xml2po -a - \ - | msgcat --output=${MESSAGES}.pot --width=70 --no-location - - - else - - xml2po -a ${FILES} \ - | msgcat --output=${MESSAGES}.pot --width=70 --no-location - - - fi - - elif [[ $ACTIONVAL =~ '^.+/(branches|trunk)/Identity/Models/.+$' ]];then - - xml2po -a ${FILES} \ - | msgcat --output=${MESSAGES}.pot --width=70 --no-location - - - else - - cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line - - fi - - # Verify, initialize or merge portable objects from portable object - # templates. - locale_updateMessagePObjects "${MESSAGES}" - -} diff --git a/Scripts/Functions/Locale/locale_updateMessages.sh b/Scripts/Functions/Locale/locale_updateMessages.sh deleted file mode 100755 index 742888d..0000000 --- a/Scripts/Functions/Locale/locale_updateMessages.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# -# locale_updateMessages.sh -- This function extracts translatable -# strings from both XML-based files (using xml2po) and shell scripts -# (using xgettext). Translatable strings are initially stored in -# portable objects templates (.pot) which are later merged into -# portable objects (.po) in order to be optionally converted as -# machine objects (.mo). -# -# Copyright (C) 2009, 2010, 2011 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 locale_updateMessages { - - # Verify existence of localization working directory. We cannot - # update translation files that don't exist. - cli_checkFiles $L10N_WORKDIR - - local ACTIONNAM='' - - # Evaluate action value to determine whether to use xml2po to - # extract translatable strings from XML-based files or to use - # xgettext to extract translatable strings from shell script - # files. - if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/(Manuals|Identity/Models)/.*$" ]];then - - # Update translatable strings inside the portable object - # template related to XML-based files (e.g., scalable vector - # graphics). - locale_updateMessageXml - - elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Scripts$" ]];then - - # Update translatable strings inside the portable object - # template related to shell scripts (e.g., the centos-art.sh - # script). - locale_updateMessageShell - - else - cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line - fi - -} diff --git a/Scripts/Functions/Prepare/Config/vim.conf b/Scripts/Functions/Prepare/Config/vim.conf deleted file mode 100755 index 5737ebd..0000000 --- a/Scripts/Functions/Prepare/Config/vim.conf +++ /dev/null @@ -1,8 +0,0 @@ -set nu -set textwidth=70 -set autoindent -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set expandtab -set tags=./tags,tags diff --git a/Scripts/Functions/Prepare/prepare.sh b/Scripts/Functions/Prepare/prepare.sh deleted file mode 100755 index 140ca5d..0000000 --- a/Scripts/Functions/Prepare/prepare.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# -# prepare.sh (initialization) -- This function creates the base -# execution environment required to standardize final configuration -# stuff needed by your workstation, once the working copy of The -# CentOS Artwork Repository has been downloaded in it. -# -# Copyright (C) 2009, 2010, 2011 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 prepare { - - local ACTIONNAM='' - local ACTIONNAMS='' - - # Define absolute path to directory holding prepare's - # configuration files. - local PREPARE_CONFIG_DIR=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/Config - - # Interpret arguments and options passed through command-line. - prepare_getOptions - - # Execute action names based on whether they were provided or not. - if [[ $ACTIONNAMS == '' ]];then - - # When action names are not provided, define action names that - # will take place, explicitly. - prepare_updatePackages - prepare_updateLinks - prepare_updateImages - prepare_updateManuals - - else - - # When action names are provided, loop through them and - # execute them one by one. - for ACTIONNAM in $ACTIONNAMS;do - ${ACTIONNAM} - done - - fi - -} diff --git a/Scripts/Functions/Prepare/prepare_getEnvars.sh b/Scripts/Functions/Prepare/prepare_getEnvars.sh deleted file mode 100755 index 8a3198a..0000000 --- a/Scripts/Functions/Prepare/prepare_getEnvars.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# -# prepare_getEnvars.sh -- This function outputs a brief description of -# relevant environment variables used by `centos-art.sh' script. -# -# Copyright (C) 2009, 2010, 2011 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 prepare_getEnvars { - - local -a VARS - local -a INFO - local COUNT=0 - - # Define name of environment variables used by centos-art.sh - # script. - VARS[0]='EDITOR' - VARS[1]='TZ' - VARS[2]='TEXTDOMAIN' - VARS[3]='TEXTDOMAINDIR' - VARS[4]='LANG' - - # Define description of environment variables. - INFO[0]="`gettext "Default text editor"`" - INFO[1]="`gettext "Default time zone representation"`" - INFO[2]="`gettext "Default domain used to retrieve translated messages"`" - INFO[3]="`gettext "Default directory used to retrive translated messages"`" - INFO[4]="`gettext "Default locale information"`" - - until [[ $COUNT -eq ${#VARS[*]} ]];do - - # Let user to reduce output using regular expression as - # reference. - if [[ ${VARS[$COUNT]} =~ $FLAG_FILTER ]];then - - # Output list of environment variables using indirect - # expansion (what a beautiful feature!) to output variable - # value. - cli_printMessage "${INFO[$COUNT]}:" - cli_printMessage "${VARS[$COUNT]}=${!VARS[$COUNT]}" --as-response-line - - fi - - # Increment counter. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Scripts/Functions/Prepare/prepare_getLinkName.sh b/Scripts/Functions/Prepare/prepare_getLinkName.sh deleted file mode 100755 index 83ab48a..0000000 --- a/Scripts/Functions/Prepare/prepare_getLinkName.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# -# prepare_getLinkName.sh -- This function standardizes link name -# construction. For the construction sake, two arguments are required, -# one to now the file's base directory, and another holding the file's -# absolute path. With this information, the base directory is removed -# from file's absolute path and the remaining path is transformed into -# a file name where each slash is converted into minus sign. -# -# For example, if the following information is provided: -# -# ARG1: /home/centos/artwork/trunk/Identity/Brushes -# ARG2: /home/centos/artwork/trunk/Identity/Brushes/Corporate/symbol.gbr -# -# the result will be: `corporate-symbol.gbr'. -# -# Copyright (C) 2009, 2010, 2011 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 prepare_getLinkName { - - local LINK_BASEDIR='' - local LINK_ABSPATH='' - local LINK_CHARSEP='' - - # Define absolute path to link's base directory. - LINK_BASEDIR="$1" - - # Define absolute path to link's file. - LINK_ABSPATH="$2" - - # Define character used as word separator on file name. - LINK_CHARSEP='-' - - # Output link name. - echo "$LINK_ABSPATH" | sed -r "s!^${LINK_BASEDIR}/!!" \ - | tr '[:upper:]' '[:lower:]' | sed -r "s!/!${LINK_CHARSEP}!g" - -} diff --git a/Scripts/Functions/Prepare/prepare_getOptions.sh b/Scripts/Functions/Prepare/prepare_getOptions.sh deleted file mode 100755 index c6da090..0000000 --- a/Scripts/Functions/Prepare/prepare_getOptions.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# -# prepare_getOptions.sh -- This function parses command options -# provided to `centos-art.sh' script when the first argument in the -# command-line is the `prepare' word. To parse options, this function -# makes use of getopt program. -# -# Copyright (C) 2009, 2010, 2011 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 prepare_getOptions { - - # Define short options we want to support. - local ARGSS="" - - # Define long options we want to support. - local ARGSL="quiet,answer-yes,packages,links,images,manuals,environment" - - # Parse arguments using getopt(1) command parser. - cli_parseArguments - - # Reset positional parameters using output from (getopt) argument - # parser. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - case "$1" in - - --quiet ) - FLAG_QUIET="true" - FLAG_DONT_COMMIT_CHANGES="true" - shift 1 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --packages ) - ACTIONNAMS="${ACTIONNAMS} prepare_updatePackages" - shift 1 - ;; - - --links ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateLinks" - shift 1 - ;; - - --images ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateImages" - shift 1 - ;; - - --manuals ) - ACTIONNAMS="${ACTIONNAMS} prepare_updateManuals" - shift 1 - ;; - - --environment ) - ACTIONNAMS="${ACTIONNAMS} prepare_getEnvars" - shift 1 - ;; - - * ) - break - esac - done - -} diff --git a/Scripts/Functions/Prepare/prepare_updateImages.sh b/Scripts/Functions/Prepare/prepare_updateImages.sh deleted file mode 100755 index ca8aa54..0000000 --- a/Scripts/Functions/Prepare/prepare_updateImages.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# prepare_updateImages.sh -- This option initializes image files inside -# the working copy. When you provide this option, the centos-art.sh -# scripts renders image files from all design models available in the -# working copy. This step is required in order to satisfy dependencies -# from different components inside the working copy. -# -# Copyright (C) 2009, 2010, 2011 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 prepare_updateImages { - - # Define list of directories that need to be rendered. - local DIRS=$(cli_getFilesList \ - ${CLI_WRKCOPY}/trunk/Identity/Images --maxdepth="1" \ - --mindepth="1" --type="d" --pattern=".+/[[:alnum:]]+$") - - # Execute the render functionality of centos-art.sh script to - # produce directories inside the list one by one. Producing - # directories one by one is important because themes directory is - # produced differently compared to others directories. This way, - # when we create a list of directories and pass them that way to - # centos-art.sh script, it is possible for ir to know how to - # produce each directory passed. - ${CLI_BASEDIR}/${CLI_PROGRAM}.sh render $DIRS --dont-commit-changes - -} diff --git a/Scripts/Functions/Prepare/prepare_updateLinks.sh b/Scripts/Functions/Prepare/prepare_updateLinks.sh deleted file mode 100755 index c3f9134..0000000 --- a/Scripts/Functions/Prepare/prepare_updateLinks.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash -# -# prepare_updateLinks.sh -- This option creates/updates the symbolic links -# information required in your workstation to connect it with the -# files inside the working copy of The CentOS Artwork Repository. When -# you provide this option, the centos-art.sh put itself into your -# system's execution path and make common brushes, patterns, palettes -# and fonts available inside applications like GIMP, so you can make -# use of them without loosing version control over them. -# -# Copyright (C) 2009, 2010, 2011 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 prepare_updateLinks { - - local -a LINKS_SRC - local -a LINKS_DST - local USERFILES='' - local PALETTE='' - local BRUSH='' - local PATTERN='' - local FONT='' - local FILE='' - local COUNT=0 - - # Define user's directories. This is the place where configuration - # links are created in. - local GIMP_DIR=${HOME}/.$(rpm -q gimp | cut -d. -f-2) - local GIMP_DIR_BRUSHES=${GIMP_DIR}/brushes - local GIMP_DIR_PALETTES=${GIMP_DIR}/palettes - local GIMP_DIR_PATTERNS=${GIMP_DIR}/patterns - local INKS_DIR=${HOME}/.inkscape - local INKS_DIR_PALETTES=${INKS_DIR}/palettes - local FONT_DIR=${HOME}/.fonts - local APPS_DIR=${HOME}/bin - - # Define working copy directories. This is the place where - # configuration links point to. - local WCDIR=$(cli_getRepoTLDir)/Identity - local WCDIR_BRUSHES=${WCDIR}/Brushes - local WCDIR_PALETTES=${WCDIR}/Palettes - local WCDIR_PATTERNS=${WCDIR}/Patterns - local WCDIR_FONTS=${WCDIR}/Fonts - local WCDIR_EDITOR=${PREPARE_CONFIG_DIR} - - # Define link relation for cli. - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${APPS_DIR}/${CLI_PROGRAM} - LINKS_DST[((++${#LINKS_DST[*]}))]=${CLI_BASEDIR}/${CLI_PROGRAM}.sh - USERFILES="${APPS_DIR}/${CLI_PROGRAM}" - - # Define link relation for fonts. - for FONT in $(cli_getFilesList "${WCDIR_FONTS}" --pattern='.+\.ttf');do - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${FONT_DIR}/$(basename $FONT) - LINKS_DST[((++${#LINKS_DST[*]}))]=${FONT} - done - - # Define link relation for common palettes. - for PALETTE in $(cli_getFilesList "${WCDIR_PALETTES}" --pattern=".+\.gpl");do - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) - LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${INKS_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) - LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} - done - - # Define link relation for common brushes. - for BRUSH in $(cli_getFilesList "${WCDIR_BRUSHES}" --pattern=".+\.(gbr|gih)");do - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_BRUSHES}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) - LINKS_DST[((++${#LINKS_DST[*]}))]=${BRUSH} - done - - # Define link relation for common patterns. - for PATTERN in $(cli_getFilesList "${WCDIR_PATTERNS}" --pattern=".+\.png");do - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PATTERNS}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) - LINKS_DST[((++${#LINKS_DST[*]}))]=${PATTERN} - done - - # Define link relation for Vim text editor's configuration. - if [[ $EDITOR == '/usr/bin/vim' ]];then - LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/.vimrc - LINKS_DST[((++${#LINKS_DST[*]}))]=${WCDIR_EDITOR}/vim.conf - USERFILES="${USERFILES} ${HOME}/.vimrc" - fi - - # Define which files inside the user's configuration directories - # need to be removed in order for centos-art.sh script to make a - # fresh installation of common patterns, common palettes and - # common brushes using symbolic links from the working copy to the - # user's configuration directories inside the workstation. - USERFILES=$(echo "$USERFILES"; - cli_getFilesList ${APPS_DIR} --pattern='.+\.sh'; - cli_getFilesList ${FONT_DIR} --pattern='.+\.ttf'; - cli_getFilesList ${GIMP_DIR_BRUSHES} --pattern='.+\.(gbr|gih)'; - cli_getFilesList ${GIMP_DIR_PATTERNS} --pattern='.+\.(pat|png|jpg|bmp)'; - cli_getFilesList ${GIMP_DIR_PALETTES} --pattern='.+\.gpl'; - cli_getFilesList ${INKS_DIR_PALETTES} --pattern='.+\.gpl';) - - # Remove user-specific configuration files from user's home - # directory. Otherwise, we might end up having links insid user's - # home directory that don't exist inside the working copy. - if [[ "$USERFILES" != '' ]];then - rm -r $USERFILES - fi - - while [[ $COUNT -lt ${#LINKS_SRC[*]} ]];do - - # Print action message. - cli_printMessage "${LINKS_SRC[$COUNT]}" --as-creating-line - - # Create symbolic link's parent directory if it doesn't exist. - if [[ ! -d $(dirname ${LINKS_SRC[$COUNT]}) ]];then - mkdir -p $(dirname ${LINKS_SRC[$COUNT]}) - fi - - # Create symbolic link. - ln ${LINKS_DST[$COUNT]} ${LINKS_SRC[$COUNT]} --symbolic --force - - # Increment counter. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Scripts/Functions/Prepare/prepare_updateManuals.sh b/Scripts/Functions/Prepare/prepare_updateManuals.sh deleted file mode 100755 index bde6e8c..0000000 --- a/Scripts/Functions/Prepare/prepare_updateManuals.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# prepare_updateManuals.sh -- This option initializes documentation files -# inside the working copy. When you provide this option, the -# centos-art.sh script renders all documentation manuals from their -# related source files so you can read them nicely. -# -# Copyright (C) 2009, 2010, 2011 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 prepare_updateManuals { - - local RELEASE=$(cat /etc/redhat-release | gawk '{ print $3 }') - - # The CentOS Artwork Repository User's Guide in docbook format. - ${CLI_BASEDIR}/${CLI_PROGRAM}.sh render \ - trunk/Manuals/Tcar-ug --filter="tcar-ug" \ - --dont-commit-changes - - # The CentOS Distribution Notes - ${CLI_BASEDIR}/${CLI_PROGRAM}.sh render \ - trunk/Manuals/Distro --releasever="${RELEASE}" \ - --dont-commit-changes - - # The CentOS Artwork Repository User's Guide in texinfo format. - ${CLI_BASEDIR}/${CLI_PROGRAM}.sh help --update \ - trunk/Manuals/Tcar-fs \ - --dont-commit-changes - -} diff --git a/Scripts/Functions/Prepare/prepare_updatePackages.sh b/Scripts/Functions/Prepare/prepare_updatePackages.sh deleted file mode 100755 index 6a75928..0000000 --- a/Scripts/Functions/Prepare/prepare_updatePackages.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# -# prepare_updatePackages.sh -- This function verifies the required -# packages your workstation needs to have installed in order for -# `centos-art.sh' script to run correctly. If there is one or more -# missing packages, the `centos-art.sh' script asks you to confirm -# their installation through `sudo yum'. -# -# Copyright (C) 2009, 2010, 2011 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 prepare_updatePackages { - - local PACKAGE='' - local PACKAGES='' - local PACKAGES_THIRDS='' - local -a PACKAGES_MISSING - local -a PACKAGES_INSTALL - local RPM='/bin/rpm' - local YUM='/usr/bin/yum' - local YUM_OPTIONS='' - - # Check execution rights of package managers. - cli_checkFiles $RPM --execution - cli_checkFiles $YUM --execution - - # Define required packages needed by centos-art.sh script. - PACKAGES="inkscape ImageMagick netpbm netpbm-progs syslinux gimp - coreutils texinfo info tetex-latex tetex-fonts tetex-xdvi - tetex-dvips gettext texi2html gnome-doc-utils elinks - docbook-style-xsl docbook-utils docbook-dtds - docbook-style-dsssl docbook-simple docbook-utils-pdf - docbook-slides firefox sudo yum rpm ctags" - - # Define packages from third party repositories (i.e., packages - # not included in CentOS [base] repository.) required by - # centos-art to work as expected. - PACKAGES_THIRDS="(inkscape|blender)" - - # Build list of installed and missing packages. - for PACKAGE in $PACKAGES;do - $RPM -q --queryformat "%{NAME}\n" $PACKAGE --quiet - if [[ $? -ne 0 ]];then - PACKAGES_MISSING[((++${#PACKAGES_MISSING[*]}))]=$PACKAGE - else - PACKAGES_INSTALL[((++${#PACKAGES_INSTALL[*]}))]=$PACKAGE - fi - done - - # Define relation between centos-art.sh options and yum options. - [[ $FLAG_ANSWER == 'true' ]] && YUM_OPTIONS="${YUM_OPTIONS} -y" - [[ $FLAG_QUIET == 'true' ]] && YUM_OPTIONS="${YUM_OPTIONS} -q" - - # Use `sudo yum' to install missing packages in your workstation. - if [[ ${#PACKAGES_MISSING[*]} -gt 0 ]];then - sudo ${YUM} ${YUM_OPTIONS} install ${PACKAGES_MISSING[*]} - fi - - # Use `sudo yum' to update installed packages in your workstation. - if [[ ${#PACKAGES_INSTALL[*]} -gt 0 ]];then - sudo ${YUM} ${YUM_OPTIONS} update ${PACKAGES_INSTALL[*]} - fi - -} diff --git a/Scripts/Functions/Render/Docbook/Styles/docbook2fo.xsl b/Scripts/Functions/Render/Docbook/Styles/docbook2fo.xsl deleted file mode 100755 index 6eac1da..0000000 --- a/Scripts/Functions/Render/Docbook/Styles/docbook2fo.xsl +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/Scripts/Functions/Render/Docbook/Styles/docbook2pdf.dsl b/Scripts/Functions/Render/Docbook/Styles/docbook2pdf.dsl deleted file mode 100644 index 407a604..0000000 --- a/Scripts/Functions/Render/Docbook/Styles/docbook2pdf.dsl +++ /dev/null @@ -1,464 +0,0 @@ - - -]]> -]> - - - - - - -;;====================================== -;;General Options -;;====================================== - -;;Do you want to print on both sides of the paper? -(define %two-side% - #t) - -;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.) -(define %section-autolabel% - #t) - -;;Show URL links? If the text of the link and the URL are identical, -;;the parenthetical URL is suppressed. -(define %show-ulinks% - #t) - -;Make Ulinks footnotes to stop bleeding in the edges - this increases -;'jade --> print' time tremendously keep this in mind before -;complaining! -(define %footnote-ulinks% - #t) - -;;Tex Backend on -(define tex-backend - #t) - -;;Define Line Spacing -(define %line-spacing-factor% 1.3) - -;;Define the Paragraph Style -(define para-style - (style - font-size: %bf-size% - font-weight: 'medium - font-posture: 'upright - font-family-name: %body-font-family% - line-spacing: (* %bf-size% %line-spacing-factor%))) - -(define ($object-titles-after$) - (list (normalize "figure"))) - -;;====================================== -;;Book Options -;;====================================== - - -;;Do you want a title page for a Book? -(define %generate-book-titlepage% - #t) - -;;Do you want a separate page for the title? -(define %generate-book-titlepage-on-separate-page% - #t) - -;;Generate Book TOC? -(define %generate-book-toc% - #t) - -;;What depth should the TOC generate? -;;!Only top level of appendixes! -(define (toc-depth nd) - (if (string=? (gi nd) (normalize "book")) - 3 - (if (string=? (gi nd) (normalize "appendix")) - 0 - 1))) - -;;Do you want a TOC for the element part? -(define %generate-part-toc% - #t) - -;;Do you want the part toc on the part titlepage or separate? -(define %generate-part-toc-on-titlepage% - #t) - -;;Generate Part Title Page? -(define %generate-part-titlepage% - #t) - -;;Do you want the Part intro on the part title page? -(define %generate-partintro-on-titlepage% - #t) - -;;What elements should have a LOT? -(define ($generate-book-lot-list$) - (list (normalize "equation"))) - -;;Do you want chapters enumerated? -(define %chapter-autolabel% - #t) - -;;Do you want Chapter's and Appendix's -;;to have automatic labels? -(define %chap-app-running-head-autolabel% - #t) - -;;====================================== -;;Article Options -;;====================================== - -;;Do you want a title page for an Article? -(define %generate-article-titlepage% - #t) - -;;Generate Article TOC? -(define %generate-article-toc% - #t) - -;;Do you want a separate page for the title? -(define %generate-article-titlepage-on-separate-page% - #t) - -;;Do you want the article toc on the titlepage or separate? -(define %generate-article-toc-on-titlepage% - #t) - -;;Do you want to start new page numbers with each article? -(define %article-page-number-restart% - #f) - -;;Titlepage Separate? -(define (chunk-skip-first-element-list) - '()) - -;;Titlepage Not Separate -;(define (chunk-skip-first-element-list) -; (list (normalize "sect1") -; (normalize "section"))) - -;;====================================== -;;Columns -;;====================================== - -;;How many columns do you want? -(define %page-n-columns% - 1) - -;;How much space between columns? -(define %page-column-sep% - 0.2in) - -;;How many Columns on the titlepage? -(define %titlepage-n-columns% - 1) - -;;Balance columns? -(define %page-balance-colums% - #t) - -;;====================================== -;;Fonts -;;====================================== - -;;Defines the general size of the text in the document. normal(10), -;;presbyopic(12), and large-type(24). -(define %visual-acuity% - "presbyopic") - -;;What font would you like for titles? -(define %title-font-family% - "Helvetica") - -;;What font would you like for the body? -(define %body-font-family% - "Palatino") - -;;What font would you like for mono-seq? -(define %mono-font-family% - "Courier New") - -;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is -;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc -(define %hsize-bump-factor% - 1.1) - -;;What size do you want the body fonts? -(define %bf-size% - (case %visual-acuity% - (("tiny") 8pt) - (("normal") 10pt) - (("presbyopic") 12pt) - (("large-type") 24pt))) - -(define-unit em %bf-size%) - -;;====================================== -;;Margins -;;====================================== - -(define %left-right-margin% 6pi) - -;;How much indentation for the body? -(define %body-start-indent% - 0pi) - -;;How big is the left margin? (relative to physical page) -(define %left-margin% - 8pi) ;white-paper-column - -;;How big is the right margin? (relative to physical page) -(define %right-margin% - 8pi) ;white-paper-column - -;;How big do you want the margin at the top? -(define %top-margin% - (if (equal? %visual-acuity% "large-type") - 7.5pi - 8pi)) - -;;How big do you want the margin at the bottom? -(define %bottom-margin% - (if (equal? %visual-acuity% "large-type") - 7.5pi - 8pi)) - -;;Define the text width. (Change the elements in the formula rather -;;than the formula itself) -;(define %text-width% (- %page-width% (* %left-right-margin% 2))) -(define %text-width% (- %page-width% (+ %left-margin% %right-margin%))) - -;;Define the body width. (Change the elements in the formula rather -;;than the formula itself) -(define %body-width% - (- %text-width% %body-start-indent%)) - -;;Define distance between paragraphs -(define %para-sep% - (/ %bf-size% 1.0)) - -;;Define distance between block elements (figures, tables, etc.). -(define %block-sep% - (* %para-sep% 1.0)) - -;;Indent block elements? -(define %block-start-indent% - 0pt) -;0pt - -;;====================================== -;;Admon Graphics -;;====================================== - -;;Do you want admon graohics on? -(define %admon-graphics% - #f) - -;;Where are the admon graphics? -(define %admon-graphics-path% - "../images/") - -;;====================================== -;;Quadding -;;====================================== - -;;What quadding do you want by default; start, center, justify, or end? -(define %default-quadding% - 'justify) - -;;What quadding for component titles(Chapter, Appendix, etc)? -(define %component-title-quadding% - 'start) - -;;What quadding for section titles? -(define %section-title-quadding% - 'start) - -;;What quadding for section sub-titles? -(define %section-subtitle-quadding% - 'start) - -;;What quadding for article title? -(define %article-title-quadding% - 'center) - -;;What quadding for article sub-titles? -(define %article-subtitle-quadding% - 'center) - -;;What quadding for division subtitles? -(define %division-subtitle-quadding% - 'start) - -;;What quadding for component subtitles? -(define %component-subtitle-quadding% - 'start) - -;;====================================== -;;Paper Options -;;====================================== - -;;What size paper do you need? A4, USletter, USlandscape, or RedHat? -(define %paper-type% - "USletter") - -;;Now define those paper types' width -(define %page-width% - (case %paper-type% - (("A4") 210mm) - (("USletter") 8.5in) - (("USlandscape") 11in))) - -;;Now define those paper types' height -(define %page-height% - (case %paper-type% - (("A4") 297mm) - (("USletter") 11in) - (("USlandscape") 8.5in))) - -;;====================================== -;;Functions -;;====================================== - -(define (OLSTEP) - (case - (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4) - ((1) 1.2em) - ((2) 1.2em) - ((3) 1.6em) - ((0) 1.4em))) - -(define (ILSTEP) 1.0em) - -(define (PROCSTEP ilvl) - (if (> ilvl 1) 1.8em 1.4em)) - -(define (PROCWID ilvl) - (if (> ilvl 1) 1.8em 1.4em)) - -(define ($comptitle$) - (make paragraph - font-family-name: %title-font-family% - font-weight: 'bold - font-size: (HSIZE 2) - line-spacing: (* (HSIZE 2) %line-spacing-factor%) - space-before: (* (HSIZE 2) %head-before-factor%) - space-after: (* (HSIZE 2) %head-after-factor%) - start-indent: 0pt - first-line-start-indent: 0pt - quadding: 'start - keep-with-next?: #t - (process-children-trim))) - -;;Callouts are confusing in Postscript... fix them. -(define %callout-fancy-bug% - #f) - -;;By default perils are centered and dropped into a box with a really -;;big border - I have simply decreased the border thickness - -;;unfortunately it takes all this to do it - sigh. -(define ($peril$) - (let* ((title (select-elements - (children (current-node)) (normalize "title"))) - (has-title (not (node-list-empty? title))) - (adm-title (if has-title - (make sequence - (with-mode title-sosofo-mode - (process-node-list (node-list-first title)))) - (literal - (gentext-element-name - (current-node))))) - (hs (HSIZE 2))) - (if %admon-graphics% - ($graphical-admonition$) - (make display-group - space-before: %block-sep% - space-after: %block-sep% - font-family-name: %admon-font-family% - font-size: (- %bf-size% 1pt) - font-weight: 'medium - font-posture: 'upright - line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%) - (make box - display?: #t - box-type: 'border - line-thickness: .5pt - start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt) - end-indent: (inherited-end-indent) - (make paragraph - space-before: %para-sep% - space-after: %para-sep% - start-indent: 1em - end-indent: 1em - font-family-name: %title-font-family% - font-weight: 'bold - font-size: hs - line-spacing: (* hs %line-spacing-factor%) - quadding: 'center - keep-with-next?: #t - adm-title) - (process-children)))))) - -;;====================================== -;;Non-printing Elements -;;====================================== -(element TITLEABBREV (empty-sosofo)) -(element SUBTITLE (empty-sosofo)) -(element SETINFO (empty-sosofo)) -(element BOOKINFO (empty-sosofo)) -(element BIBLIOENTRY (empty-sosofo)) -(element BIBLIOMISC (empty-sosofo)) -(element BOOKBIBLIO (empty-sosofo)) -(element SERIESINFO (empty-sosofo)) -(element DOCINFO (empty-sosofo)) -(element ARTHEADER (empty-sosofo)) -;;(element ADDRESS (empty-sosofo)) - -;;Show comment element? -(define %show-comments% - #t) - -;;====================================== -;;Formalpara titles -;;====================================== - -;;Change the way Formal Paragraph titles are displayed. The commented -;;out section will run the titles in the paragraphs. -(element (formalpara title) - ;(make sequence - ;font-weight: 'bold - ;($runinhead$)) - ($lowtitle$ 5 7)) - -;;====================================== -;;Inlines -;;====================================== - -(element application ($mono-seq$)) -(element command ($bold-seq$)) -(element filename ($mono-seq$)) -(element function ($mono-seq$)) -(element guibutton ($bold-seq$)) -(element guiicon ($bold-seq$)) -(element guilabel ($italic-seq$)) -(element guimenu ($bold-seq$)) -(element guimenuitem ($bold-seq$)) -(element hardware ($bold-mono-seq$)) -(element keycap ($bold-seq$)) -(element literal ($mono-seq$)) -(element parameter ($italic-mono-seq$)) -(element prompt ($mono-seq$)) -(element symbol ($charseq$)) -(element emphasis ($italic-seq$)) - - - - - - - diff --git a/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-chunks.xsl b/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-chunks.xsl deleted file mode 100755 index 9c99ade..0000000 --- a/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-chunks.xsl +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-common.xsl b/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-common.xsl deleted file mode 100755 index 619b0d2..0000000 --- a/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-common.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - -=REPO_HOME=/trunk/Identity/Webenv/Css/Docbook/default.css - - - -=REPO_HOME=/trunk/Identity/Images/Webenv/ - diff --git a/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-single.xsl b/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-single.xsl deleted file mode 100755 index 271e624..0000000 --- a/Scripts/Functions/Render/Docbook/Styles/docbook2xhtml-single.xsl +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Scripts/Functions/Render/Docbook/docbook.sh b/Scripts/Functions/Render/Docbook/docbook.sh deleted file mode 100755 index e776abc..0000000 --- a/Scripts/Functions/Render/Docbook/docbook.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# docbook.sh -- This function performs base-rendition actions for -# DocBook files. -# -# Copyright (C) 2009, 2010, 2011 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 docbook { - - # Initialize absolute path to Xsl directory. This is the location - # where customization of XSL tranformations are stored in. - DOCBOOK_STYLES_DIR="${RENDER_BACKEND_DIR}/Docbook/Styles" - - docbook_convertToXhtmlChunk - docbook_convertToXhtml - - # WARNING: There are some issues related to DocBook-to-PDF - # transformations that make the whole process not so "clean" as - # DocBook-to-XHTML transformation is. Based on this situation and - # the need of providing a clean output, PDF transformation is - # commented until these issues be corrected. If you have a release - # of CentOS greater than 5.5, uncomment this to see what happen. - #docbook_convertToPdf - - # Perform backend post-rendition. - docbook_doPostActions - - # Perform backend last-rendition. - docbook_doLastActions - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_convertToPdf.sh b/Scripts/Functions/Render/Docbook/docbook_convertToPdf.sh deleted file mode 100755 index 1f4497c..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_convertToPdf.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# -# docbook_convertToPdf.sh -- This function takes DocBook XML as input -# and produces two different PDF as outputs; one from DocBook XML and -# another from DocBook SGML. We decided to provide support for both -# ways of output production from DocBook XML and DocBook SGML for you -# to evaluate and if possible correct. -# -# Copyright (C) 2009, 2010, 2011 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 docbook_convertToPdf { - - # Tranform DocBook XML to PDF. - docbook_convertToPdfFromXml - - # Tranform DocBook SGML to PDF. - if [[ $(cli_getCurrentLocale) =~ '^en' ]];then - # FIXME: This is only possible when no localization is - # performed (i.e., xml2po is not involved.) to main DocBook - # file, otherwise there will be errors and the PDF output - # won't be created. The errors come out because when we passed - # the validated DocBook file to xml2po all XML decimal - # entities inside the main DocBook file are expanded and set - # in the msgid field. Such expanded characters are not - # recognized by openjade when they are used as source to - # produce the PDF output. - docbook_convertToPdfFromSgml - fi - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_convertToPdfFromSgml.sh b/Scripts/Functions/Render/Docbook/docbook_convertToPdfFromSgml.sh deleted file mode 100755 index 0417f47..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_convertToPdfFromSgml.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# -# docbook_convertToPdfFromSgml.sh -- This function transforms DocBook -# files which have set the SGML DTD in them. To produce PDF from -# DocBook SGML DTD, we take the DocBook XML DTD file and change its -# DTD from XML to SGML. Since XML is SGML shoudn't be any problem. -# Once the DTD has been changed from XML to SGML, we use openjade -# (through `jw' shell script) to convert the SGML-based DocBook file -# to PDF. Customization can be achieved through DSL -# (docbook-style-dsssl-1.79-4.1) shipped in this distribution. -# -# In this configuration and using default configuration settings, I've -# presented the following problems: -# -# 1. It is not possible to produce localized PDF outputs through -# `xml2po', the default way of producing localized content inside -# `centos-art.sh' script. -# -# In this configuration and using default configuration settins, I've -# presented the following advantages: -# -# 1. The PDF output produced from SGML-based files seem to be better -# looking an less buggy than PDF output produced from XML-based -# files, visually I mean. -# -# To make the whole process transparent, a temporal directory is -# created for intermediate works and final files are moved then to -# their final location. -# -# Copyright (C) 2009, 2010, 2011 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 docbook_convertToPdfFromSgml { - - # Print action message. - if [[ -f ${FILE}.sgml.pdf ]];then - cli_printMessage "${FILE}.sgml.pdf" --as-updating-line - else - cli_printMessage "${FILE}.sgml.pdf" --as-creating-line - fi - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define name of temporal directory where the DocBook to PDF - # transformation will take place. - local TMPDIR=$(cli_getTemporalFile "docbook2pdf") - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SRC=${INSTANCE} - - # Define absolute path to PDF target file. This is the final - # location the PDF file produced as result of DocBook to PDF - # transformation will be stored in. - local DST="${FILE}.sgml.pdf" - - # Define file name of PDF file. This is the file we were looking - # for and the one moved, once produced. - local PDF=$(basename ${SRC} | sed -r 's!\.docbook$!.pdf!') - - # Replace document definition from XML to SGML. - sed -i -r \ - -e 's!"-//OASIS//DTD DocBook XML!"-//OASIS//DTD DocBook!' \ - -e 's!"http://www\.oasis-open\.org/docbook/xml/([[:digit:]])\.([[:digit:]])/docbookx\.dtd"!"docbook/sgml-dtd-\1.\2-1.0-30.1/docbook.dtd"!' \ - $SRC - - # Prepare style final instance used in transformations. - docbook_prepareStyles "${DOCBOOK_STYLES_DIR}/docbook2pdf.dsl" - - # Verify temporal directory and create it if doesn't exist. - if [[ ! -d $TMPDIR ]];then - mkdir $TMPDIR - fi - - # Move inside temporal directory. - pushd $TMPDIR > /dev/null - - # Create PDF format. - docbook2pdf --dsl ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null - - # Verify `docbook2pdf' exit status and, if everything is ok, move - # PDF file from temporal directory to its target location. - if [[ $? -eq 0 ]];then - mv $PDF $DST - else - cli_printMessage "`gettext "Cannot produce the PDF file."`" --as-error-line - fi - - # Return to where we initially were. - popd > /dev/null - - # Remove temporal directory and temporal style instances created. - rm -r $TMPDIR - rm ${STYLE_INSTANCE[*]} - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_convertToPdfFromXml.sh b/Scripts/Functions/Render/Docbook/docbook_convertToPdfFromXml.sh deleted file mode 100755 index b327857..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_convertToPdfFromXml.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash -# -# docbook_convertToPdfFromXml.sh -- This function transforms DocBook -# files which have set the XML DTD in them. To produce PDF from -# DocBook XML DTD, we need an XSLT engine (e.g., through `xsltproc' -# command) to produce formatting objects (FO), which then must be -# processed with an FO engine (e.g., through `pdfxmltex' command, -# which uses PassiveTex) to produce the PDF output. -# -# In this configuration and using default configuration settings, I've -# presented the following problems: -# -# 1. Something is wrong with headings. They are not expanded along -# the whole page-body. They seem to be rendered in a reduced width -# (1 inch approximatly). This provokes the heading to be broken in a -# two-to-five letters column and sometimes it overlaps the -# sectioning titles (e.g., chatper, section). I tried to customize -# the value of `header.column.widths' and `page.margin.top' but it -# seems to be not there where I need to touch. -# -# 2. TOC's indentation is not rendered. Even the `toc.indent.width' -# property is set to 24 by default. -# -# 3. Inside lists, when items are more than one line, the -# indentation seems to work for the first line only. All other -# lines in the same item are not indented and begin completly -# unaligned. -# -# 4. Long file paths near the end of page-body aren't hyphenated. -# Even the `hyphenate' property is set to `true' by default. -# -# In this configuration and using default configuration settings, I've -# presented the following advantages: -# -# 1. It is possible to produce localized PDF outputs through -# `xml2po', the default way of producing localized content inside -# the `centos-art.sh' script. -# -# To make the whole process transparent, a temporal directory is -# created for intermediate works and final files are moved then to -# their final location. -# -# Copyright (C) 2009, 2010, 2011 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 docbook_convertToPdfFromXml { - - # Print action message. - if [[ -f ${FILE}.sgml.pdf ]];then - cli_printMessage "${FILE}.xml.pdf" --as-updating-line - else - cli_printMessage "${FILE}.xml.pdf" --as-creating-line - fi - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define name of temporal directory where the DocBook to PDF - # transformation will take place. - local TMPDIR=$(cli_getTemporalFile "docbook2pdf") - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SRC=${INSTANCE} - - # Define absolute path to PDF target file. This is the final - # location the PDF file produced as result of DocBook to PDF - # transformation will be stored in. - local DST="${FILE}.xml.pdf" - - # Define file name of formatting object (.fo) file. This file is - # an intermediate file needed to produced the PDF. - local FO=$(basename ${FILE}).fo - - # Define file name of PDF file. This is the file we were looking - # for and the one moved, once produced. - local PDF=$(basename ${FILE}).pdf - - # Prepare XSL final instances used in transformations. - docbook_prepareStyles "${DOCBOOK_STYLES_DIR}/docbook2fo.xsl" - - # Verify temporal directory and create it if doesn't exist. - if [[ ! -d $TMPDIR ]];then - mkdir $TMPDIR - fi - - # Move inside temporal directory. - pushd $TMPDIR > /dev/null - - # Create formatting object supressing output from stderr. - xsltproc --output ${FO} ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null - - # Create PDF format from formatting object. The `pdfxmltex' - # command (which use the `PassiveTex' engine) must be executed - # twice in order for the document's cross references to be built - # correctly. - if [[ $? -eq 0 ]];then - pdfxmltex ${FO} > /dev/null - pdfxmltex ${FO} > /dev/null - else - cli_printMessage "`gettext "Cannot produce the formatting object."`" --as-error-line - fi - - # Verify `pdfxmltex' exit status and, if everything is ok, move - # PDF file from temporal directory to its target location. - if [[ $? -eq 0 ]];then - mv $PDF $DST - else - cli_printMessage "`gettext "Cannot produce the PDF file."`" --as-error-line - fi - - # Return to where we initially were. - popd > /dev/null - - # Remove temporal directory and temporal style instances created. - rm -r $TMPDIR - rm ${STYLE_INSTANCE[*]} - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_convertToText.sh b/Scripts/Functions/Render/Docbook/docbook_convertToText.sh deleted file mode 100755 index e1c86f7..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_convertToText.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# svg_convertToText.sh -- This function takes the XHTML file produced -# by docbook_convertToXhtml and produces one plain-text file (i.e., -# without markup inside). -# -# Copyright (C) 2009, 2010, 2011 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 docbook_convertToText { - - # Verify existence of HTML file. If `.xhtml' file doesn't exist - # don't create text file. The `.xhtml' file is required in order - # to create the `.txt' file. - if [[ ! -f ${FILE}.xhtml ]];then - return - fi - - local COMMAND='' - local OPTIONS='' - - # Define the command path to text-based web browser and options - # used to produce plain-text files. Most of these programs have a - # dump option that print formatted plain-text versions of given - # HTML file to stdout. - if [[ -x '/usr/bin/lynx' ]];then - COMMAND='/usr/bin/lynx' - OPTIONS='-force_html -nolist -width 70 -dump' - elif [[ -x '/usr/bin/elinks' ]];then - COMMAND='/usr/bin/elinks' - OPTIONS='-force_html -no-numbering -no-references -width 70 -dump' - elif [[ -x '/usr/bin/w3m' ]];then - COMMAND='/usr/bin/w3m' - OPTIONS='-dump' - fi - - if [[ $COMMAND != '' ]];then - - # Print action message. - if [[ -f ${FILE}.txt ]];then - cli_printMessage "${FILE}.txt" --as-updating-line - else - cli_printMessage "${FILE}.txt" --as-creating-line - fi - - # Convert from HTML to plain-text without markup. - ${COMMAND} ${OPTIONS} ${FILE}.xhtml > ${FILE}.txt - - else - cli_printMessage "`gettext "No way to convert from XHTML to plain-text found."`" --as-error-line - fi - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_convertToXhtml.sh b/Scripts/Functions/Render/Docbook/docbook_convertToXhtml.sh deleted file mode 100755 index 3d02c15..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_convertToXhtml.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# docbook_convertToXhtml.sh -- This function uses DocBook XML as input -# and applies XSL stylesheets to produce a big XHTML files as output. -# The procedure was taken from the documentation of -# `docbook-style-xsl-1.69.1-5.1' package, which says: ---To publish -# HTML from your XML documents, you just need an XSL engine.---. -# -# Copyright (C) 2009, 2010, 2011 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 docbook_convertToXhtml { - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Print action message. - if [[ -f ${FILE}.xhtml ]];then - cli_printMessage "${FILE}.xhtml" --as-updating-line - else - cli_printMessage "${FILE}.xhtml" --as-creating-line - fi - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SRC=${INSTANCE} - - # Define absolute path to PDF target file. This is the final - # location the PDF file produced as result of DocBook to PDF - # transformation will be stored in. - local DST="${FILE}.xhtml" - - # Prepare XSL final instances used in transformations. - docbook_prepareStyles $(cli_getFilesList \ - ${DOCBOOK_STYLES_DIR} --pattern='.*docbook2xhtml-(single|common)\.xsl') - - # Transform DocBook XML to XHTML supressing all stderr output. - xsltproc --output ${DST} ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null - - # Remove XSL instance files. - rm ${STYLE_INSTANCE[*]} - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_convertToXhtmlChunk.sh b/Scripts/Functions/Render/Docbook/docbook_convertToXhtmlChunk.sh deleted file mode 100755 index fe2c8fe..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_convertToXhtmlChunk.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# -# docbook_convertToXhtmlChunk.sh -- This function uses DocBook XML as -# input and applies XSL stylesheets to produce a directory with many -# XHTML files as output. The procedure was taken from the -# documentation of `docbook-style-xsl-1.69.1-5.1' package, which says: -# ---To publish HTML from your XML documents, you just need an XSLT -# engine.---. -# -# Copyright (C) 2009, 2010, 2011 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 docbook_convertToXhtmlChunk { - - local -a STYLE_TEMPLATE - local -a STYLE_INSTANCE - local STYLE_INSTANCE_FINAL='' - - # Define absolute path to PDF target file. This is the final - # location the PDF file produced as result of DocBook to PDF - # transformation will be stored in. - local DST="${FILE}-xhtml/" - - # Clean up output directory. This is required in order to prevent - # old files from remaining therein when they are no longer needed. - if [[ -d ${DST} ]];then - rm -r "${DST}" - fi - mkdir ${DST} - - # Print action message. - cli_printMessage "${FILE}-xhtml" --as-creating-line - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SRC=${INSTANCE} - - # Prepare XSL final instances used in transformations. - docbook_prepareStyles $(cli_getFilesList \ - ${DOCBOOK_STYLES_DIR} --pattern='.*docbook2xhtml-(chunks|common)\.xsl') - - # Transform DocBook XML to XHTML supressing all stderr output. - xsltproc --output ${DST} ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null - - # Remove XSL instance files. - rm ${STYLE_INSTANCE[*]} - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_doLastActions.sh b/Scripts/Functions/Render/Docbook/docbook_doLastActions.sh deleted file mode 100755 index 7009fec..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_doLastActions.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# docbook_doLastActions.sh -- This function performs last-rendition -# actions for DocBook files. These are the actions that take -# base-rendition and post-rendition output as input to produce output -# from it. -# -# Copyright (C) 2009, 2010, 2011 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 docbook_doLastActions { - - # Presently, there is no last-rendition action for DocBook base - # rendition but the function should exist for consistency with - # other backends. - return - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_doPostActions.sh b/Scripts/Functions/Render/Docbook/docbook_doPostActions.sh deleted file mode 100755 index d858b60..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_doPostActions.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# docbook_doPostActions.sh -- This function performs post-rendition -# actions for DocBook files. These are the actions that take -# base-rendition output as input to producing output from it. -# -# Copyright (C) 2009, 2010, 2011 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 docbook_doPostActions { - - docbook_convertToText - -} diff --git a/Scripts/Functions/Render/Docbook/docbook_prepareStyles.sh b/Scripts/Functions/Render/Docbook/docbook_prepareStyles.sh deleted file mode 100755 index 6a5f955..0000000 --- a/Scripts/Functions/Render/Docbook/docbook_prepareStyles.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# -# docbook_prepareStyles.sh -- This function prepares styles' final -# instances used in transformations based on XSL or DSL templates. -# There are translation markers inside the XSL and DSL templates that -# need to be expand before they be used for transformations. This -# function creates temporal instances of XSL and DSL templates with -# translation markers expanded inside so as for transformation -# commands (e.g., `xmltproc' or `openjade' through `docbook2pdf') to -# use as style defintion. -# -# Copyright (C) 2009, 2010, 2011 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 docbook_prepareStyles { - - local STYLE_TEMPLATE_FILE='' - local STYLE_TEMPLATE_FILES=$@ - local STYLE_INSTANCE_COMMON='' - local COUNT=0 - - for STYLE_TEMPLATE_FILE in $STYLE_TEMPLATE_FILES;do - - STYLE_TEMPLATE[((++${#STYLE_TEMPLATE[*]}))]="${STYLE_TEMPLATE_FILE}" - STYLE_INSTANCE[((++${#STYLE_INSTANCE[*]}))]="$(cli_getTemporalFile ${STYLE_TEMPLATE_FILE})" - - # Keep track of array's real index value. Remember, it starts - # at zero but counting starts at 1 instead. So, substracting 1 - # from counting we have the real index value we need to work - # with the information stored in the array. - COUNT=$(( ${#STYLE_INSTANCE[*]} - 1 )) - - # Create style instance from style template. - cp ${STYLE_TEMPLATE[$COUNT]} ${STYLE_INSTANCE[$COUNT]} - - # Define both final an common style instances based on style - # templates. - if [[ $STYLE_TEMPLATE_FILE =~ 'docbook2fo\.xsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[$COUNT]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2pdf\.dsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-(chunks|single)\.xsl$' ]];then - STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} - elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-common\.xsl$' ]];then - STYLE_INSTANCE_COMMON=${STYLE_INSTANCE[${COUNT}]} - fi - - done - - # Verify style final instance. This is the file used by - # transformation command (`xsltproc' or `openjade') to produce the - # specified output. We cannot continue without it. - cli_checkFiles $STYLE_INSTANCE_FINAL - - # Expand common translation markers in the common style instance, - # if it exists. - if [[ -f $STYLE_INSTANCE_COMMON ]];then - cli_expandTMarkers $STYLE_INSTANCE_COMMON - fi - - # Expand specific translation markers in final style instance. - sed -r -i "s!=STYLE_XHTML_COMMON=!${STYLE_INSTANCE_COMMON}!" ${STYLE_INSTANCE_FINAL} - -} diff --git a/Scripts/Functions/Render/Svg/svg.sh b/Scripts/Functions/Render/Svg/svg.sh deleted file mode 100755 index 0419479..0000000 --- a/Scripts/Functions/Render/Svg/svg.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# svg.sh -- This function performs base-rendition action for SVG -# files. -# -# Copyright (C) 2009, 2010, 2011 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 svg { - - # Initialize the export id used inside design templates. This - # value defines the design area we want to export. - local EXPORTID='CENTOSARTWORK' - - # Verify the export id. - svg_checkModelExportId "$INSTANCE" "$EXPORTID" - - # Check existence of external files. Inside design templates and - # their instances, external files are used to refere the - # background information required by the design template. If such - # background information is not available the image is produced - # without background information. This is something that need to - # be avoided. - svg_checkModelAbsref "$INSTANCE" - - # Render template instance using inkscape and save the output. - local INKSCAPE_OUTPUT="$(\ - inkscape $INSTANCE --export-id=$EXPORTID --export-png=${FILE}.png)" - - # Modify output from inkscape to fit the centos-art.sh script - # output visual style. - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Area' \ - | sed -r "s!^Area!`gettext "Area"`:!")" - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Background' \ - | sed -r "s!^Background (RRGGBBAA):(.*)!`gettext "Background"`: \1 \2!")" - cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Bitmap saved as' \ - | sed -r "s!^Bitmap saved as:!`gettext "Saved as"`:!")" - - # Perform backend post-rendition. - svg_doPostActions - - # Perform backend last-rendition. - svg_doLastActions - -} diff --git a/Scripts/Functions/Render/Svg/svg_checkColorAmount.sh b/Scripts/Functions/Render/Svg/svg_checkColorAmount.sh deleted file mode 100755 index 9012829..0000000 --- a/Scripts/Functions/Render/Svg/svg_checkColorAmount.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# svg_checkColorAmount.sh -- This function verifies whether the list -# of colors provided in the first argument matches the amount of -# colors specified by the second argument. -# -# Copyright (C) 2009, 2010, 2011 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 svg_checkColorAmount { - - # Define list of colors. - local COLORS=$1 - - # Define the amount of colors the list provided must have, in - # order to be considered as valid. - local NUMBER=$2 - - # Verify amount of colors provided in the list. - if [[ $(echo "$COLORS" | wc -l) -ne $NUMBER ]];then - cli_printMessage "`gettext "The palette does not have the correct number of colors."`" --as-error-line - fi - -} diff --git a/Scripts/Functions/Render/Svg/svg_checkColorFormats.sh b/Scripts/Functions/Render/Svg/svg_checkColorFormats.sh deleted file mode 100755 index 1f3dc74..0000000 --- a/Scripts/Functions/Render/Svg/svg_checkColorFormats.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# -# svg_checkColorFormats.sh -- This function verifies formats of colors -# (i.e., the way color information is specified). -# -# Copyright (C) 2009, 2010, 2011 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 svg_checkColorFormats { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='format:' - - # Initialize ARGUMENTS with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Initialize pattern used for color sanitation. - local PATTERN='^#[0-9a-f]{6}$' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --format ) - - case "$2" in - - rrggbb|*) - PATTERN='^#[0-9a-f]{6}$' - ;; - - esac - shift 2 - ;; - - -- ) - shift 1 - break - ;; - esac - done - - # Define the location we want to apply verifications to. - local COLOR='' - local COLORS="$@" - - # Loop through colors and perform format verification as specified - # by pattern. - for COLOR in $COLORS;do - - if [[ ! $COLOR =~ $PATTERN ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$COLOR\\\" string is not a valid color code."`" --as-error-line - fi - - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_checkModelAbsref.sh b/Scripts/Functions/Render/Svg/svg_checkModelAbsref.sh deleted file mode 100755 index 8ef23e7..0000000 --- a/Scripts/Functions/Render/Svg/svg_checkModelAbsref.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash -# -# svg_checkModelAbsref.sh -- This function retrives absolute files and -# checks their existence. In order for design templates to point -# different artistic motifs, design templates make use of external -# files which point to specific artistic motif background images. If -# such external files don't exist, try to create the background image -# required by cropping a higher background image (e.g., -# 2048x1536-final.png). If this isn't possible neither, then create -# the background image using a plain color and crop from it then. We -# can't go on without the required background information. -# -# Copyright (C) 2009, 2010, 2011 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 svg_checkModelAbsref { - - local FILE='' - local BG_DST_FILES='' - local BG_DST_FILE='' - local BG_DST_FILE_WIDTH='' - local BG_DST_FILE_HEIGHT='' - local BG_SRC_FILE='' - local BG_SRC_FILE_COLOR='' - local BG_SRC_FILE_WIDTH='' - local BG_SRC_FILE_HEIGHT='' - - # Define absolute path to the translated instance of design model. - FILE="$1" - - # Verify existence of file we need to retrive absolute paths from. - cli_checkFiles "$FILE" - - # Retrive absolute paths from file. - BG_DST_FILES=$(egrep "(sodipodi:absref|xlink:href)=\"${HOME}.+" $FILE \ - | sed -r "s,.+=\"(${HOME}.+\.png)\".*,\1," | sort | uniq) - - # Verify absolute paths retrived from file. - for BG_DST_FILE in $BG_DST_FILES;do - - # Print action message. - cli_printMessage "$BG_DST_FILE" --as-checking-line - - # Verify parent directory of absolute files retrived from - # file. This is required to prevent the construction of paths - # to locations that don't exist. For example, when including - # background images in SVG files, it is possible that the path - # information inside SVG files get outdated temporarly. If in - # that exact moment, you try to render the SVG file it won't - # be possible to create the image used for cropping because - # the path build from the location inside SVG file doesn't - # exist. In this case, centos-art.sh script will end up with - # `file ... doesn't exist' errors. - cli_checkFiles "$(dirname ${BG_DST_FILE})" -d - - if [[ ! -a $BG_DST_FILE ]];then - - # Define the source background file, the image file will - # crop when no specific background informatio be available - # for using. Generally, this is the most reusable - # background file inside the artistic motifs (e.g,. the - # `2048x1536-final.png' file). We can use this image file - # to create almost all artworks inside The CentOS - # Distribution visual manifestation when - # resolution-specific backgrounds don't exist. - BG_SRC_FILE=$(echo $BG_DST_FILE \ - | sed -r "s!(.+)/[[:digit:]]+x[[:digit:]]+(-final\.png)!\1/2048x1536\2!") - - # Verify existence of source background file. If the file - # doesn't exist create it using The CentOS Project default - # background color information, as specified in its - # corporate identity manual. - if [[ ! -f $BG_SRC_FILE ]];then - - # Define plain color that will be used as background. - BG_SRC_FILE_COLOR=$(svg_getColors) - - # Verify format of color value. - svg_checkColorFormats $BG_SRC_FILE_COLOR --format='rrggbb' - - # Define width for the source background file the - # required background information is cropped from. - BG_SRC_FILE_WIDTH=$(echo $BG_SRC_FILE \ - | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') - - # Define height for the source background file the - # required background information is cropped from. - BG_SRC_FILE_HEIGHT=$(echo $BG_SRC_FILE \ - | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') - - # Print action message. - cli_printMessage "${BG_SRC_FILE} ($BG_SRC_FILE_COLOR)" --as-creating-line - - # Create the source background file. - ppmmake -quiet ${BG_SRC_FILE_COLOR} \ - ${BG_SRC_FILE_WIDTH} ${BG_SRC_FILE_HEIGHT} \ - | pnmtopng > ${BG_SRC_FILE} - - fi - - # Print action message. - cli_printMessage "$BG_SRC_FILE" --as-cropping-line - - # Define the width of the required background information. - BG_DST_FILE_WIDTH=$(echo $BG_DST_FILE \ - | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') - - # Define the height of the required background information. - BG_DST_FILE_HEIGHT=$(echo $BG_DST_FILE \ - | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') - - # Create required backgrounnd information. - convert -quiet \ - -crop ${BG_DST_FILE_WIDTH}x${BG_DST_FILE_HEIGHT}+0+0 \ - ${BG_SRC_FILE} ${BG_DST_FILE} - - # Verify required background information. - cli_checkFiles $BG_DST_FILE - - fi - - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_checkModelExportId.sh b/Scripts/Functions/Render/Svg/svg_checkModelExportId.sh deleted file mode 100755 index 7d3a9fd..0000000 --- a/Scripts/Functions/Render/Svg/svg_checkModelExportId.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# svg_checkModelExportId.sh -- This function standardizes the export -# id used inside svg files and the way of verify them. -# -# Copyright (C) 2009, 2010, 2011 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 svg_checkModelExportId { - - local INSTANCE="$1" - local EXPORTID="$2" - - # Verify instance. - cli_checkFiles $INSTANCE - - # Verify export id. - if [[ $EXPORTID == '' ]];then - cli_printMessage "`gettext "The export id value cannot be empty."`" --as-error-line - fi - - # Check export id inside design templates. - grep "id=\"$EXPORTID\"" $INSTANCE > /dev/null - if [[ $? -gt 0 ]];then - cli_printMessage "`eval_gettext "There is not export id (\\\$EXPORTID) inside \\\"\\\$TEMPLATE\\\"."`" --as-error-line - fi - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertGplToHex.sh b/Scripts/Functions/Render/Svg/svg_convertGplToHex.sh deleted file mode 100755 index 48aa47e..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertGplToHex.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# svg_convertGplToHex.sh -- This function takes one palette produced -# by Gimp (e.g., syslinux.gpl) as input and outputs the list of -# hexadecimal colors and their respective index position the -# `pnmtolss16' program needs (e.g., #RRGGBB=0 #RRGGBB=1 ... [all -# values in the same line]). -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertGplToHex { - - # Define path to GPL palette. This is the .gpl file we use to - # retrive color information from. - local PALETTE_GPL="$1" - - # Define path to HEX palette. This is the palette used to stored - # the color information the `ppmtolss16' program needs. - local PALETTE_HEX="$2" - - # Define the number of colors this function should return. - local NUMBER="$3" - - # Define list of colors from GPL palette. - local COLORS=$(svg_getColors $PALETTE_GPL --head=$NUMBER --tail=$NUMBER) - - # Verify number of colors returned in the list. They must match - # exactly the amount specified, no more no less. Sometimes, the - # list of colors may have less colors than it should have, so we - # need to prevent such palettes from being used. - svg_checkColorAmount "$COLORS" "$NUMBER" - - # Verify format of colors. - svg_checkColorFormats "$COLORS" --format='rrggbb' - - # Create list of colors to be processed by `pnmtolss16'. - echo "$COLORS" | nl | gawk '{ printf "%s=%d ", $2, $1 - 1 }' \ - > $PALETTE_HEX - - # Verify HEX palette existence. - cli_checkFiles $PALETTE_HEX - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertGplToPpm.sh b/Scripts/Functions/Render/Svg/svg_convertGplToPpm.sh deleted file mode 100755 index a79ef38..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertGplToPpm.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# svg_convertGplToPpm.sh -- This function takes one palette produced -# by Gimp (e.g., syslinux.gpl) as input and outputs one PPM file based -# on it (e.g., syslinux.ppm). -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertGplToPpm { - - local -a FILES - local COUNT=0 - - # Define path to GPL palette. This is the .gpl file we use to - # retrive color information from. - local PALETTE_GPL="$1" - - # Define path to PPM palette. This is the .ppm file we'll save - # color information to. - local PALETTE_PPM="$2" - - # Define the number of colors this function should return. - local NUMBER="$3" - - # Define list of colors from GPL palette. - local COLOR='' - local COLORS=$(svg_getColors "$PALETTE_GPL" --head=$NUMBER --tail=$NUMBER --format='rrrggbb') - - # Verify amount of colors in the list of colors. - svg_checkColorAmount "$COLORS" "$NUMBER" - - # Verify format of colors. - svg_checkColorFormats $COLORS --format='rrggbb' - - # Create temporal images (of 1x1 pixel each) to store each color - # retrived from Gimp's palette. - for COLOR in $COLORS;do - FILES[$COUNT]=$(cli_getTemporalFile ${COUNT}.ppm) - ppmmake $COLOR 1 1 > ${FILES[$COUNT]} - COUNT=$(($COUNT + 1)) - done - - # Concatenate each temporal image from left to right to create the - # PPM file. - pnmcat -lr ${FILES[*]} > $PALETTE_PPM - - # Remove temporal images used to build the PPM palette file. - rm ${FILES[*]} - - # Verify PPM palette existence. - cli_checkFiles "$PALETTE_PPM" - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngTo.sh b/Scripts/Functions/Render/Svg/svg_convertPngTo.sh deleted file mode 100755 index 1216e10..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngTo.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# svg_convertPngTo.sh -- This function provides post-rendition actions -# to use the `convert' command of ImageMagick tool set. -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngTo { - - # Initialize image formats. - local FORMAT='' - local FORMATS=$(render_getConfigOption "$ACTION" '2') - - # Convert from PNG to specified formats. - for FORMAT in $FORMATS;do - cli_printMessage "${FILE}.${FORMAT}" --as-savedas-line - convert -quality 85 ${FILE}.png ${FILE}.${FORMAT} - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToBranded.sh b/Scripts/Functions/Render/Svg/svg_convertPngToBranded.sh deleted file mode 100755 index 00c16b1..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngToBranded.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToBranded.sh -- This function standardizes image -# branding. Once the base PNG image is rendered and the -# `--with-brands' option is provided, this function composites a new -# branded image using the preferences set in the `branding.conf' file. -# The `branding.conf' file must be stored in the design model root -# location used as reference to produce the base PNG image. -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToBranded { - - # Verify whether the option `--with-brands' was provided or not to - # `centos-art.sh' script command-line. - if [[ $FLAG_WITH_BRANDS == 'false' ]];then - return - fi - - local BRANDING_CONF_FILE='' - local BRANDING_CONF_SECTION='' - local BRANDING_CONF_VALUES='' - local BRANDING_CONF_VALUE='' - local BRAND='' - local POSITION='' - local POSITIONS='' - - # Define absolute path to branding configuration file. - BRANDING_CONF_FILE="$(cli_getRepoTLDir)/Identity/Models/Themes/${FLAG_THEME_MODEL}/branding.conf" - - # Define regular expression matching the variable name (i.e., the - # left column), inside the configuration line, you want to match - # on. - BRANDING_CONF_VARNAME=$(echo $TEMPLATE | cut -d/ -f10-) - - # Define list of configuration lines related to current design - # model. This are the lines that tell us how and where to apply - # branding information on base PNG image. Be sure that only - # configuration lines from supported section names (e.g., - # `symbol', `type', `logo') be read, no need to waste resources - # with others. - BRANDING_CONF_VALUES=$(\ - for BRANDING_CONF_SECTION in $(echo "types symbols logos");do - cli_getConfigValue "${BRANDING_CONF_FILE}" "${BRANDING_CONF_SECTION}" "${BRANDING_CONF_VARNAME}" - done) - - for BRANDING_CONF_VALUE in $BRANDING_CONF_VALUES;do - - # Define absolute path to image file used as brand. This is - # the image put over the PNG image produced as result of - # design models base rendition. - BRAND="$(cli_getRepoTLDir)/Identity/Images/Brands/$(echo $BRANDING_CONF_VALUE \ - | gawk 'BEGIN{ FS=":" } { print $1 }')" - - # Verify absolute path to image file used as brand. Assuming - # no brand image file is found, continue with the next - # configuration line. - if [[ ! -f $BRAND ]];then - continue - fi - - # Define list of positions using the format of ImageMagick - # `-geometry' option argument. - POSITIONS=$(echo "$BRANDING_CONF_VALUE" | cut -d: -f2- | tr ':' ' ') - - # Loop through list of brand image positions and use the - # composite command from ImageMagick, to overlap brand image - # over unbranded image just rendered. - for POSITION in $POSITIONS;do - composite -geometry $POSITION $BRAND ${FILE}.png ${FILE}.png - done - - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToBrands.sh b/Scripts/Functions/Render/Svg/svg_convertPngToBrands.sh deleted file mode 100755 index 75b41ab..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngToBrands.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToBrands.sh -- This function provides post-rendition -# actions to produce brand images in different sizes and formats from -# the same SVG design model. -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToBrands { - - # Define height dimensions you want to produce brands for. - local SIZE="" - local SIZES="16 20 22 24 32 36 38 40 48 64 72 78 96 112 124 128 148 164 196 200 512" - - # Define image formats you want to produce brands for. - local FORMAT="" - local FORMATS="xpm pdf jpg tif" - - for SIZE in ${SIZES};do - - # Redefine absolute path to file location where size-specific - # images will be stored in. - local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE) - - # Prepare directory where size-specific images will be stored - # in. If it doesn't exist create it. - if [[ ! -d $(dirname $FINALFILE) ]];then - mkdir -p $(dirname $FINALFILE) - fi - - # Print action message. - cli_printMessage "${FINALFILE}.png" --as-creating-line - - # Create size-specific PNG image ommiting all output. - inkscape $INSTANCE --export-id=$EXPORTID \ - --export-png=${FINALFILE}.png --export-height=${SIZE} \ - &> /dev/null - - for FORMAT in ${FORMATS};do - - # Print action message. - cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line - - # Convert size-specific PNG image into different formats. - convert ${FINALFILE}.png ${FINALFILE}.${FORMAT} - - done - - # Create copy of size-specific image in 2 colors. - cli_printMessage "${FINALFILE}.xbm" --as-creating-line - convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm - - # Create copy of size-specific image with emboss effect. - cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line - convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png - - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToDm.sh b/Scripts/Functions/Render/Svg/svg_convertPngToDm.sh deleted file mode 100755 index a2dd443..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngToDm.sh +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToDm.sh -- This function standardize production of -# display managers (e.g., Gdm and Kdm). This function copies all files -# needed into a temporal directory, realize expansion of translation -# markers and packs all the files into a tar.gz package that is used -# for installation. This function must be used as last-rendition -# action for Gdm and Kdm directory specific base-rendition actions. -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToDm { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Initialize source and destination local variables. - local SRC='' - local DST='' - - # Initialize display manager type. - local DM=$(render_getConfigOption "${ACTION}" '2') - - # Initialize screen resolutions used by display manager theme. - # These are the different screen resolutions a display manager - # theme is built for. The amount of screen resolution a display - # manager theme can be built for is limited to the amount of - # background files provided by the artistic motif used to build - # the display manager theme. - local RESOLUTION='' - local RESOLUTIONS=$(render_getConfigOption "${ACTION}" '3') - - # Verify screen resolutions. We cannot produce display manager - # theme if no screen resolution has been specified. - if [[ "$RESOLUTIONS" == '' ]];then - cli_printMessage "`gettext "There is no resolution information to process."`" --as-error-line - fi - - # Initialize theme information we are going to build the display - # manager theme for. - local THEME=$(cli_getPathComponent $ACTIONVAL --motif) - local THEME_NAME=$(cli_getPathComponent $ACTIONVAL --motif-name) - - # Initialize temporal directory where we collect all files needed - # in order to create the tar.gz file. This intermediate step is - # also needed in order to expand translation markers from XML and - # Desktop definitions. - local TMPDIR=$(cli_getTemporalFile 'dm') - - # Initialize source location for brands. This is the place where - # brand information, needed to build the display manager theme, is - # retrived from. - local BRANDS=$(cli_getRepoTLDir)/Identity/Images/Brands - - # Initialize source location for artistic motif's backgrounds. - # This is the place where background information needed to ubild - # the display manager theme is retrived from. - local BGS=$(cli_getRepoTLDir)/Identity/Images/Themes/${THEME}/Backgrounds/Img/Png - - # Initialize file variables. File variables are used build and - # process the file relation between source and target locations. - local FILE='' - local FILES='' - - # Define major release from template. - local MAJOR_RELEASE=$(cli_getPathComponent "$TEMPLATE" "--release-major") - - # Define file relation between source and target locations, based - # on whether we are producing GDM or KDM. Use the colon character - # (`:') as separator; on the left side we put the file's source - # location and in the right side the file's target location. - # Presently, both GDM and KDM are very similar on files with the - # exception that GDM does use icons near actions buttons (e.g., - # shutdown, reboot, session, language) and KDM doesn't. - case ${DM} in - - Gdm ) - FILES="\ - ${BRANDS}/Symbols/48/centos.png:centos-symbol.png - ${BRANDS}/Types/White/112/centos-${MAJOR_RELEASE}-msg.png:centos-release.png - ${OUTPUT}/screenshot.png:screenshot.png - $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml - $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop - $(dirname $TEMPLATE)/icon-language.png:icon-language.png - $(dirname $TEMPLATE)/icon-reboot.png:icon-reboot.png - $(dirname $TEMPLATE)/icon-session.png:icon-session.png - $(dirname $TEMPLATE)/icon-shutdown.png:icon-shutdown.png - " - ;; - - Kdm ) - FILES="\ - ${BRANDS}/Symbols/48/centos.png:centos-symbol.png - ${BRANDS}/Types/White/112/centos-${MAJOR_RELEASE}-msg.png:centos-release.png - ${OUTPUT}/screenshot.png:screenshot.png - $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml - $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop - " - ;; - - * ) - cli_printMessage "`eval_gettext "The \\\"\\\$DM\\\" display manager is not supported yet."`" --as-error-line - ;; - esac - - for FILE in $FILES;do - - # Define source location. - SRC=$(echo $FILE | cut -d: -f1) - - # Define target location. - DST=${TMPDIR}/${THEME_NAME}/$(echo $FILE | cut -d: -f2) - - # Verify source files. - cli_checkFiles $SRC - - # Verify parent directory for target file. - if [[ ! -d $(dirname $DST) ]];then - mkdir -p $(dirname $DST) - fi - - # Copy files from source to target location. - cp ${SRC} ${DST} - - # Expand translation markers. - if [[ ${DST} =~ "\.(xml|desktop)$" ]];then - cli_expandTMarkers "${DST}" - fi - - done - - # Move into temporal directory. - pushd $TMPDIR > /dev/null - - for RESOLUTION in $RESOLUTIONS;do - - # Verify background information. If it doesn't exist go on - # with the next one in the list. - if [[ ! -f $BGS/${RESOLUTION}-final.png ]];then - continue - fi - - # Print action message. - if [[ -f ${RESOLUTION}.tar.gz ]];then - cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-updating-line - else - cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-creating-line - fi - - # Copy background information. - cp $BGS/${RESOLUTION}-final.png ${THEME_NAME}/background.png - - # Create tar.gz file. - tar -czf ${RESOLUTION}.tar.gz ${THEME_NAME} - - # Move from temporal directory to its final location. - mv ${RESOLUTION}.tar.gz ${OUTPUT} - - done - - # Return to where we were initially. - popd > /dev/null - - # Remove temporal directory. - rm -r ${TMPDIR} - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToGrub.sh b/Scripts/Functions/Render/Svg/svg_convertPngToGrub.sh deleted file mode 100755 index 4ecdf4e..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngToGrub.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToGrub.sh -- This function provides post-rendition -# action used to produce GRUB images. -# -# Initially, the color information is defined with GIMP (The GNU Image -# Manipulation Program) as a `.gpl' palette of color. This palette of -# colors contains 14 colors only and is saved in a file named -# `grub.gpl. The `grub.gpl' file is used to build the `grub.ppm' file -# which provide the color information needed to reduce the full color -# PNG image, produced as result of SVG base-rendition, to the amount -# of colors specified (i.e., 14 colors). Later, with the 14 color PNG -# image already created, the `grub.ppm' file is used to build the -# `splash.xpm.gz' file. -# -# In order for this function to work, the `grub.gpl' file should have -# a format similar to the following: -# -# GIMP Palette -# Name: CentOS-TreeFlower-4-Syslinux -# Columns: 14 -# # -# 32 76 141 204c8d -# 36 82 146 245292 -# 52 93 152 345d98 -# 72 108 162 486ca2 -# 102 131 176 6683b0 -# 126 153 190 7e99be -# 146 170 200 92aac8 -# 161 182 209 a1b6d1 -# 182 199 219 b6c7db -# 202 214 228 cad6e4 -# 221 230 238 dde6ee -# 235 241 245 ebf1f5 -# 246 251 254 f6fbfe -# 254 255 252 fefffc -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToGrub { - - # Define number of colors the images will be produced on. - local COLORS='14' - - # Define options using those passed to actions from pre-rendition - # configuration script. These options are applied to pnmremap when - # doing color reduction, so any option available for pnmremap - # command can be passed to renderSyslinux functionality. - local OPTIONS=$(render_getConfigOption "$ACTION" '2-') - - # Check options passed to action. This is required in order to - # aviod using options used already in this script. For example - # -verbose and -mapfile options. - for OPTION in $OPTIONS;do - # Remove anything after equal sign inside option. - OPTION=$(echo -n $OPTION | cut -d'=' -f1) - if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line - fi - done - - # Define file name prefix. - local PREFIX="-${COLORS}c" - - # Redefine file name prefix using options as reference. This is - # useful to differenciate final files produced using - # Floyd-Steinberg dithering and files which are not. - if [[ "$OPTIONS" =~ '-floyd' ]];then - PREFIX="${PREFIX}-floyd" - fi - - # Define absolute path to GPL palette. This palettes should have - # 14 colors only. For more information on this see the GRUB's - # documentation. - local PALETTE_GPL=${MOTIF_DIR}/Palettes/grub.gpl - - # Verify GPL palette existence. If it doesn't exist copy the one - # provided by the design model through subversion (to keep track - # of the change) and expand translation markers in the copied - # instance. - if [[ ! -f $PALETTE_GPL ]];then - svn cp ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/grub.gpl ${PALETTE_GPL} - cli_expandTMarkers ${PALETTE_GPL} - fi - - # Define absolute path to PPM palette. The PPM palette is built - # from source palette (PALETTE_GPL) and provides the color - # information understood by `ppmremap', the program used to - # produce images in a specific amount of colors. - local PALETTE_PPM=$(cli_getTemporalFile "grub.ppm") - - # Create image in Netpbm superformat (PNM). The PNM image file is - # created from the PNG image rendered previously as centos-art - # base-rendition output. The PNM image is an intermediate format - # used to manipulate images through Netpbm tools. - cli_printMessage "${FILE}.pnm" --as-savedas-line - pngtopnm -verbose \ - < ${FILE}.png 2>${FILE}.log > ${FILE}.pnm - - # Print the path to GPL palette. - cli_printMessage "$PALETTE_GPL" --as-palette-line - - # Create PPM palette using GPL palette. - svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" - - # Reduce colors as specified in PPM palette. Here we use the PPM - # palette to enforce the color position in the image index and the - # Floyd-Steinberg dithering in order to improve color reduction. - cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line - pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ - < ${FILE}.pnm 2>>${FILE}.log > ${FILE}${PREFIX}.ppm - - # Remove PPM palette. It is no longer needed. - if [[ -f ${PALETTE_PPM} ]];then - rm $PALETTE_PPM - fi - - # Create the 14 colors xpm.gz file. - cli_printMessage "${FILE}${PREFIX}.xpm.gz" --as-savedas-line - ppmtoxpm \ - < ${FILE}${PREFIX}.ppm 2>>${FILE}.log > ${FILE}.xpm \ - && gzip --force ${FILE}.xpm \ - && mv ${FILE}.xpm.gz ${FILE}${PREFIX}.xpm.gz - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToIcons.sh b/Scripts/Functions/Render/Svg/svg_convertPngToIcons.sh deleted file mode 100755 index f63d7c5..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngToIcons.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToIcons.sh -- This function provides post-rendition -# actions to produce icon images in different sizes and formats from -# the same SVG design model. -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToIcons { - - # Define height dimensions you want to produce brands for. - local SIZE="" - local SIZES="16 20 22 24 32 36 40 48 64 96 128 148 164 196 200 512" - - # Define image formats you want to produce brands for. - local FORMAT="" - local FORMATS="" - - for SIZE in ${SIZES};do - - # Redefine absolute path to file location where size-specific - # images will be stored in. - local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE) - - # Prepare directory where size-specific images will be stored - # in. If it doesn't exist create it. - if [[ ! -d $(dirname $FINALFILE) ]];then - mkdir -p $(dirname $FINALFILE) - fi - - # Print action message. - cli_printMessage "${FINALFILE}.png" --as-creating-line - - # Create size-specific PNG image ommiting all output. - inkscape $INSTANCE --export-id=$EXPORTID \ - --export-png=${FINALFILE}.png --export-height=${SIZE} \ - &> /dev/null - - #for FORMAT in ${FORMATS};do - # - # # Print action message. - # cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line - # - # # Convert size-specific PNG image into different formats. - # convert ${FINALFILE}.png ${FINALFILE}.${FORMAT} - # - #done - - # Create copy of size-specific image in 2 colors. - #cli_printMessage "${FINALFILE}.xbm" --as-creating-line - #convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm - - # Create copy of size-specific image with emboss effect. - #cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line - #convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png - - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToKsplash.sh b/Scripts/Functions/Render/Svg/svg_convertPngToKsplash.sh deleted file mode 100755 index 6f7049f..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngToKsplash.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToKsplash.sh -- This function collects KDE splash -# (KSplash) required files and creates a tar.gz package that groups -# them all together. Use this function as last-rendition action for -# KSplash base-rendition action. -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToKsplash { - - local -a SRC - local -a DST - local FONT='' - local COUNT=0 - - # Define font used to print bottom splash message. - FONT=$(cli_getTTFont "DejaVuLGCSans-Bold") - - # Check existence of font file. - cli_checkFiles "$FONT" - - # Define absolute source location of files. - SRC[0]="${OUTPUT}/splash_top.png" - SRC[1]="${OUTPUT}/splash_active_bar.png" - SRC[2]="${OUTPUT}/splash_inactive_bar.png" - SRC[3]="${OUTPUT}/splash_bottom.png" - SRC[4]="$(dirname $TEMPLATE)/Theme.rc" - - # Check absolute source location of files. - cli_checkFiles "${SRC[@]}" - - # Define relative target location of files. - DST[0]="${OUTPUT}/splash_top.png" - DST[1]="${OUTPUT}/splash_active_bar.png" - DST[2]="${OUTPUT}/splash_inactive_bar.png" - DST[3]="${OUTPUT}/splash_bottom.png" - DST[4]="${OUTPUT}/Theme.rc" - - # Print action message. - cli_printMessage "${OUTPUT}/Preview.png" --as-creating-line - - # Create `Preview.png' image. - convert -append ${SRC[0]} ${SRC[1]} ${SRC[3]} ${OUTPUT}/Preview.png - - # Add bottom text to Preview.png image. The text position was set - # inside an image of 400x300 pixels. If you change the final - # preview image dimension, you probably need to change the text - # position too. - mogrify -draw 'text 6,295 "KDE is up and running."' \ - -fill \#ffffff \ - -font $FONT \ - ${OUTPUT}/Preview.png - - # Copy `Theme.rc' file. - cp ${SRC[4]} ${DST[4]} - - # Apply common translation markers to Theme.rc file. - cli_expandTMarkers "${DST[4]}" - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToSyslinux.sh b/Scripts/Functions/Render/Svg/svg_convertPngToSyslinux.sh deleted file mode 100755 index 548cb21..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngToSyslinux.sh +++ /dev/null @@ -1,184 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToSyslinux.sh -- This function provides post-rendition -# action used to produce LSS16 images, the images used by isolinux. -# -# Initially, the color information is defined with GIMP (The GNU Image -# Manipulation Program) as a `.gpl' palette of color. This palette of -# colors contains 16 colors only and is saved in a file named -# `syslinux.gpl. The `syslinux.gpl' file is used to build two other -# files: the `syslinux.ppm' file and the `syslinux.hex' file. The -# `syslinux.ppm' provides the color information needed to reduce the -# full color PNG image, produced as result of SVG base-rendition, to -# the amount of colors specified (i.e., 16 colors). Later, with the 16 -# color PNG image already created, the `syslinux.hex' file is used to -# build the LSS16 image. -# -# In order to produce images in LSS16 format correctly, it is required -# that both the `syslinux.ppm' and `syslinux.hex' files do contain the -# same color information. This is, both `syslinux.ppm' and -# `syslinux.hex' must represent the same color values and in the same -# color index. -# -# In order for this function to work, the `syslinux.gpl' file should -# have a format similar to the following: -# -# GIMP Palette -# Name: CentOS-TreeFlower-4-Syslinux -# Columns: 16 -# # -# 32 76 141 204c8d -# 37 82 146 255292 -# 52 94 153 345e99 -# 73 110 162 496ea2 -# 91 124 172 5b7cac -# 108 136 180 6c88b4 -# 120 146 186 7892ba -# 131 158 193 839ec1 -# 255 255 255 ffffff -# 146 170 200 92aac8 -# 162 182 209 a2b6d1 -# 183 199 219 b7c7db -# 204 216 230 ccd8e6 -# 221 229 238 dde5ee -# 235 241 245 ebf1f5 -# 246 251 254 f6fbfe -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToSyslinux { - - # Define number of colors the images will be produced on. - local COLORS='16' - - # Define options using those passed to actions from pre-rendition - # configuration script. These options are applied to pnmremap when - # doing color reduction, so any option available for pnmremap - # command can be passed to renderSyslinux functionality. - local OPTIONS=$(render_getConfigOption "$ACTION" '2-') - - # Check options passed to action. This is required in order to - # aviod using options already used in this script. For example - # -verbose and -mapfile options. - for OPTION in $OPTIONS;do - # Remove anything after equal sign inside option. - OPTION=$(echo $OPTION | cut -d'=' -f1) - if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then - cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line - fi - done - - # Define default file name prefix for 16 colors images. - local PREFIX="-${COLORS}c" - - # Re-define 16 colors images default file name prefix using - # options as reference. This is useful to differenciate final - # files produced using Floyd-Steinberg dithering and final files - # which are not. - if [[ "$OPTIONS" =~ '-floyd' ]];then - PREFIX="${PREFIX}-floyd" - fi - - # Define absolute path to GPL palette. The GPL palette defines the - # color information used to build syslinux images. This palette - # should be set to 16 colors and, as specified in isolinux - # documentation, the background color should be indexed on - # position 0 and the forground in position 7 (see - # /usr/share/doc/syslinux-X.XX/isolinux.doc, for more - # information.) - local PALETTE_GPL=${MOTIF_DIR}/Palettes/syslinux.gpl - - # Verify GPL palette existence. If it doesn't exist copy the one - # provided by the design model through subversion (to keep track - # of the change) and expand translation markers in the copied - # instance. - if [[ ! -f $PALETTE_GPL ]];then - svn cp ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL} - cli_expandTMarkers ${PALETTE_GPL} - fi - - # Define absolute path to PPM palette. The PPM palette is built - # from source palette (PALETTE_GPL) and provides the color - # information understood by `ppmremap', the program used to - # produce images in a specific amount of colors. - local PALETTE_PPM=$(cli_getTemporalFile "syslinux.ppm") - - # Define the HEX palette. The HEX palette is built from source - # palette (PALETTE_GPL) and provides the color information in the - # format understood by `ppmtolss16', the program used to produce - # images in LSS16 format. The HEX palette stores just one line - # with the color information as described in isolinux - # documentation (i.e #RRGGBB=0 #RRGGBB=1 ... [all values in the - # same line]) - local PALETTE_HEX=$(cli_getTemporalFile "syslinux.hex") - - # Create image in Netpbm superformat (PNM). The PNM image file is - # created from the PNG image rendered previously as centos-art - # base-rendition output. The PNM image is an intermediate format - # used to manipulate images through Netpbm tools. - cli_printMessage "${FILE}.pnm" --as-savedas-line - pngtopnm -verbose \ - < ${FILE}.png 2>${FILE}.log > ${FILE}.pnm - - # Print the path to GPL palette. - cli_printMessage "$PALETTE_GPL" --as-palette-line - - # Create PPM palette using GPL palette. - svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" - - # Create HEX palette using GPL palette. - svg_convertGplToHex "$PALETTE_GPL" "$PALETTE_HEX" "$COLORS" - - # Reduce colors as specified in PPM palette. Here we use the PPM - # palette to enforce the color position in the image index and the - # Floyd-Steinberg dithering in order to improve color reduction. - cli_printMessage "${FILE}${PREFIX}.pnm" --as-savedas-line - pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ - < ${FILE}.pnm 2>> ${FILE}.log > ${FILE}${PREFIX}.pnm - - # Create LSS16 image. - cli_printMessage "${FILE}${PREFIX}.lss" --as-savedas-line - ppmtolss16 $(cat $PALETTE_HEX) \ - < ${FILE}${PREFIX}.pnm 2>>${FILE}.log > ${FILE}${PREFIX}.lss - - # Remove HEX palette. It is no longer needed. - if [[ -f ${PALETTE_HEX} ]];then - rm $PALETTE_HEX - fi - - # Create the PPM image indexed to 16 colors. Also the colormap - # used in the LSS16 image is saved on ${FILE}.log; this is useful to - # verify the correct order of colors in the image index. - cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line - lss16toppm -map \ - < ${FILE}${PREFIX}.lss 2>>${FILE}.log > ${FILE}${PREFIX}.ppm - - # Create the 16 colors PNG image. - cli_printMessage "${FILE}${PREFIX}.png" --as-savedas-line - pnmtopng -verbose -palette=$PALETTE_PPM \ - < ${FILE}${PREFIX}.pnm 2>>${FILE}.log > ${FILE}${PREFIX}.png - - # Remove PPM palette. It is no longer needed. - if [[ -f ${PALETTE_PPM} ]];then - rm $PALETTE_PPM - fi - -} diff --git a/Scripts/Functions/Render/Svg/svg_convertPngToThumbnail.sh b/Scripts/Functions/Render/Svg/svg_convertPngToThumbnail.sh deleted file mode 100755 index 6e319e2..0000000 --- a/Scripts/Functions/Render/Svg/svg_convertPngToThumbnail.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# svg_convertPngToThumbnail.sh -- This function provides -# post-rendition to create thumbnails from images produced by -# centos-art base-rendition. Thumbnails are created in PNG and JPG -# format for you to decide which is the more appropriate one. When no -# size is specified, thumbnails are created at 250 pixels width and -# height is automatically calculated to match the image ratio. -# -# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToThumbnail { - - # Get image size. - local SIZE='' - local SIZES=$(render_getConfigOption "$ACTION" '2-') - - # Check image sizes and do convertion. - if [[ "$SIZES" == "" ]];then - SIZES='250' - fi - - # Check base file existence. - cli_checkFiles "${FILE}.png" - - # Create thumbnails. - for SIZE in $SIZES;do - cli_printMessage "${FILE}-thumb-${SIZE}.png" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}.png ${FILE}-thumb-${SIZE}.png - cli_printMessage "${FILE}-thumb-${SIZE}.jpg" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.jpg - cli_printMessage "${FILE}-thumb-${SIZE}.pdf" --as-savedas-line - convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.pdf - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_doLastActions.sh b/Scripts/Functions/Render/Svg/svg_doLastActions.sh deleted file mode 100755 index f28eef6..0000000 --- a/Scripts/Functions/Render/Svg/svg_doLastActions.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# svg_doLastActions.sh -- This function performs last-rendition -# actions for SVG files. -# -# Copyright (C) 2009, 2010, 2011 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 svg_doLastActions { - - # Verify position of file being produced in the list of files been - # currently processed. - if [[ $THIS_FILE_DIR == $NEXT_FILE_DIR ]];then - return - fi - - local ACTION='' - - # Redefine SVG last-rendition actions as local to avoid undesired - # concatenation when massive rendition is performed. - local -a LASTACTIONS - - # Define SVG directory-specific actions. This is required in order - # to provide a predictable way of producing content inside the - # repository and save you the time of writing long several - # commands each time you need to produce images inside the - # repository. - if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then - if [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Gdm/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Gdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Kdm/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Kdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Ksplash/.+\.svg$" ]];then - LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToKsplash:' - fi - fi - - # Define SVG last-rendition actions. Since last-rendition makes - # use of all files in the output directory structure and - # directory-specific rendition modifies all the files in the - # output directory structure as well, these actions must be - # defined after the directory-specific definition. Otherwise, - # modifications impossed by these actions may interfier the whole - # purpose of having a directory-specific rendition. - [[ $FLAG_LASTRENDITION != '' ]] && LASTACTIONS[((++${#LASTACTIONS[*]}))]="doLastActions:(png|jpg):${FLAG_LASTRENDITION}" - - # At this point centos-art.sh should be producing the last file - # from the same unique directory structure, so, before producing - # images for the next directory structure lets execute the list of - # last-rendition actions for the current directory structure. - for ACTION in "${LASTACTIONS[@]}"; do - svg_$(echo "$ACTION" | cut -d: -f1) - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_doLastCommand.sh b/Scripts/Functions/Render/Svg/svg_doLastCommand.sh deleted file mode 100755 index eae59b9..0000000 --- a/Scripts/Functions/Render/Svg/svg_doLastCommand.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# svg_doLastCommand.sh -- This function standardizes the way -# last-rendition commands are applied to base-rendition and -# post-rendition outputs. -# -# Copyright (C) 2009, 2010, 2011 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 svg_doLastCommand { - - # Define the file extensions. This value is a regular expression - # pattern which must match the file extensions that last-rendition - # actions will be applied to. - local EXTENSION=$(render_getConfigOption "$ACTION" '2') - - # Define the command string that will be evaluated as - # last-rendition action. Only commands that perform in-place - # modifications can be passed here. - local COMMAND=$(render_getConfigOption "$ACTION" '3-') - - # Define the list of files to process. This value contain all the - # files in the output directory which extension match the - # extension pattern previously defined. - local FILE='' - local FILES=$(cli_getFilesList $OUTPUT --pattern=".+\.${EXTENSION}") - - for FILE in $FILES;do - - # Identify file before processing it. Only formats recognized - # by ImageMagick are supported. In case the file isn't - # supported by ImageMagick, continue with the next file in the - # list. - identify -quiet ${FILE} > /dev/null - if [[ $? -ne 0 ]];then - continue - fi - - # Print action message. - cli_printMessage "${FILE}" --as-updating-line - - # Execute mogrify action on all files inside the same - # directory structure. - eval ${COMMAND} ${FILE} - - # Be sure the command was executed correctly. Otherwise stop - # script execution. - if [[ $? -ne 0 ]];then - exit - fi - - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_doPostActions.sh b/Scripts/Functions/Render/Svg/svg_doPostActions.sh deleted file mode 100755 index 1a10b2f..0000000 --- a/Scripts/Functions/Render/Svg/svg_doPostActions.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# -# svg_doPostActions.sh -- This function performs post-rendition -# actions for SVG files. -# -# Copyright (C) 2009, 2010, 2011 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 svg_doPostActions { - - local ACTION='' - - # Redefine SVG post-rendition actions as local to avoid undesired - # concatenation when massive rendition is performed. - local -a POSTACTIONS - - # Define default comment written to base-rendition output. - local COMMENT="`gettext "Created in CentOS Artwork Repository"` ($(cli_printUrl '--projects-artwork'))" - - # Define SVG post-rendition actions. Since these actions are - # applied to base-rendition output and base-rendition output is - # used as reference to perform directory-specific rendition, these - # action must be defined before directory-specific rendition. - # Otherwise it wouldn't be possible to propagate changes impossed - # by these actions to new files produced as result of - # directory-specific rendition. - POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:mogrify -comment '$COMMENT'" - [[ $FLAG_POSTRENDITION != '' ]] && POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:${FLAG_POSTRENDITION}" - - # Define SVG directory-specific rendition. Directory-specfic - # rendition provides a predictable way of producing content inside - # the repository. - if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then - - if [[ $TEMPLATE =~ 'trunk/Identity/(Models|Images)/Themes/.+\.svg$' ]];then - - POSTACTIONS[((++${#POSTACTIONS[*]}))]="convertPngToBranded" - - if [[ $TEMPLATE =~ "Backgrounds/.+\.svg$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='groupBy:png jpg' - - elif [[ $TEMPLATE =~ "Concept/.+\.svg$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToThumbnail:250' - - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Syslinux/.+\.svg$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:-floyd' - - elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Grub/.+\.svg$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:' - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:-floyd' - - elif [[ $TEMPLATE =~ "Posters/.+\.svg$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - fi - - elif [[ $TEMPLATE =~ "trunk/Identity/Models/Brands/.+\.svg$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToBrands' - - elif [[ $TEMPLATE =~ "trunk/Identity/Models/Icons/.+\.svg$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToIcons' - - elif [[ $TEMPLATE =~ "trunk/Identity/Models/Manuals.+\.svg$" ]];then - POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' - - fi - - fi - - # Execute SVG post-rendition actions. - for ACTION in "${POSTACTIONS[@]}"; do - svg_$(echo "$ACTION" | cut -d: -f1) - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_doPostCommand.sh b/Scripts/Functions/Render/Svg/svg_doPostCommand.sh deleted file mode 100755 index 10c7f4b..0000000 --- a/Scripts/Functions/Render/Svg/svg_doPostCommand.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# svg_doPostCommand.sh -- This function standardizes the way -# post-rendition commands are applied to base-rendition output. -# -# Copyright (C) 2009, 2010, 2011 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 svg_doPostCommand { - - # Define the file extension of base-rendition output. - local EXTENSION=$(render_getConfigOption "$ACTION" '2') - - # Define the command string. - local COMMAND=$(render_getConfigOption "$ACTION" '3-') - - # Verify the absolute path of base-rendition output. - cli_checkFiles ${FILE}.${EXTENSION} - - # Execute the command string on base-rendition output. - eval $COMMAND ${FILE}.${EXTENSION} - - # Be sure the command string was executed correctly. Otherwise - # stop the script execution. - if [[ $? -ne 0 ]];then - exit - fi - -} diff --git a/Scripts/Functions/Render/Svg/svg_getColors.sh b/Scripts/Functions/Render/Svg/svg_getColors.sh deleted file mode 100755 index f4dd076..0000000 --- a/Scripts/Functions/Render/Svg/svg_getColors.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/bash -# -# svg_getColors.sh -- This function takes one palette produced by Gimp -# (e.g., syslinux.gpl) as input and outputs a list of colors in the -# specified format. In order for this function to output the color in -# the format specified, it is needed that the fourth column in the gpl -# palette be set in the `rrggbb' format and the appropriate conversion -# be implemented here. -# -# Notice that using both the `--head' and `--tail' options it is -# possible to control how many consecutive items does the list of -# colors is going to have. It is possible to output all colors in the -# list, or a consecutive range of them. -# -# Copyright (C) 2009, 2010, 2011 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 svg_getColors { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='head:,tail:,format:' - - # Initialize ARGUMENTS with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Initialize both head and tail values to return the first line of - # color information from the palette. - local HEAD=1 - local TAIL=1 - - # Initialize format value used as default when no format option be - # provided. - local FORMAT='rrggbb' - - # Initialize list of colors. - local COLORS='' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --head ) - HEAD=$2 - shift 2 - ;; - - --tail ) - TAIL=$2 - shift 2 - ;; - - --format ) - FORMAT=$2 - shift 2 - ;; - - -- ) - shift 1 - break - ;; - esac - done - - # Define path to gpl palette. This is the first file we use to - # retrive color information from. Only the first file provided - # will be used. - local PALETTE=$(echo $@ | cut -d' ' -f1) - - if [[ $PALETTE == '' ]];then - - # Define palette path inside the theme's artistic motif. - local MOTIF_PALETTE=$(cli_getRepoTLDir)/Identity/Images/Themes/$(cli_getPathComponent $ACTIONVAL --motif)/Palettes/grub.gpl - - # Define palette path inside the theme's design model. - local MODEL_PALETTE=$(cli_getRepoTLDir)/Identity/Models/Themes/${THEME_MODEL_NAME}/Palettes/grub.gpl - - # Redefine default background color using palettes provided by - # artistic motif first, and design model later. Assuming none - # of them is present, use The CentOS Project default color - # then. - if [[ -f $MOTIF_PALETTE ]];then - COLORS=$(svg_getColors $MOTIF_PALETTE --head=1 --tail=1) - elif [[ -f $MODEL_PALETTE ]];then - COLORS=$(svg_getColors $MODEL_PALETTE --head=1 --tail=1) - else - COLORS='#204c8d' - fi - - else - - # Retrive the fourth column from GPL palette. The fourth - # column of a GPL palette contains the palette commentary - # field. The palette commentary field can be anything, but for - # the sake of our own convenience we use it to store the color - # value in hexadecimal format (e.g., rrggbb). Notice that you - # can put your comments from the fifth column on using an - # space as field separator. - COLORS=$(sed -r '1,/^#/d' $PALETTE \ - | awk '{ printf "%s\n", $4 }' | head -n $HEAD | tail -n $TAIL) - - fi - - # Implement color formats convertions from rrggbb to other formats - # that you might need to use. - for COLOR in $COLORS;do - - case $FORMAT in - - rrggbb|* ) - if [[ ! $COLOR =~ '^#' ]];then - COLOR="#${COLOR}" - fi - ;; - - esac - - # Output color value. - echo "$COLOR" - - done - -} diff --git a/Scripts/Functions/Render/Svg/svg_groupBy.sh b/Scripts/Functions/Render/Svg/svg_groupBy.sh deleted file mode 100755 index 1e747d8..0000000 --- a/Scripts/Functions/Render/Svg/svg_groupBy.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# svg_groupBy.sh -- This function provides post-rendition action to -# group files inside directories named as their file extensions. For -# example: if the current file is a .png file, it is moved inside a -# Png/ directory; if the current file is a .jpg file, it is stored -# inside a Jpg/ directory, and so on. -# -# For this function to work correctly, you need to specify which file -# type you want to group. This is done in the post-rendition ACTIONS -# array inside the appropriate `render.conf.sh' pre-configuration -# script. This function cannot be used as last-rendition action. -# -# Copyright (C) 2009, 2010, 2011 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 svg_groupBy { - - local SOURCE='' - local TARGET='' - - # Sanitate file types passed from render.conf.sh pre-rendition - # configuration script. - local FORMAT='' - local FORMATS=$(render_getConfigOption "$ACTION" '2-') - - for FORMAT in $FORMATS;do - - # Redifine source file we want to move. - SOURCE=${FILE}.${FORMAT} - - # Define target directory where source file will be moved - # into. - TARGET=$(dirname "$FILE")/$(cli_getRepoName $FORMAT -d) - - # Check existence of source file. - cli_checkFiles $SOURCE - - # Check existence of target directory. - if [[ ! -d $TARGET ]];then - mkdir -p $TARGET - fi - - # Redifine file path to add file and its type. - TARGET=${TARGET}/$(cli_getRepoName $FILE -f).${FORMAT} - - # Move file into its final location. - cli_printMessage "$TARGET" --as-movedto-line - mv ${SOURCE} ${TARGET} - - done - -} diff --git a/Scripts/Functions/Render/render.sh b/Scripts/Functions/Render/render.sh deleted file mode 100755 index 98b4180..0000000 --- a/Scripts/Functions/Render/render.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash -# -# render.sh -- This function initializes rendition variables and -# actions to centos-art.sh script. -# -# Copyright (C) 2009, 2010, 2011 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 render { - - local ACTIONNAM='' - local ACTIONVAL='' - - # Initialize `--releasever' option. The release version option - # controls the release number used to produce release-specific - # content. By default, the release number of The CentOS - # Distribution you have installed in your workstation is used. - local FLAG_RELEASEVER=$(cat /etc/redhat-release \ - | gawk '{ print $3 }') - - # Initialize `--basearch' option. The base architecture option - # controls the architecture type used to produce - # architecture-specific content. By default, the hardware - # platform of your workstation is used. - local FLAG_BASEARCH=$(uname -i) - - # Initialize `--theme-model' option. The theme model option - # specifies the the theme model name used to produce theme - # artistic motifs. - local FLAG_THEME_MODEL='Default' - - # Initialize `--post-rendition' option. This option defines what - # command to use as post-rendition. Post-rendition takes palce - # over base-rendition output. - local FLAG_POSTRENDITION='' - - # Initialize `--last-rendition' option. This option defines what - # command to use as last-rendition. Last-rendition takes palce - # once both base-rendition and post-rendition has been performed - # in the same directory structure. - local FLAG_LASTRENDITION='' - - # Initialize `--dont-dirspecific' option. This option can take two - # values only (e.g., `true' or `false') and controls whether to - # perform or not directory-specific rendition. Directory-specific - # rendition may use any of the three types of renditions (e.g., - # base-rendition, post-rendition and last-rendition) to accomplish - # specific tasks when specific directory structures are detected - # in the rendition flow. By default, the centos-art.sh script - # performs directory-specific rendition. - local FLAG_DONT_DIRSPECIFIC='false' - - # Initialize `--with-brands' option. This option controls whether - # to brand output images or not. By default output images are not - # branded. - local FLAG_WITH_BRANDS='false' - - # Initialize name of rendition backend as an empty value. The name - # of rendition backend is determined automatically based on - # template file extension, later, at rendition time. - local RENDER_BACKEND='' - - # Initialize absolute path to backend's base directory, the place - # where backend-specific directories are stored in. - local RENDER_BACKEND_DIR="${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" - - # Initialize list of supported file extensions. These file - # extensions are used by design model files, the files used as - # base-rendition input. In order for design model files to be - # correclty rendered, they must end with one of the file - # extensions listed here. - local RENDER_EXTENSIONS='svg docbook' - - # Interpret arguments and options passed through command-line. - render_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" - - # Define action value. We use non-option arguments to define the - # action value (ACTIONVAL) variable. - for ACTIONVAL in "$@";do - - # Check action value. Be sure the action value matches the - # convenctions defined for source locations inside the working - # copy. - ACTIONVAL=$(cli_checkRepoDirSource "$ACTIONVAL") - - # Syncronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_syncroRepoChanges - - # Define renderable directories and the way they are produced. - # To describe the way renderable directories are produced, we - # take the action value (ACTIONVAL) as reference and describe - # the production through an action name (ACTIONNAM). - if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Identity/Images/Themes" ]];then - ACTIONNAM="render_doThemeActions" - elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Identity/Images" ]];then - ACTIONNAM="render_doBaseActions" - elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Manuals" ]];then - ACTIONNAM="render_doBaseActions" - else - cli_printMessage "`gettext "The path provided doesn't support rendition."`" --as-error-line - fi - - # Execute action name. - ${ACTIONNAM} - - # Syncronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_syncroRepoChanges - - done - -} diff --git a/Scripts/Functions/Render/render_doBaseActions.sh b/Scripts/Functions/Render/render_doBaseActions.sh deleted file mode 100755 index cb493fc..0000000 --- a/Scripts/Functions/Render/render_doBaseActions.sh +++ /dev/null @@ -1,244 +0,0 @@ -#!/bin/bash -# -# render_doBaseActions.sh -- This function performs base-rendition -# action for all files. -# -# Copyright (C) 2009, 2010, 2011 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 render_doBaseActions { - - local -a FILES - local FILE='' - local OUTPUT='' - local TEMPLATE='' - local TEMPLATE_HAS_DOCTYPE='' - local PARENTDIR='' - local TRANSLATION='' - local EXTERNALFILE='' - local EXTERNALFILES='' - local THIS_FILE_DIR='' - local NEXT_FILE_DIR='' - local RENDER_EXTENSION='' - local COUNT=0 - - # Verify default directory where design models are stored in. - cli_checkFiles "$(cli_getRepoTLDir)/Identity/Models/Themes/${FLAG_THEME_MODEL}" --directory - - # Redefine parent directory for current workplace. - PARENTDIR=$(basename "${ACTIONVAL}") - - # Define base location of template files. - render_getDirTemplate - - # Loop through list of supported file extensions. - for RENDER_EXTENSION in ${RENDER_EXTENSIONS};do - - # Redefine name of rendition backend based on supported file - # extension. - if [[ $RENDER_EXTENSION == '^(svg|docbook)$' ]];then - RENDER_BACKEND=${RENDER_EXTENSION} - else - cli_printMessage "`eval_gettext "The \\\"\\\$RENDER_EXTENSION\\\" file extension is not supported yet."`" --as-error-line - fi - - # Define the list of files to process. Use an array variable - # to store the list of files to process. This make posible to - # realize verifications like: is the current base directory - # equal to the next one in the list of files to process? - # Questions like this is let us to know when centos-art.sh is - # leaving a directory structure and entering another. This - # information is required in order for centos-art.sh to know - # when to apply last-rendition actions. - # - # Another issue is that some directories might be named as if - # they were files (e.g., using a renderable extension like - # .docbook). In these situations we need to avoid such - # directories from being interpreted as a renderable file. For - # this, pass the `--type="f"' option when building the list of - # files to process in order to retrive regular files only. - # - # Another issue to consider here, is that in some cases both - # templates and outputs might be in the same location. In - # these cases localized content are stored in the same - # location where template files are retrived from and we need - # to avoid using localized content from being interpreted as - # design models. In that sake, supress language-specific files - # from the list of files to process. - # - # Another issue to consider here, is the way of filtering. We - # cannot expand the pattern specified by FLAG_FILTER with a - # `.*' here (e.g., "${FLAG_FILTER}.*\.${RENDER_EXTENSION}") - # because that would suppress any possibility from the user to - # specifiy just one file name in locations where more than one - # file with the same name as prefix exists (e.g., - # `repository.docbook', `repository-preamble.docbook' and - # `repository-parts.docbook'). Instead, pass filtering - # control to the user whom can use regular expression markup - # in the `--filter' option to decide whether to match - # `repository.docbook' only (e.g., through - # `--filter="repository"') or `repository-preamble.docbook' - # and `repository-parts.docbook' but not `repository.docbook' - # (e.g., through `--filter="repository-.*"'). - for FILE in $(cli_getFilesList ${TEMPLATE} \ - --pattern="${FLAG_FILTER}\.${RENDER_EXTENSION}" --type="f" \ - | egrep -v '/[[:alpha:]]{2}_[[:alpha:]]{2}/');do - FILES[((++${#FILES[*]}))]=$FILE - done - - # Verify list of files to process. Assuming no file is found, - # evaluate the next supported file extension. - if [[ ${#FILES[*]} -eq 0 ]];then - continue - fi - - # Initialize backend-specific functionalities. - cli_exportFunctions "${RENDER_BACKEND_DIR}/$(cli_getRepoName \ - ${RENDER_BACKEND} -d)" "${RENDER_BACKEND}" - - # Start processing the base rendition list of FILES. Fun part - # approching :-). - while [[ $COUNT -lt ${#FILES[*]} ]];do - - # Define base file. - FILE=${FILES[$COUNT]} - - # Define the base directory path for the current file being - # process. - THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) - - # Define the base directory path for the next file that will - # be process. - if [[ $(($COUNT + 1)) -lt ${#FILES[*]} ]];then - NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) - else - NEXT_FILE_DIR='' - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Define final location of translation file. - TRANSLATION=$(dirname $FILE \ - | sed -r 's!trunk/(Manuals|Identity)!trunk/L10n/\1!')/$(cli_getCurrentLocale)/messages.po - - # Define final location of template file. - TEMPLATE=${FILE} - - # Verify design models file existence. We cannot continue - # with out it. - if [[ ! -f $TEMPLATE ]];then - cli_printMessage "`gettext "The template file doesn't exist."`" --as-error-line - fi - - # Verify whether the design model uses DOCTYPE definition - # or not; and redefine related variable for further using. - egrep '^ /dev/null - TEMPLATE_HAS_DOCTYPE=$? - - # Validate design model before processing it. This step is - # very important in order to detect document's - # malformations and warn you about it, so you can correct - # them before processing the document as input. Notice - # that, here, validation is possible only for documents - # which have a DOCTYPE definition inside. - if [[ $TEMPLATE_HAS_DOCTYPE -eq 0 ]];then - - # Print action message. - cli_printMessage "$TEMPLATE" --as-validating-line - - # Validate document before processing it. - xmllint --valid --noent --noout $TEMPLATE - if [[ $? -ne 0 ]];then - cli_printMessage "`gettext "Validation failed."`" --as-error-line - fi - - else - # Print action message. - cli_printMessage "$TEMPLATE" --as-template-line - fi - - # Define final location of output directory. - render_getDirOutput - - # Get relative path to file. The path string (stored in - # FILE) has two parts: 1. the variable path and 2. the - # common path. The variable path is before the common - # point in the path string. The common path is after the - # common point in the path string. The common point is the - # name of the parent directory (stored in PARENTDIR). - # - # Identity/Models/Themes/.../Firstboot/3/splash-small.svg - # -------------------------^| the |^------------^ - # variable path | common | common path - # -------------------------v| point | v------------v - # Identity/Images/Themes/.../Firstboot/Img/3/splash-small.png - # - # What we do here is remove the varibale path, the common - # point, and the file extension parts in the string - # holding the path retrived from design models directory - # structure. Then we use the common path as relative path - # to store the the final image file. - # - # The file extension is removed from the common path - # because it is set when we create the final image file. - # This configuration let us use different extensions for - # the same file name. - # - # When we render using base-rendition action, the - # structure of files under the output directory will be - # the same used after the common point in the related - # design model directory structure. - FILE=$(echo ${FILE} \ - | sed -r "s!.*${PARENTDIR}/!!" \ - | sed -r "s/\.${RENDER_EXTENSION}$//") - - # Define absolute path to final file (without extension). - FILE=${OUTPUT}/$(basename "${FILE}") - - # Define instance name from design model. - INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) - - # Apply translation file to design model to produce the design - # model translated instance. - render_doTranslation - - # Expand translation markers inside design model instance. - cli_expandTMarkers ${INSTANCE} - - # Perform backend base-rendition. - ${RENDER_BACKEND} - - # Remove template instance. - if [[ -f $INSTANCE ]];then - rm $INSTANCE - fi - - # Increment file counter. - COUNT=$(($COUNT + 1)) - - done - - # Unset backend-specific functionalities. - cli_unsetFunctions "${RENDER_BACKEND_DIR}/$(cli_getRepoName \ - ${RENDER_BACKEND} -d)" "${RENDER_BACKEND}" - - done -} diff --git a/Scripts/Functions/Render/render_doThemeActions.sh b/Scripts/Functions/Render/render_doThemeActions.sh deleted file mode 100755 index df0db5e..0000000 --- a/Scripts/Functions/Render/render_doThemeActions.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/bash -# -# render_doThemeActions.sh -- This function performs theme-specific -# rendition. -# -# Copyright (C) 2009, 2010, 2011 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 render_doThemeActions { - - local -a DIRS - local COUNT=0 - local NEXT_DIR='' - local MOTIF_NAME='' - local MOTIF_DIR='' - - # Define base directory of artistic motifs. This is the location - # where all artistic motifs are stored in. - local MOTIF_BASEDIR="$(cli_getRepoTLDir $ACTIONVAL)/Identity/Images/Themes" - - # Define base directory of design models. This is the location - # where all design models are stored in. - local MODEL_BASEDIR="$(cli_getRepoTLDir $ACTIONVAL)/Identity/Models/Themes" - - # Define directory structure of design models. Design models - # directory structures are used as reference to create artistic - # motifs directory structure. Use the `--pattern' option to be - # sure any modification to FLAG_FILTER won't affect the output - # result. We need to make matching everything here, no matter what - # the FLAG_FILTER value be. - local MODEL_DIR='' - local MODEL_DIRS="$(cli_getFilesList ${MODEL_BASEDIR}/${FLAG_THEME_MODEL} \ - --pattern=".+" --type="d" | egrep -v '\.svn' | sed -r '/^[[:space:]]*$/d' | sed -r \ - "s!^.*/${FLAG_THEME_MODEL}/!!" | sed -r '/^[[:space:]]*$/d')" - - # Define design model regular expression patterns from design - # models directory structure. - local MODEL_PATTERN=$(echo "$MODEL_DIRS" | tr "\n" '|' \ - | sed -e 's!^|!!' -e 's!|$!!') - - # Define list of renderable directory structures inside the - # artistic motif. As reference, to build this list, use design - # model directory structure. Later, filter the result using the - # action value as reference to control what renderable directory - # structure to produce. The more specific you be in the path - # specification the more specific theme rendition will be. - local MOTIF_RENDERABLE_DIR='' - local MOTIF_RENDERABLE_DIRS=$(cli_getFilesList ${MOTIF_BASEDIR} \ - --pattern=".+/($MODEL_PATTERN)" --type="d" | grep "$ACTIONVAL") - - # Rebuild list of renderable directory structures using an array - # variable. This let us to predict what directory is one step - # forward or backward from the current directory structure. - for MOTIF_RENDERABLE_DIR in $MOTIF_RENDERABLE_DIRS;do - DIRS[((++${#DIRS[*]}))]=${MOTIF_RENDERABLE_DIR} - done - - # Define total number of directories to process. This is required - # in order to correct the counting value and so, make it to match - # the zero based nature of bash array variables. - local DIRS_TOTAL=$((${#DIRS[*]} - 1)) - - while [[ $COUNT -le ${DIRS_TOTAL} ]];do - - # Redefine action value to refer the theme-specific renderable - # directory. - ACTIONVAL=${DIRS[$COUNT]} - - # Refine artistic motif name using the current action value. - MOTIF_NAME=$(cli_getPathComponent $ACTIONVAL --motif) - - # Verify artistic motif name. The name of the artistic motif - # must be present in order for theme rendition to happen. - # Theme rendition takes place inside artistic motifs and the - # artistic motif name is an indispensable part of it. Take - # care of not using design models directory structure as name - # for artistic motifs. They, sometimes, match the pattern used - # to verify artistic motifs names but must not be confused. - if [[ $MOTIF_NAME == '' ]] || [[ $MOTIF_NAME =~ "^$MODEL_PATTERN" ]];then - COUNT=$(($COUNT + 1)) - continue - fi - - # Refine artistic motif directory. This is the top directory - # where all visual manifestations of an artistic motif are - # stored in (e.g., Backgrounds, Brushes, Concept, Distro, - # etc.). - MOTIF_DIR="${MOTIF_BASEDIR}/${MOTIF_NAME}" - - # Define what is the next directory in the list, so we could - # verify whether to render or not the current theme-specific - # renderable directory. - if [[ $COUNT -lt ${DIRS_TOTAL} ]];then - NEXT_DIR=$(dirname ${DIRS[(($COUNT + 1))]}) - else - NEXT_DIR='' - fi - - # Verify whether to render or not the current theme's - # renderable directory. This verification is needed in order - # to avoid unncessary rendition loops. For example, don't - # render `path/to/dir/A' when `path/to/dir/A/B' does exist, - # that configuration would produce `/path/to/dir/A/B twice. - if [[ $ACTIONVAL =~ '[[:digit:]]$' ]] || [[ $ACTIONVAL == $NEXT_DIR ]];then - COUNT=$(($COUNT + 1)) - continue - fi - - # Execute direct rendition on theme specific renderable - # directory as specified by action value. - render_doBaseActions - - # Increment counter to match the correct count value. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Scripts/Functions/Render/render_doTranslation.sh b/Scripts/Functions/Render/render_doTranslation.sh deleted file mode 100755 index d473f5c..0000000 --- a/Scripts/Functions/Render/render_doTranslation.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# -# render_doTranslation.sh -- This function standardizes the way -# translation files are applied to design models in order to produce -# the translated instance that is used to expand translation markers -# and produce the base-rendition output. -# -# Assuming no translation file exists, the an untranslated instace -# from the design model is created (i.e., just a copy of it). Using a -# design model instance (translated or not) is required in order to -# expand translation markers safetly. -# -# Copyright (C) 2009, 2010, 2011 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 render_doTranslation { - - # Verify translation file existence and create template - # instance accordingly. - if [[ -f ${TRANSLATION} ]];then - - # Print final location of translation file. - cli_printMessage "${TRANSLATION}" --as-translation-line - - # Create the translated instance of design model based on - # whether the template file has DOCTYPE definition or not. - if [[ ${TEMPLATE_HAS_DOCTYPE} -eq 0 ]];then - xmllint --valid --noent ${TEMPLATE} \ - | xml2po -a -l $(cli_getCurrentLocale) -p ${TRANSLATION} -o ${INSTANCE} - - else - xml2po -a -l $(cli_getCurrentLocale) -p ${TRANSLATION} -o ${INSTANCE} ${TEMPLATE} - fi - - # Remove .xml2po.mo temporal file. - if [[ -f ${PWD}/.xml2po.mo ]];then - rm ${PWD}/.xml2po.mo - fi - - else - - # Create the non-translated instance of design model. - if [[ ${TEMPLATE_HAS_DOCTYPE} -eq 0 ]];then - xmllint --valid --noent ${TEMPLATE} > ${INSTANCE} - else - cp ${TEMPLATE} ${INSTANCE} - fi - - fi - - # Verify instance existence. - cli_checkFiles $INSTANCE - -} diff --git a/Scripts/Functions/Render/render_getConfigOption.sh b/Scripts/Functions/Render/render_getConfigOption.sh deleted file mode 100755 index c79d864..0000000 --- a/Scripts/Functions/Render/render_getConfigOption.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# render_getConfigOption.sh -- This function standardizes the -# configuration fields are retrived from some action-specific -# definitions. -# -# Copyright (C) 2009, 2010, 2011 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 render_getConfigOption { - - # Initialize action string. - local ACTION="$1" - - # Initialize field definition. - local FIELD="$2" - - # Initialize configuration options. - local OPTION='' - - # Check action string. The action string must be present in order - # for this function to work. It provides the information needed to - # retrive configurantion options from. - if [[ "$ACTION" == '' ]];then - cli_printMessage "`gettext "There is no action string to work with."`" --as-error-line - fi - - # Check field definition. The field definition must match any of - # the formats specified by the `-f' option of `cut' command. - if [[ ! "$FIELD" =~ '^([0-9]+|[0-9]+-|-[0-9]+|[0-9]+-[0-9]+)$' ]];then - cli_printMessage "`gettext "The field definition is not valid."`" --as-error-line - fi - - # Get configuration option from action string. - OPTION=$(echo -n "$ACTION" | cut -d: -f${FIELD}) - - # Sanitate configuration option retrived from action string. - OPTION=$(echo -n "${OPTION}" \ - | sed -r 's!^ *!!g' \ - | sed -r 's!( |,|;) *! !g' \ - | sed -r 's! *$!!g') - - # Print out the configuration option retrived from action string, - # only if it is not an empty value. Do not use `echo' or `printf' - # built-in commands here. Use the `cli_printMessage' functionality - # instead. This is required in order to reverse the apostrophe - # codification accomplished when options were retrived from - # command-line (cli_parseArgumentsReDef) in the argument of - # options like `--post-rendition' and `--last-rendition'. - if [[ $OPTION != '' ]];then - cli_printMessage "$OPTION" --as-stdout-line - fi - -} diff --git a/Scripts/Functions/Render/render_getDirOutput.sh b/Scripts/Functions/Render/render_getDirOutput.sh deleted file mode 100755 index 8796d8f..0000000 --- a/Scripts/Functions/Render/render_getDirOutput.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# -# render_getDirOutput.sh -- This function defines the final -# absolute path the centos-art.sh script uses to store identity -# contents produced at rendition time. -# -# Copyright (C) 2009, 2010, 2011 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 render_getDirOutput { - - # Define base output directory using design model path as - # reference. - OUTPUT=$(dirname $FILE | sed -r \ - -e "s!/Themes/${FLAG_THEME_MODEL}!/Themes/$(cli_getPathComponent $ACTIONVAL --motif)!" \ - -e "s!/Models!/Images!" \ - -e "s!/Tpl!!") - - # By default rendered identity content is stored immediatly under - # identity entry structure, but if `Img/' directory exists use it - # instead. - if [[ -d "${OUTPUT}/Img" ]];then - OUTPUT=${OUTPUT}/Img - fi - - # Redefine base output directory to introduce specific information - # like release number and architecture. This information is - # require by directories (e.g., the `Media' directory inside - # themes and the `trunk/Manuals/Distro' directory ) whose need - # this information to be passed explicitly at the command-line - # through the `--releasever' and `--basearch' options. Other - # directories take such information from the path they are stored - # in (e.g., the `Distro/5/Anaconda' directory inside themes.). So, - # we need to differentiate the way information like release - # numbers and architectures are retrived in order to build the - # output path correctly at rendition time. - if [[ $OUTPUT =~ "^${MOTIF_DIR}/Media$" ]];then - OUTPUT=${OUTPUT}/${FLAG_RELEASEVER}/${FLAG_BASEARCH} - elif [[ $OUTPUT =~ 'trunk/Manuals/Distro$' ]];then - OUTPUT=${OUTPUT}/${FLAG_RELEASEVER} - else - OUTPUT=${OUTPUT} - fi - - # Define whether to use or not locale-specific directory to store - # content, using current locale information as reference. As - # convenction, when we produce content, only specific locations - # use locale-specific directories to organize language-specific - # content (e.g., Manuals, Anaconda, Installation media, etc.). All - # other locations do not use locale-specific directories to - # organize content. This convenction is important in order for - # the `prepare' functionality of centos-art.sh script to produce - # content in the correct location. Otherwise, we might end up - # duplicating content (e.g., icons, brands, etc.) which doesn't - # have any translation, nor any need to be translated. - if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then - if [[ $(cli_isLocalized $TEMPLATE) == 'true' ]];then - OUTPUT=${OUTPUT}/$(cli_getCurrentLocale) - fi - fi - - # Create final output directory, if it doesn't exist yet. - if [[ ! -d ${OUTPUT} ]];then - mkdir -p ${OUTPUT} - fi - -} diff --git a/Scripts/Functions/Render/render_getDirTemplate.sh b/Scripts/Functions/Render/render_getDirTemplate.sh deleted file mode 100755 index 1b0c2de..0000000 --- a/Scripts/Functions/Render/render_getDirTemplate.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# -# render_getDirTemplate.sh -- This function defines the way renderable -# directories are processed inside the repository. Inside the -# repository, renderable directories are processed either through -# direct or theme-specific rendition. -# -# Direct rendition takes one XML file from design model -# (`trunk/Identity/Models') directory structure and produces one file -# in `trunk/Identity/Images' directory strucutre. In this -# configuration, the organization used to stored the design model is -# taken as reference to build the path required to store the image -# related to it under `trunk/Identity/Images' directory structure. -# -# Theme-specific rendition takes one design model from -# `trunk/Identity/Models/Themes' directory structure to produce one or -# more images in `trunk/Identity/Images/Themes/$THEME/$VERSION/$MODEL' -# directory structure. In this configuration we have many different -# artistic motifs that use one unique design model directory structure -# as reference to produce images. -# -# Since theme design models are unified to be reused by more -# than one artistic motif, it is not possible to render artistic -# motifs in a lineal manner (i.e., as we do with direct rendition) -# because we need to establish the relation between the artistic motif -# renderable directory structure and the design model first and that -# relation happens when renderable directory structures inside -# artistic motifs are processed individually. -# -# In the first rendition category, we use a design model directory -# structure as reference to produce images one by one. In the second -# rendition category, we can't use the same procedure because one -# design model directory structure is used to produce several -# renderable directory structures, not just one. -# -# Copyright (C) 2009, 2010, 2011 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 render_getDirTemplate { - - # Initialize design models location used as reference to process - # renderable directory structures. - TEMPLATE=$ACTIONVAL - - # Sanitate design models location. Be sure design models do - # always point to trunk directory structure. This is useful to let - # `centos-art.sh' script do rendition under branches directory - # structure, reusing design models under trunk directory - # structure. - TEMPLATE=$(echo "$TEMPLATE" | sed "s!/branches/!/trunk/!") - - # Define absolute path to input files using absolute path from - # output files. - if [[ -d ${TEMPLATE}/Tpl ]];then - TEMPLATE=${TEMPLATE}/Tpl - else - TEMPLATE=$(echo "$TEMPLATE" | sed -r \ - -e "s!/Themes/$(cli_getPathComponent $ACTIONVAL --motif)!/Themes/${FLAG_THEME_MODEL}!" \ - -e "s!/Images!/Models!") - fi - - # Verify absolute path to input file. This verification is - # specially needed in those situations when the artistic motif - # directory structure has an organization different to that in - # design models directory structure. Since the path to design - # models is built from artistic motif directory structure, if - # artistic motifs directory structure is different from design - # model directory structure, as result we'll have a path to a - # design model that may not exist and that would make - # centos-art.sh script to fail. So, verify the absolute path to - # the input file and stop script execution if it doesn't exist. - cli_checkFiles $TEMPLATE - -} diff --git a/Scripts/Functions/Render/render_getOptions.sh b/Scripts/Functions/Render/render_getOptions.sh deleted file mode 100755 index 3464f6f..0000000 --- a/Scripts/Functions/Render/render_getOptions.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/bash -# -# render_getOptions.sh -- This function interprets option parameters -# passed to `render' functionality and calls actions accordingly. -# -# Copyright (C) 2009, 2010, 2011 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 render_getOptions { - - # Define short options we want to support. - local ARGSS="" - - # Define long options we want to support. - local ARGSL="filter:,quiet,answer-yes,dont-commit-changes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:,with-brands" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - - case "$1" in - - --filter ) - FLAG_FILTER="$2" - shift 2 - ;; - - --quiet ) - FLAG_QUIET="true" - FLAG_DONT_COMMIT_CHANGES="true" - shift 1 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --dont-commit-changes ) - FLAG_DONT_COMMIT_CHANGES="true" - shift 1 - ;; - - --dont-dirspecific ) - FLAG_DONT_DIRSPECIFIC="true" - shift 1 - ;; - - --post-rendition ) - FLAG_POSTRENDITION="$2" - shift 2 - ;; - - --last-rendition ) - FLAG_LASTRENDITION="$2" - shift 2 - ;; - - --basearch ) - FLAG_BASEARCH="$2" - if [[ ! $FLAG_BASEARCH =~ $(cli_getPathComponent --architecture-pattern) ]];then - cli_printMessage "`gettext "The architecture provided is not supported."`" --as-error-line - fi - shift 2 - ;; - - --releasever ) - FLAG_RELEASEVER="$2" - if [[ ! $FLAG_RELEASEVER =~ $(cli_getPathComponent --release-pattern) ]];then - cli_printMessage "`gettext "The release version provided is not supported."`" --as-error-line - fi - shift 2 - ;; - - --theme-model ) - FLAG_THEME_MODEL=$(cli_getRepoName $2 -d) - shift 2 - ;; - - --with-brands ) - FLAG_WITH_BRANDS='true' - 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 "$@" - - # Verify non-option arguments passed to command-line. If there - # isn't any, redefine the ARGUMENTS variable to use the current - # location the functionality was called from. - if [[ $ARGUMENTS == '' ]];then - ARGUMENTS=${PWD} - fi - -} diff --git a/Scripts/Functions/Tuneup/Shell/Config/topcomment.sed b/Scripts/Functions/Tuneup/Shell/Config/topcomment.sed deleted file mode 100644 index 0b3077f..0000000 --- a/Scripts/Functions/Tuneup/Shell/Config/topcomment.sed +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sed -# -# topcomment.sed -- This file standardizes the top comment inside -# centos-art.sh scripts. -# -# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG -# -# 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$ -# ---------------------------------------------------------------------- -/^# +Copyright .*$/a\ -# Copyright (C) =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER=\ -#\ -# 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.\ -#\ -# ---------------------------------------------------------------------- - -# Remove previous copyright notice, just to be sure the one above be -# used always. -/^# +Copyright .*$/,/^# -{70}$/{ -d -} - -# Remove more than one space after comments. -s/^# +/# / - -# Define script first line. -1c\ -#!/bin/bash diff --git a/Scripts/Functions/Tuneup/Shell/shell.sh b/Scripts/Functions/Tuneup/Shell/shell.sh deleted file mode 100755 index da719b2..0000000 --- a/Scripts/Functions/Tuneup/Shell/shell.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# shell.sh -- This function standardizes maintainance tasks for Shell -# script files. -# -# Copyright (C) 2009, 2010, 2011 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 shell { - - # Rebuild top comment inside shell scripts, mainly to update - # copyright information. - shell_doTopComment - -} diff --git a/Scripts/Functions/Tuneup/Shell/shell_doTopComment.sh b/Scripts/Functions/Tuneup/Shell/shell_doTopComment.sh deleted file mode 100755 index 259e948..0000000 --- a/Scripts/Functions/Tuneup/Shell/shell_doTopComment.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# shell_doTopComment.sh -- This function standardizes the top comment -# section inside shell scripts (*.sh) using a predefined template. -# -# Copyright (C) 2009, 2010, 2011 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 shell_doTopComment { - - # Define absolute path to template file. - local TEMPLATE="${TUNEUP_CONFIG_DIR}/topcomment.sed" - - # Check template file existence. - cli_checkFiles $TEMPLATE - - # Define file name to template instance. - local INSTANCE=$(cli_getTemporalFile $TEMPLATE) - - # Create template instance. - cp $TEMPLATE $INSTANCE - - # Check template instance. We cannot continue if template instance - # couldn't be created. - cli_checkFiles $INSTANCE - - # Expand translation markers in template instance. - cli_expandTMarkers $INSTANCE - - # Apply template instance to file. - sed -r -i -f $INSTANCE $FILE - - # Remove template instance. - if [[ -f ${INSTANCE} ]];then - rm ${INSTANCE} - fi - -} diff --git a/Scripts/Functions/Tuneup/Svg/Config/metadata.sed b/Scripts/Functions/Tuneup/Svg/Config/metadata.sed deleted file mode 100644 index 199c44d..0000000 --- a/Scripts/Functions/Tuneup/Svg/Config/metadata.sed +++ /dev/null @@ -1,64 +0,0 @@ -# This file is the metadata information used by CentOS Artwork SIG on -# its scalable vector graphics (SVG) files. This files is used with -# the regular expression '.*\.svg$' only. -# --------------------------------------------------- -# $Id$ -# --------------------------------------------------- -/\ - \ - \ - image/svg+xml\ - \ - \ - =TITLE=\ - =DATE=\ - \ - \ - =COPYRIGHT_HOLDER=\ - \ - \ - \ - \ - =COPYRIGHT_HOLDER=\ - \ - \ - \ - \ - =COPYRIGHT_HOLDER=\ - \ - \ - =URL=\ - =URL=\ - =URL=\ - =LOCALE=\ - \ - \ -=KEYWORDS=\ - \ - \ - =COPYRIGHT_HOLDER=\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - diff --git a/Scripts/Functions/Tuneup/Svg/svg.sh b/Scripts/Functions/Tuneup/Svg/svg.sh deleted file mode 100755 index b3e55d0..0000000 --- a/Scripts/Functions/Tuneup/Svg/svg.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# -# svg.sh -- This function standardizes maintainance of SVG files. -# -# Copyright (C) 2009, 2010, 2011 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 svg { - - # Update metadata information. - svg_doMetadata - - # Remove all unused items. - svg_doVacuumDefs - -} diff --git a/Scripts/Functions/Tuneup/Svg/svg_doMetadata.sh b/Scripts/Functions/Tuneup/Svg/svg_doMetadata.sh deleted file mode 100755 index da58c2f..0000000 --- a/Scripts/Functions/Tuneup/Svg/svg_doMetadata.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# -# svg_doMetadata.sh -- This function updates metadata values inside -# scalable vector graphic (SVG) files using default values from The -# CentOS Project. -# -# Copyright (C) 2009, 2010, 2011 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 svg_doMetadata { - - # Define template file name. - local TEMPLATE="${TUNEUP_CONFIG_DIR}/metadata.sed" - - # Check template file existence. - cli_checkFiles $TEMPLATE - - # Build title from file path. - local TITLE=$(basename "$FILE") - - # Build url from file path. - local URL=$(echo $FILE | sed 's!/home/centos!https://projects.centos.org/svn!') - - # Build keywords from file path. Do not include filename, it is - # already on title. - local KEY='' - local KEYS=$(dirname "$FILE" | cut -d/ -f6- | tr '/' '\n') - - # Build keywords using SVG standard format. Note that this - # information is inserted inside template file. The template file - # is a replacement set of sed commands so we need to escape the - # new line of each line using one backslash (\). As we are doing - # this inside bash, it is required to escape the backslash with - # another backslash so one of them passes literally to template - # file. - KEYS=$(\ - for KEY in $KEYS;do - echo " $KEY\\" - done) - - # Redefine template instance file name. - local INSTANCE=$(cli_getTemporalFile $TEMPLATE) - - # Create instance. - cp $TEMPLATE $INSTANCE - - # Check template instance. We cannot continue if the template - # instance couldn't be created. - cli_checkFiles $INSTANCE - - # Expand translation markers inside template instance. - sed -r -i \ - -e "s!=TITLE=!$TITLE!" \ - -e "s!=URL=!$URL!" \ - -e "s!=DATE=!$(date "+%Y-%m-%d")!" $INSTANCE - sed -i -r "/=KEYWORDS=/c\\${KEYS}" $INSTANCE - sed -i -r 's/>$/>\\/g' $INSTANCE - cli_expandTMarkers $INSTANCE - - # Update scalable vector graphic using template instance. - sed -i -f $INSTANCE $FILE - - # Remove template instance. - if [[ -f $INSTANCE ]];then - rm $INSTANCE - fi - - # Sanitate scalable vector graphic. - sed -i -r '/^[[:space:]]*$/d' $FILE - -} diff --git a/Scripts/Functions/Tuneup/Svg/svg_doVacuumDefs.sh b/Scripts/Functions/Tuneup/Svg/svg_doVacuumDefs.sh deleted file mode 100755 index 3a4ac2f..0000000 --- a/Scripts/Functions/Tuneup/Svg/svg_doVacuumDefs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# svg_doVacuumDefs.sh -- This function removes all unused items from -# the defs section of the SVG file. -# -# Copyright (C) 2009, 2010, 2011 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 svg_doVacuumDefs { - - # Vacuum unused svg definition using inkscape. - inkscape --vacuum-defs $FILE &> /dev/null - -} diff --git a/Scripts/Functions/Tuneup/Xhtml/Config/toc.awk b/Scripts/Functions/Tuneup/Xhtml/Config/toc.awk deleted file mode 100644 index 69c668f..0000000 --- a/Scripts/Functions/Tuneup/Xhtml/Config/toc.awk +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/gawk -# -# toc.awk -- This file provides the output format required by -# `xhtml_makeToc' function, inside centos-art.sh script, to produce -# the table of contents correctly. -# -# Copyright (C) 2009-2010 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Pubdtc License as pubdtshed 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 usefdl, but -# WITHOUT ANY WARRANTY; without even the impdted warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Pubdtc License for more details. -# -# You shodld have received a copy of the GNU General Pubdtc License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -BEGIN {FS=":"} - -{ - if ($1 == 0 && $2 == $3) { - opentags = "
" - closetags = "" - } - - if ($1 > 0 && $2 > $3) { - opentags = "
" - closetags = "" - } - - if ($1 > 0 && $2 == $3) { - opentags = "
" - closetags = "" - } - - if ($1 > 0 && $2 < $3) { - opentags = "" - for (i = 1; i <= ($3 - $2); i++) { - opentags = opentags "
" - closetags = "" - } - opentags = opentags "
" - } - - printf "%s%s%s\n",opentags,$4,closetags - -} - -END { - - if ($1 > 0 && $2 >= $3 && $3 > 1) { - for (i = 1; i <= $3; i++) { - print "
" - } - } - - if ($1 > 0 && $2 >= $3 && $3 == 1) { - print "" - print "" - } - - if ($1 > 0 && $2 < $3) { - for (i = 1; i <= $2; i++) { - print "" - } - } - - print "" -} diff --git a/Scripts/Functions/Tuneup/Xhtml/xhtml.sh b/Scripts/Functions/Tuneup/Xhtml/xhtml.sh deleted file mode 100755 index 201401a..0000000 --- a/Scripts/Functions/Tuneup/Xhtml/xhtml.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# xhtml.sh -- This function standardizes maintainance tasks of XHTML -# files. -# -# Copyright (C) 2009, 2010, 2011 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 xhtml { - - # Transforms xhtml headings to make them accessible (e.g., through - # a table of contents). - xhtml_doToc - -} diff --git a/Scripts/Functions/Tuneup/Xhtml/xhtml_doToc.sh b/Scripts/Functions/Tuneup/Xhtml/xhtml_doToc.sh deleted file mode 100755 index 314a310..0000000 --- a/Scripts/Functions/Tuneup/Xhtml/xhtml_doToc.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash -# -# xhtml_doToc.sh -- This functionality transforms web page headings to -# make them accessible through a table of contents. The table of -# contents is expanded in place, wherever the
-# piece of code be in the page. Once the
-# piece of code has be expanded, there is no need to put anything else -# in the page. -# -# In order for the tuneup functionality to transform headings, you -# need to put headings in just one line using one of the following -# forms: -# -#

Title

-#

Title

-#

Title

-# -# In the example above, h1 can vary from h1 to h6. Closing tag must be -# present and also match the openning tag. The value of `name' and -# `href' options from the anchor element are set dynamically using the -# md5sum output of combining the page location, the head- string and -# the heading string. -# -# Copyright (C) 2009, 2010, 2011 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 xhtml_doToc { - - # Define variables as local to avoid conflicts outside. - local COUNT=0 - local PREVCOUNT=0 - local -a FINAL - local -a TITLE - local -a MD5SM - local -a OPTNS - local -a CLASS - local -a LEVEL - local -a PARENT - local -a TOCENTRIES - local -a LINK - - # Define table of content configuration file, the file used to - # produce the table of content XHTML output code. - local TOC_CONFIG=${TUNEUP_CONFIG_DIR}/toc.awk - - # Verify table of content configuration file. - cli_checkFiles ${TOC_CONFIG} - - # Define html heading regular expression pattern. Use parenthisis - # to save html action name, action value, and heading title. - local PATTERN='(]>)(.*[^<])' - - # Verify list of html files. Are files really html files? If they - # don't, continue with the next one in the list. - if [[ ! $(file --brief $FILE) =~ '^(XHTML|HTML|XML)' ]];then - continue - fi - - # Define list of headings to process. When building the heading, - # it is required to change spaces characters from its current - # decimal output to something different (e.g., its \040 octal - # alternative). This is required because the space character is - # used as egrep default field separator and spaces can be present - # inside heading strings we don't want to separate. - for HEADING in $(egrep "$PATTERN" $FILE \ - | sed -r -e 's!^[[:space:]]+!!' -e "s! !\\\040!g");do - - # Define previous counter value using current counter - # value as reference. - if [[ $COUNT -ne 0 ]];then - PREVCOUNT=$(($COUNT-1)) - fi - - # Define initial heading information. - FIRST[$COUNT]=$(echo $HEADING | sed -r "s!\\\040! !g") - TITLE[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\4!") - MD5SM[$COUNT]=$(echo "${FILE}${FIRST[$COUNT]}" | md5sum | sed -r 's![[:space:]]+-$!!') - OPTNS[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\3!") - CLASS[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\2!") - LEVEL[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\1!") - PARENT[$COUNT]=${LEVEL[$PREVCOUNT]} - - # Transform heading information using initial heading - # information as reference. - if [[ ${OPTNS[$COUNT]} =~ '^$' ]];then - OPTNS[$COUNT]='' - elif [[ ${OPTNS[$COUNT]} =~ '^$' ]];then - OPTNS[$COUNT]='' - elif [[ ${OPTNS[$COUNT]} =~ '^$' ]];then - OPTNS[$COUNT]='' - fi - - # Build final html heading structure. - FINAL[$COUNT]=''${OPTNS[$COUNT]}${TITLE[$COUNT]}'' - - # Build html heading link structure. These links are used by - # the table of contents later. - LINK[$COUNT]=''${TITLE[$COUNT]}'' - - # Build table of contents entry with numerical - # identifications. The numerical identification is what we use - # to determine the correct position of each heading link on - # the table of content. - TOCENTRIES[$COUNT]="$COUNT:${LEVEL[$COUNT]}:${PARENT[$COUNT]}:${LINK[$COUNT]}" - - # Update heading information inside the current file being - # processed. Use the first and final heading information. - sed -i -r "s!${FIRST[$COUNT]}!${FINAL[$COUNT]}!" $FILE - - # Increase heading counter. - COUNT=$(($COUNT + 1)) - - done - - # Build the table of contents using heading numerical - # identifications as reference. The numerical identification - # describes the order of headings in one xhtml file. This - # information is processed by awk to make the appropriate - # replacements. Finnally, the result is stored in the TOC - # variable. - TOC=$(echo '
' - echo "

`gettext "Table of contents"`

" - for TOCENTRY in "${TOCENTRIES[@]}";do - echo $TOCENTRY - done \ - | awk -f ${TOC_CONFIG}) - - # Update table of contents inside the current file being - # processed. - sed -i -r '/
[^<\/div].*<\/div>/c'"$(echo -e $TOC)" $FILE - - # Clean up variables to receive the next file. - unset FINAL - unset TITLE - unset MD5SM - unset OPTNS - unset CLASS - unset LEVEL - unset PARENT - unset TOCENTRIES - unset LINK - -} diff --git a/Scripts/Functions/Tuneup/tuneup.sh b/Scripts/Functions/Tuneup/tuneup.sh deleted file mode 100755 index b4a9efb..0000000 --- a/Scripts/Functions/Tuneup/tuneup.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# -# tuneup.sh -- This function standardizes maintainance tasks for files -# inside the repository. Maintainance tasks are applied to files using -# file extension as reference. -# -# Copyright (C) 2009, 2010, 2011 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 tuneup { - - local ACTIONNAM='' - local ACTIONVAL='' - - # Initialize name of rendition backend as an empty value. The name - # of rendition backend is determined automatically based on - # template file extension, later, when files are processed. - local TUNEUP_BACKEND='' - - # Initialize absolute path to backend's base directory, the place - # where backend-specific directories are stored in. - 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. - local TUNEUP_EXTENSIONS='svg xhtml sh' - - # Interpret arguments and options passed through command-line. - tuneup_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" - - # Define action name. No matter what option be passed to - # centos-art, there is only one action to perform (i.e., build the - # list of files and interpretation of file extensions for further - # processing). - ACTIONNAM="tuneup_doBaseActions" - - # Define action value. We use non-option arguments to define the - # action value (ACTIONVAL) variable. - for ACTIONVAL in "$@";do - - # Check action value. Be sure the action value matches the - # convenctions defined for source locations inside the working - # copy. - ACTIONVAL=$(cli_checkRepoDirSource $ACTIONVAL) - - # Syncronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_syncroRepoChanges - - # Execute action name. - $ACTIONNAM - - # Syncronize changes between repository and working copy. At - # this point, changes in the repository are merged in the - # working copy and changes in the working copy committed up to - # repository. - cli_syncroRepoChanges - - done - -} diff --git a/Scripts/Functions/Tuneup/tuneup_doBaseActions.sh b/Scripts/Functions/Tuneup/tuneup_doBaseActions.sh deleted file mode 100755 index 232ee5c..0000000 --- a/Scripts/Functions/Tuneup/tuneup_doBaseActions.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# tuneup_doBaseActions.sh -- This function builds one list of files to -# process for each file extension supported and applies maintainance -# tasks file by file for each one of them. -# -# Copyright (C) 2009, 2010, 2011 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 tuneup_doBaseActions { - - local TUNEUP_CONFIG_DIR='' - local TUNEUP_BACKEND_DIR='' - local TUNEUP_BACKEND_INIT='' - local TUNEUP_EXTENSION='' - local FILE='' - local FILES='' - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Loop through list of supported file extensions. - for TUNEUP_EXTENSION in ${TUNEUP_EXTENSIONS};do - - # Define backend name based on supported file extensions. - TUNEUP_BACKEND="${TUNEUP_EXTENSION}" - - # Define absolute path to directory where backend-specific - # functionalities are stored in. - TUNEUP_BACKEND_DIR="${TUNEUP_BASEDIR}/$(cli_getRepoName \ - ${TUNEUP_BACKEND} -d)" - - # Define absolute path to backend initialization script. - TUNEUP_BACKEND_INIT="${TUNEUP_BACKEND_DIR}/$(cli_getRepoName ${TUNEUP_BACKEND} -f)" - - # Verify absolute path to backend initialization script. When - # a file extension is provided, but no backend initialization - # script exists for it, continue with the next file extension - # in the list. - if [[ ! -f ${TUNEUP_BACKEND_INIT} ]];then - continue - fi - - # Define absolute path to directory where backend-specific - # configurations are retrived from. - TUNEUP_CONFIG_DIR="${TUNEUP_BACKEND_DIR}/Config" - - # Build list of files to process using action value as - # reference. - FILES=$(cli_getFilesList ${ACTIONVAL} --pattern="${FLAG_FILTER}\.${TUNEUP_EXTENSION}") - - # Verify list of files to process. Assuming no file is found, - # evaluate the next supported file extension. - if [[ $FILES == '' ]];then - continue - fi - - # Export backend-specific functionalities up to the - # execution environment. - cli_exportFunctions "${TUNEUP_BASEDIR}/$(cli_getRepoName \ - ${TUNEUP_BACKEND} -d)" "${TUNEUP_BACKEND}" - - # Execute backend-specific maintainance tasks. - for FILE in $FILES;do - cli_printMessage "$FILE" --as-tuningup-line - ${TUNEUP_BACKEND} - done - - # Unset backend-specific functionalities from execution - # environment. This is required to prevent end up with more - # than one backend-specifc function initialization, in those - # cases when different template files are rendered in just one - # execution of `centos-art.sh' script. - cli_unsetFunctions "${TUNEUP_BASEDIR}/$(cli_getRepoName \ - ${TUNEUP_BACKEND} -d)" "${TUNEUP_BACKEND}" - - done - -} diff --git a/Scripts/Functions/Tuneup/tuneup_getOptions.sh b/Scripts/Functions/Tuneup/tuneup_getOptions.sh deleted file mode 100755 index 38aaf9b..0000000 --- a/Scripts/Functions/Tuneup/tuneup_getOptions.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -# -# tuneup_getOptions.sh -- This function interprets option parameters -# passed to `tuneup' functionality and calls actions accordingly. -# -# Copyright (C) 2009, 2010, 2011 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 tuneup_getOptions { - - # Define short options we want to support. - local ARGSS="" - - # Define long options we want to support. - local ARGSL="filter:,quiet,answer-yes,dont-commit-changes" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - - case "$1" in - - --filter ) - FLAG_FILTER="$2" - shift 2 - ;; - - --quiet ) - FLAG_QUIET="true" - FLAG_DONT_COMMIT_CHANGES="true" - shift 1 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --dont-commit-changes ) - FLAG_DONT_COMMIT_CHANGES="true" - 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 "$@" - - # Verify non-option arguments passed to command-line. If there - # isn't any, redefine the ARGUMENTS variable to use the current - # location the functionality was called from. - if [[ $ARGUMENTS == '' ]];then - ARGUMENTS=${PWD} - fi - -} diff --git a/Scripts/Functions/cli.sh b/Scripts/Functions/cli.sh deleted file mode 100755 index e9f1acb..0000000 --- a/Scripts/Functions/cli.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# -# cli.sh -- This function initiates centos-art command-line interface. -# Variables defined in this function are accesible by all other -# functions. The cli function is the first script executed by -# centos-art command-line onces invoked. -# -# Copyright (C) 2009, 2010, 2011 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 cli { - - # Initialize global variables. - local CLI_FUNCNAME='' - local CLI_FUNCDIR='' - local CLI_FUNCDIRNAM='' - local CLI_FUNCSCRIPT='' - local ARGUMENTS='' - - # Initialize default value to filter flag. The filter flag - # (--filter) is used mainly to reduce the number of files to - # process. The value of this variable is interpreted as - # egrep-posix regular expression. By default, everything matches. - local FLAG_FILTER='.+' - - # Initialize default value to verbosity flag. The verbosity flag - # (--quiet) controls whether centos-art.sh script prints messages - # or not. By default, all messages are printed out. - local FLAG_QUIET='false' - - # Initialize default value to answer flag. The answer flag - # (--answer-yes) controls whether centos-art.sh script does or - # does not pass confirmation request points. By default, it - # doesn't. - local FLAG_ANSWER='false' - - # Initialize default value to don't commit changes flag. The don't - # commit changes flag (--dont-commit-changes) controls whether - # centos-art.sh script syncronizes changes between the central - # repository and the working copy. By default, it does. - local FLAG_DONT_COMMIT_CHANGES='false' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Define function directory (CLI_FUNCDIR). The directory path where - # functionalities are stored inside the repository. - CLI_FUNCDIR=${CLI_BASEDIR}/Functions - - # Check function name. The function name is critical for - # centos-art.sh script to do something coherent. If it is not - # provided, execute the help functionality and end script - # execution. - if [[ "$1" == '' ]];then - exec ${CLI_BASEDIR}/centos-art.sh help - exit - fi - - # Define function name (CLI_FUNCNAME) variable from first command-line - # argument. As convenction we use the first argument to determine - # the exact name of functionality to call. - CLI_FUNCNAME=$(cli_getRepoName $1 -f) - - # Define function directory. - CLI_FUNCDIRNAM=$(cli_getRepoName $CLI_FUNCNAME -d) - - # Define function file name. - CLI_FUNCSCRIPT=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/${CLI_FUNCNAME}.sh - - # Check function script execution rights. - cli_checkFiles "${CLI_FUNCSCRIPT}" --execution - - # Remove the first argument passed to centos-art.sh command-line - # in order to build optional arguments inside functionalities. We - # start counting from second argument (inclusive) on. - shift 1 - - # Redefine ARGUMENTS using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Define default text editors used by centos-art.sh script. - if [[ ! "$EDITOR" =~ '/usr/bin/(vim|emacs|nano)' ]];then - EDITOR='/usr/bin/vim' - fi - - # Check text editor execution rights. - cli_checkFiles $EDITOR --execution - - # Go for function initialization. Keep the cli_exportFunctions - # function calling after all variables and arguments definitions. - cli_exportFunctions "${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" - - # Execute function. - eval $CLI_FUNCNAME - -} diff --git a/Scripts/Functions/cli_checkFiles.sh b/Scripts/Functions/cli_checkFiles.sh deleted file mode 100755 index 56df0bb..0000000 --- a/Scripts/Functions/cli_checkFiles.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/bash -# -# cli_checkFiles.sh -- This function standardizes the way file -# conditional expressions are applied inside centos-art.sh script. -# Here is where we answer questions like: is the file a regular file -# or a directory? or, is it a symbolic link? or even, does it have -# execution rights, etc. If the verification fails somehow at any -# point, an error message is output and centos-art.sh script ends its -# execution. -# -# More than one file can be passed to this function, so we want to -# process them all as specified by the options. Since we are using -# getopt output it is possible to determine where options and -# non-option arguments are in the list of arguments (e.g., options -# are on the left side of ` -- ' and non-options on the rigth side of -# ` -- '). Non-options are the files we want to verify and options how -# we want to verify them. -# -# Another issue to consider, when more than one file is passed to this -# function, is that we cannot shift positional parameters as we -# frequently do whe just one argument is passsed, doing so would -# annulate the validation for the second and later files passed to the -# function. So, in order to provide verification to all files passed -# to the function, the verification loop must be set individual for -# each option in this function. -# -# Assuming no option be passed to the function, a general verification -# is performed to determine whether or not the file exists without -# considering the file type just its existence. -# -# Copyright (C) 2009, 2010, 2011 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 cli_checkFiles { - - # Define short options. - local ARGSS='d,r,h,n,x,w' - - # Define long options. - local ARGSL='directory,regular-file,symbolic-link,execution,versioned,working-copy' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Initialize file variable as local to avoid conflicts outside - # this function scope. In the file variable will set the file path - # we'r going to verify. - local FILE='' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Define list of files we want to apply verifications to. - local FILES=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') - - # Verify files in the list. It is required at least one. - if [[ $FILES =~ '--$' ]];then - cli_printMessage "You need to provide one file at least." --as-error-line - fi - - # Look for options passed through positional parameters. - while true; do - - case "$1" in - - -d|--directory ) - for FILE in $(echo $FILES);do - if [[ ! -d $FILE ]];then - cli_printMessage "`eval_gettext "The directory \\\"\\\$FILE\\\" does not exist."`" --as-error-line - fi - done - shift 1 - ;; - - -f|--regular-file ) - for FILE in $(echo $FILES);do - if [[ ! -f $FILE ]];then - cli_printMessage "`eval_gettext "The file \\\"\\\$FILE\\\" is not a regular file."`" --as-error-line - fi - done - shift 1 - ;; - - -h|--symbolic-link ) - for FILE in $(echo $FILES);do - if [[ ! -h $FILE ]];then - cli_printMessage "`eval_gettext "The file \\\"\\\$FILE\\\" is not a symbolic link."`" --as-error-line - fi - done - shift 1 - ;; - - -n|--versioned ) - for FILE in $(echo $FILES);do - if [[ $(cli_isVersioned $FILE) == 'false' ]];then - cli_printMessage "`eval_gettext "The path \\\"\\\$FILE\\\" is not versioned."`" --as-error-line - fi - done - shift 1 - ;; - - -x|--execution ) - for FILE in $(echo $FILES);do - if [[ ! -x $FILE ]];then - cli_printMessage "`eval_gettext "The file \\\"\\\$FILE\\\" is not executable."`" --as-error-line - fi - done - shift 1 - ;; - - -w|--working-copy ) - for FILE in $(echo $FILES);do - if [[ ! $FILE =~ "^${CLI_WRKCOPY}/.+$" ]];then - cli_printMessage "`eval_gettext "The path \\\"\\\$FILE\\\" does not exist inside the working copy."`" --as-error-line - fi - done - shift 1 - ;; - - -- ) - for FILE in $(echo $FILES);do - if [[ ! -a $FILE ]];then - cli_printMessage "`eval_gettext "The path \\\"\\\$FILE\\\" does not exist."`" --as-error-line - fi - done - shift 1 - break - ;; - - esac - done - -} diff --git a/Scripts/Functions/cli_checkPathComponent.sh b/Scripts/Functions/cli_checkPathComponent.sh deleted file mode 100755 index 182850a..0000000 --- a/Scripts/Functions/cli_checkPathComponent.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# -# cli_checkPathComponent.sh -- This function checks parts/components -# from repository paths. -# -# Copyright (C) 2009, 2010, 2011 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 cli_checkPathComponent { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='release,architecture,motif' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Initialize file variable as local to avoid conflicts outside - # this function scope. In the file variable will set the file path - # we are going to verify. - local FILE='' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Define list of locations we want to apply verifications to. - local FILES=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') - - # Verify list of locations, it is required that one location be - # present in the list and also be a valid file. - if [[ $FILES == '--' ]];then - cli_printMessage "You need to provide one file at least." --as-error-line - fi - - # Look for options passed through positional parameters. - while true; do - - case "$1" in - - --release ) - for FILE in $(echo $FILES);do - if [[ ! $FILE =~ "^.+/$(cli_getPathComponent --release-pattern)/.*$" ]];then - cli_printMessage "`eval_gettext "The release \\\"\\\$FILE\\\" is not valid."`" --as-error-line - fi - done - shift 2 - break - ;; - - --architecture ) - for FILE in $(echo $FILES);do - if [[ ! $FILE =~ $(cli_getPathComponent --architecture-pattern) ]];then - cli_printMessage "`eval_gettext "The architecture \\\"\\\$FILE\\\" is not valid."`" --as-error-line - fi - done - shift 2 - break - ;; - - --motif ) - for FILE in $(echo $FILES);do - if [[ ! $FILE =~ $(cli_getPathComponent --motif-pattern) ]];then - cli_printMessage "`eval_gettext "The theme \\\"\\\$FILE\\\" is not valid."`" --as-error-line - fi - done - shift 2 - break - ;; - - -- ) - for FILE in $(echo $FILES);do - if [[ $FILE == '' ]] \ - || [[ $FILE =~ '(\.\.(/)?)' ]] \ - || [[ ! $FILE =~ '^[A-Za-z0-9\.:/_-]+$' ]]; then - cli_printMessage "`eval_gettext "The value \\\"\\\$FILE\\\" is not valid."`" --as-error-line - fi - done - shift 2 - break - ;; - - esac - done - -} diff --git a/Scripts/Functions/cli_checkRepoDirSource.sh b/Scripts/Functions/cli_checkRepoDirSource.sh deleted file mode 100755 index 7090848..0000000 --- a/Scripts/Functions/cli_checkRepoDirSource.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -# -# cli_checkRepoDirSource.sh -- This function provides input validation -# to repository entries considered as source locations. -# -# Copyright (C) 2009, 2010, 2011 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 cli_checkRepoDirSource { - - - # Define location in order to make this function reusable not just - # for action value variable but whatever value passed as first - # positional argument. - local LOCATION=$1 - - # Verify location. Assuming no location is passed as first - # positional parameter to this function, print an error message - # and stop script execution. - if [[ "$LOCATION" == '' ]];then - cli_printMessage "`gettext "The first positional parameter is required."`" --as-error-line - fi - - # Check action value to be sure strange characters are kept far - # away from path provided. - cli_checkPathComponent $LOCATION - - # Redefine source value to build repository absolute path from - # repository top level on. As we are removing - # /home/centos/artwork/ from all centos-art.sh output (in order to - # save horizontal output space), we need to be sure that all - # strings begining with trunk/..., branches/..., and tags/... use - # the correct absolute path. That is, you can refer trunk's - # entries using both /home/centos/artwork/trunk/... or just - # trunk/..., the /home/centos/artwork/ part is automatically added - # here. - if [[ $LOCATION =~ '^(trunk|branches|tags)' ]];then - LOCATION=${CLI_WRKCOPY}/$LOCATION - fi - - # Re-define source value to build repository absolute path from - # repository relative paths. This let us to pass repository - # relative paths as source value. Passing relative paths as - # source value may save us some typing; specially if we are stood - # a few levels up from the location we want to refer to as source - # value. There is no need to pass the absolute path to it, just - # refere it relatively. - if [[ -d ${LOCATION} ]];then - - # Add directory to the top of the directory stack. - pushd "$LOCATION" > /dev/null - - # Check directory existence inside the repository. - if [[ $(pwd) =~ "^${CLI_WRKCOPY}" ]];then - # Re-define source value using absolute path. - LOCATION=$(pwd) - else - cli_printMessage "`eval_gettext "The location \\\"\\\$LOCATION\\\" is not valid."`" --as-error-line - fi - - # Remove directory from the directory stack. - popd > /dev/null - - elif [[ -f ${LOCATION} ]];then - - # Add directory to the top of the directory stack. - pushd "$(dirname "$LOCATION")" > /dev/null - - # Check directory existence inside the repository. - if [[ $(pwd) =~ "^${CLI_WRKCOPY}" ]];then - # Re-define source value using absolute path. - LOCATION=$(pwd)/$(basename "$LOCATION") - else - cli_printMessage "`eval_gettext "The location \\\"\\\$LOCATION\\\" is not valid."`" --as-error-line - fi - - # Remove directory from the directory stack. - popd > /dev/null - - fi - - # Output sanitated location. - echo $LOCATION - -} diff --git a/Scripts/Functions/cli_checkRepoDirTarget.sh b/Scripts/Functions/cli_checkRepoDirTarget.sh deleted file mode 100755 index b688c12..0000000 --- a/Scripts/Functions/cli_checkRepoDirTarget.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# cli_checkRepoDirTarget.sh -- This function provides input validation -# to repository entries considered as target location. -# -# Copyright (C) 2009, 2010, 2011 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 cli_checkRepoDirTarget { - - local LOCATION="$1" - - # Redefine target value to build repository absolute path from - # repository top level on. As we are removing - # /home/centos/artwork/ from all centos-art.sh output (in order to - # save horizontal output space), we need to be sure that all - # strings begining with trunk/..., branches/..., and tags/... use - # the correct absolute path. That is, you can refer trunk's - # entries using both /home/centos/artwork/trunk/... or just - # trunk/..., the /home/centos/artwork/ part is automatically added - # here. - if [[ $LOCATION =~ '^(trunk|branches|tags)/.+$' ]];then - LOCATION=${CLI_WRKCOPY}/$LOCATION - fi - - # Print target location. - echo $LOCATION - -} diff --git a/Scripts/Functions/cli_commitRepoChanges.sh b/Scripts/Functions/cli_commitRepoChanges.sh deleted file mode 100755 index e3a7dc9..0000000 --- a/Scripts/Functions/cli_commitRepoChanges.sh +++ /dev/null @@ -1,170 +0,0 @@ -#!/bin/bash -# -# cli_commitRepoChanges.sh -- This function realizes a subversion -# commit command agains the workgin copy in order to send local -# changes up to central repository. -# -# Copyright (C) 2009, 2010, 2011 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 cli_commitRepoChanges { - - # Verify `--dont-commit-changes' option. - if [[ $FLAG_DONT_COMMIT_CHANGES == 'true' ]];then - return - fi - - local -a FILES - local -a INFO - local -a FILESNUM - local COUNT=0 - local STATUSOUT='' - local PREDICATE='' - local CHNGTOTAL=0 - local LOCATIONS='' - local LOCATION='' - - # Define source location the subversion status action will take - # place on. If arguments are provided use them as srouce location. - # Otherwise use action value as default source location. - if [[ "$@" != '' ]];then - LOCATIONS="$@" - else - LOCATIONS="$ACTIONVAL" - fi - - # 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 versioned - # status. Be sure to keep output files off from this list. - # Remember, output files are not versioned 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. - for LOCATION in $LOCATIONS;do - - # Don't process location outside of version control. - if [[ $(cli_isVersioned $LOCATION) == 'false' ]];then - continue - fi - - # Process location based on its path information. - if [[ $LOCATION =~ '(trunk/Manuals/Tcar-fs|branches/Manuals/Texinfo)' ]];then - STATUSOUT="$(svn status ${LOCATION} | egrep -v '(pdf|txt|xhtml|xml|docbook|bz2)$')\n$STATUSOUT" - elif [[ $LOCATION =~ 'trunk/Manuals' ]];then - STATUSOUT="$(svn status ${LOCATION} | egrep -v '(pdf|txt|xhtml)$')\n$STATUSOUT" - elif [[ $LOCATION =~ 'trunk/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 - - done - - # 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 fo files considered recent modifications from - # working copy up to central repository. - FILES[0]=$(echo "$STATUSOUT" | egrep "^M.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - FILES[1]=$(echo "$STATUSOUT" | egrep "^\?.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - FILES[2]=$(echo "$STATUSOUT" | egrep "^D.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - FILES[3]=$(echo "$STATUSOUT" | egrep "^A.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - - # 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]}" - - # Increase counter. - COUNT=$(($COUNT + 1)) - - done - - # Check total amount of changes and, if any, check differences and - # commit them up to central repository. - if [[ $CHNGTOTAL -gt 0 ]];then - - # Outout separator line. - cli_printMessage '-' --as-separator-line - - # In the very specific case unversioned files, we need to add - # them to the repository first, in order to make them - # available for subversion commands (e.g., `copy') Otherwise, - # if no unversioned file is found, go ahead with change - # differences and committing. Notice that if there is mix of - # changes (e.g., aditions and modifications), addition take - # preference and no other change is considered. In order - # for other changes to be considered, be sure no adition is - # present, or that they have already happened. - if [[ ${FILESNUM[1]} -gt 0 ]];then - - cli_printMessage "`ngettext "The following file is unversioned" \ - "The following files are unversioned" ${FILESNUM[1]}`:" - for FILE in ${FILES[1]};do - cli_printMessage "$FILE" --as-response-line - done - cli_printMessage "`ngettext "Do you want to add it now?" \ - "Do you want to add them now?" ${FILESNUM[1]}`" --as-yesornorequest-line - svn add ${FILES[1]} --quiet - - else - - # Verify changes on locations. - cli_printMessage "`gettext "Do you want to see changes now?"`" --as-yesornorequest-line - svn diff $LOCATIONS | less - - # Commit changes on locations. - cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line - svn commit $LOCATIONS - - fi - - fi - -} diff --git a/Scripts/Functions/cli_expandTMarkers.sh b/Scripts/Functions/cli_expandTMarkers.sh deleted file mode 100755 index 1bf6c1d..0000000 --- a/Scripts/Functions/cli_expandTMarkers.sh +++ /dev/null @@ -1,175 +0,0 @@ -#!/bin/bash -# -# cli_expandTMarkers.sh -- This function standardizes -# replacements for common translation markers. Raplacements are -# applied to temporal instances used to produce the final file. -# -# Copyright (C) 2009, 2010, 2011 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 cli_expandTMarkers { - - # Initialize variables. - local -a SRC - local -a DST - local COUNT=0 - local COUNTSRC=0 - local COUNTDST=0 - local LOCATION='' - - # Define source location on which sed replacements take place. - LOCATION="$1" - - # Verify file source location. - cli_checkFiles $LOCATION - - # Define copyright translation markers. - SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR_LAST=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year)" - SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year)" - SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR_LIST=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year-list)" - SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-holder)" - SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER_PREDICATE=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-holder-predicate)" - - # Define license translation markers. - SRC[((++${#SRC[*]}))]='=LICENSE=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license)" - SRC[((++${#SRC[*]}))]='=LICENSE_URL=' - DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license-url)" - - # Define theme translation markers. - SRC[((++${#SRC[*]}))]='=THEME=' - DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif)" - SRC[((++${#SRC[*]}))]='=THEMENAME=' - DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-name)" - SRC[((++${#SRC[*]}))]='=THEMERELEASE=' - DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-release)" - - # Define release-specific translation markers. - SRC[((++${#SRC[*]}))]='=RELEASE=' - DST[((++${#DST[*]}))]="$FLAG_RELEASEVER" - SRC[((++${#SRC[*]}))]='=MAJOR_RELEASE=' - DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f1)" - SRC[((++${#SRC[*]}))]='=MINOR_RELEASE=' - DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f2)" - - # Define architectures translation markers. - SRC[((++${#SRC[*]}))]='=ARCH=' - DST[((++${#DST[*]}))]="$(cli_getPathComponent $FLAG_BASEARCH --architecture)" - - # Define url translation markers. - SRC[((++${#SRC[*]}))]='=URL=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--home' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_WIKI=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--wiki' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_LISTS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--lists' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_FORUMS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--forums' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_MIRRORS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--mirrors' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_DOCS=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--docs' '--with-locale') - SRC[((++${#SRC[*]}))]='=URL_IRC=' - DST[((++${#DST[*]}))]=$(cli_printUrl '--irc') - - # Define emails translation markers. - SRC[((++${#SRC[*]}))]='=MAIL_DOCS=' - DST[((++${#DST[*]}))]="centos-docs@centos.org" - SRC[((++${#SRC[*]}))]='=MAIL_L10N=' - DST[((++${#DST[*]}))]="centos-l10n@centos.org" - - # Define locale translation markers. - SRC[((++${#SRC[*]}))]='=LOCALE_LL=' - DST[((++${#DST[*]}))]="$(cli_getCurrentLocale '--langcode-only')" - SRC[((++${#SRC[*]}))]='=LOCALE=' - DST[((++${#DST[*]}))]="$(cli_getCurrentLocale)" - - # Define domain translation markers for domains. - SRC[((++${#SRC[*]}))]='=DOMAIN_LL=' - if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then - DST[((++${#DST[*]}))]="$(cli_getCurrentLocale '--langcode-only')." - else - DST[((++${#DST[*]}))]="" - fi - - # Define repository translation markers. - SRC[((++${#SRC[*]}))]='=REPO_TLDIR=' - DST[((++${#DST[*]}))]="$(cli_getRepoTLDir)" - SRC[((++${#SRC[*]}))]='=REPO_HOME=' - DST[((++${#DST[*]}))]="${CLI_WRKCOPY}" - - # Do replacement of nested translation markers. - while [[ $COUNTDST -lt ${#DST[@]} ]];do - - # Verify existence of translation markers. If there is no - # translation marker on replacement, continue with the next - # one in the list. - if [[ ! ${DST[$COUNTDST]} =~ '=[A-Z_]+=' ]];then - # Increment destination counter. - COUNTDST=$(($COUNTDST + 1)) - # The current replacement value doesn't have translation - # marker inside, so skip it and evaluate the next - # replacement value in the list. - continue - fi - - while [[ $COUNTSRC -lt ${#SRC[*]} ]];do - - # Update replacements. - DST[$COUNTDST]=$(echo ${DST[$COUNTDST]} \ - | sed -r "s!${SRC[$COUNTSRC]}!${DST[$COUNTSRC]}!g") - - # Increment source counter. - COUNTSRC=$(($COUNTSRC + 1)) - - done - - # Reset source counter - COUNTSRC=0 - - # Increment destination counter. - COUNTDST=$(($COUNTDST + 1)) - - done - - # Apply replacements for translation markers. - while [[ ${COUNT} -lt ${#SRC[*]} ]];do - - # Use sed to replace translation markers inside the design - # model instance. - sed -r -i "s!${SRC[$COUNT]}!${DST[$COUNT]}!g" ${LOCATION} - - # Increment counter. - COUNT=$(($COUNT + 1)) - - done - - # Unset specific translation markers and specific replacement - # variables in order to clean them up. Otherwise, undesired values - # may ramain from one file to another. - unset SRC - unset DST - -} diff --git a/Scripts/Functions/cli_exportFunctions.sh b/Scripts/Functions/cli_exportFunctions.sh deleted file mode 100755 index 2a85602..0000000 --- a/Scripts/Functions/cli_exportFunctions.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# cli_exportFunctions.sh -- This function exports funtionalities to -# `centos-art.sh' script execution evironment. -# -# Copyright (C) 2009, 2010, 2011 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 cli_exportFunctions { - - # Define source location where function files are placed in. - local LOCATION=$1 - - # Define suffix used to retrive function files. - local SUFFIX=$2 - - # Verify suffix value used to retrive function files. Assuming no - # suffix value is passed as second argument to this function, use - # the function name value (CLI_FUNCNAME) as default value. - if [[ $SUFFIX == '' ]];then - SUFFIX=$CLI_FUNCNAME - fi - - # Define pattern used to retrive function names from function - # files. - local PATTERN="^function[[:space:]]+${SUFFIX}[[:alnum:]_]*[[:space:]]+{$" - - # Define list of files. - local FUNCFILE='' - local FUNCFILES=$(cli_getFilesList ${LOCATION} --pattern="${SUFFIX}.*\.sh" --maxdepth="1") - - # Verify list of files. If no function file exists for the - # location specified stop the script execution. Otherwise the - # script will surely try to execute a function that haven't been - # exported yet and report an error about it. - if [[ $FUNCFILES == '' ]];then - cli_printMessage "`gettext "No function file was found for this action."`" --as-error-line - fi - - # Process list of files. - for FUNCFILE in $FUNCFILES;do - - # Verify file execution rights. - cli_checkFiles $FUNCFILE --execution - - # Initialize file. - . $FUNCFILE - - # Export function names inside the file to current shell - # script environment. - export -f $(egrep "${PATTERN}" ${FUNCFILE} | gawk '{ print $2 }') - - done - -} diff --git a/Scripts/Functions/cli_getConfigLines.sh b/Scripts/Functions/cli_getConfigLines.sh deleted file mode 100755 index 248d4cf..0000000 --- a/Scripts/Functions/cli_getConfigLines.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# -# cli_getConfigLines.sh -- This function retrives configuration lines -# form configuration files. As arguments, the configuration file -# absolute path, the configuration section name, and the configuration -# variable name must be provided. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getConfigLines { - - # Initialize absolute path to configuration file. - local CONFIG_ABSPATH="$1" - - # Verify absolute path to configuration file. - cli_checkFiles ${CONFIG_ABSPATH} - - # Initialize configuration section name where the variable value - # we want to to retrive is set in. - local CONFIG_SECTION="$2" - - # Initialize variable name we want to retrive value from. - local CONFIG_VARNAME="$3" - - # Verify configuration variable name. When no variable name is - # provided print all configuration lines that can be considered - # as well-formed paths. Be sure configuration variable name starts - # just at the begining of the line. - if [[ ! $CONFIG_VARNAME =~ '^[[:alnum:]_./-]+$' ]];then - CONFIG_VARNAME='[[:alnum:]_./-]+=' - fi - - # Retrive configuration lines from configuration file. - local CONFIG_LINES=$(cat ${CONFIG_ABSPATH} \ - | egrep -v '^#' \ - | egrep -v '^[[:space:]]*$' \ - | sed -r 's![[:space:]]*!!g' \ - | sed -r -n "/^\[${CONFIG_SECTION}\]$/,/^\[/p" \ - | egrep -v '^\[' | sort | uniq \ - | egrep "^${CONFIG_VARNAME}") - - # Output value related to variable name. - echo "$CONFIG_LINES" - -} diff --git a/Scripts/Functions/cli_getConfigValue.sh b/Scripts/Functions/cli_getConfigValue.sh deleted file mode 100755 index 4b54ec6..0000000 --- a/Scripts/Functions/cli_getConfigValue.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# cli_getConfigValue.sh -- This function retrives configuration values -# from configuration files. As arguments, the configuration file -# absolute path, the configuration section name, and the configuration -# variable name must be provided. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getConfigValue { - - # Initialize absolute path to configuration file. - local CONFIG_ABSPATH="$1" - - # Initialize configuration section name where the variable value - # we want to to retrive is set in. - local CONFIG_SECTION="$2" - - # Initialize variable name we want to retrive value from. - local CONFIG_VARNAME="$3" - - # Retrive configuration lines from configuration file. - local CONFIG_LINES=$(cli_getConfigLines \ - "$CONFIG_ABSPATH" "$CONFIG_SECTION" "$CONFIG_VARNAME") - - # Parse configuration lines to retrive the values of variable - # names. - local CONFIG_VARVALUE=$(echo $CONFIG_LINES \ - | gawk 'BEGIN { FS="=" } { print $2 }' \ - | sed -r 's/^"(.*)"$/\1/') - - # Output values related to variable name. - echo "$CONFIG_VARVALUE" - -} diff --git a/Scripts/Functions/cli_getCountryCodes.sh b/Scripts/Functions/cli_getCountryCodes.sh deleted file mode 100755 index a521486..0000000 --- a/Scripts/Functions/cli_getCountryCodes.sh +++ /dev/null @@ -1,276 +0,0 @@ -#!/bin/bash -# -# cli_getCountryCodes.sh -- This function outputs a list with country -# codes as defined in ISO3166 standard. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getCountryCodes { - - local FILTER="$(echo $1 | cut -d_ -f2)" - - COUNTRYCODES='AD - AE - AF - AG - AI - AL - AM - AN - AO - AQ - AR - AS - AT - AU - AW - AZ - BA - BB - BD - BE - BF - BG - BH - BI - BJ - BM - BN - BO - BR - BS - BT - BV - BW - BY - BZ - CA - CC - CD - CF - CG - CH - CI - CK - CL - CM - CN - CO - CR - CS - CU - CV - CX - CY - CZ - DE - DJ - DK - DM - DO - DZ - EC - EE - EG - EH - ER - ES - ET - FI - FJ - FK - FM - FO - FR - GA - GB - GD - GE - GF - GH - GI - GL - GM - GN - GP - GQ - GR - GS - GT - GU - GW - GY - HK - HM - HN - HR - HT - HU - ID - IE - IL - IN - IO - IQ - IR - IS - IT - JM - JO - JP - KE - KG - KH - KI - KM - KN - KP - KR - KW - KY - KZ - LA - LB - LC - LI - LK - LR - LS - LT - LU - LV - LY - MA - MC - MD - MG - MH - MK - ML - MM - MN - MO - MP - MQ - MR - MS - MT - MU - MV - MW - MX - MY - MZ - NA - NC - NE - NF - NG - NI - NL - NO - NP - NR - NU - NZ - OM - PA - PE - PF - PG - PH - PK - PL - PM - PN - PR - PS - PT - PW - PY - QA - RE - RO - RU - RW - SA - SB - SC - SD - SE - SG - SH - SI - SJ - SK - SL - SM - SN - SO - SR - ST - SV - SY - SZ - TC - TD - TF - TG - TH - TJ - TK - TL - TM - TN - TO - TR - TT - TV - TW - TZ - UA - UG - UM - US - UY - UZ - VA - VC - VE - VG - VI - VN - VU - WF - WS - YE - YT - ZA - ZM - ZW' - - if [[ $FILTER != '' ]];then - echo $COUNTRYCODES | egrep "$FILTER" - else - echo "$COUNTRYCODES" - fi - -} diff --git a/Scripts/Functions/cli_getCountryName.sh b/Scripts/Functions/cli_getCountryName.sh deleted file mode 100755 index 0db8776..0000000 --- a/Scripts/Functions/cli_getCountryName.sh +++ /dev/null @@ -1,758 +0,0 @@ -#!/bin/bash -# -# cli_getCountryName.sh -- This function reads one language locale -# code in the format LL_CC and outputs the name of its related -# country. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getCountryName { - - local LOCALECODE="$(echo $1 | cut -d_ -f2)" - local COUNTRYNAME="" - - case $LOCALECODE in - - 'AD' ) - COUNTRYNAME="`gettext "Andorra"`" - ;; - 'AE' ) - COUNTRYNAME="`gettext "United Arab Emirates"`" - ;; - 'AF' ) - COUNTRYNAME="`gettext "Afghanistan"`" - ;; - 'AG' ) - COUNTRYNAME="`gettext "Antigua and Barbuda"`" - ;; - 'AI' ) - COUNTRYNAME="`gettext "Anguilla"`" - ;; - 'AL' ) - COUNTRYNAME="`gettext "Albania"`" - ;; - 'AM' ) - COUNTRYNAME="`gettext "Armenia"`" - ;; - 'AN' ) - COUNTRYNAME="`gettext "Netherlands Antilles"`" - ;; - 'AO' ) - COUNTRYNAME="`gettext "Angola"`" - ;; - 'AQ' ) - COUNTRYNAME="`gettext "Antarctica"`" - ;; - 'AR' ) - COUNTRYNAME="`gettext "Argentina"`" - ;; - 'AS' ) - COUNTRYNAME="`gettext "Samoa (American)"`" - ;; - 'AT' ) - COUNTRYNAME="`gettext "Austria"`" - ;; - 'AU' ) - COUNTRYNAME="`gettext "Australia"`" - ;; - 'AW' ) - COUNTRYNAME="`gettext "Aruba"`" - ;; - 'AZ' ) - COUNTRYNAME="`gettext "Azerbaijan"`" - ;; - 'BA' ) - COUNTRYNAME="`gettext "Bosnia and Herzegovina"`" - ;; - 'BB' ) - COUNTRYNAME="`gettext "Barbados"`" - ;; - 'BD' ) - COUNTRYNAME="`gettext "Bangladesh"`" - ;; - 'BE' ) - COUNTRYNAME="`gettext "Belgium"`" - ;; - 'BF' ) - COUNTRYNAME="`gettext "Burkina Faso"`" - ;; - 'BG' ) - COUNTRYNAME="`gettext "Bulgaria"`" - ;; - 'BH' ) - COUNTRYNAME="`gettext "Bahrain"`" - ;; - 'BI' ) - COUNTRYNAME="`gettext "Burundi"`" - ;; - 'BJ' ) - COUNTRYNAME="`gettext "Benin"`" - ;; - 'BM' ) - COUNTRYNAME="`gettext "Bermuda"`" - ;; - 'BN' ) - COUNTRYNAME="`gettext "Brunei"`" - ;; - 'BO' ) - COUNTRYNAME="`gettext "Bolivia"`" - ;; - 'BR' ) - COUNTRYNAME="`gettext "Brazil"`" - ;; - 'BS' ) - COUNTRYNAME="`gettext "Bahamas"`" - ;; - 'BT' ) - COUNTRYNAME="`gettext "Bhutan"`" - ;; - 'BV' ) - COUNTRYNAME="`gettext "Bouvet Island"`" - ;; - 'BW' ) - COUNTRYNAME="`gettext "Botswana"`" - ;; - 'BY' ) - COUNTRYNAME="`gettext "Belarus"`" - ;; - 'BZ' ) - COUNTRYNAME="`gettext "Belize"`" - ;; - 'CA' ) - COUNTRYNAME="`gettext "Canada"`" - ;; - 'CC' ) - COUNTRYNAME="`gettext "Cocos (Keeling) Islands"`" - ;; - 'CD' ) - COUNTRYNAME="`gettext "Congo (Dem. Rep.)"`" - ;; - 'CF' ) - COUNTRYNAME="`gettext "Central African Rep."`" - ;; - 'CG' ) - COUNTRYNAME="`gettext "Congo (Rep.)"`" - ;; - 'CH' ) - COUNTRYNAME="`gettext "Switzerland"`" - ;; - 'CI' ) - COUNTRYNAME="`gettext "Co^te d'Ivoire"`" - ;; - 'CK' ) - COUNTRYNAME="`gettext "Cook Islands"`" - ;; - 'CL' ) - COUNTRYNAME="`gettext "Chile"`" - ;; - 'CM' ) - COUNTRYNAME="`gettext "Cameroon"`" - ;; - 'CN' ) - COUNTRYNAME="`gettext "China"`" - ;; - 'CO' ) - COUNTRYNAME="`gettext "Colombia"`" - ;; - 'CR' ) - COUNTRYNAME="`gettext "Costa Rica"`" - ;; - 'CS' ) - COUNTRYNAME="`gettext "Serbia and Montenegro"`" - ;; - 'CU' ) - COUNTRYNAME="`gettext "Cuba"`" - ;; - 'CV' ) - COUNTRYNAME="`gettext "Cape Verde"`" - ;; - 'CX' ) - COUNTRYNAME="`gettext "Christmas Island"`" - ;; - 'CY' ) - COUNTRYNAME="`gettext "Cyprus"`" - ;; - 'CZ' ) - COUNTRYNAME="`gettext "Czech Republic"`" - ;; - 'DE' ) - COUNTRYNAME="`gettext "Germany"`" - ;; - 'DJ' ) - COUNTRYNAME="`gettext "Djibouti"`" - ;; - 'DK' ) - COUNTRYNAME="`gettext "Denmark"`" - ;; - 'DM' ) - COUNTRYNAME="`gettext "Dominica"`" - ;; - 'DO' ) - COUNTRYNAME="`gettext "Dominican Republic"`" - ;; - 'DZ' ) - COUNTRYNAME="`gettext "Algeria"`" - ;; - 'EC' ) - COUNTRYNAME="`gettext "Ecuador"`" - ;; - 'EE' ) - COUNTRYNAME="`gettext "Estonia"`" - ;; - 'EG' ) - COUNTRYNAME="`gettext "Egypt"`" - ;; - 'EH' ) - COUNTRYNAME="`gettext "Western Sahara"`" - ;; - 'ER' ) - COUNTRYNAME="`gettext "Eritrea"`" - ;; - 'ES' ) - COUNTRYNAME="`gettext "Spain"`" - ;; - 'ET' ) - COUNTRYNAME="`gettext "Ethiopia"`" - ;; - 'FI' ) - COUNTRYNAME="`gettext "Finland"`" - ;; - 'FJ' ) - COUNTRYNAME="`gettext "Fiji"`" - ;; - 'FK' ) - COUNTRYNAME="`gettext "Falkland Islands"`" - ;; - 'FM' ) - COUNTRYNAME="`gettext "Micronesia"`" - ;; - 'FO' ) - COUNTRYNAME="`gettext "Faeroe Islands"`" - ;; - 'FR' ) - COUNTRYNAME="`gettext "France"`" - ;; - 'GA' ) - COUNTRYNAME="`gettext "Gabon"`" - ;; - 'GB' ) - COUNTRYNAME="`gettext "Britain (UK)"`" - ;; - 'GD' ) - COUNTRYNAME="`gettext "Grenada"`" - ;; - 'GE' ) - COUNTRYNAME="`gettext "Georgia"`" - ;; - 'GF' ) - COUNTRYNAME="`gettext "French Guiana"`" - ;; - 'GH' ) - COUNTRYNAME="`gettext "Ghana"`" - ;; - 'GI' ) - COUNTRYNAME="`gettext "Gibraltar"`" - ;; - 'GL' ) - COUNTRYNAME="`gettext "Greenland"`" - ;; - 'GM' ) - COUNTRYNAME="`gettext "Gambia"`" - ;; - 'GN' ) - COUNTRYNAME="`gettext "Guinea"`" - ;; - 'GP' ) - COUNTRYNAME="`gettext "Guadeloupe"`" - ;; - 'GQ' ) - COUNTRYNAME="`gettext "Equatorial Guinea"`" - ;; - 'GR' ) - COUNTRYNAME="`gettext "Greece"`" - ;; - 'GS' ) - COUNTRYNAME="`gettext "South Georgia and the South Sandwich Islands"`" - ;; - 'GT' ) - COUNTRYNAME="`gettext "Guatemala"`" - ;; - 'GU' ) - COUNTRYNAME="`gettext "Guam"`" - ;; - 'GW' ) - COUNTRYNAME="`gettext "Guinea-Bissau"`" - ;; - 'GY' ) - COUNTRYNAME="`gettext "Guyana"`" - ;; - 'HK' ) - COUNTRYNAME="`gettext "Hong Kong"`" - ;; - 'HM' ) - COUNTRYNAME="`gettext "Heard Island and McDonald Islands"`" - ;; - 'HN' ) - COUNTRYNAME="`gettext "Honduras"`" - ;; - 'HR' ) - COUNTRYNAME="`gettext "Croatia"`" - ;; - 'HT' ) - COUNTRYNAME="`gettext "Haiti"`" - ;; - 'HU' ) - COUNTRYNAME="`gettext "Hungary"`" - ;; - 'ID' ) - COUNTRYNAME="`gettext "Indonesia"`" - ;; - 'IE' ) - COUNTRYNAME="`gettext "Ireland"`" - ;; - 'IL' ) - COUNTRYNAME="`gettext "Israel"`" - ;; - 'IN' ) - COUNTRYNAME="`gettext "India"`" - ;; - 'IO' ) - COUNTRYNAME="`gettext "British Indian Ocean Territory"`" - ;; - 'IQ' ) - COUNTRYNAME="`gettext "Iraq"`" - ;; - 'IR' ) - COUNTRYNAME="`gettext "Iran"`" - ;; - 'IS' ) - COUNTRYNAME="`gettext "Iceland"`" - ;; - 'IT' ) - COUNTRYNAME="`gettext "Italy"`" - ;; - 'JM' ) - COUNTRYNAME="`gettext "Jamaica"`" - ;; - 'JO' ) - COUNTRYNAME="`gettext "Jordan"`" - ;; - 'JP' ) - COUNTRYNAME="`gettext "Japan"`" - ;; - 'KE' ) - COUNTRYNAME="`gettext "Kenya"`" - ;; - 'KG' ) - COUNTRYNAME="`gettext "Kyrgyzstan"`" - ;; - 'KH' ) - COUNTRYNAME="`gettext "Cambodia"`" - ;; - 'KI' ) - COUNTRYNAME="`gettext "Kiribati"`" - ;; - 'KM' ) - COUNTRYNAME="`gettext "Comoros"`" - ;; - 'KN' ) - COUNTRYNAME="`gettext "St Kitts and Nevis"`" - ;; - 'KP' ) - COUNTRYNAME="`gettext "Korea (North)"`" - ;; - 'KR' ) - COUNTRYNAME="`gettext "Korea (South)"`" - ;; - 'KW' ) - COUNTRYNAME="`gettext "Kuwait"`" - ;; - 'KY' ) - COUNTRYNAME="`gettext "Cayman Islands"`" - ;; - 'KZ' ) - COUNTRYNAME="`gettext "Kazakhstan"`" - ;; - 'LA' ) - COUNTRYNAME="`gettext "Laos"`" - ;; - 'LB' ) - COUNTRYNAME="`gettext "Lebanon"`" - ;; - 'LC' ) - COUNTRYNAME="`gettext "St Lucia"`" - ;; - 'LI' ) - COUNTRYNAME="`gettext "Liechtenstein"`" - ;; - 'LK' ) - COUNTRYNAME="`gettext "Sri Lanka"`" - ;; - 'LR' ) - COUNTRYNAME="`gettext "Liberia"`" - ;; - 'LS' ) - COUNTRYNAME="`gettext "Lesotho"`" - ;; - 'LT' ) - COUNTRYNAME="`gettext "Lithuania"`" - ;; - 'LU' ) - COUNTRYNAME="`gettext "Luxembourg"`" - ;; - 'LV' ) - COUNTRYNAME="`gettext "Latvia"`" - ;; - 'LY' ) - COUNTRYNAME="`gettext "Libya"`" - ;; - 'MA' ) - COUNTRYNAME="`gettext "Morocco"`" - ;; - 'MC' ) - COUNTRYNAME="`gettext "Monaco"`" - ;; - 'MD' ) - COUNTRYNAME="`gettext "Moldova"`" - ;; - 'MG' ) - COUNTRYNAME="`gettext "Madagascar"`" - ;; - 'MH' ) - COUNTRYNAME="`gettext "Marshall Islands"`" - ;; - 'MK' ) - COUNTRYNAME="`gettext "Macedonia"`" - ;; - 'ML' ) - COUNTRYNAME="`gettext "Mali"`" - ;; - 'MM' ) - COUNTRYNAME="`gettext "Myanmar (Burma)"`" - ;; - 'MN' ) - COUNTRYNAME="`gettext "Mongolia"`" - ;; - 'MO' ) - COUNTRYNAME="`gettext "Macao"`" - ;; - 'MP' ) - COUNTRYNAME="`gettext "Northern Mariana Islands"`" - ;; - 'MQ' ) - COUNTRYNAME="`gettext "Martinique"`" - ;; - 'MR' ) - COUNTRYNAME="`gettext "Mauritania"`" - ;; - 'MS' ) - COUNTRYNAME="`gettext "Montserrat"`" - ;; - 'MT' ) - COUNTRYNAME="`gettext "Malta"`" - ;; - 'MU' ) - COUNTRYNAME="`gettext "Mauritius"`" - ;; - 'MV' ) - COUNTRYNAME="`gettext "Maldives"`" - ;; - 'MW' ) - COUNTRYNAME="`gettext "Malawi"`" - ;; - 'MX' ) - COUNTRYNAME="`gettext "Mexico"`" - ;; - 'MY' ) - COUNTRYNAME="`gettext "Malaysia"`" - ;; - 'MZ' ) - COUNTRYNAME="`gettext "Mozambique"`" - ;; - 'NA' ) - COUNTRYNAME="`gettext "Namibia"`" - ;; - 'NC' ) - COUNTRYNAME="`gettext "New Caledonia"`" - ;; - 'NE' ) - COUNTRYNAME="`gettext "Niger"`" - ;; - 'NF' ) - COUNTRYNAME="`gettext "Norfolk Island"`" - ;; - 'NG' ) - COUNTRYNAME="`gettext "Nigeria"`" - ;; - 'NI' ) - COUNTRYNAME="`gettext "Nicaragua"`" - ;; - 'NL' ) - COUNTRYNAME="`gettext "Netherlands"`" - ;; - 'NO' ) - COUNTRYNAME="`gettext "Norway"`" - ;; - 'NP' ) - COUNTRYNAME="`gettext "Nepal"`" - ;; - 'NR' ) - COUNTRYNAME="`gettext "Nauru"`" - ;; - 'NU' ) - COUNTRYNAME="`gettext "Niue"`" - ;; - 'NZ' ) - COUNTRYNAME="`gettext "New Zealand"`" - ;; - 'OM' ) - COUNTRYNAME="`gettext "Oman"`" - ;; - 'PA' ) - COUNTRYNAME="`gettext "Panama"`" - ;; - 'PE' ) - COUNTRYNAME="`gettext "Peru"`" - ;; - 'PF' ) - COUNTRYNAME="`gettext "French Polynesia"`" - ;; - 'PG' ) - COUNTRYNAME="`gettext "Papua New Guinea"`" - ;; - 'PH' ) - COUNTRYNAME="`gettext "Philippines"`" - ;; - 'PK' ) - COUNTRYNAME="`gettext "Pakistan"`" - ;; - 'PL' ) - COUNTRYNAME="`gettext "Poland"`" - ;; - 'PM' ) - COUNTRYNAME="`gettext "St Pierre and Miquelon"`" - ;; - 'PN' ) - COUNTRYNAME="`gettext "Pitcairn"`" - ;; - 'PR' ) - COUNTRYNAME="`gettext "Puerto Rico"`" - ;; - 'PS' ) - COUNTRYNAME="`gettext "Palestine"`" - ;; - 'PT' ) - COUNTRYNAME="`gettext "Portugal"`" - ;; - 'PW' ) - COUNTRYNAME="`gettext "Palau"`" - ;; - 'PY' ) - COUNTRYNAME="`gettext "Paraguay"`" - ;; - 'QA' ) - COUNTRYNAME="`gettext "Qatar"`" - ;; - 'RE' ) - COUNTRYNAME="`gettext "Reunion"`" - ;; - 'RO' ) - COUNTRYNAME="`gettext "Romania"`" - ;; - 'RU' ) - COUNTRYNAME="`gettext "Russia"`" - ;; - 'RW' ) - COUNTRYNAME="`gettext "Rwanda"`" - ;; - 'SA' ) - COUNTRYNAME="`gettext "Saudi Arabia"`" - ;; - 'SB' ) - COUNTRYNAME="`gettext "Solomon Islands"`" - ;; - 'SC' ) - COUNTRYNAME="`gettext "Seychelles"`" - ;; - 'SD' ) - COUNTRYNAME="`gettext "Sudan"`" - ;; - 'SE' ) - COUNTRYNAME="`gettext "Sweden"`" - ;; - 'SG' ) - COUNTRYNAME="`gettext "Singapore"`" - ;; - 'SH' ) - COUNTRYNAME="`gettext "St Helena"`" - ;; - 'SI' ) - COUNTRYNAME="`gettext "Slovenia"`" - ;; - 'SJ' ) - COUNTRYNAME="`gettext "Svalbard and Jan Mayen"`" - ;; - 'SK' ) - COUNTRYNAME="`gettext "Slovakia"`" - ;; - 'SL' ) - COUNTRYNAME="`gettext "Sierra Leone"`" - ;; - 'SM' ) - COUNTRYNAME="`gettext "San Marino"`" - ;; - 'SN' ) - COUNTRYNAME="`gettext "Senegal"`" - ;; - 'SO' ) - COUNTRYNAME="`gettext "Somalia"`" - ;; - 'SR' ) - COUNTRYNAME="`gettext "Suriname"`" - ;; - 'ST' ) - COUNTRYNAME="`gettext "Sao Tome and Principe"`" - ;; - 'SV' ) - COUNTRYNAME="`gettext "El Salvador"`" - ;; - 'SY' ) - COUNTRYNAME="`gettext "Syria"`" - ;; - 'SZ' ) - COUNTRYNAME="`gettext "Swaziland"`" - ;; - 'TC' ) - COUNTRYNAME="`gettext "Turks and Caicos Islands"`" - ;; - 'TD' ) - COUNTRYNAME="`gettext "Chad"`" - ;; - 'TF' ) - COUNTRYNAME="`gettext "French Southern and Antarctic Lands"`" - ;; - 'TG' ) - COUNTRYNAME="`gettext "Togo"`" - ;; - 'TH' ) - COUNTRYNAME="`gettext "Thailand"`" - ;; - 'TJ' ) - COUNTRYNAME="`gettext "Tajikistan"`" - ;; - 'TK' ) - COUNTRYNAME="`gettext "Tokelau"`" - ;; - 'TL' ) - COUNTRYNAME="`gettext "Timor-Leste"`" - ;; - 'TM' ) - COUNTRYNAME="`gettext "Turkmenistan"`" - ;; - 'TN' ) - COUNTRYNAME="`gettext "Tunisia"`" - ;; - 'TO' ) - COUNTRYNAME="`gettext "Tonga"`" - ;; - 'TR' ) - COUNTRYNAME="`gettext "Turkey"`" - ;; - 'TT' ) - COUNTRYNAME="`gettext "Trinidad and Tobago"`" - ;; - 'TV' ) - COUNTRYNAME="`gettext "Tuvalu"`" - ;; - 'TW' ) - COUNTRYNAME="`gettext "Taiwan"`" - ;; - 'TZ' ) - COUNTRYNAME="`gettext "Tanzania"`" - ;; - 'UA' ) - COUNTRYNAME="`gettext "Ukraine"`" - ;; - 'UG' ) - COUNTRYNAME="`gettext "Uganda"`" - ;; - 'UM' ) - COUNTRYNAME="`gettext "US minor outlying islands"`" - ;; - 'US' ) - COUNTRYNAME="`gettext "United States"`" - ;; - 'UY' ) - COUNTRYNAME="`gettext "Uruguay"`" - ;; - 'UZ' ) - COUNTRYNAME="`gettext "Uzbekistan"`" - ;; - 'VA' ) - COUNTRYNAME="`gettext "Vatican City"`" - ;; - 'VC' ) - COUNTRYNAME="`gettext "St Vincent"`" - ;; - 'VE' ) - COUNTRYNAME="`gettext "Venezuela"`" - ;; - 'VG' ) - COUNTRYNAME="`gettext "Virgin Islands (UK)"`" - ;; - 'VI' ) - COUNTRYNAME="`gettext "Virgin Islands (US)"`" - ;; - 'VN' ) - COUNTRYNAME="`gettext "Vietnam"`" - ;; - 'VU' ) - COUNTRYNAME="`gettext "Vanuatu"`" - ;; - 'WF' ) - COUNTRYNAME="`gettext "Wallis and Futuna"`" - ;; - 'WS' ) - COUNTRYNAME="`gettext "Samoa (Western)"`" - ;; - 'YE' ) - COUNTRYNAME="`gettext "Yemen"`" - ;; - 'YT' ) - COUNTRYNAME="`gettext "Mayotte"`" - ;; - 'ZA' ) - COUNTRYNAME="`gettext "South Africa"`" - ;; - 'ZM' ) - COUNTRYNAME="`gettext "Zambia"`" - ;; - 'ZW' ) - COUNTRYNAME="`gettext "Zimbabwe"`" - ;; - * ) - COUNTRYNAME="`gettext "Unknown"`" - - esac - - echo $COUNTRYNAME - -} diff --git a/Scripts/Functions/cli_getCurrentLocale.sh b/Scripts/Functions/cli_getCurrentLocale.sh deleted file mode 100755 index 9181c59..0000000 --- a/Scripts/Functions/cli_getCurrentLocale.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# cli_getCurrentLocale.sh -- This function checks LANG environment -# variable and returns the current locale information in the LL_CC -# format. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getCurrentLocale { - - local CURRENTLOCALE='' - local OPTION="$1" - - # Redefine current locale using LL_CC format. - CURRENTLOCALE=$(echo $LANG | sed -r 's!(^[a-z]{2,3}_[A-Z]{2}).+$!\1!') - - # Define centos-art.sh script default current locale. If - # centos-art.sh script doesn't support current system locale, use - # English language from United States as default current locale. - if [[ $CURRENTLOCALE == '' ]];then - CURRENTLOCALE='en_US' - fi - - # Output current locale. - case $OPTION in - - '--langcode-only' ) - echo "${CURRENTLOCALE}" | cut -d_ -f1 - ;; - - '--langcode-and-countrycode'| * ) - echo "${CURRENTLOCALE}" - ;; - esac -} diff --git a/Scripts/Functions/cli_getFilesList.sh b/Scripts/Functions/cli_getFilesList.sh deleted file mode 100755 index 5b9ff22..0000000 --- a/Scripts/Functions/cli_getFilesList.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -# -# cli_getFilesList.sh -- This function outputs the list of files to -# process. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getFilesList { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='pattern:,mindepth:,maxdepth:,type:,uid:' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Initialize pattern used to reduce the find output. - local PATTERN="$FLAG_FILTER" - - # Initialize options used with find command. - local OPTIONS='' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - while true;do - case "$1" in - - --pattern ) - PATTERN="$2" - shift 2 - ;; - - --maxdepth ) - OPTIONS="$OPTIONS -maxdepth $2" - shift 2 - ;; - - --mindepth ) - OPTIONS="$OPTIONS -mindepth $2" - shift 2 - ;; - - --type ) - OPTIONS="$OPTIONS -type $2" - shift 2 - ;; - - --uid ) - OPTIONS="$OPTIONS -uid $2" - shift 2 - ;; - - -- ) - shift 1 - break - ;; - esac - done - - # At this point all options arguments have been processed and - # removed from positional parameters. Only non-option arguments - # remain so we use them as source location for find command to - # look files for. - local LOCATIONS="$@" - - # Verify locations. - cli_checkFiles ${LOCATIONS} - - # Redefine pattern as regular expression. When we use regular - # expressions with find, regular expressions are evaluated against - # the whole file path. This way, when the regular expression is - # specified, we need to build it in a way that matches the whole - # path. Doing so, everytime we pass the `--filter' option in the - # command-line could be a tedious task. Instead, in the sake of - # reducing some typing, we prepare the regular expression here to - # match the whole path using the regular expression provided by - # the user as pattern. Do not use LOCATION variable as part of - # regular expresion so it could be possible to use path expansion. - # Using path expansion reduce the amount of places to find out - # things and so the time required to finish the task. - PATTERN="^.*(/)?${PATTERN}$" - - # Define list of files to process. At this point we cannot verify - # whether the LOCATION is a directory or a file since path - # expansion coul be introduced to it. The best we can do is - # verifying exit status and go on. - find ${LOCATIONS} -regextype posix-egrep ${OPTIONS} -regex "${PATTERN}" | sort | uniq - -} diff --git a/Scripts/Functions/cli_getLangCodes.sh b/Scripts/Functions/cli_getLangCodes.sh deleted file mode 100755 index 59f7444..0000000 --- a/Scripts/Functions/cli_getLangCodes.sh +++ /dev/null @@ -1,222 +0,0 @@ -#!/bin/bash -# -# cli_getLangCodes.sh -- This function outputs a list with language -# codes as defined in ISO639 standard. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getLangCodes { - - local FILTER="$(echo $1 | cut -d_ -f1)" - - LANGCODES="aa - ab - ae - af - ak - am - an - ar - as - av - ay - az - ba - be - bg - bh - bi - bm - bn - bo - br - bs - ca - ce - ch - co - cr - cs - cu - cv - cy - da - de - dv - dz - ee - el - en - eo - es - et - eu - fa - ff - fi - fj - fo - fr - fy - ga - gd - gl - gn - gu - gv - ha - he - hi - ho - hr - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - io - is - it - iu - ja - jv - ka - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ku - kv - kw - ky - la - lb - lg - li - ln - lo - lt - lu - lv - mg - mh - mi - mk - ml - mn - mo - mr - ms - mt - my - na - nb - nd - ne - ng - nl - nn - no - nr - nv - ny - oc - oj - om - or - os - pa - pi - pl - ps - pt - qu - rm - rn - ro - ru - rw - sa - sc - sd - se - sg - si - sk - sl - sm - sn - so - sq - sr - ss - st - su - sv - sw - ta - te - tg - th - ti - tk - tl - tn - to - tr - ts - tt - tw - ty - ug - uk - ur - uz - ve - vi - vo - wa - wo - xh - yi - yo - za - zh - zu" - - if [[ $FILTER != '' ]];then - echo "$LANGCODES" | egrep "$FILTER" | sed -r 's![[:space:]]+!!g' - else - echo "$LANGCODES" - fi - -} diff --git a/Scripts/Functions/cli_getLangName.sh b/Scripts/Functions/cli_getLangName.sh deleted file mode 100755 index 6d734b2..0000000 --- a/Scripts/Functions/cli_getLangName.sh +++ /dev/null @@ -1,780 +0,0 @@ -#!/bin/bash -# -# cli_getLangName.sh -- This function reads one language locale code -# in the format LL_CC and outputs its language name. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getLangName { - - local LANGCODE="$(echo "$1" | cut -d_ -f1 | tr '[:upper:]' '[:lower:]')" - local LANGNAME='' - - case $LANGCODE in - - 'aa' ) - LANGNAME="`gettext "Afar"`" - ;; - - 'ab' ) - LANGNAME="`gettext "Abkhazian"`" - ;; - - 'ae' ) - LANGNAME="`gettext "Avestan"`" - ;; - - 'af' ) - LANGNAME="`gettext "Afrikaans"`" - ;; - - 'ak' ) - LANGNAME="`gettext "Akan"`" - ;; - - 'am' ) - LANGNAME="`gettext "Amharic"`" - ;; - - 'an' ) - LANGNAME="`gettext "Aragonese"`" - ;; - - 'ar' ) - LANGNAME="`gettext "Arabic"`" - ;; - - 'as' ) - LANGNAME="`gettext "Assamese"`" - ;; - - 'av' ) - LANGNAME="`gettext "Avaric"`" - ;; - - 'ay' ) - LANGNAME="`gettext "Aymara"`" - ;; - - 'az' ) - LANGNAME="`gettext "Azerbaijani"`" - ;; - - 'ba' ) - LANGNAME="`gettext "Bashkir"`" - ;; - - 'be' ) - LANGNAME="`gettext "Byelorussian"`" - ;; - - 'bg' ) - LANGNAME="`gettext "Bulgarian"`" - ;; - - 'bh' ) - LANGNAME="`gettext "Bihari"`" - ;; - - 'bi' ) - LANGNAME="`gettext "Bislama"`" - ;; - - 'bm' ) - LANGNAME="`gettext "Bambara"`" - ;; - - 'bn' ) - LANGNAME="`gettext "Bengali"`" - ;; - - 'bo' ) - LANGNAME="`gettext "Tibetan"`" - ;; - - 'br' ) - LANGNAME="`gettext "Breton"`" - ;; - - 'bs' ) - LANGNAME="`gettext "Bosnian"`" - ;; - - 'ca' ) - LANGNAME="`gettext "Catalan"`" - ;; - - 'ce' ) - LANGNAME="`gettext "Chechen"`" - ;; - - 'ch' ) - LANGNAME="`gettext "Chamorro"`" - ;; - - 'co' ) - LANGNAME="`gettext "Corsican"`" - ;; - - 'cr' ) - LANGNAME="`gettext "Cree"`" - ;; - - 'cs' ) - LANGNAME="`gettext "Czech"`" - ;; - - 'cu' ) - LANGNAME="`gettext "Church Slavic"`" - ;; - - 'cv' ) - LANGNAME="`gettext "Chuvash"`" - ;; - - 'cy' ) - LANGNAME="`gettext "Welsh"`" - ;; - - 'da' ) - LANGNAME="`gettext "Danish"`" - ;; - - 'de' ) - LANGNAME="`gettext "German"`" - ;; - - 'dv' ) - LANGNAME="`gettext "Divehi"`" - ;; - - 'dz' ) - LANGNAME="`gettext "Dzongkha"`" - ;; - - 'ee' ) - LANGNAME="`gettext "E'we"`" - ;; - - 'el' ) - LANGNAME="`gettext "Greek"`" - ;; - - 'en' ) - LANGNAME="`gettext "English"`" - ;; - - 'eo' ) - LANGNAME="`gettext "Esperanto"`" - ;; - - 'es' ) - LANGNAME="`gettext "Spanish"`" - ;; - - 'et' ) - LANGNAME="`gettext "Estonian"`" - ;; - - 'eu' ) - LANGNAME="`gettext "Basque"`" - ;; - 'fa' ) - LANGNAME="`gettext "Persian"`" - ;; - - 'ff' ) - LANGNAME="`gettext "Fulah"`" - ;; - - 'fi' ) - LANGNAME="`gettext "Finnish"`" - ;; - - 'fj' ) - LANGNAME="`gettext "Fijian"`" - ;; - - 'fo' ) - LANGNAME="`gettext "Faroese"`" - ;; - - 'fr' ) - LANGNAME="`gettext "French"`" - ;; - - 'fy' ) - LANGNAME="`gettext "Frisian"`" - ;; - - 'ga' ) - LANGNAME="`gettext "Irish"`" - ;; - - 'gd' ) - LANGNAME="`gettext "Scots"`" - ;; - - 'gl' ) - LANGNAME="`gettext "Gallegan"`" - ;; - - 'gn' ) - LANGNAME="`gettext "Guarani"`" - ;; - - 'gu' ) - LANGNAME="`gettext "Gujarati"`" - ;; - - 'gv' ) - LANGNAME="`gettext "Manx"`" - ;; - - 'ha' ) - LANGNAME="`gettext "Hausa"`" - ;; - - 'he' ) - LANGNAME="`gettext "Hebrew"`" - ;; - - 'hi' ) - LANGNAME="`gettext "Hindi"`" - ;; - - 'ho' ) - LANGNAME="`gettext "Hiri Motu"`" - ;; - - 'hr' ) - LANGNAME="`gettext "Croatian"`" - ;; - - 'ht' ) - LANGNAME="`gettext "Haitian"`" - ;; - - 'hu' ) - LANGNAME="`gettext "Hungarian"`" - ;; - - 'hy' ) - LANGNAME="`gettext "Armenian"`" - ;; - - 'hz' ) - LANGNAME="`gettext "Herero"`" - ;; - - 'ia' ) - LANGNAME="`gettext "Interlingua"`" - ;; - - 'id' ) - LANGNAME="`gettext "Indonesian"`" - ;; - - 'ie' ) - LANGNAME="`gettext "Interlingue"`" - ;; - - 'ig' ) - LANGNAME="`gettext "Igbo"`" - ;; - - 'ii' ) - LANGNAME="`gettext "Sichuan Yi"`" - ;; - - 'ik' ) - LANGNAME="`gettext "Inupiak"`" - ;; - - 'io' ) - LANGNAME="`gettext "Ido"`" - ;; - - 'is' ) - LANGNAME="`gettext "Icelandic"`" - ;; - - 'it' ) - LANGNAME="`gettext "Italian"`" - ;; - - 'iu' ) - LANGNAME="`gettext "Inuktitut"`" - ;; - - 'ja' ) - LANGNAME="`gettext "Japanese"`" - ;; - - 'jv' ) - LANGNAME="`gettext "Javanese"`" - ;; - - 'ka' ) - LANGNAME="`gettext "Georgian"`" - ;; - - 'kg' ) - LANGNAME="`gettext "Kongo"`" - ;; - - 'ki' ) - LANGNAME="`gettext "Kikuyu"`" - ;; - - 'kj' ) - LANGNAME="`gettext "Kuanyama"`" - ;; - - 'kk' ) - LANGNAME="`gettext "Kazakh"`" - ;; - - 'kl' ) - LANGNAME="`gettext "Kalaallisut"`" - ;; - - 'km' ) - LANGNAME="`gettext "Khmer"`" - ;; - - 'kn' ) - LANGNAME="`gettext "Kannada"`" - ;; - - 'ko' ) - LANGNAME="`gettext "Korean"`" - ;; - - 'kr' ) - LANGNAME="`gettext "Kanuri"`" - ;; - - 'ks' ) - LANGNAME="`gettext "Kashmiri"`" - ;; - - 'ku' ) - LANGNAME="`gettext "Kurdish"`" - ;; - - 'kv' ) - LANGNAME="`gettext "Komi"`" - ;; - - 'kw' ) - LANGNAME="`gettext "Cornish"`" - ;; - - 'ky' ) - LANGNAME="`gettext "Kirghiz"`" - ;; - - 'la' ) - LANGNAME="`gettext "Latin"`" - ;; - - 'lb' ) - LANGNAME="`gettext "Letzeburgesch"`" - ;; - - 'lg' ) - LANGNAME="`gettext "Ganda"`" - ;; - - 'li' ) - LANGNAME="`gettext "Limburgish"`" - ;; - - 'ln' ) - LANGNAME="`gettext "Lingala"`" - ;; - - 'lo' ) - LANGNAME="`gettext "Lao"`" - ;; - - 'lt' ) - LANGNAME="`gettext "Lithuanian"`" - ;; - - 'lu' ) - LANGNAME="`gettext "Luba-Katanga"`" - ;; - - 'lv' ) - LANGNAME="`gettext "Latvian"`" - ;; - - 'mg' ) - LANGNAME="`gettext "Malagasy"`" - ;; - - 'mh' ) - LANGNAME="`gettext "Marshall"`" - ;; - - 'mi' ) - LANGNAME="`gettext "Maori"`" - ;; - - 'mk' ) - LANGNAME="`gettext "Macedonian"`" - ;; - - 'ml' ) - LANGNAME="`gettext "Malayalam"`" - ;; - - 'mn' ) - LANGNAME="`gettext "Mongolian"`" - ;; - - 'mo' ) - LANGNAME="`gettext "Moldavian"`" - ;; - - 'mr' ) - LANGNAME="`gettext "Marathi"`" - ;; - - 'ms' ) - LANGNAME="`gettext "Malay"`" - ;; - - 'mt' ) - LANGNAME="`gettext "Maltese"`" - ;; - - 'my' ) - LANGNAME="`gettext "Burmese"`" - ;; - - 'na' ) - LANGNAME="`gettext "Nauru"`" - ;; - - 'nb' ) - LANGNAME="`gettext "Norwegian Bokmaal"`" - ;; - - 'nd' ) - LANGNAME="`gettext "Ndebele, North"`" - ;; - - 'ne' ) - LANGNAME="`gettext "Nepali"`" - ;; - - 'ng' ) - LANGNAME="`gettext "Ndonga"`" - ;; - - 'nl' ) - LANGNAME="`gettext "Dutch"`" - ;; - - 'nn' ) - LANGNAME="`gettext "Norwegian Nynorsk"`" - ;; - - 'no' ) - LANGNAME="`gettext "Norwegian"`" - ;; - - 'nr' ) - LANGNAME="`gettext "Ndebele, South"`" - ;; - - 'nv' ) - LANGNAME="`gettext "Navajo"`" - ;; - - 'ny' ) - LANGNAME="`gettext "Chichewa"`" - ;; - - 'oc' ) - LANGNAME="`gettext "Occitan"`" - ;; - - 'oj' ) - LANGNAME="`gettext "Ojibwa"`" - ;; - - 'om' ) - LANGNAME="`gettext "(Afan) Oromo"`" - ;; - - 'or' ) - LANGNAME="`gettext "Oriya"`" - ;; - - 'os' ) - LANGNAME="`gettext "Ossetian; Ossetic"`" - ;; - - 'pa' ) - LANGNAME="`gettext "Panjabi; Punjabi"`" - ;; - - 'pi' ) - LANGNAME="`gettext "Pali"`" - ;; - - 'pl' ) - LANGNAME="`gettext "Polish"`" - ;; - - 'ps' ) - LANGNAME="`gettext "Pashto, Pushto"`" - ;; - - 'pt' ) - LANGNAME="`gettext "Portuguese"`" - ;; - - 'qu' ) - LANGNAME="`gettext "Quechua"`" - ;; - - 'rm' ) - LANGNAME="`gettext "Rhaeto-Romance"`" - ;; - - 'rn' ) - LANGNAME="`gettext "Rundi"`" - ;; - - 'ro' ) - LANGNAME="`gettext "Romanian"`" - ;; - - 'ru' ) - LANGNAME="`gettext "Russian"`" - ;; - - 'rw' ) - LANGNAME="`gettext "Kinyarwanda"`" - ;; - - 'sa' ) - LANGNAME="`gettext "Sanskrit"`" - ;; - - 'sc' ) - LANGNAME="`gettext "Sardinian"`" - ;; - - 'sd' ) - LANGNAME="`gettext "Sindhi"`" - ;; - - 'se' ) - LANGNAME="`gettext "Northern Sami"`" - ;; - - 'sg' ) - LANGNAME="`gettext "Sango; Sangro"`" - ;; - - 'si' ) - LANGNAME="`gettext "Sinhalese"`" - ;; - - 'sk' ) - LANGNAME="`gettext "Slovak"`" - ;; - - 'sl' ) - LANGNAME="`gettext "Slovenian"`" - ;; - - 'sm' ) - LANGNAME="`gettext "Samoan"`" - ;; - - 'sn' ) - LANGNAME="`gettext "Shona"`" - ;; - - 'so' ) - LANGNAME="`gettext "Somali"`" - ;; - - 'sq' ) - LANGNAME="`gettext "Albanian"`" - ;; - - 'sr' ) - LANGNAME="`gettext "Serbian"`" - ;; - - 'ss' ) - LANGNAME="`gettext "Swati; Siswati"`" - ;; - - 'st' ) - LANGNAME="`gettext "Sesotho; Sotho, Southern"`" - ;; - - 'su' ) - LANGNAME="`gettext "Sundanese"`" - ;; - - 'sv' ) - LANGNAME="`gettext "Swedish"`" - ;; - - 'sw' ) - LANGNAME="`gettext "Swahili"`" - ;; - - 'ta' ) - LANGNAME="`gettext "Tamil"`" - ;; - - 'te' ) - LANGNAME="`gettext "Telugu"`" - ;; - - 'tg' ) - LANGNAME="`gettext "Tajik"`" - ;; - - 'th' ) - LANGNAME="`gettext "Thai"`" - ;; - - 'ti' ) - LANGNAME="`gettext "Tigrinya"`" - ;; - - 'tk' ) - LANGNAME="`gettext "Turkmen"`" - ;; - - 'tl' ) - LANGNAME="`gettext "Tagalog"`" - ;; - - 'tn' ) - LANGNAME="`gettext "Tswana; Setswana"`" - ;; - - 'to' ) - LANGNAME="`gettext "Tonga (?)"`" - ;; - - 'tr' ) - LANGNAME="`gettext "Turkish"`" - ;; - - 'ts' ) - LANGNAME="`gettext "Tsonga"`" - ;; - - - 'tt' ) - LANGNAME="`gettext "Tatar"`" - ;; - - 'tw' ) - LANGNAME="`gettext "Twi"`" - ;; - - 'ty' ) - LANGNAME="`gettext "Tahitian"`" - ;; - - 'ug' ) - LANGNAME="`gettext "Uighur"`" - ;; - - 'uk' ) - LANGNAME="`gettext "Ukrainian"`" - ;; - - 'ur' ) - LANGNAME="`gettext "Urdu"`" - ;; - - 'uz' ) - LANGNAME="`gettext "Uzbek"`" - ;; - - 've' ) - LANGNAME="`gettext "Venda"`" - ;; - - 'vi' ) - LANGNAME="`gettext "Vietnamese"`" - ;; - - 'vo' ) - LANGNAME="`gettext "Volapuk; Volapuk"`" - ;; - - 'wa' ) - LANGNAME="`gettext "Walloon"`" - ;; - - 'wo' ) - LANGNAME="`gettext "Wolof"`" - ;; - - 'xh' ) - LANGNAME="`gettext "Xhosa"`" - ;; - - 'yi' ) - LANGNAME="`gettext "Yiddish (formerly ji)"`" - ;; - - 'yo' ) - LANGNAME="`gettext "Yoruba"`" - ;; - - 'za' ) - LANGNAME="`gettext "Zhuang"`" - ;; - - 'zh' ) - LANGNAME="`gettext "Chinese"`" - ;; - - 'zu' ) - LANGNAME="`gettext "Zulu"`" - ;; - - * ) - LANGNAME="`gettext "Unknown"`" - - esac - - echo $LANGNAME; -} - diff --git a/Scripts/Functions/cli_getLocales.sh b/Scripts/Functions/cli_getLocales.sh deleted file mode 100755 index 853efc7..0000000 --- a/Scripts/Functions/cli_getLocales.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# -# cli_getLocales.sh -- This function outputs/verifies locale codes in LL -# and LL_CC format. Combine both ISO639 and ISO3166 specification in -# order to build the final locale list. This function defines which -# translation locales are supported inside CentOS Artwork Repository. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getLocales { - - # Print locales supported by centos-art.sh script. - locale -a | egrep '^[a-z]{2,3}_[A-Z]{2}$' | sort | uniq - -} diff --git a/Scripts/Functions/cli_getPathComponent.sh b/Scripts/Functions/cli_getPathComponent.sh deleted file mode 100755 index e838cf7..0000000 --- a/Scripts/Functions/cli_getPathComponent.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash -# -# cli_getPathComponent.sh -- This function standardizes the way -# directory structures are organized inside the working copy of CentOS -# Artwork Repository. You can use this function to retrive information -# from paths (e.g., releases, architectures and theme artistic motifs) -# or the patterns used to build the paths. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getPathComponent { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='release,release-major,release-minor,release-pattern,architecture,architecture-pattern,motif,motif-name,motif-release,motif-pattern' - - # Initialize ARGUMENTS with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Define release pattern. - local RELEASE="(([[:digit:]]+)(\.([[:digit:]]+)){0,1})" - - # Define architecture pattern. Make it match the architectures the - # CentOS distribution is able to be installed on. - local ARCHITECTURE="(i386|x86_64)" - - # Define pattern for themes' artistic motifs. - local THEME_MOTIF="Identity/Images/Themes/(([[:alnum:]]+)/(${RELEASE}))" - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Define location we want to apply verifications to. - local LOCATION=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --release ) - echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\1!" - shift 1 - break - ;; - - --release-major ) - echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\2!" - shift 1 - break - ;; - - --release-minor ) - echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\4!" - shift 1 - break - ;; - - --release-pattern ) - echo "${RELEASE}" - shift 1 - break - ;; - - --architecture ) - echo "$LOCATION" | egrep "${ARCHITECTURE}" | sed -r "s!${ARCHITECTURE}!\1!" - shift 1 - break - ;; - - --architecture-pattern ) - echo "${ARCHITECTURE}" - shift 1 - break - ;; - - --motif ) - echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\1!" - shift 1 - break - ;; - - --motif-name ) - echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\2!" - shift 1 - break - ;; - - --motif-release ) - echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\3!" - shift 1 - break - ;; - - --motif-pattern ) - echo "${THEME_MOTIF}" - shift 1 - break - ;; - - esac - - done -} diff --git a/Scripts/Functions/cli_getRepoName.sh b/Scripts/Functions/cli_getRepoName.sh deleted file mode 100755 index 4a43eb3..0000000 --- a/Scripts/Functions/cli_getRepoName.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/bash -# -# cli_getRepoName.sh -- This function standardize file and directories -# name convenction inside the working copy of CentOS Artowrk -# Repository. As convenction, regular files are written in lower case -# and directories are written in lower case but with the first letter -# in upper case. Use this function to sanitate the name of regular -# files and directory components of paths you work with. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getRepoName { - - # Define the name we want to apply verifications to. - local NAME="$1" - - # Avoid using options as it were names. When name value is empty - # but an option is provided, the option becomes the first - # positional argument and is evaluated as it were a name which is - # something we need to prevent from happening. - if [[ $NAME =~ '^-' ]];then - return - fi - - # Look for options passed through positional parameters. - case "$2" in - - -f|--basename ) - - # Reduce the path passed to use just the non-directory - # part of it (i.e., the last component in the path; _not_ - # the last "real" directory in the path). - NAME=$(basename $NAME) - - # Clean value. - NAME=$(echo $NAME \ - | tr -s ' ' '_' \ - | tr '[:upper:]' '[:lower:]') - ;; - - -d|--dirname ) - - local DIR='' - local DIRS='' - local CLEANDIRS='' - local PREFIXDIR='' - - # In order to sanitate each directory in a path, it is - # required to break off the path string so each component - # can be worked out individually and later combine them - # back to create a clean path string. - - # Reduce path information passed to use the directory part - # of it only. Of course, this is applied if there is a - # directory part in the path. Assuming there is no - # directory part but a non-empty value in the path, use - # that value as directory part and clean it up. - if [[ $NAME =~ '.+/.+' ]];then - - # When path information is reduced, we need to - # consider that absolute paths contain some - # directories outside the working copy directory - # structure that shouldn't be sanitated (e.g., /home, - # /home/centos, /home/centos/artwork, - # /home/centos/artwork/turnk, trunk, etc.) So, we keep - # them unchaged for later use. - PREFIXDIR=$(echo $NAME \ - | sed -r "s,^(($(cli_getRepoTLDir)/)?(trunk|branches|tags)/).+$,\1,") - - # ... and remove them from the path information we do - # want to sanitate. - DIRS=$(dirname "$NAME" \ - | sed -r "s!^${PREFIXDIR}!!" \ - | tr '/' ' ') - - else - - # At this point, there is not directory part in the - # information passed, so use the value passed as - # directory part as such. - DIRS=$NAME - - fi - - for DIR in $DIRS;do - - # Sanitate directory component. - if [[ $DIR =~ '^[a-z]' ]];then - DIR=$(echo ${DIR} \ - | tr -s ' ' '_' \ - | tr '[:upper:]' '[:lower:]' \ - | sed -r 's/^([[:alpha:]])/\u\1/') - fi - - # Rebuild path using sanitated values. - CLEANDIRS="${CLEANDIRS}/$DIR" - - done - - # Redefine path using sanitated values. - NAME=$(echo ${CLEANDIRS} | sed -r "s!^/!!") - - # Add prefix directory information to sanitated path - # information. - if [[ "$PREFIXDIR" != '' ]];then - NAME=${PREFIXDIR}${NAME} - fi - ;; - - esac - - # Print out the clean path string. - echo $NAME - -} diff --git a/Scripts/Functions/cli_getRepoParallelDirs.sh b/Scripts/Functions/cli_getRepoParallelDirs.sh deleted file mode 100755 index f2d0bc8..0000000 --- a/Scripts/Functions/cli_getRepoParallelDirs.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# cli_getRepoParallelDirs.sh -- This function returns the parallel -# directories related to the first positional paramenter passed as -# parent directory. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getRepoParallelDirs { - - local BOND='' - local TDIR='' - local -a PDIRS - - # Define bond string using first positional parameter as - # reference. - if [[ "$1" != '' ]];then - BOND="$1" - elif [[ "$ACTIONVAL" != '' ]];then - BOND="$ACTIONVAL" - else - cli_printMessage "`gettext "The bond string is required."`" --as-error-line - fi - - # Define repository top level directory. - TDIR=$(cli_getRepoTLDir ${BOND}) - - # Define parallel directory base structures. - PDIRS[0]=Manuals/$(cli_getCurrentLocale)/Texinfo/Repository/$(cli_getRepoTLDir ${BOND} --relative) - PDIRS[1]=Scripts/Bash/Functions/Render/Config - PDIRS[2]=L10n - - # Redefine bond string without its top level directory structure. - BOND=$(echo $BOND | sed -r "s,^${TDIR}/(.+)$,\1,") - - # Concatenate repository top level directory, parallel directory - # base structure, and bond information; in order to produce the - # final parallel directory path. - for PDIR in "${PDIRS[@]}";do - echo ${TDIR}/${PDIR}/${BOND} - done - -} diff --git a/Scripts/Functions/cli_getRepoStatus.sh b/Scripts/Functions/cli_getRepoStatus.sh deleted file mode 100755 index dca042f..0000000 --- a/Scripts/Functions/cli_getRepoStatus.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# cli_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 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 cli_getRepoStatus { - - local LOCATION="$1" - - # Define regular expression pattern to retrive 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" --quiet | sed -r "s/${PATTERN}/\1/" - -} diff --git a/Scripts/Functions/cli_getRepoTLDir.sh b/Scripts/Functions/cli_getRepoTLDir.sh deleted file mode 100755 index bc30f2c..0000000 --- a/Scripts/Functions/cli_getRepoTLDir.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -# -# cli_getRepoTLDir.sh -- This function returns the repository top -# level absolute path. The repository top level absolute path can be -# either ${CLI_WRKCOPY}/trunk, ${CLI_WRKCOPY}/branches, or -# ${CLI_WRKCOPY}/tags. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getRepoTLDir { - - # Define short options. - local ARGSS='r' - - # Define long options. - local ARGSL='relative' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Initialize path pattern and replacement. - local PATTERN='' - local REPLACE='' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Define the location we want to apply verifications to. - local LOCATION=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') - - # Verify location passed as non-option argument. If no location is - # passed as non-option argument to this function, then set the - # trunk directory structure as default location. - if [[ $LOCATION =~ '--$' ]];then - LOCATION=${CLI_WRKCOPY}/trunk - fi - - # Verify location where the working copy should be stored in the - # workstations. Whatever the location provided be, it should refer - # to one of the top level directories inside the working copy of - # CentOS Artwork Repository which, in turn, should be sotred in - # the `artwork' directory immediatly under your home directory. - if [[ ! $LOCATION =~ "^${CLI_WRKCOPY}/(trunk|branches|tags)" ]];then - cli_printMessage "`eval_gettext "The location \\\"\\\$LOCATION\\\" is not valid."`" --as-error-line - fi - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - -r|--relative ) - PATTERN="^${CLI_WRKCOPY}/(trunk|branches|tags)/.+$" - REPLACE='\1' - shift 2 - break - ;; - - -- ) - PATTERN="^(${CLI_WRKCOPY}/(trunk|branches|tags))/.+$" - REPLACE='\1' - shift 1 - break - ;; - esac - - done - - # Print out top level directory. - echo $LOCATION | sed -r "s!${PATTERN}!${REPLACE}!g" - -} diff --git a/Scripts/Functions/cli_getTTFont.sh b/Scripts/Functions/cli_getTTFont.sh deleted file mode 100755 index d6b0cd8..0000000 --- a/Scripts/Functions/cli_getTTFont.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# cli_getFont.sh -- This function creates a list of all True Type -# Fonts (TTF) installed in your workstation and returns the absolute -# path of the file matching the pattern passed as first argument. -# Assuming more than one value matches, the first one in the list is -# used. In case no match is found, the function verifies if there is -# any file in the list that can be used (giving preference to sans -# files). If no file is found at this point, an error will be printed -# out. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getTTFont { - - local -a FONT_PATTERNS - local FONT_PATTERN='' - local FONT_FILE='' - - # Define list of patterns used to build the list of TTF files. - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="/${1}\.ttf$" - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="sans\.ttf$" - FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="\.ttf$" - - # Define directory location where fonts are installed in your - # workstation. - local FONT_DIR='/usr/share/fonts' - - # Define list of all TTF files installed in your workstation. - local FONT_FILES=$(cli_getFilesList ${FONT_DIR} --pattern="\.ttf") - - # Define TTF absolute path based on pattern. Notice that if the - # pattern matches more than one value, only the first one of a - # sorted list will be used. - for FONT_PATTERN in ${FONT_PATTERNS[@]};do - - FONT_FILE=$(echo "$FONT_FILES" | egrep ${FONT_PATTERN} \ - | head -n 1) - - if [[ -f $FONT_FILE ]];then - break - fi - - done - - # Output TTF absolute path. - if [[ -f $FONT_FILE ]];then - echo $FONT_FILE - else - cli_printMessage "`gettext "The font provided doesn't exist."`" --as-error-line - fi - -} diff --git a/Scripts/Functions/cli_getTemporalFile.sh b/Scripts/Functions/cli_getTemporalFile.sh deleted file mode 100755 index 9322da1..0000000 --- a/Scripts/Functions/cli_getTemporalFile.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# -# cli_getTemporalFile.sh -- This function returns the absolute path -# you need to use to create temporal files. Use this function whenever -# you need to create temporal files inside centos-art.sh script. -# -# Copyright (C) 2009, 2010, 2011 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 cli_getTemporalFile { - - # Define base name for temporal file. This is required when svg - # instances are created previous to be parsed by inkscape in order - # to be exported as png. In such cases .svg file exention is - # required in order to avoid complains from inkscape. - local NAME="$(cli_getRepoName $1 -f)" - - # Check default base name for temporal file, it can't be an empty - # value. - if [[ "$NAME" == '' ]];then - cli_printMessage "`gettext "The first argument cannot be empty."`" --as-error-line - fi - - # Redefine file name for the temporal file. Make it a combination - # of the program name, the program process id, a random string and - # the design model name. Using the program name and process id in - # the file name let us to relate both the shell script execution - # and the temporal files it creates, so they can be removed in - # case an interruption signal be detected. The random string let - # us to produce the same artwork in different terminals at the - # same time. the The design model name provides file - # identification. - NAME=${CLI_PROGRAM}-${CLI_PROGRAM_ID}-${RANDOM}-${NAME} - - # Define absolute path for temporal file using the program name, - # the current locale, the unique identifier and the file name. - local TEMPFILE="${CLI_TEMPDIR}/${NAME}" - - # Output absolute path to final temporal file. - echo $TEMPFILE - -} diff --git a/Scripts/Functions/cli_isLocalized.sh b/Scripts/Functions/cli_isLocalized.sh deleted file mode 100755 index efce7f8..0000000 --- a/Scripts/Functions/cli_isLocalized.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# cli_isLocalized.sh -- This function determines whether a file or -# directory can have translation messages or not. This is the way we -# standardize what locations can be localized and what cannot inside -# the repository. -# -# Copyright (C) 2009, 2010, 2011 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 cli_isLocalized { - - local DIR='' - local -a DIRS - - # Initialize default value returned by this function. - local LOCALIZED='false' - - # Initialize location will use as reference to determine whether - # it can have translation messages or not. - local LOCATION="$1" - - # Redefine location to be sure we'll always evaluate a directory, - # as reference location. - if [[ -f $LOCATION ]];then - LOCATION=$(dirname $LOCATION) - fi - - # Verify location existence. If it doesn't exist we cannot go on. - cli_checkFiles $LOCATION -d - - # Define regular expresion list of all directories inside the - # repository that can have translation. These are the - # locale-specific directories will be created for. - DIRS[++((${#DIRS[*]}))]="$(cli_getRepoTLDir)/Identity/Models/Themes/[[:alnum:]-]+/(Distro/$(\ - cli_getPathComponent --release-pattern)/Anaconda|Concept|Posters|Media)" - DIRS[++((${#DIRS[*]}))]="$(cli_getRepoTLDir)/Manuals/[[:alnum:]-]+$" - DIRS[++((${#DIRS[*]}))]="$(cli_getRepoTLDir)/Scripts$" - - # Verify location passed as first argument agains the list of - # directories that can have translation messages. By default, the - # location passed as first argument is considered as a location - # that cannot have translation messages until a positive answer - # says otherwise. - for DIR in ${DIRS[@]};do - if [[ $LOCATION =~ $DIR ]];then - LOCALIZED='true' - break - fi - done - - # Output final answer to all verifications. - echo "$LOCALIZED" - -} diff --git a/Scripts/Functions/cli_isVersioned.sh b/Scripts/Functions/cli_isVersioned.sh deleted file mode 100755 index a1f7f97..0000000 --- a/Scripts/Functions/cli_isVersioned.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# -# cli_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 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 cli_isVersioned { - - # Initialize absolute path using first positional parameter as - # reference. - local LOCATION="$1" - - # Verify location to be sure it really exists. - cli_checkFiles $LOCATION - - # Use subversion to determine whether the location is under - # version control or not. - svn info $LOCATION &> /dev/null - - # Verify subversion exit status and print output. - if [[ $? -eq 0 ]];then - echo 'true' - else - echo 'false' - fi - -} diff --git a/Scripts/Functions/cli_parseArguments.sh b/Scripts/Functions/cli_parseArguments.sh deleted file mode 100755 index 2adb19b..0000000 --- a/Scripts/Functions/cli_parseArguments.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# cli_parseArguments.sh -- This function redefines arguments -# (ARGUMENTS) global variable using getopt(1) output. -# -# Copyright (C) 2009, 2010, 2011 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 cli_parseArguments { - - # Reset positional parameters using optional arguments. - eval set -- "$ARGUMENTS" - - # Parse optional arguments using getopt. - ARGUMENTS=$(getopt -o "$ARGSS" -l "$ARGSL" -n "$CLI_PROGRAM (${FUNCNAME[1]})" -- "$@") - - # Be sure getout parsed arguments successfully. - if [[ $? != 0 ]]; then - cli_printMessage "${CLI_FUNCDIRNAM}" --as-toknowmore-line - fi - -} diff --git a/Scripts/Functions/cli_parseArgumentsReDef.sh b/Scripts/Functions/cli_parseArgumentsReDef.sh deleted file mode 100755 index 6a6c4c0..0000000 --- a/Scripts/Functions/cli_parseArgumentsReDef.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# -# cli_parseArgumentsReDef.sh -- This function initiates/reset and -# sanitates positional parameters passed to this function and creates -# the the list of arguments that getopt will process. -# -# Copyright (C) 2009, 2010, 2011 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 cli_parseArgumentsReDef { - - local ARG - - # Clean up arguments global variable. - ARGUMENTS='' - - # Fill up arguments global variable with current positional - # parameter information. To avoid interpretation problems, use - # single quotes to enclose each argument (ARG) from command-line - # idividually. - for ARG in "$@"; do - - # Sanitate option arguments before process them. Be sure that - # no option argument does contain any single quote (U+0027) - # inside; that would break option parsing. Remember that we - # are using single quotes to enclose option arguments in order - # to let getopt to interpret option arguments with spaces - # inside. To solve this issue, we replace all single quotes - # in the arguments list with their respective codification and - # reverse the process back when doPrint them out. - ARG=$(echo $ARG | sed "s/'/\\\0x27/g") - - # Concatenate arguments and encolose them to let getopt to - # process them when they have spaces inside. - ARGUMENTS="$ARGUMENTS '$ARG'" - - done - -} diff --git a/Scripts/Functions/cli_printActionPreamble.sh b/Scripts/Functions/cli_printActionPreamble.sh deleted file mode 100755 index c8270bc..0000000 --- a/Scripts/Functions/cli_printActionPreamble.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash -# -# cli_printActionPreamble -- This function standardizes the way -# preamble messages are printed out. Preamble messages are used before -# actions (e.g., file elimination, edition, creation, actualization, -# etc.) and provide a way for the user to control whether the action -# is performed or not. -# -# Copyright (C) 2009, 2010, 2011 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 cli_printActionPreamble { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='to-create,to-delete,to-locale,to-edit' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Initialize message. - local MESSAGE='' - - # Initialize message options. - local OPTION='' - - # Initialize file variable as local to avoid conflicts outside. - # We'll use the file variable later, to show the list of files - # that will be affected by the action. - local FILE='' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Define the location we want to apply verifications to. - local FILES=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') - - # Initialize counter with total number of files. - local COUNT=$(echo $FILES | wc -l) - - # Look for options passed through positional parameters. - while true;do - - case "$1" in - - --to-create ) - if [[ $FILES == '--' ]];then - MESSAGE="`gettext "There is no entry to create."`" - OPTION='--as-error-line' - else - MESSAGE="`ngettext "The following entry will be created" \ - "The following entries will be created" $COUNT`:" - OPTION='' - fi - shift 2 - break - ;; - - --to-delete ) - if [[ $FILES == '--' ]];then - MESSAGE="`gettext "There is no file to delete."`" - OPTION='--as-error-line' - else - MESSAGE="`ngettext "The following entry will be deleted" \ - "The following entries will be deleted" $COUNT`:" - OPTION='' - fi - shift 2 - break - ;; - - --to-locale ) - if [[ $FILES == '--' ]];then - MESSAGE="`gettext "There is no file to locale."`" - OPTION='--as-error-line' - else - MESSAGE="`ngettext "Translatable strings will be retrived from the following entry" \ - "Translatable strings will be retrived from the following entries" $COUNT`:" - OPTION='' - fi - shift 2 - break - ;; - - --to-edit ) - if [[ $FILES == '--' ]];then - MESSAGE="`gettext "There is no file to edit."`" - OPTION='--as-error-line' - else - MESSAGE="`ngettext "The following file will be edited" \ - "The following files will be edited" $COUNT`:" - OPTION='' - fi - shift 2 - break - ;; - - -- ) - if [[ $FILES == '--' ]];then - MESSAGE="`gettext "There is no file to process."`" - OPTION='--as-error-line' - else - MESSAGE="`ngettext "The following file will be processed" \ - "The following files will be processed" $COUNT`:" - OPTION='' - fi - shift 1 - break - ;; - esac - done - - # Print out the preamble message. - cli_printMessage "${MESSAGE}" "${OPTION}" - for FILE in $FILES;do - cli_printMessage "$FILE" --as-response-line - done - cli_printMessage "`gettext "Do you want to continue"`" --as-yesornorequest-line - -} diff --git a/Scripts/Functions/cli_printCopyrightInfo.sh b/Scripts/Functions/cli_printCopyrightInfo.sh deleted file mode 100755 index 6f4e6e2..0000000 --- a/Scripts/Functions/cli_printCopyrightInfo.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -# -# cli_printCopyrightInfo.sh -- This function standardizes the -# copyright information used by centos-art.sh script. -# -# As far as I understand, the copyright exists to make people create -# more. The copyright gives creators the legal power over their -# creations and so the freedom to distribute them under the ethical -# terms the creator considers better. At this moment I don't feel -# very confident about this legal affairs and their legal -# implications, but I need to decide what copyright information the -# centos-art.sh script will print out. So, in that sake, I'll assume -# the same copyright information used by The CentOS Wiki -# (http://wiki.centos.org/) as reference. -# -# Copyright (C) 2009, 2010, 2011 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 cli_printCopyrightInfo { - - case "$1" in - - --license ) - - # Print out the name of the license used by to release the - # content produced by centos-art.sh script, inside CentOS - # Artwork Repository. - echo "`gettext "Creative Common Attribution-ShareAlike 3.0 License"`" - ;; - - --license-url ) - - # Print out the url of the license used by to release the - # content produced by centos-art.sh script, inside CentOS - # Artwork Repository. - cli_printUrl --cc-sharealike - ;; - - --copyright-year-first ) - - # The former year when I (as part of The CentOS Project) - # started to consolidate The CentOS Project Corporate - # Visual Identity through the CentOS Artwork Repository. - echo '2009' - ;; - - --copyright-year|--copyright-year-last ) - - # The last year when The CentOS Project stopped working in - # its Corporate Visual Identity through the CentOS Artwork - # Repository. That is something that I hope does never - # happen, so assume the current year as last working year. - date +%Y - ;; - - --copyright-year-range ) - - local FIRST_YEAR=$(cli_printCopyrightInfo '--copyright-year-first') - local LAST_YEAR=$(cli_printCopyrightInfo '--copyright-year-last') - echo "${FIRST_YEAR}-${LAST_YEAR}" - ;; - - --copyright-year-list ) - - local FIRST_YEAR=$(cli_printCopyrightInfo '--copyright-year-first') - local LAST_YEAR=$(cli_printCopyrightInfo '--copyright-year-last') - - # Define full copyright year string based on first and - # last year. - local FULL_YEAR=$(\ - while [[ ${FIRST_YEAR} -le ${LAST_YEAR} ]];do - echo -n "${FIRST_YEAR}, " - FIRST_YEAR=$(($FIRST_YEAR + 1)) - done) - - # Prepare full copyright year string and print it out. - echo "${FULL_YEAR}" | sed 's!, *$!!' - ;; - - --copyright-holder ) - - # Output default copyright holder. - echo "`gettext "The CentOS Project"`" - ;; - - --copyright-holder-predicate ) - - local HOLDER=$(cli_printCopyrightInfo '--copyright-holder') - echo "${HOLDER}. `gettext "All rights reserved."`" - ;; - - --copyright ) - - local YEAR=$(cli_printCopyrightInfo '--copyright-year-last') - local HOLDER=$(cli_printCopyrightInfo '--copyright-holder') - echo "Copyright © ${YEAR} ${HOLDER}" - ;; - - esac - -} diff --git a/Scripts/Functions/cli_printMessage.sh b/Scripts/Functions/cli_printMessage.sh deleted file mode 100755 index d0366b5..0000000 --- a/Scripts/Functions/cli_printMessage.sh +++ /dev/null @@ -1,242 +0,0 @@ -#!/bin/bash -# -# cli_printMessage.sh -- This function standardizes the way messages -# are printed out from centos-art.sh script. -# -# Copyright (C) 2009, 2010, 2011 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 cli_printMessage { - - # Verify `--quiet' option. - if [[ "$FLAG_QUIET" == 'true' ]];then - return - fi - - local MESSAGE="$1" - local FORMAT="$2" - - # Verify message variable, it cannot have an empty value. - if [[ $MESSAGE == '' ]];then - cli_printMessage "`gettext "The message cannot be empty."`" --as-error-line - fi - - # Define message horizontal width. This is the max number of - # horizontal characters the message will use to be displayed on - # the screen. - local MESSAGE_WIDTH=66 - - # Reverse the codification performed on characters that may affect - # parsing options and non-option arguments. This codification is - # realized before building the ARGUMENTS variable, at - # cli_parseArgumentsReDef, and we need to reverse it back here - # in order to show the correct character when the message be - # printed out on the screen. - MESSAGE=$(echo $MESSAGE | sed -e "s/\\\0x27/'/g") - - # Remove empty spaces from message. - MESSAGE=$(echo $MESSAGE | sed -e 's!^[[:space:]]+!!') - - # Print out messages based on format. - case "$FORMAT" in - - --as-separator-line ) - - # Build the separator line. - MESSAGE=$(\ - until [[ $MESSAGE_WIDTH -eq 0 ]];do - echo -n "$MESSAGE" - MESSAGE_WIDTH=$(($MESSAGE_WIDTH - 1)) - done) - - # Draw the separator line. - echo "$MESSAGE" > /dev/stderr - ;; - - --as-banner-line ) - cli_printMessage '-' --as-separator-line - cli_printMessage "$MESSAGE" - cli_printMessage '-' --as-separator-line - ;; - - --as-cropping-line ) - cli_printMessage "`gettext "Cropping from"`: $MESSAGE" - ;; - - --as-tuningup-line ) - cli_printMessage "`gettext "Tuning-up"`: $MESSAGE" - ;; - - --as-checking-line ) - cli_printMessage "`gettext "Checking"`: $MESSAGE" - ;; - - --as-creating-line | --as-updating-line ) - if [[ -a "$MESSAGE" ]];then - cli_printMessage "`gettext "Updating"`: $MESSAGE" - else - cli_printMessage "`gettext "Creating"`: $MESSAGE" - fi - ;; - - --as-deleting-line ) - cli_printMessage "`gettext "Deleting"`: $MESSAGE" - ;; - - --as-reading-line ) - cli_printMessage "`gettext "Reading"`: $MESSAGE" - ;; - - --as-savedas-line ) - cli_printMessage "`gettext "Saved as"`: $MESSAGE" - ;; - - --as-linkto-line ) - cli_printMessage "`gettext "Linked to"`: $MESSAGE" - ;; - - --as-movedto-line ) - cli_printMessage "`gettext "Moved to"`: $MESSAGE" - ;; - - --as-translation-line ) - cli_printMessage "`gettext "Translation"`: $MESSAGE" - ;; - - --as-validating-line ) - cli_printMessage "`gettext "Validating"`: $MESSAGE" - ;; - - --as-template-line ) - cli_printMessage "`gettext "Template"`: $MESSAGE" - ;; - - --as-configuration-line ) - cli_printMessage "`gettext "Configuration"`: $MESSAGE" - ;; - - --as-palette-line ) - cli_printMessage "`gettext "Palette"`: $MESSAGE" - ;; - - --as-response-line ) - cli_printMessage "--> $MESSAGE" - ;; - - --as-request-line ) - cli_printMessage "${MESSAGE}:\040" --as-notrailingnew-line - ;; - - --as-selection-line ) - local NAME='' - select NAME in ${MESSAGE};do - echo $NAME - break - done - ;; - - --as-error-line ) - # Define where the error was originated inside the - # centos-art.sh script. Print out the function name and - # line from the caller. - local ORIGIN="$(caller 1 | gawk '{ print $2 " " $1 }')" - - # Build the error message. - cli_printMessage "${CLI_PROGRAM} (${ORIGIN}): $MESSAGE" --as-stderr-line - cli_printMessage "${CLI_FUNCDIRNAM}" --as-toknowmore-line - ;; - - --as-toknowmore-line ) - cli_printMessage '-' --as-separator-line - cli_printMessage "`gettext "To know more, run the following command"`:" - cli_printMessage "centos-art help --read trunk/Scripts/Functions/$MESSAGE" - cli_printMessage '-' --as-separator-line - exit # <-- ATTENTION: Do not remove this line. We use this - # option as convenction to end script - # execution. - ;; - - --as-yesornorequest-line ) - # Define positive answer. - local Y="`gettext "yes"`" - - # Define negative answer. - local N="`gettext "no"`" - - # Define default answer. - local ANSWER=${N} - - if [[ $FLAG_ANSWER == 'true' ]];then - - ANSWER=${Y} - - else - - # Print the question. - cli_printMessage "$MESSAGE [${Y}/${N}]:\040" --as-notrailingnew-line - - # Redefine default answer based on user's input. - read ANSWER - - fi - - # Verify user's answer. Only positive answer let the - # script flow to continue. Otherwise, if something - # different from possitive answer is passed, the script - # terminates its execution immediatly. - if [[ ! ${ANSWER} =~ "^${Y}" ]];then - exit - fi - ;; - - --as-notrailingnew-line ) - echo -e -n "$MESSAGE" > /dev/stderr - ;; - - --as-stdout-line ) - echo "$MESSAGE" - ;; - - --as-stderr-line ) - echo "$MESSAGE" - ;; - - * ) - - # Default printing format. This is the format used when no - # other specification is passed to this function. As - # convenience, we transform absolute paths into relative - # paths in order to free horizontal space on final output - # messages. - echo "$MESSAGE" | sed -r \ - -e "s!${CLI_WRKCOPY}/(trunk|branches|tags)/!\1/!g" \ - | awk 'BEGIN { FS=": " } - { - if ( $0 ~ /^-+$/ ) - print $0 - else - printf "%-15s\t%s\n", $1, $2 - } - END {}' > /dev/stderr - ;; - - esac - -} diff --git a/Scripts/Functions/cli_printUrl.sh b/Scripts/Functions/cli_printUrl.sh deleted file mode 100755 index 5994d8d..0000000 --- a/Scripts/Functions/cli_printUrl.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash -# -# cli_printUrl.sh -- This function standardize the way URLs are -# printed inside centos-art.sh script. This function describes the -# domain organization of The CentOS Project through its URLs and -# provides a way to print them out when needed. -# -# Copyright (C) 2009, 2010, 2011 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 cli_printUrl { - - local URL='' - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='home,lists,wiki,forums,bugs,planet,docs,mirrors,irc,projects,projects-artwork,cc-sharealike,with-locale,as-html-link' - - # Define ARGUMENTS as local variable in order to parse options - # internlally. - local ARGUMENTS='' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through command-line. - while true; do - case "$1" in - - --home ) - URL='http://www.centos.org/' - shift 1 - ;; - - --lists ) - URL='http://lists.centos.org/' - shift 1 - ;; - - --wiki ) - URL='http://wiki.centos.org/' - shift 1 - ;; - - --forums ) - URL='http://forums.centos.org/' - shift 1 - ;; - - --bugs ) - URL='http://bugs.centos.org/' - shift 1 - ;; - - --projects ) - URL='https://projects.centos.org/' - shift 1 - ;; - - --projects-artwork ) - URL=$(cli_printUrl '--projects')svn/artwork/ - shift 1 - ;; - - --planet ) - URL='http://planet.centos.org/' - shift 1 - ;; - - --docs ) - URL='http://docs.centos.org/' - shift 1 - ;; - - --mirrors ) - URL='http://mirrors.centos.org/' - shift 1 - ;; - - --irc ) - URL='http://www.centos.org/modules/tinycontent/index.php?id=8' - shift 1 - ;; - - --cc-sharealike ) - URL="http://creativecommons.org/licenses/by-sa/3.0/" - shift 1 - ;; - - --with-locale ) - if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then - URL="${URL}$(cli_getCurrentLocale '--langcode-only')/" - fi - shift 1 - ;; - - --as-html-link ) - URL="${URL}" - shift 1 - ;; - - -- ) - - shift 1 - break - ;; - esac - done - - # Print Url. - echo "$URL" - -} diff --git a/Scripts/Functions/cli_syncroRepoChanges.sh b/Scripts/Functions/cli_syncroRepoChanges.sh deleted file mode 100755 index 168ee6b..0000000 --- a/Scripts/Functions/cli_syncroRepoChanges.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# cli_syncroRepoChanges.sh -- This function syncronizes both central -# repository and working copy performing a subversion update command -# first and a subversion commit command later. -# -# Copyright (C) 2009, 2010, 2011 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 cli_syncroRepoChanges { - - # Verify don't commit changes flag. - if [[ $FLAG_DONT_COMMIT_CHANGES != 'false' ]];then - return - fi - - # Define source location the subversion update action will take - # place on. If arguments are provided use them as srouce location. - # Otherwise use action value as default source location. - if [[ "$@" != '' ]];then - LOCATIONS="$@" - else - LOCATIONS="$ACTIONVAL" - fi - - # Bring changes from the repository into the working copy. - cli_updateRepoChanges "$LOCATIONS" - - # Check changes in the working copy. - cli_commitRepoChanges "$LOCATIONS" - -} diff --git a/Scripts/Functions/cli_terminateScriptExecution.sh b/Scripts/Functions/cli_terminateScriptExecution.sh deleted file mode 100755 index fd65ab4..0000000 --- a/Scripts/Functions/cli_terminateScriptExecution.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# cli_terminateScriptExecution.sh -- This function standardizes the -# actions that must be realized just before leaving the script -# execution (e.g., cleaning temporal files). This function is the one -# called when interruption signals like EXIT, SIGHUP, SIGINT and -# SIGTERM are detected. -# -# Copyright (C) 2009, 2010, 2011 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 cli_terminateScriptExecution { - - # Build list of temporal files related to this script execution. - # Remember that inside `/tmp' directory there are files and - # directories you might have no access to (due permission - # restrictions), so command cli_getFilesList to look for files in - # the first level of files that you are owner of. Otherwise, - # undesired `permission denied' messages might be output. - local FILES=$(cli_getFilesList ${CLI_TEMPDIR} \ - --pattern="${CLI_PROGRAM}-${CLI_PROGRAM_ID}-.+" \ - --maxdepth="1" --uid="$(id -u)") - - # Remove list of temporal files related to this script execution, - # if any of course. Remember that some of the temporal files can - # be directories, too. - if [[ $FILES != '' ]];then - rm -rf $FILES - fi - - # Terminate script correctly. - exit 0 - -} diff --git a/Scripts/Functions/cli_unsetFunctions.sh b/Scripts/Functions/cli_unsetFunctions.sh deleted file mode 100755 index 0977480..0000000 --- a/Scripts/Functions/cli_unsetFunctions.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# cli_unsetFunctions.sh -- This function unsets funtionalities from -# `centos-art.sh' script execution evironment. -# -# Copyright (C) 2009, 2010, 2011 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 cli_unsetFunctions { - - # Define source location where function files are placed in. - local LOCATION=$1 - - # Define suffix used to retrive function files. - local SUFFIX=$2 - - # Verify suffix value used to retrive function files. Assuming no - # suffix value is passed as second argument to this function, use - # the function name value (CLI_FUNCNAME) as default value. - if [[ $SUFFIX == '' ]];then - SUFFIX=$CLI_FUNCNAME - fi - - # Define list of backend-specific functionalities. This is the - # list of function definitions previously exported by - # `cli_exportFunctions'. Be sure to limit the list to function - # names that start with the suffix specified only. - local FUNCDEF='' - local FUNCDEFS=$(declare -F | gawk '{ print $3 }' | egrep "^${SUFFIX}") - - # Unset function names from current execution environment. - for FUNCDEF in $FUNCDEFS;do - unset -f $FUNCDEF - done - -} diff --git a/Scripts/Functions/cli_updateRepoChanges.sh b/Scripts/Functions/cli_updateRepoChanges.sh deleted file mode 100755 index 78a6ad4..0000000 --- a/Scripts/Functions/cli_updateRepoChanges.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash -# -# cli_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 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 cli_updateRepoChanges { - - # Verify don't commit changes flag. - if [[ $FLAG_DONT_COMMIT_CHANGES != 'false' ]];then - return - fi - - local -a FILES - local -a INFO - local -a FILESNUM - local COUNT=0 - local UPDATEOUT='' - local PREDICATE='' - local CHNGTOTAL=0 - local LOCATIONS='' - - # Define source location the subversion update action will take - # place on. If arguments are provided use them as srouce location. - # Otherwise use action value as default source location. - if [[ "$@" != '' ]];then - LOCATIONS="$@" - else - LOCATIONS="$ACTIONVAL" - fi - - # Update working copy and retrive update output. - cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line - UPDATEOUT=$(svn update ${LOCATIONS}) - - # Define path of files considered recent modifications from - # central repository to working copy. - FILES[0]=$(echo "$UPDATEOUT" | egrep "^A.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - FILES[1]=$(echo "$UPDATEOUT" | egrep "^D.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - FILES[2]=$(echo "$UPDATEOUT" | egrep "^U.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - FILES[3]=$(echo "$UPDATEOUT" | egrep "^C.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - FILES[4]=$(echo "$UPDATEOUT" | egrep "^G.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") - - # 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]}" - - # Increase counter. - COUNT=$(($COUNT + 1)) - - done - -} diff --git a/Scripts/centos-art.sh b/Scripts/centos-art.sh deleted file mode 100755 index 4d8e3ec..0000000 --- a/Scripts/centos-art.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# -# centos-art.sh -- The CentOS Artwork Repository automation tool. -# -# Copyright (C) 2009, 2010, 2011 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$ -# ---------------------------------------------------------------------- - -# Initialize personal data. -declare -xr CLI_PROGRAM='centos-art' -declare -xr CLI_PROGRAM_ID=$$ -declare -xr CLI_VERSION='1.0 (beta)' - -# Initialize paths. -declare -xr CLI_WRKCOPY="${HOME}/artwork" -declare -xr CLI_BASEDIR="${CLI_WRKCOPY}/trunk/Scripts" -declare -xr CLI_TEMPDIR='/tmp' - -# Initialize internazionalization through GNU gettext. -. gettext.sh -declare -xr TEXTDOMAIN=${CLI_PROGRAM}.sh -declare -xr TEXTDOMAINDIR=${CLI_WRKCOPY}/trunk/L10n/Scripts - -# Verify the working copy directory. Be sure it is -# `/home/centos/artwork'. Otherwise, end the script execution. We -# cannot continue if the working copy is stored in a place other than -# `/home/centos/artwork'. This restriction is what let us to reuse -# contents using absolute paths inside a distributed environment like -# that one provided by The CentOS Artwork Repository. -if [[ ! -d ${CLI_WRKCOPY} ]];then - echo "`eval_gettext "The working copy must be under \\\"\\\$CLI_WRKCOPY\\\"."`" > /dev/stderr - exit -fi - -# Initialize common functions. -FILES=$(ls ${CLI_BASEDIR}/Functions/{cli,cli_*}.sh) -for FILE in ${FILES};do - if [[ -x ${FILE} ]];then - . ${FILE} - FUNCTION=$(grep '^function ' ${FILE} | cut -d' ' -f2) - export -f ${FUNCTION} - else - echo `eval_gettext "The \\\"\\\$FILE\\\" needs to have execution rights."` > /dev/stderr - exit - fi -done - -# Unset all variables not considered global in order to start common -# functions with a clean environment. -unset FILE -unset FILES -unset FUNCTION - -# Trap signals in order to terminate the script execution correctly -# (e.g., removing all temporal files before leaving). Trapping the -# exit signal seems to be enough by now, since it is always present as -# part of the script execution flow. Each time the centos-art.sh -# script is executed it will inevitably end with an EXIT signal at -# some point of its execution, even if it is interrupted in the middle -# of its execution (e.g., through `Ctrl+C'). -trap cli_terminateScriptExecution 0 - -# Initialize command-line interface. -cli "$@" diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-menu.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-menu.texinfo new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-menu.texinfo diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-nodes.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-nodes.texinfo new file mode 100644 index 0000000..3e2dc0b --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter-nodes.texinfo @@ -0,0 +1 @@ +@include =INCL= diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter.texinfo new file mode 100644 index 0000000..33e9993 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/chapter.texinfo @@ -0,0 +1,12 @@ +@node =CHAPTER_NODE= +@chapter =CHAPTER_TITLE= +@cindex =CHAPTER_CIND= + +@c -- Chapter Introduction +... + +@c -- Chapter Menu +@include =CHAPTER_NAME=/chapter-menu.texinfo + +@c -- Chapter Nodes +@include =CHAPTER_NAME=/chapter-nodes.texinfo diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/section-functions.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/section-functions.texinfo new file mode 100644 index 0000000..7bf3dfd --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/section-functions.texinfo @@ -0,0 +1,34 @@ +@section =SECT= +@cindex =CIND= + +@subheading Name + +The @file{=SECT=} directory organizes @dots{} + +@subheading Synopsis + +@dots{} + +@subheading Description + +@dots{} + +@subheading Examples + +@dots{} + +@subheading Author + +Written by @dots{} + +@subheading Reporting bugs + +Report bugs to @email{centos-artwork@@centos.org} mailing list. + +@subheading Copyright + +Copyright @copyright{} =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER= + +This is free software. You may redistribute copies of it under the +terms of the @ref{GNU General Public License}. There is NO WARRANTY, +to the extent permitted by law. diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/section.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/section.texinfo new file mode 100644 index 0000000..9461faa --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Chapters/section.texinfo @@ -0,0 +1,8 @@ +@node =NODE= +@section =SECT= +@cindex =CIND= + +... + +@c -- <[centos-art(SeeAlso) +@c -- ]> diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/GFDL.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/GFDL.texinfo new file mode 100755 index 0000000..c40cf38 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/GFDL.texinfo @@ -0,0 +1,414 @@ +Version 1.2, November 2002 + +@verbatim +Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA +@end verbatim + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +@subheading Preamble + +The purpose of this License is to make a manual, textbook, or other +functional and useful document ``free'' in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@subheading 1. Applicability and definitions + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the +Title'' of such a section when you modify the Document means that it +remains a section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@subheading 2. Verbatim copying + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section @emph{3. +Copying in quantity}. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@subheading 3. Copying in quantity + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. + +@subheading 4. Modifications + +You may copy and distribute a Modified Version of the Document under +the conditions of sections @emph{2. Verbatim copying} and @emph{3. +Copying in quantity} above, provided that you release the Modified +Version under precisely this License, with the Modified Version +filling the role of the Document, thus licensing distribution and +modification of the Modified Version to whoever possesses a copy of +it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions (which +should, if there were any, be listed in the History section of the +Document). You may use the same title as a previous version if the +original publisher of that version gives permission. + +B. List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +C. State on the Title page the name of the publisher of the Modified +Version, as the publisher. + +D. Preserve all the copyright notices of the Document. + +E. Add an appropriate copyright notice for your modifications adjacent +to the other copyright notices. + +F. Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +G. Preserve in that license notice the full lists of Invariant +Sections and required Cover Texts given in the Document's license +notice. + +H. Include an unaltered copy of this License. + +I. Preserve the section Entitled ``History'', Preserve its Title, and +add to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +J. Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise the +network locations given in the Document for previous versions it was +based on. These may be placed in the ``History'' section. You may +omit a network location for a work that was published at least four +years before the Document itself, or if the original publisher of the +version it refers to gives permission. + +K. For any section Entitled ``Acknowledgements'' or ``Dedications'', +Preserve the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +L. Preserve all the Invariant Sections of the Document, unaltered in +their text and in their titles. Section numbers or the equivalent are +not considered part of the section titles. + +M. Delete any section Entitled ``Endorsements''. Such a section may +not be included in the Modified Version. + +N. Do not retitle any existing section to be Entitled ``Endorsements'' +or to conflict in title with any Invariant Section. + +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@subheading 5. Combining documents + +You may combine the Document with other documents released under this +License, under the terms defined in section @emph{4. Modifications} +above for modified versions, provided that you include in the +combination all of the Invariant Sections of all of the original +documents, unmodified, and list them all as Invariant Sections of your +combined work in its license notice, and that you preserve all their +Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled +``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all sections +Entitled ``Endorsements''. + +@subheading 6. Collections of documents + +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. + +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. + +@subheading 7. Aggregation with independent works + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section @emph{3. Copying in quantity} +is applicable to these copies of the Document, then if the Document is +less than one half of the entire aggregate, the Document's Cover Texts +may be placed on covers that bracket the Document within the +aggregate, or the electronic equivalent of covers if the Document is +in electronic form. Otherwise they must appear on printed covers that +bracket the whole aggregate. + +@subheading 8. Translations + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section +@emph{4. Modifications}. Replacing Invariant Sections with +translations requires special permission from their copyright holders, +but you may include translations of some or all Invariant Sections in +addition to the original versions of these Invariant Sections. You +may include a translation of this License, and all the license notices +in the Document, and any Warranty Disclaimers, provided that you also +include the original English version of this License and the original +versions of those notices and disclaimers. In case of a disagreement +between the translation and the original version of this License or a +notice or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section @emph{4. +Modifications}) to Preserve its Title (section @emph{1. Applicability +and definitions}) will typically require changing the actual title. + +@subheading 9. Termination + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided for under this License. Any other +attempt to copy, modify, sublicense or distribute the Document is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +@subheading Future Revisions of this License + +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See +@url{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + +@subheading How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@verbatim + Copyright (C) YEAR YOUR NAME. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled ``GNU Free Documentation License''. +@end verbatim + +If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the ``with...Texts''. line with this: + +@verbatim + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. +@end verbatim + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/GPL.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/GPL.texinfo new file mode 100755 index 0000000..3349125 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/GPL.texinfo @@ -0,0 +1,376 @@ +Version 2, June 1991 + +@verbatim +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA +@end verbatim + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +@subheading Preamble + +The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License +is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, +we want its recipients to know that what they have is not the +original, so that any problems introduced by others will not reflect +on the original authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at +all. + +The precise terms and conditions for copying, distribution and +modification follow. + +@subheading TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +@subsubheading Section 0 + +This License applies to any program or other work which contains a +notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The ``Program'', +below, refers to any such program or work, and a ``work based on the +Program'' means either the Program or any derivative work under +copyright law: that is to say, a work containing the Program or a +portion of it, either verbatim or with modifications and/or translated +into another language. (Hereinafter, translation is included without +limitation in the term ``modification''.) Each licensee is addressed +as ``you''. + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +@subsubheading Section 1 + +You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +@subsubheading Section 2 + +You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any part +thereof, to be licensed as a whole at no charge to all third parties +under the terms of this License. + +c) If the modified program normally reads commands interactively when +run, you must cause it, when started running for such interactive use +in the most ordinary way, to print or display an announcement +including an appropriate copyright notice and a notice that there is +no warranty (or else, saying that you provide a warranty) and that +users may redistribute the program under these conditions, and telling +the user how to view a copy of this License. (Exception: if the +Program itself is interactive but does not normally print such an +announcement, your work based on the Program is not required to print +an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +@subsubheading Section 3 + +You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections 1 +and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, +to give any third party, for a charge no more than your cost of +physically performing source distribution, a complete machine-readable +copy of the corresponding source code, to be distributed under the +terms of Sections 1 and 2 above on a medium customarily used for +software interchange; or, + +c) Accompany it with the information you received as to the offer to +distribute corresponding source code. (This alternative is allowed +only for noncommercial distribution and only if you received the +program in object code or executable form with such an offer, in +accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +@subsubheading Section 4 + +You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +@subsubheading Section 5 + +You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +@subsubheading Section 6 + +Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +@subsubheading Section 7 + +If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +@subsubheading Section 8 + +If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Program under this License may add an +explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +@subsubheading Section 9 + +The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and ``any +later version'', you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +@subsubheading Section 10 + +If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the +author to ask for permission. For software which is copyrighted by +the Free Software Foundation, write to the Free Software Foundation; +we sometimes make exceptions for this. Our decision will be guided by +the two goals of preserving the free status of all derivatives of our +free software and of promoting the sharing and reuse of software +generally. + +@subsubheading NO WARRANTY + +BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT +WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER +PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +@subsubheading Section 12 + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + +@strong{END OF TERMS AND CONDITIONS} + +@subheading How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the ``copyright'' line and a pointer to where the full notice is +found. + +@verbatim + + Copyright (C) 19yy + + 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. +@end verbatim + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +@verbatim + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +@end verbatim + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a ``copyright disclaimer'' for the program, if +necessary. Here is a sample; alter the names: + +@verbatim + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice +@end verbatim + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-menu.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-menu.texinfo new file mode 100755 index 0000000..b8240ba --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-menu.texinfo @@ -0,0 +1,4 @@ +@menu +* GNU General Public License:: +* GNU Free Documentation License:: +@end menu diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-nodes.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-nodes.texinfo new file mode 100755 index 0000000..2a33229 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter-nodes.texinfo @@ -0,0 +1,9 @@ +@node GNU General Public License +@section GNU General Public License +@cindex GNU General Public License +@include trunk/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GPL.texinfo + +@node GNU Free Documentation License +@section GNU Free Documentation License +@cindex GNU Free Documentation License +@include trunk/Scripts/Functions/Help/Texinfo/Templates/en_US/Licenses/GFDL.texinfo diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter.texinfo new file mode 100755 index 0000000..e5ffcbd --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/Licenses/chapter.texinfo @@ -0,0 +1,5 @@ +@node Licenses +@appendix Licenses +@cindex Licenses +@include Licenses/chapter-menu.texinfo +@include Licenses/chapter-nodes.texinfo diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-index.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-index.texinfo new file mode 100755 index 0000000..b197b13 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-index.texinfo @@ -0,0 +1,8 @@ +@node Index +@unnumbered Index +@syncodeindex fn cp +@syncodeindex vr cp +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex tp cp +@printindex cp diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-init.pl b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-init.pl new file mode 100755 index 0000000..c6eff54 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-init.pl @@ -0,0 +1,7 @@ +# This file extends the `../manual-init.pl' initialization file to +# provide English specific initializations for `texi2html-1.76-4.fc6'. +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +return 1; diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-menu.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-menu.texinfo new file mode 100644 index 0000000..0afc9ff --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-menu.texinfo @@ -0,0 +1,4 @@ +@menu +* Licenses:: +* Index:: +@end menu diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-nodes.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-nodes.texinfo new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual-nodes.texinfo diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.conf b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.conf new file mode 100755 index 0000000..061f17f --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.conf @@ -0,0 +1,36 @@ +# This file controls the manual configuration. This file is divided +# in configuration sections (e.g., `main' and `templates') which, in +# turn, are organized in the form `variable = value'. +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +[main] + +# Specify documentation backend used by documentation manual. This is +# the format used to write documentation manual source files. +manual_backend = "texinfo" + +# Specify title style used by sections inside the manual. Possible +# values to this option are `cap-each-word' to capitalize each word in +# the section title, `cap-first-word' to capitalize the first word in +# the section title only and `directory' to transform each word in the +# section title into a directory path. From all these options, +# `cap-each-word' is the one used as default. +manual_section_style = "cap-each-word" + +# Specify the order used by sections inside the manual. By default new +# sections added to the manual are put on the end to follow the +# section `created' order. Other possible values to this option are +# `ordered' and `reversed' to sort the list of sections alphabetically +# from A-Z and Z-A, respectively. +manual_section_order = "created" + +[templates] + +# Specify relation between template files and section definition files +# inside the manual. Template definition is set on the left side using +# relative path. The section main definition file is described on the +# right using a regular expression. The first match wins. +Chapters/section-functions.texinfo = "^.+-functions-[[:alnum:]]+\.texinfo$" +Chapters/section.texinfo = "^.+\.texinfo$" diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.sed b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.sed new file mode 100755 index 0000000..474a78f --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.sed @@ -0,0 +1,40 @@ +#!/bin/sed +# +# repository.sed -- This file provide English transformations for +# texi2html outupt, based on The CentOS Project CSS definitions. +# +# Copyright (C) 2009-2010 Alain Reguera Delgado +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +# Quotations. +s!

Note!

Info

Note

!g + +s!

Warning!

Warning

Warning

!g + +s!

Important!

Important

Important

!g + +s!

Tip!

Tip

Tip

!g + +s!

Caution!

Caution

Caution

!g + +s!

Convention!

Convention

Convention

!g + +s!

Redirection!

Redirection

Redirection

!g diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.texinfo new file mode 100644 index 0000000..4565623 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/en_US/manual.texinfo @@ -0,0 +1,74 @@ +\input texinfo @c -*-texinfo-*- +@c -- Header -------------------------------------------------- + +@setfilename =MANUAL_NAME=.info +@settitle =MANUAL_TITLE= +@documentlanguage =LOCALE_LL= +@afourpaper +@finalout + +@c -- Variables ----------------------------------------------- + +@set TCENTOS The Community Enterprise Operating System +@set TCPROJ @url{http://www.centos.org/, The CentOS Project} +@set TCWIKI @url{http://wiki.centos.org/, The CentOS Wiki} +@set TCMLISTS @url{http://lists.centos.org/, The CentOS Mailing Lists} +@set TCBUGS @url{http://bugs.centos.org/, The CentOS Bugs} +@set TCMIRRORS @url{http://mirrors.centos.org/, The CentOS Mirrors} +@set TCPLANET @url{http://planet.centos.org/, The CentOS Planet} +@set TCFORUMS @url{http://forums.centos.org/, The CentOS Forums} +@set TCINFOML @email{centos-info@@centos.org, The CentOS Information Mailing List} +@set TCDEVSML @email{centos-devel@@centos.org, The CentOS Developers Mailing List} +@set TCDOCSML @email{centos-docs@@centos.org, The CentOS Documentation Mailing List} +@set TCARTWML @email{centos-artwork@@centos.org, The CentOS Artwork Mailing List} +@set TCL10NML @email{centos-l10n@@centos.org, The CentOS Localization Mailing List} +@set TCAR @url{https://projects.centos.org/svn/artwork/, The CentOS Artwork Repository} +@set TCAS @url{https://projects.centos.org/trac/artwork/, The CentOS Artwork SIG} + +@c -- Summary description and copyright ----------------------- + +@copying +=MANUAL_ABSTRACT= + +Copyright @copyright{} =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER= + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A +copy of the license is included in the section entitled @ref{GNU Free +Documentation License}. +@end copying + +@c -- Titlepage, contents, copyright --------------------------- + +@titlepage +@title =MANUAL_TITLE= +@subtitle =MANUAL_SUBTITLE= +@author =COPYRIGHT_HOLDER= +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage +@contents + +@c -- `Top' node and master menu ------------------------------- + +@ifnottex +@node Top +@top =MANUAL_TITLE= +@insertcopying +@end ifnottex + +@include =MANUAL_NAME=-menu.texinfo + +@c -- The body of the document -------------------------------- + +@include =MANUAL_NAME=-nodes.texinfo + +@c -- The end of the document --------------------------------- + +@include Licenses/chapter.texinfo +@include =MANUAL_NAME=-index.texinfo + +@bye diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/GFDL.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/GFDL.texinfo new file mode 100755 index 0000000..8f789ec --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/GFDL.texinfo @@ -0,0 +1,372 @@ +@subheading Preámbulo + +El propósito de esta Licencia es permitir que un manual, libro de +texto, u otro documento escrito sea «libre» en el sentido de libertad: +asegurar a todo el mundo la libertad efectiva de copiarlo y +redistribuirlo, con o sin modificaciones, de manera comercial o no. En +segundo término, esta Licencia proporciona al autor y al editor una +manera de obtener reconocimiento por su trabajo, sin que se le +considere responsable de las modificaciones realizadas por otros. + +Esta Licencia es de tipo «copyleft», lo que significa que los trabajos +derivados del documento deben a su vez ser libres en el mismo sentido. +Complementa la Licencia Pública General de GNU, que es una licencia +tipo copyleft diseñada para el software libre. + +Hemos diseñado esta Licencia para usarla en manuales de software +libre, ya que el software libre necesita documentación libre: Un +programa libre debe venir con los manuales que ofrezcan la mismas +libertades que da el software. Pero esta licencia no se limita a +manuales de software; puede ser usada para cualquier trabajo textual, +sin tener en cuenta su temática o si se publica como libro impreso. +Recomendamos esta licencia principalmente para trabajos cuyo fin sea +instructivo o de referencia. + +@subheading 1. Aplicación y definiciones + +Esta Licencia se aplica a cualquier manual u otro trabajo que contenga +un aviso colocado por el poseedor del copyright diciendo que puede +distribuirse bajo los términos de esta Licencia. El «Documento», +abajo, se refiere a cualquier manual o trabajo. Cualquier miembro del +público es un licenciatario,y será referido como «Usted». + +Una «Versión Modificada» del Documento significa cualquier trabajo que +contenga el Documento o una porción del mismo, ya sea una copia +literal o con modificaciones y/o traducciones a otro idioma. + +Una «Sección Secundaria» es un apéndice con título o una sección +preliminar del Documento que trata exclusivamente de la relación entre +los autores o editores y el tema general delDocumento que trata +exclusivamente con la relación entre los editores o autores del +Documento con el asunto general del Documento (o asuntos relacionados) +y no contiene nada que pueda considerarse dentro del tema principal. +(Por ejemplo, si el Documento es en parte un libro de texto de +matemáticas, una Sección Secundaria no explicará nada de matemáticas.) +La relación puede ser una conexión histórica con el asunto o temas +relacionados, o una opinión legal, comercial, filosófica, ética o +política acerca de ellos. + +Las «Secciones Invariantes» son ciertas Secciones Secundarias cuyos +títulos son designados como Secciones Invariantes en la nota que +indica que el Documento se publica bajo esta Licencia. + +Los «Textos de Cubierta» son ciertos pasajes cortos de texto que se +listan como Textos de Cubierta Delantera o Textos de Cubierta Trasera +en la nota que indica que el Documento se publica bajo esta Licencia. + +Una copia «Transparente» del Documento, significa una copia para +lectura en máquina, representada en un formato cuya especificación +está disponible al público en general, cuyo contenido puede ser visto +y editados directamente con editores de texto genéricos o (para +imágenes compuestas por píxeles) con programas genéricos de +manipulación de imágenes o (para dibujos) con algún editor de dibujos +ampliamente disponible, y que sea adecuado como entrada para +formateadores de texto o para su traducción automática a formatos +adecuados para formateadores de texto. Una copia hecha en un formato +definido como Transparente, pero cuyo marcaje o ausencia de él haya +sido diseñado para impedir o dificultar modificaciones posteriores por +parte de los lectores no es Transparente. Una copia que no es +«Transparente» se denomina «Opaca». + +Como ejemplos de formatos adecuados para copias Transparentes están +ASCII puro sin marcaje, formato de entrada de Texinfo, formato de +entrada de LaTeX, SGML o XML usando una DTD disponible públicamente, y +HTML, PostScript o PDF simples, que sigan los estándares y diseños +para que los modifiquen personas.Los formatos Opacos incluyen formatos +propietarios que pueden ser leídos y editados únicamente en +procesadores de textos propietarios, SGML o XML para los cuáles las +DTD y/o herramientas de procesamiento no estén ampliamente +disponibles, y HTML, PostScript o PDF generados por algunos +procesadores de textos sólo como salida. + +La «Portada» significa, en un libro impreso, la página de título, más +las páginas siguientes que sean necesarias para mantener legiblemente +el material que esta Licencia requiere en la portada. Para trabajos en +formatos que no tienen página de portada como tal, «Portada»significa +el texto cercano a la aparición más prominente del título del +trabajo,precediendo el comienzo del cuerpo del texto. + +@subheading 2. Copia literal + +Usted puede copiar y distribuir el Documento en cualquier medio, sea +en forma comercial o no, siempre y cuando proporcione esta Licencia, +las notas de copyright y la nota que indica que esta Licencia se +aplica al Documento reproduciéndola en todas las copias y que usted no +añada ninguna otra condición a las expuestas en esta Licencia. Usted +no puede usar medidas técnicas para obstruir o controlar la lectura o +copia posterior de las copias que usted haga o distribuya. Sin +embargo, usted puede aceptar compensación a cambio de las copias. Si +distribuye un número suficientemente grande de copias también deberá +seguir las condiciones de la sección 3. + +Usted también puede prestar copias, bajo las mismas condiciones +establecidas anteriormente, y puede exhibir copias públicamente. + +@subheading 3. Copiando en cantidad + +Si publica copias impresas del Documento que sobrepasen las 100, y la +nota de licencia del Documento exige Textos de Cubierta, debe +incluirlas copias con cubiertas que lleven en forma clara y legible +todos esos Textos de Cubierta: Textos de Cubierta Delantera en la +cubierta delantera y Textos de Cubierta Trasera en la cubierta +trasera. Ambas cubiertas deben identificarlo a Usted clara y +legiblemente como editor de tales copias. La cubierta debe mostrar el +título completo con todas las palabras igualmente prominentes y +visibles. Además puede añadir otro material en las cubiertas. Las +copias con cambios limitados a las cubiertas, siempre que conserven el +título del Documento y satisfagan estas condiciones, pueden +considerarse como copias literales en todos los aspectos. + +Si los textos requeridos para la cubierta son muy voluminosos para que +ajusten legiblemente, debe colocar los primeros (tantos como sea +razonable colocar) en la verdadera cubierta y situar el resto en +páginas adyacentes. + +Si Usted publica o distribuye copias Opacas del Documento cuya +cantidad exceda las 100, debe incluir una copia Transparente, que +pueda ser leída por una máquina, con cada copia Opaca, o bien mostrar, +en cada copia Opaca, una dirección de red donde cualquier usuario de +la misma tenga acceso por medio de protocolos públicos y +estandarizados a una copia Transparente del Documento completa, sin +material adicional. Si usted hace uso de la última opción, deberá +tomar las medidas necesarias, cuando comience la distribución de las +copias Opacas en cantidad, para asegurar que esta copia Transparente +permanecerá accesible en el sitio establecido por lo menos un año +después de la última vez que distribuya una copia Opaca de esa edición +al público (directamente o a través de sus agentes o distribuidores). + +Se solicita, aunque no es requisito, que se ponga en contacto con los +autores del Documento antes de redistribuir gran número de copias, +para darles la oportunidad de que le proporcionen una versión +actualizada del Documento. + +@subheading 4. Modificaciones + +Puede copiar y distribuir una Versión Modificada del Documento bajo +las condiciones de las secciones 2 y 3 anteriores, siempre que Usted +libere la Versión Modificada bajo esta misma Licencia, con la Versión +Modificada haciendo el rol del Documento, por lo tanto dando Licencia +de distribución y modificación de la Versión Modificada a quienquiera +posea una copia de la misma. Además, debe hacer lo siguiente en la +Versión Modificada: + +A. Usar en la Portada (y en las cubiertas, si hay alguna) un título +distinto al del Documento y de sus versiones anteriores (que deberían, +si hay alguna, estar listadas en la sección de Historia del +Documento). Puede usar el mismo título de versiones anteriores al +original siempre y cuando quien las publicó originalmente otorgue +permiso. + +B. Listar en la Portada, como autores, una o más personas o entidades +responsables de la autoría de las modificaciones de la Versión +Modificada, junto con por lo menos cinco de los autores principales +del Documento (todos sus autores principales, si hay menos de cinco), +a menos que le eximan de tal requisito. + +C. Mostrar en la Portada como editor el nombre del editor de la +Versión Modificada + +D. Conservar todas las notas de copyright del Documento. + +E. Añadir una nota de copyright apropiada a sus modificaciones, +adyacente a las otras notas de copyright. + +F. Incluir, inmediatamente después de los avisos de copyright, una +nota de licencia dando el permiso público para usar la Versión +Modificada bajo los términos de esta Licencia, de la forma mostrada en +el Adenda de más abajo. + +G. Incluir, inmediatamente después de ese aviso de licencia, la lista +completa de Secciones invariantes y de los Textos de Cubierta que sean +requeridos en el aviso de Licencia del Documento original. + +H. Incluir una copia sin modificación de esta Licencia. + +I. Conservar la sección titulada «Historia», conservar su Título y +añadirle un elemento que declare al menos el título, el año, los +nuevos autores y el editor de la Versión Modificada, tal como figuran +en la Portada. Si no hay una sección titulada «Historia» en el +Documento, crear una estableciendo el título, el año, los autores y el +editor del Documento, tal como figuran en su Portada, añadiendo además +un elemento describiendo la Versión Modificada, como se estableció en +la sentencia anterior. + +J. Conservar la dirección en red, si la hay, dada en el Documento para +el acceso público a una copia Transparente del mismo, así como las +otras direcciones de red dadas en el Documento para versiones +anteriores en las que estuviese basado. Pueden ubicarse en la sección +«Historia». Se puede omitir la ubicación en red de un trabajo que haya +sido publicado por lo menos cuatro años antes que el Documento mismo, +o si el editor original de dicha versión da permiso. + +K. En cualquier sección titulada «Agradecimientos» o «Dedicatorias», +conservar el título de la sección y conservar en ella toda la +sustancia y el tono de los agradecimientos y/o dedicatorias incluidas +por cada contribuyente. + +L. Conservar todas las Secciones Invariantes del Documento, sin +alterar su texto ni sus títulos. Los números de sección o equivalentes +no se consideran parte de los títulos de la sección. + +M. Borrar cualquier sección titulada «Aprobaciones». Tales secciones +no pueden estar incluidas en las Versiones Modificadas. + +N. No cambiar el título de ninguna sección existente a «Aprobaciones» +ni a uno que entre en conflicto con el de alguna Sección Invariante. + +Si la Versión Modificada incluye secciones o apéndices nuevos que +cualifiquen como Secciones Secundarias y no contienen ningún material +copiado del Documento, puede opcionalmente designar algunas o todas +esas secciones como invariantes. Para hacerlo, añada sus títulos a la +lista de Secciones Invariantes en el aviso de licencia de la Versión +Modificada. Tales títulos deben ser distintos de cualquier otro título +de sección. + +Puede añadir una sección titulada «Aprobaciones», siempre que contenga +únicamente aprobaciones de su Versión Modificada por otras fuentes +--por ejemplo, observaciones de compañeros o que el texto ha sido +aprobado por una organización como definición oficial de un estándar. + +Puede añadir un pasaje de hasta cinco palabras como Texto de Cubierta +Delantera y un pasaje de hasta 25 palabras como Texto de Cubierta +Trasera al final de la lista de Texto de Cubierta en la Versión +Modificada. Una entidad sólo puede añadir (o hacer que se añada) un +pasaje al Texto de Cubierta Delantera y uno al de Cubierta Trasera. Si +el Documento ya incluye un textos de cubiertas añadidos previamente +por usted o por acuerdo previo con la entidad que usted representa, +usted no puede añadir otro; pero puede reemplazar el anterior, con +permiso explícito del editor anterior que agregó el texto anterior. + +Con esta Licencia ni los autores ni los editores del Documento dan +permiso para usar sus nombres para publicidad ni para asegurar o +implicar aprobación de cualquier Versión Modificada. + +@subheading 5. Combinación de documentos + +Usted puede combinar el Documento con otros documentos liberados bajo +esta Licencia, bajo los términos definidos en la sección section 4 más +arriba para versiones modificadas, siempre que incluya en la +combinación todas las Secciones Invariantes de todos los documentos +originales, sin modificaciones, y las liste todas como Secciones +Invariantes de su trabajo combinado en su aviso de licencia. + +El trabajo combinado necesita contener solamente una copia de esta +Licencia, y múltiples Secciones Invariantes idénticas pueden +reemplazarse por una sola copia. Si hay múltiples Secciones +Invariantes con el mismo nombre pero con contenidos diferentes, haga +el título de cada una de estas secciones único añadiéndolo al final de +este, entre paréntesis, el nombre del autor o de quien editó +originalmente esa sección, si es conocido, o si no, un número único. +Haga el mismo ajuste a los títulos de sección en la lista de Secciones +Invariantes en la nota de licencia del trabajo combinado. + +En la combinación, debe combinar cualquier sección titulada «Historia» +de los distintos documentos originales, formando una sección titulada +«Historia»; de la misma forma, combine cualquier sección titulada +«Reconocimientos» y cualquier sección titulada «Dedicatorias». Debe +borrar todas las secciones tituladas «Aprobaciones». + +@subheading 6. Colecciones de documentos + +Puede hacer una colección que conste del Documento y de otros +documentos publicados bajo esta Licencia, y reemplazar las copias +individuales de esta Licencia en todos los documentos por una sola +copia que esté incluida en la colección, siempre que siga las reglas +de esta Licencia para cada copia literal de cada uno de los documentos +en cualquiera de los demás aspectos. + +Puede extraer un solo documento de una de tales colecciones y +distribuirlo individualmente bajo esta Licencia, siempre que inserte +una copia de esta Licencia en el documento extraído, y siga esta +Licencia en todos los demás aspectos relativos a la copia literal de +dicho documento. + +@subheading 7. Agregación con trabajos independientes + +Una recopilación que conste del Documento o sus derivados y de otros +documentos o trabajos separados e independientes, en cualquier soporte +de almacenamiento o distribución, no cuenta como un todo como una +Versión Modificada del Documento, siempre que no se reclame ningún +derecho de copyright por la compilación. Dicha compilación se denomina +un «agregado», y esta Licencia no se aplica a otros trabajos +autocontenidos incluidos con el Documento. teniendo en cuenta que son +compilados, si no son los mismos trabajos derivados del Documento. Si +el requisito de Texto de Cubierta de la sección 3 es aplicable a estas +copias del Documento, entonces si el Documento es menor que un cuarto +del agregado completo, los Textos de Cubierta del Documento pueden +colocarse en cubiertas que enmarquen solamente el Documento dentro del +agregado. En caso contrario deben aparecer en cubiertas impresas +enmarcando todo el agregado. + +@subheading 8. Traducción + +La Traducción se considera como un tipo de modificación, por lo que +usted puede distribuir traducciones del Documento bajo los términos de +la sección 4. El reemplazo las Secciones Invariantes por traducciones +requiere permiso especial de los poseedores del copyright, pero usted +puede incluir traducciones de algunas o todas las Secciones +Invariantes junto con las versiones originales de las mismas. Puede +incluir una traducción de esta Licencia, siempre que incluya también +la versión original en inglés de esta Licencia. En caso de desacuerdo +entre la traducción y la versión original en inglés de esta Licencia, +la versión original en Inglés prevalecerá. + +@subheading 9. Terminación + +Usted no puede copiar, modificar, sublicenciar o distribuir el +Documento salvo por lo permitido expresamente por esta Licencia. +Cualquier otro intento de copia, modificación, sublicenciamiento o +distribución del Documento es nulo, y dará por terminados +automáticamente sus derechos bajo esa Licencia. Sin embargo, los +terceros que hayan recibido copias, o derechos, de usted bajo esta +Licencia no verán terminadas sus licencias, siempre que permanezcan en +total conformidad con ella. + +@subheading Revisiones futuras de esta licencia + +La Free Software Foundation puede publicar versiones nuevas y +revisadas de la Licencia de Documentación Libre GNU de vez en cuando. +Dichas versiones nuevas serán similares en espíritu a la presente +versión, pero pueden diferir en detalles para solucionar nuevos +problemas o preocupaciones. Vea @url{http://www.gnu.org/copyleft/}. + +Cada versión de la Licencia tiene un número de versión que la +distingue. Si el Documento especifica que se aplica una versión +numerada en particular de esta licencia o «cualquier versión +posterior», usted tiene la opción de seguir los términos y condiciones +de la versión especificada o cualquiera posterior que haya sido +publicada (no como borrador) por la Free Software Foundation. Si el +Documento no especifica un número de versión de esta Licencia, puede +escoger cualquier versión que haya sido publicada (no como borrador) +por la Free Software Foundation. + +@subheading Adenda + +Para usar esta licencia en un documento que usted haya escrito, +incluya una copia de la Licencia en el documento y ponga el siguiente +copyright y notificación de licencia justo después de la página de +título: + +@example +Copyright © AÑO SU NOMBRE. + +Se otorga permiso para copiar, distribuir y/o modificar este documento +bajo los términos de la Licencia de Documentación Libre de GNU, +Versión 1.1 o cualquier otra versión posterior publicada por la +Free Software Foundation; con las Secciones Invariantes siendo su +LISTE SUS TÍTULOS, con Textos de Cubierta Delantera siendo LISTA, y +con los Textos de Cubierta Trasera siendo LISTA. Una copia de la +licencia está incluida en la sección titulada «GNU Free +Documentation License». +@end example + +Si no tiene Secciones Invariantes, escriba «sin Secciones Invariantes» +en vez de decir cuáles son invariantes. Si no tiene Textos de Cubierta +Frontal, escriba «sin Textos de Cubierta Frontal»; de la misma manera +para Textos de Cubierta Trasera. + +Si su documento contiene ejemplos de código de programa no triviales, +recomendamos liberar estos ejemplos en paralelo bajo la licencia de +software libre que usted elija, como la Licencia Pública General de +GNU (@pxref{GNU General Public License}), para permitir su uso en +software libre. diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/GPL.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/GPL.texinfo new file mode 100755 index 0000000..79680fe --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/GPL.texinfo @@ -0,0 +1,329 @@ +@subheading Preámbulo + +Las licencias que cubren la mayor parte del software están diseñadas +para quitarle a usted la libertad de compartirlo y modificarlo. Por el +contrario, la Licencia Pública General de GNU pretende garantizarle la +libertad de compartir y modificar software libre, para asegurar que el +software es libre para todos sus usuarios. Esta Licencia Pública +General se aplica a la mayor parte del software del la Free Software +Foundation y a cualquier otro programa si sus autores se comprometen a +utilizarla. (Existe otro software de la Free Software Foundation que +está cubierto por la Licencia Pública General de GNU para +Bibliotecas). Si quiere, también puede aplicarla a sus propios +programas. + +Cuando hablamos de software libre, estamos refiriéndonos a libertad, +no a precio. Nuestras Licencias Públicas Generales están diseñadas +para asegurarnos de que tenga la libertad de distribuir copias de +software libre (y cobrar por ese servicio si quiere), de que reciba el +código fuente o que pueda conseguirlo si lo quiere, de que pueda +modificar el software o usar fragmentos de él en programas nuevos +libres, y de que sepa que puede hacer todas estas cosas. + +Para proteger sus derechos necesitamos algunas restricciones que +prohíban a cualquiera negarle a usted estos derechos o pedirle que +renuncie a ellos. Estas restricciones se traducen en ciertas +obligaciones que le afectan si distribuye copias del software, o si lo +modifica. + +Por ejemplo, si distribuye copias de uno de estos programas, sea +gratuitamente, o a cambio de una contraprestación, debe dar a los +receptores todos los derechos que tiene. Debe asegurarse de que ellos +también reciben, o pueden conseguir, el código fuente. Y debe +mostrarles estas condiciones de forma que conozcan sus derechos. + +Protegemos sus derechos con la combinación de dos medidas: + +@itemize +@item Derechos de copia del software (copyright), y +@item Le ofrecemos esta licencia, que le da permiso legal para copiar, +distribuir y/o modificar el software. +@end itemize + +También, para la protección de cada autor y la nuestra propia, +queremos asegurarnos de que todo el mundo comprende que no se +proporciona ninguna garantía para este software libre. Si el software +se modifica por cualquiera y éste a su vez lo distribuye, queremos que +sus receptores sepan que lo que tienen no es el original, de forma que +cualquier problema introducido por otros no afecte a la reputación de +los autores originales. + +Finalmente, cualquier programa libre está constantemente amenazado por +patentes sobre el software. Queremos evitar el peligro de que los +redistribuidores de un programa libre obtengan patentes por su cuenta, +convirtiendo de facto el programa en propietario. Para evitar esto, +hemos dejado claro que cualquier patente debe ser pedida para el uso +libre de cualquiera, o no ser pedida. + +Los términos precisos y las condiciones para la copia, distribución y +modificación se exponen a continuación. + +@subheading TÉRMINOS Y CONDICIONES PARA LA COPIA, DISTRIBUCIÓN Y MODIFICACIÓN + +@subsubheading Sección 0 + +Esta Licencia se aplica a cualquier programa u otro tipo de obra que +contenga una notificación colocada por el propietario del copyright +diciendo que puede distribuirse bajo los términos de esta Licencia +Pública General. El «Programa», en adelante, se referirá a cualquier +programa u obra, y «obra basada en el Programa» se referirá bien al +Programa o a cualquier trabajo derivado de él según la ley de derechos +de autor (copyright): Esto es, una obra o trabajo que contenga el +programa o una porción de él, bien en forma literal o con +modificaciones y/o traducido en otro lenguaje. Aquí y después, la +traducción está incluida sin limitación en el término «modificación». +Cada concesionario (licenciatario) será denominado «usted». + +Cualquier otra actividad que no sea la copia, distribución o +modificación no está cubierta por esta Licencia, está fuera de su +ámbito. El acto de ejecutar el Programa no está restringido, y los +resultados del Programa están cubiertos únicamente si sus contenidos +constituyen un trabajo basado en el Programa, independientemente de +haberlo producido mediante la ejecución del programa. El que esto se +cumpla, depende de lo que haga el programa. + +@subsubheading Sección 1 + +Usted puede copiar y distribuir copias literales del código fuente del +Programa, según lo has recibido, en cualquier medio, supuesto que de +forma adecuada y bien visible publique en cada copia un anuncio de +copyright adecuado y un repudio de garantía, mantenga intactos todos +los anuncios que se refieran a esta Licencia y a la ausencia de +garantía, y proporcione a cualquier otro receptor del programa una +copia de esta Licencia junto con el Programa. + +Puede cobrar un precio por el acto físico de transferir una copia, y +puede, según su libre albedrío, ofrecer garantía a cambio de unos +honorarios. + +@subsubheading Sección 2 + +Puede modificar su copia o copias del Programa o de cualquier porción +de él, formando de esta manera un trabajo basado en el Programa, y +copiar y distribuir esa modificación o trabajo bajo los términos de la +Sección 1 anterior, probado que además usted cumpla con todas las +siguientes condiciones: + +@enumerate +@item Debe hacer que los ficheros modificados lleven anuncios +prominentes indicando que los ha cambiado y la fecha de cualquier +cambio. + +@item Debe hacer que cualquier trabajo que distribuya o publique y que +en todo o en parte contenga o sea derivado del Programa o de cualquier +parte de él sea licenciada como un todo, sin carga alguna, a todas las +terceras partes y bajo los términos de esta Licencia. + +@item If the modified program normally reads commands interactively +when run, you must cause it, when started running for such interactive +use in the most ordinary way, to print or display an announcement +including an appropriate copyright notice and a notice that there is +no warranty (or else, saying that you provide a warranty) and that +users may redistribute the program under these conditions, and telling +the user how to view a copy of this License. + +Excepción: Si el propio Programa es interactivo pero normalmente no +muestra ese anuncio, no se requiere que su trabajo basado en el +Programa muestre ningún anuncio. + +@end enumerate + +Estos requisitos se aplican al trabajo modificado como un todo. Si +partes identificables de ese trabajo no son derivadas del Programa, y +pueden, razonablemente, ser consideradas trabajos independientes y +separados por ellos mismos, entonces esta Licencia y sus términos no +se aplican a esas partes cuando sean distribuidas como trabajos +separados. Pero cuando distribuya esas mismas secciones como partes de +un todo que es un trabajo basado en el Programa, la distribución del +todo debe ser según los términos de esta licencia, cuyos permisos para +otros licenciatarios se extienden al todo completo, y por lo tanto a +todas y cada una de sus partes, con independencia de quién la +escribió. + +Por lo tanto, no es la intención de este apartado reclamar derechos o +desafiar sus derechos sobre trabajos escritos totalmente por usted +mismo. El intento es ejercer el derecho a controlar la distribución de +trabajos derivados o colectivos basados en el Programa. + +Además, el simple hecho de reunir un trabajo no basado en el Programa +con el Programa (o con un trabajo basado en el Programa) en un volumen +de almacenamiento o en un medio de distribución no hace que dicho +trabajo entre dentro del ámbito cubierto por esta Licencia. + +@subsubheading Sección 3 + +Puede copiar y distribuir el Programa (o un trabajo basado en él, +según se especifica en la Sección 2, como código objeto o en formato +ejecutable según los términos de las Secciones 1 y 2 anteriores, +supuesto que además cumpla una de las siguientes condiciones: + +@enumerate + +@item Acompañarlo con el código fuente leíble completo +correspondiente, leíble por máquinas, que debe ser distribuido según +los términos las Secciones 1 y 2 mencionadas antes en un medio +habitualmente utilizado para el intercambio de software, o, + +@item Acompañarlo con una oferta por escrito, válida durante al menos +tres años, de proporcionar a cualquier tercera parte una copia +completa en formato electrónico del código fuente correspondiente, a +un coste no mayor que el de realizar físicamente la distribución del +fuente, que será distribuido bajo las condiciones descritas en los +apartados 1 y 2 anteriores, en un medio habitualmente utilizado para +el intercambio de programas, o + +@item Acompañarlo con la información que recibiste ofreciendo +distribuir el código fuente correspondiente. (Esta opción se permite +sólo para distribución no comercial y sólo si usted recibió el +programa como código objeto o en formato ejecutable con tal oferta, de +acuerdo con la Subsección b anterior). +@end enumerate + +Por código fuente de un trabajo se entiende la forma preferida del +trabajo cuando se le hacen modificaciones. Para un trabajo ejecutable, +se entiende por código fuente completo todo el código fuente para +todos los módulos que contiene, más cualquier fichero asociado de +definición de interfaces, más los guiones utilizados para controlar la +compilación e instalación del ejecutable. Como excepción especial el +código fuente distribuido no necesita incluir nada que sea distribuido +normalmente (bien como fuente, bien en forma binaria) con los +componentes principales (compilador, núcleo y similares) del sistema +operativo en el cual funciona el ejecutable, a no ser que el propio +componente acompañe al ejecutable. + +Si la distribución del ejecutable o del código objeto se hace mediante +la oferta acceso para copiarlo de un cierto lugar, entonces se +considera la oferta de acceso para copiar el código fuente del mismo +lugar como distribución del código fuente, incluso aunque terceras +partes no estén forzadas a copiar el fuente junto con el código +objeto. + +@subsubheading Sección 4 + +No puede copiar, modificar, sublicenciar o distribuir el Programa +excepto como prevé expresamente esta Licencia. Cualquier intento de +copiar, modificar sublicenciar o distribuir el Programa de otra forma +es inválida, y hará que cesen automáticamente los derechos que te +proporciona esta Licencia. En cualquier caso, las partes que hayan +recibido copias o derechos de usted bajo esta Licencia no cesarán en +sus derechos mientras esas partes continúen cumpliéndola. 5Sección 5 + +No está obligado a aceptar esta licencia, ya que no la ha firmado. Sin +embargo, no hay hada más que le proporcione permiso para modificar o +distribuir el Programa o sus trabajos derivados. Estas acciones están +prohibidas por la ley si no acepta esta Licencia. Por lo tanto, si +modifica o distribuye el Programa (o cualquier trabajo basado en el +Programa), está indicando que acepta esta Licencia para poder hacerlo, +y todos sus términos y condiciones para copiar, distribuir o modificar +el Programa o trabajos basados en él. 6Sección 6 + +Cada vez que redistribuya el Programa (o cualquier trabajo basado en +el Programa), el receptor recibe automáticamente una licencia del +licenciatario original para copiar, distribuir o modificar el +Programa, de forma sujeta a estos términos y condiciones. No puede +imponer al receptor ninguna restricción más sobre el ejercicio de los +derechos aquí garantizados. No es usted responsable de hacer cumplir +esta licencia por terceras partes. 7Sección 7 + +Si como consecuencia de una resolución judicial o de una alegación de +infracción de patente o por cualquier otra razón (no limitada a +asuntos relacionados con patentes) se le imponen condiciones (ya sea +por mandato judicial, por acuerdo o por cualquier otra causa) que +contradigan las condiciones de esta Licencia, ello no le exime de +cumplir las condiciones de esta Licencia. Si no puede realizar +distribuciones de forma que se satisfagan simultáneamente sus +obligaciones bajo esta licencia y cualquier otra obligación pertinente +entonces, como consecuencia, no puede distribuir el Programa de +ninguna forma. Por ejemplo, si una patente no permite la +redistribución libre de derechos de autor del Programa por parte de +todos aquellos que reciban copias directa o indirectamente a través de +usted, entonces la única forma en que podría satisfacer tanto esa +condición como esta Licencia sería evitar completamente la +distribución del Programa. + +Si cualquier porción de este apartado se considera inválida o +imposible de cumplir bajo cualquier circunstancia particular ha de +cumplirse el resto y la sección por entero ha de cumplirse en +cualquier otra circunstancia. + +No es el propósito de este apartado inducirle a infringir ninguna +reivindicación de patente ni de ningún otro derecho de propiedad o +impugnar la validez de ninguna de dichas reivindicaciones. Este +apartado tiene el único propósito de proteger la integridad del +sistema de distribución de software libre, que se realiza mediante +prácticas de licencia pública. Mucha gente ha hecho contribuciones +generosas a la gran variedad de software distribuido mediante ese +sistema con la confianza de que el sistema se aplicará +consistentemente. Será el autor/donante quien decida si quiere +distribuir software mediante cualquier otro sistema y una licencia no +puede imponer esa elección. + +Este apartado pretende dejar completamente claro lo que se cree que es +una consecuencia del resto de esta Licencia. + +@subsubheading Sección 8 + +Si la distribución y/o uso de el Programa está restringida en ciertos +países, bien por patentes o por interfaces bajo copyright, el tenedor +del copyright que coloca este Programa bajo esta Licencia puede añadir +una limitación explícita de distribución geográfica excluyendo esos +países, de forma que la distribución se permita sólo en o entre los +países no excluidos de esta manera. En ese caso, esta Licencia +incorporará la limitación como si estuviese escrita en el cuerpo de +esta Licencia. 9Sección 9 + +La Free Software Foundation puede publicar versiones revisadas y/o +nuevas de la Licencia Pública General de tiempo en tiempo. Dichas +nuevas versiones serán similares en espíritu a la presente versión, +pero pueden ser diferentes en detalles para considerar nuevos +problemas o situaciones. + +Cada versión recibe un número de versión que la distingue de otras. Si +el Programa especifica un número de versión de esta Licencia que se +aplica aplica a éste y a «cualquier versión posterior», usted tiene la +opción de seguir los términos y condiciones, bien de esa versión, bien +de cualquier versión posterior publicada por la Free Software +Foundation. Si el Programa no especifica un número de versión de esta +Licencia, usted puede escoger cualquier versión publicada por la Free +Software Foundation. + +@subsubheading Sección 10 + +Si quiere incorporar partes del Programa en otros programas libres +cuyas condiciones de distribución son diferentes, escribe al autor +para pedirle permiso. Si el software tiene copyright de la Free +Software Foundation, escribe a la Free Software Foundation: algunas +veces hacemos excepciones en estos casos. Nuestra decisión estará +guiada por el doble objetivo de de preservar la libertad de todos los +derivados de nuestro software libre y promover el que se comparta y +reutilice el software en general. + +@subsubheading AUSENCIA DE GARANTÍA + +Sección 11 + +DEBIDO A QUE EL PROGRAMA SE LICENCIA LIBRE DE CARGAS, NO SE OFRECE +NINGUNA GARANTÍA SOBRE EL PROGRAMA, EN TODA LA EXTENSIÓN PERMITIDA POR +LA LEGISLACIÓN APLICABLE. EXCEPTO CUANDO SE INDIQUE DE OTRA FORMA POR +ESCRITO, LOS PROPIETARIOS DEL COPYRIGHT Y/U OTRAS PARTES PROPORCIONAN +EL PROGRAMA «TAL CUAL», SIN GARANTÍA DE NINGUNA CLASE, BIEN EXPRESA O +IMPLÍCITA, CON INCLUSIÓN, PERO SIN LIMITACIÓN A LAS GARANTÍAS +MERCANTILES IMPLÍCITAS O A LA CONVENIENCIA PARA UN PROPÓSITO +PARTICULAR. CUALQUIER RIESGO REFERENTE A LA CALIDAD Y PRESTACIONES DEL +PROGRAMA ES ASUMIDO POR USTED. SI SE PROBASE QUE EL PROGRAMA ES +DEFECTUOSO, USTED ASUME EL COSTE DE CUALQUIER SERVICIO, REPARACIÓN O +CORRECCIÓN NECESARIO. + +@subsubheading Sección 12 + +EN NINGÚN CASO, SALVO QUE LO REQUIERA LA LEGISLACIÓN APLICABLE O HAYA +SIDO ACORDADO POR ESCRITO, NINGÚN TENEDOR DEL COPYRIGHT NI NINGUNA +OTRA PARTE QUE MODIFIQUE Y/O REDISTRIBUYA EL PROGRAMA SEGÚN SE PERMITE +EN ESTA LICENCIA SERÁ RESPONSABLE ANTE USTED POR DAÑOS, INCLUYENDO +CUALQUIER DAÑO GENERAL, ESPECIAL, INCIDENTAL O RESULTANTE PRODUCIDO +POR EL USO O LA IMPOSIBILIDAD DE USO DEL PROGRAMA (CON INCLUSIÓN, PERO +SIN LIMITACIÓN A LA PÉRDIDA DE DATOS O A LA GENERACIÓN INCORRECTA DE +DATOS O A PÉRDIDAS SUFRIDAS POR USTED O POR TERCERAS PARTES O A UN +FALLO DEL PROGRAMA AL FUNCIONAR EN COMBINACIÓN CON CUALQUIER OTRO +PROGRAMA), INCLUSO SI DICHO TENEDOR U OTRA PARTE HA SIDO ADVERTIDO DE +LA POSIBILIDAD DE DICHOS DAÑOS. diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-menu.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-menu.texinfo new file mode 100755 index 0000000..b8240ba --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-menu.texinfo @@ -0,0 +1,4 @@ +@menu +* GNU General Public License:: +* GNU Free Documentation License:: +@end menu diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-nodes.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-nodes.texinfo new file mode 100755 index 0000000..7148d15 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter-nodes.texinfo @@ -0,0 +1,9 @@ +@node GNU General Public License +@section Licencia Pública General de GNU +@cindex Licencia pública general GNU +@include trunk/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GPL.texinfo + +@node GNU Free Documentation License +@section Licencia de Documentación Libre de GNU +@cindex Licencia documentación libre GNU +@include trunk/Scripts/Functions/Help/Texinfo/Templates/es_ES/Licenses/GFDL.texinfo diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter.texinfo new file mode 100755 index 0000000..fed7e22 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/Licenses/chapter.texinfo @@ -0,0 +1,5 @@ +@node Licenses +@appendix Licencias +@cindex Licencias +@include Licenses/chapter-menu.texinfo +@include Licenses/chapter-nodes.texinfo diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-index.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-index.texinfo new file mode 100755 index 0000000..bed8139 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-index.texinfo @@ -0,0 +1,8 @@ +@node Index +@unnumbered Índice +@syncodeindex fn cp +@syncodeindex vr cp +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex tp cp +@printindex cp diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-init.pl b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-init.pl new file mode 100755 index 0000000..d8e2045 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-init.pl @@ -0,0 +1,119 @@ +# This file extends the '../manual-init.pl' initialization file to # provide Spanish translation messages for `texi2html-1.76-4.fc6'. +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +$LANGUAGES->{'es'} = { + ' The buttons in the navigation panels have the following meaning:' => 'Los botones en el panel de navegación tienen el significado siguiente:', + ' where the @strong{ Example } assumes that the current position is at @strong{ Subsubsection One-Two-Three } of a document of the following structure:' => 'donde el @strong{Ejemplo} asume que la posición actual es en @strong{Subsubsección Uno-Dos-Tres}', + ' Up ' => 'Arriba', + '%{acronym_like} (%{explanation})' => '', + '%{month}, %{day} %{year}' => '', + '%{name} of %{class}' => '%{name} de %{class}', + '%{name} on %{class}' => '%{name} en %{class}', + '%{node_file_href}' => '', + '%{node_file_href} @cite{%{book}}' => '', + '%{node_file_href} section `%{section}\' in @cite{%{book}}' => 'sección %{node_file_href} `%{section}\' en @cite{%{book}}', + '%{reference_name}' => '', + '%{style} %{number}' => '', + '%{style}: %{caption_first_line}' => '', + '%{style}: %{shortcaption_first_line}' => '', + '@b{%{quotation_arg}:} ' => '', + '@cite{%{book}}' => '', + 'About This Document' => 'Acerca de este documento', + 'April' => 'abril', + 'August' => 'agosto', + 'Button' => 'Botón', + 'Contents' => 'Contenidos', + 'Current Position' => 'Posición actual', + 'December' => 'diciembre', + 'February' => 'febrero', + 'Footnotes' => 'Pie de página', + 'From 1.2.3 go to' => 'Desde 1.2.3 va a', + 'Go to' => 'Ir a', + 'Index' => 'Índice', + 'Index Entry' => 'Entrada índice', + 'January' => 'enero', + 'July' => 'julio', + 'Jump to' => 'Saltar a', + 'June' => 'junio', + 'March' => 'marzo', + 'May' => 'mayo', + 'Menu:' => 'Menú:', + 'Name' => 'Nombre', + 'Next' => 'Siguiente', + 'November' => 'noviembre', + 'October' => 'octubre', + 'Overview' => 'Introducción', + 'Overview:' => 'Introducción:', + 'Prev' => 'Anterior', + 'Section' => 'Sección', + 'Section One' => 'Sección Uno', + 'See %{node_file_href}' => 'Véase %{node_file_href}', + 'See %{node_file_href} @cite{%{book}}' => 'Véase %{node_file_href} @cite{%{book}}', + 'See %{node_file_href} section `%{section}\' in @cite{%{book}}' => 'Véase la sección %{node_file_href} `%{section}\' en @cite{%{book}}', + 'See %{reference_name}' => 'Véase %{reference_name}', + 'See @cite{%{book}}' => 'Véase @cite{%{book}}', + 'See section %{reference_name}' => 'Véase la sección %{reference_name}', + 'See section `%{section}\' in @cite{%{book}}' => 'Véase la sección `%{section}\' en @cite{%{book}}', + 'September' => 'septiembre', + 'Short Table of Contents' => 'Resumen del Contenido', + 'Subsection One-Four' => 'Subsección Uno-Cuatro', + 'Subsection One-One' => 'Subsección Uno-Uno', + 'Subsection One-Three' => 'Subsección Uno-Tres', + 'Subsection One-Two' => 'Subsección Uno-Dos', + 'Subsubsection One-Two-Four' => 'Subsubsección Uno-Dos-Cuatro', + 'Subsubsection One-Two-One' => 'Subsubsección Uno-Dos-Uno', + 'Subsubsection One-Two-Three' => 'Subsubsección Uno-Dos-Tress', + 'Subsubsection One-Two-Two' => 'Subsubsección Uno-Dos-Dos', + 'T2H_today' => '', + 'Table of Contents' => 'Tabla de contenidos', + 'This document was generated by @emph{%{user}} on @emph{%{date}} using @uref{%{program_homepage}, @emph{%{program}}}.' => 'Este documento fue generado pr @emph{%{user}} en @emph{%{date}} usando @uref{%{program_homepage}, @emph{%{program}}}.', + 'This document was generated by @emph{%{user}} using @uref{%{program_homepage}, @emph{%{program}}}.' => 'Este documento fue generado por @emph{%{user}} usando @uref{%{program_homepage}, @emph{%{program}}}.', + 'This document was generated on @i{%{date}} using @uref{%{program_homepage}, @i{%{program}}}.' => 'Este documento fue generado en @i{%{date}} usando @uref{%{program_homepage}, @i{%{program}}}.', + 'This document was generated using @uref{%{program_homepage}, @emph{%{program}}}.' => 'Este documento fue generado usando @uref{%{program_homepage}, @emph{%{program}}}.', + 'Top' => 'Inicio', + 'Untitled Document' => 'Documento sintítulo', + 'about (help)' => 'Acerca de (ayuda)', + 'beginning of this chapter or previous chapter' => 'Inicio del capítulo o capítulo anterior', + 'by @emph{%{user}}' => 'por @emph{%{user}}', + 'by @emph{%{user}} on @emph{%{date}}' => 'por @emph{%{user}} el @emph{%{date}}', + 'cover (top) of document' => 'Cubierta (inicio) del documento', + 'current' => 'actual', + 'current section' => 'Sección actual', + 'first section in reading order' => 'Primera sección en orden de lectura', + 'following node' => 'Nodo siguiente', + 'index' => 'Índice', + 'last section in reading order' => 'Última sección en orden de lectura', + 'next chapter' => 'Capítulo siguiente', + 'next node' => 'Nodo siguiente', + 'next section in reading order' => 'Sección siguiente en order de lectura', + 'next section on same level' => 'Sección siguiente en el mismo nivel', + 'node following in node reading order' => 'siguiente nodo en orden de lectura', + 'node up' => 'nodo arriba', + 'on @emph{%{date}}' => 'el @emph{%{date}}', + 'previous node' => 'nodo anterior', + 'previous section in reading order' => 'Sección anterior en orden de lectura', + 'previous section on same level' => 'Sección anterior en el mismo nivel', + 'section `%{section}\' in @cite{%{book}}' => 'sección `%{section}\' en @cite{%{book}}', + 'see %{node_file_href}' => 'Véase %{node_file_href}', + 'see %{node_file_href} @cite{%{book}}' => 'Véase %{node_file_href} @cite{%{book}}', + 'see %{node_file_href} section `%{section}\' in @cite{%{book}}' => 'Véase %{node_file_href} sección `%{section}\' en @cite{%{book}}', + 'see %{reference_name}' => 'Véase %{reference_name}', + 'see @cite{%{book}}' => 'Véase @cite{%{book}}', + 'see section %{reference_name}' => 'véase sección %{reference_name}', + 'see section `%{section}\' in @cite{%{book}}' => 'véase sección `%{section}\' en @cite{%{book}}', + 'short table of contents' => 'resumen del contenido', + 'table of contents' => 'Tabla de contenidos', + 'unknown' => 'desconocido', + 'up node' => 'nodo superior', + 'up section' => 'Sección superior' + }; + +$T2H_OBSOLETE_STRINGS->{'es'} = { + 'See' => 'Véase', + 'section' => 'sección', + 'see' => 'véase' + }; + +return 1; diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-menu.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-menu.texinfo new file mode 100644 index 0000000..0afc9ff --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-menu.texinfo @@ -0,0 +1,4 @@ +@menu +* Licenses:: +* Index:: +@end menu diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-nodes.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-nodes.texinfo new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual-nodes.texinfo diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.conf b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.conf new file mode 100755 index 0000000..488ad84 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.conf @@ -0,0 +1,43 @@ +# Este fichero controla la configuración del manual. Este fichero +# está dividido en diferentes secciones de configuración (e.g., `main' +# para organizar la configuración principal y `templates' para +# organizar la relación de asiganación plantillas-sección). Cada +# sección de configuración está organizada en pares de valores +# `variable = valor' usados para describir las preferencias de +# configuración. +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +[main] + +# Especifica el trasfondo de documentación usado por el manual. Este +# es el formato utilizado para redactar los ficheros fuentes del +# manual de documentación. +manual_backend = "texinfo" + +# Especifica el estilo de títulos utilizados por las secciones del +# manual. Los valores posibles para esta opción son `cap-each-word' +# para escribir la primera letra de cada palabra en el título con +# mayúscula y el resto en minúscula, `cap-first-word' para escribir +# solo la primera letra del título en mayúscula y el resto en +# minúscula; y `directory' para transformar el título en un camino de +# directorio. +manual_section_style = "cap-each-word" + +# Especifica el order con que se muestran las secciones en el manual. +# Los valores posibles para esta opción son `created' para ubicar las +# nuevas secciones creadas en orden de creación, `ordered' para +# ordenar las secciones alfabéticamente sin importar el orden con el +# cual fueron creadas; y `reversed' lo contrario the `ordered'. +manual_section_order = "created" + +[templates] + +# Especifica la relación entre los ficheros de plantilla y los +# ficheros de definición de secciones en el manual. La definición de +# las plantillas se escriben en forma de camino relativo en el +# izquierdo y la definición de secciones en forma de expresión regular +# en el lado derecho. +Chapters/section-functions.texinfo = "^.+-functions-[[:alnum:]]+\.texinfo$" +Chapters/section.texinfo = "^.+\.texinfo$" diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.sed b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.sed new file mode 100644 index 0000000..1887582 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.sed @@ -0,0 +1,40 @@ +#!/bin/sed +# +# repository.sed -- This file provide Spanish transformations for +# texi2html outupt, based on The CentOS Project CSS definitions. +# +# Copyright (C) 2009-2010 Alain Reguera Delgado +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +# Quotations. +s!

Nota!

Info

Nota

!g + +s!

Advertencia!

Advertencia

Advertencia

!g + +s!

Importante!

Importante

Importante

!g + +s!

Idea!

Idea

Idea

!g + +s!

Precaución!

Precaución

Precaución

!g + +s!

Convensión!

Convensión

Convensión

!g + +s!

Redirección!

Redirección

Redirección

!g diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.texinfo b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.texinfo new file mode 100644 index 0000000..991a60d --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/es_ES/manual.texinfo @@ -0,0 +1,75 @@ +\input texinfo @c -*-texinfo-*- +@c -- Header -------------------------------------------------- + +@setfilename =MANUAL_NAME=.info +@settitle =MANUAL_TITLE= +@documentlanguage es +@afourpaper +@finalout + +@c -- Variables ----------------------------------------------- + +@set TCENTOS The Community Enterprise Operating System +@set TCPROJ @url{http://www.centos.org/, The CentOS Project} +@set TCWIKI @url{http://wiki.centos.org/, The CentOS Wiki} +@set TCMLISTS @url{http://lists.centos.org/, The CentOS Mailing Lists} +@set TCBUGS @url{http://bugs.centos.org/, The CentOS Bugs} +@set TCMIRRORS @url{http://mirrors.centos.org/, The CentOS Mirrors} +@set TCPLANET @url{http://planet.centos.org/, The CentOS Planet} +@set TCFORUMS @url{http://forums.centos.org/, The CentOS Forums} +@set TCINFOML @email{centos-info@@centos.org, The CentOS Information Mailing List} +@set TCDEVSML @email{centos-devel@@centos.org, The CentOS Developers Mailing List} +@set TCDOCSML @email{centos-docs@@centos.org, The CentOS Documentation Mailing List} +@set TCARTWML @email{centos-artwork@@centos.org, The CentOS Artwork Mailing List} +@set TCL10NML @email{centos-l10n@@centos.org, The CentOS Localization Mailing List} +@set TCAR @url{https://projects.centos.org/svn/artwork/, The CentOS Artwork Repository} +@set TCAS @url{https://projects.centos.org/trac/artwork/, The CentOS Artwork SIG} + +@c -- Summary description and copyright ----------------------- + +@copying +=MANUAL_ABSTRACT= + +Copyright @copyright{} =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER= + +Se otorga permiso para copiar, distribuir y/o modificar este documento +bajo los términos de la Licencia de Documentación Libre de GNU, +Versión 1.1 o cualquier otra versión posterior publicada por la Free +Software Foundation; con las Secciones Invariantes, con Textos de +Cubierta Delantera, y con los Textos de Cubierta Trasera. Una copia de +la licencia está incluida en la sección titulada @ref{GNU Free +Documentation License}. +@end copying + +@c -- Titlepage, contents, copyright --------------------------- + +@titlepage +@title =MANUAL_TITLE= +@subtitle =MANUAL_SUBTITLE= +@author =COPYRIGHT_HOLDER= +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage +@contents + +@c -- `Top' node and master menu ------------------------------- + +@ifnottex +@node Top +@top =MANUAL_TITLE= +@insertcopying +@end ifnottex + +@include =MANUAL_NAME=-menu.texinfo + +@c -- The body of the document -------------------------------- + +@include =MANUAL_NAME=-nodes.texinfo + +@c -- The end of the document --------------------------------- + +@include Licenses/chapter.texinfo +@include =MANUAL_NAME=-index.texinfo + +@bye diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/manual-init.pl b/Scripts/centos-art/Functions/Help/Texinfo/Templates/manual-init.pl new file mode 100755 index 0000000..6dfc09d --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/manual-init.pl @@ -0,0 +1,389 @@ +#!/usr/bin/perl +# +# repository.init -- This file initializes Texi2HTML program to +# produce the repository documentation manual using the CentOS Web +# Environment XHTML and CSS standard definition. +# +# Copyright (C) 2009, 2010, 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +# -iso +# if set, ISO8859 characters are used for special symbols (like +# copyright, etc) +$USE_ISO = 1; + +# -I +# add a directory to the list of directories where @include files are +# searched for (besides the directory of the file). additional '-I' +# args are appended to this list. (APA: Don't implicitely search ., +# to conform with the docs!) my @INCLUDE_DIRS = ("."); +@INCLUDE_DIRS = ("/home/centos/artwork"); + +# Extension used on output files. +$EXTENSION = "xhtml"; + +# Horizontal rules. +$DEFAULT_RULE = '


'; +$SMALL_RULE = $DEFAULT_RULE; +$MIDDLE_RULE = $DEFAULT_RULE; +$BIG_RULE = $DEFAULT_RULE; + +# -split section|chapter|node|none +# if $SPLIT is set to 'section' (resp. 'chapter') one html file per +# section (resp. chapter) is generated. If $SPLIT is set to 'node' one +# html file per node or sectionning element is generated. In all these +# cases separate pages for Top, Table of content (Toc), Overview and +# About are generated. Otherwise a monolithic html file that contains +# the whole document is created. +$SPLIT = 'section'; + +# -sec-nav|-nosec-nav +# if this is set then navigation panels are printed at the beginning +# of each section. If the document is split at nodes then navigation +# panels are printed at the end if there were more than $WORDS_IN_PAGE +# words on page. +# +# If the document is split at sections this is ignored. +# +# This is most useful if you do not want to have section navigation +# with -split chapter. There will be chapter navigation panel at the +# beginning and at the end of chapters anyway. +$SECTION_NAVIGATION = 1; + +# Layout control +$print_page_head = \&T2H_XHTML_print_page_head; +$print_page_foot = \&T2H_XHTML_print_page_foot; +$print_frame = \&T2H_XHTML_print_frame; +$button_icon_img = \&T2H_XHTML_button_icon_img; +$print_navigation = \&T2H_XHTML_print_navigation; + +#FIXME update once it is more stabilized in texi2html.init +sub T2H_XHTML_print_page_head +{ + my $fh = shift; + my $longtitle = "$Texi2HTML::THISDOC{'title_unformatted'}"; + $longtitle .= ": $Texi2HTML::UNFORMATTED{'This'}" if exists $Texi2HTML::UNFORMATTED{'This'}; + print $fh < + + + + + $longtitle + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +EOT +} + +sub T2H_XHTML_print_page_foot +{ + my $fh = shift; + my @date=localtime(time); + my $year=$date[5] += 1900; + my $program_string = program_string(); + print $fh <$program_string

+ +
+ +
+ + +
+ + + + +EOT +} + +# / in +sub T2H_XHTML_button_icon_img +{ + my $button = shift; + my $icon = shift; + my $name = shift; + return '' if (!defined($icon)); + if (defined($name) && $name) + { + $name = ": $name"; + } + else + { + $name = ''; + } + $button = "" if (!defined ($button)); + return qq{$button$name}; +} + +$simple_map{'*'} = '
'; + +# formatting functions + +$def_line = \&t2h_xhtml_def_line; +$index_summary = \&t2h_xhtml_index_summary; +$image = \&t2h_xhtml_image; + +# need / in +sub t2h_xhtml_image($$$) +{ + my $file = shift; + my $base = shift; + my $preformatted = shift; + return "[ $base ]" if ($preformatted); + return "\"$base\""; +} + +# process definition commands line @deffn for example +# replaced by +sub t2h_xhtml_def_line($$$$$) +{ + my $category = shift; + my $name = shift; + my $type = shift; + my $arguments = shift; + my $index_label = shift; + $index_label = '' if (!defined($index_label)); + $name = '' if (!defined($name) or ($name =~ /^\s*$/)); + $type = '' if (!defined($type) or $type =~ /^\s*$/); + if (!defined($arguments) or $arguments =~ /^\s*$/) + { + $arguments = ''; + } + else + { + $arguments = '' . $arguments . ''; + } + my $type_name = ''; + $type_name = " $type" if ($type ne ''); + $type_name .= ' ' . $name . '' if ($name ne ''); + $type_name .= $arguments . "\n"; + if (! $DEF_TABLE) + { + return '
'. '' . $category . ':' . $type_name . $index_label . "
\n"; + } + else + { + + return "\n" . $type_name . + "\n" . $category . $index_label . "\n" . "\n"; + } +} + +# There is a br which needs / +sub t2h_xhtml_index_summary($$) +{ + my $alpha = shift; + my $nonalpha = shift; + my $join = ''; + my $nonalpha_text = ''; + my $alpha_text = ''; + $join = "   \n
\n" if (@$nonalpha and @$alpha); + if (@$nonalpha) + { + $nonalpha_text = join("\n   \n", @$nonalpha) . "\n"; + } + if (@$alpha) + { + $alpha_text = join("\n   \n", @$alpha) . "\n   \n"; + } + #I18n + return "
" . &$I('Jump to') . ":   " . + $nonalpha_text . $join . $alpha_text . '
'; +} + +# Layout of navigation panel +sub T2H_XHTML_print_navigation +{ + my $fh = shift; + my $buttons = shift; + my $vertical = shift; + print $fh '' . "\n"; + + print $fh "" unless $vertical; + for my $button (@$buttons) + { + print $fh qq{\n} if $vertical; + print $fh qq{\n"; + print $fh "\n" if $vertical; + } + print $fh "" unless $vertical; + print $fh "\n"; +} + +# Use icons for navigation. +$ICONS = 0; + +# insert here name of icon images for buttons +# Icons are used, if $ICONS and resp. value are set +%ACTIVE_ICONS = + ( + 'Top', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-top.png', + 'Contents', 'file:///usr/share/icons/Bluecurve/24x24/stock/help-contents.png', + 'Overview', '', + 'Index', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-find.png', + 'This', '', + 'Back', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', + 'FastBack', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-first.png', + 'Prev', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', + 'Up', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-up.png', + 'Next', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', + 'NodeUp', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-up.png', + 'NodeNext', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', + 'NodePrev', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', + 'Following', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', + 'Forward', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', + 'FastForward', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-last.png', + 'About' , 'file:///usr/share/icons/Bluecurve/24x24/stock/gtk-about.png', + 'First', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-first.png', + 'Last', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-last.png', + ' ', '' + ); + +# Insert here name of icon images for these, if button is inactive +%PASSIVE_ICONS = + ( + 'Top', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-top.png', + 'Contents', 'file:///usr/share/icons/Bluecurve/24x24/stock/help-contents.png', + 'Overview', '', + 'Index', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-find.png', + 'This', '', + 'Back', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', + 'FastBack', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-first.png', + 'Prev', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', + 'Up', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-up.png', + 'Next', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', + 'NodeUp', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-up.png', + 'NodeNext', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', + 'NodePrev', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-back.png', + 'Following', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', + 'Forward', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-go-forward.png', + 'FastForward', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-last.png', + 'About' , 'file:///usr/share/icons/Bluecurve/24x24/stock/gtk-about.png', + 'First', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-first.png', + 'Last', 'file:///usr/share/icons/Bluecurve/24x24/stock/stock-goto-last.png', + ' ', '' + ); + +return 1; diff --git a/Scripts/centos-art/Functions/Help/Texinfo/Templates/manual.sed b/Scripts/centos-art/Functions/Help/Texinfo/Templates/manual.sed new file mode 100644 index 0000000..2b89341 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/Templates/manual.sed @@ -0,0 +1,29 @@ +#!/bin/sed +# +# repository.sed -- This file provides common transformations for +# texi2html output, based on The CentOS Project CSS definitions. +# +# Copyright (C) 2009, 2010, 2011 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +# Links +#s!
${MANUAL_CHAPTER_DIR}/chapter-nodes.${MANUAL_EXTENSION} + + # Print action maessage. + cli_printMessage "`gettext "Updating chapter menu and nodes inside manual structure."`" --as-response-line + + # Update chapter information inside the manual's texinfo + # structure. + texinfo_updateChapterMenu + texinfo_updateChapterNodes + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_createStructure.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_createStructure.sh new file mode 100755 index 0000000..a267e28 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_createStructure.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# +# texinfo_createStructure.sh -- This function creates the +# documentation structure of a manual using the current language as +# reference. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_createStructure { + + # Verify manual base directory. The manual base directory is where + # the whole documentation manual is stored in. If it already + # exist, assume it was correctly created in the past. + if [[ -d $MANUAL_BASEDIR ]];then + return + else + cli_printMessage "-" --as-separator-line + cli_printMessage "`eval_gettext "The following documentation manual will be created:"`" + cli_printMessage "${MANUAL_BASEFILE}.texinfo" --as-response-line + cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line + fi + + # Initialize manual's information (e.g., title, subtitle, abstract). + local MANUAL_TITLE='' + local MANUAL_SUBTITLE='' + local MANUAL_ABSTRACT='' + + # Create manual's top-level directory using subversion. This is + # the place where all texinfo documentation manuals is stored in. + if [[ ! -d ${MANUAL_BASEDIR} ]];then + svn mkdir ${MANUAL_BASEDIR} --quiet + fi + + # Create manual's base directory. This is the place where + # language-specific documentation source files are stored in. + svn mkdir ${MANUAL_BASEDIR_L10N} --quiet + + # Retrive manual's information from standard input. + cli_printMessage "`gettext "Manual Title"`" --as-request-line + read MANUAL_TITLE + cli_printMessage "`gettext "Manual Subtitle"`" --as-request-line + read MANUAL_SUBTITLE + cli_printMessage "`gettext "Manual Abstract"`" --as-request-line + read MANUAL_ABSTRACT + + # Print action message. + cli_printMessage "-" --as-separator-line + cli_printMessage "`gettext "Creating manual structure in texinfo format."`" --as-response-line + + # Verify manual's information. The title information must be + # non-empty value. + if [[ $MANUAL_TITLE == '' ]];then + cli_printMessage "`gettext "The manual title cannot be empty."`" --as-error-line + fi + + # Define file names required to build the manual. + local FILE='' + local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ + --maxdepth='1' \ + --pattern="manual((-menu|-nodes|-index)?\.${MANUAL_EXTENSION}|\.conf)") + + # Verify manual base file. The manual base file is where the + # documentation manual is defined in the backend format. Assuming + # no file exists (e.g., a new language-specific manual is being + # created), use texinfo templates for it. + for FILE in $FILES;do + if [[ ! -f ${MANUAL_BASEDIR_L10N}/$(basename ${FILE}) ]];then + + # Be sure the file is inside the working copy and under + # version control. + cli_checkFiles ${FILE} -wn + + # Define target file. + local DST=${MANUAL_BASEDIR_L10N}/$(basename ${FILE} \ + | sed -r "s!manual!${MANUAL_NAME}!") + + # Copy using subversion to register this action. + svn cp ${FILE} ${DST} --quiet + + # Expand common translation markers inside target file. + cli_expandTMarkers ${DST} + + # Expand specific translation markers inside target file. + sed -r -i -e "s!=MANUAL_NAME=!${MANUAL_NAME}!g" \ + -e "s!=MANUAL_TITLE=!${MANUAL_TITLE}!g" \ + -e "s!=MANUAL_SUBTITLE=!${MANUAL_SUBTITLE}!g" \ + -e "s!=MANUAL_ABSTRACT=!${MANUAL_ABSTRACT}!g" $DST + + fi + done + + # Initialize chapter structure inside the manual. + texinfo_createStructureChapters + + # Redefine absolute path to changed directory. + MANUAL_CHANGED_DIRS=${MANUAL_BASEDIR} + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_createStructureChapters.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_createStructureChapters.sh new file mode 100755 index 0000000..37a3a38 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_createStructureChapters.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# texinfo_createStructureChapters.sh -- This function initiates the +# chapter documentation structure of a manual, using the current +# language and template files as reference. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_createStructureChapters { + + local MANUAL_CHAPTER_DIR='' + + # Define list of chapter templates files used to build the + # documentation manual. Do not include the `Chapters' directory + # here. It is used to build chapters based on value passed though + # `--chapter' option passed in the command-line. + local FILE='' + local FILES=$(cli_getFilesList ${MANUAL_TEMPLATE_L10N} \ + --pattern='chapter(-menu|-nodes)?\.texinfo' --mindepth='2' \ + | grep -v '/Chapters/') + + # Loop through chapter structures and create them inside the + # manual. + for FILE in $FILES;do + + # Redefine manual's chapter directory based on template files. + MANUAL_CHAPTER_DIR=${MANUAL_BASEDIR_L10N}/$(basename $(dirname ${FILE})) + + # Verify texinfo templates used as based to build the chapter. + # Be sure they are inside the working copy of CentOS Artwork + # Repository (-w) and under version control (-n), too. + cli_checkFiles ${FILE} -wn + + # Verify chapter's directory. If it doesn't exist, create it. + if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then + svn mkdir ${MANUAL_CHAPTER_DIR} --quiet + fi + + # Copy template files into chapter's directory. + svn cp ${FILE} ${MANUAL_CHAPTER_DIR} --quiet + + done + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh new file mode 100755 index 0000000..dbbd981 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteCrossReferences.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# +# 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 +# function in coordination with texinfo_deleteEntry function, in order +# to keep cross reference information, inside the documentation +# manual, syncronized. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteCrossReferences { + + local -a PATTERN + local -a REPLACE + + # Define documentation entry. + local MANUAL_ENTRY="$1" + + # Verify documentation entry. If documentation entry is empty, + # stop script execution with an error message. + if [[ $MANUAL_ENTRY == '' ]];then + cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line + fi + + # Build the node string using entry location. + local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" + + # Define regular expression patterns for texinfo cross reference + # commands. + PATTERN[0]="@(pxref|xref|ref)\{(${NODE})\}" + REPLACE[0]='--- @strong{'`gettext "Removed"`'}(\1:\2) ---' + + # Define replacement string for missing entries. It is convenient + # to keep missing entries in documentation for documentation team + # to know. Removing the missing cross reference may intorudce + # confussion. Imagine that! you are spending lots of hours in an + # article and suddenly one of your cross refereces disappears with + # no visible reason, with the next working copy update you + # perform. That's frustrating. Instead, when centos-art.sh script + # finds a missing cross reference it removes the link and remark + # the issue for you to act on it. + PATTERN[1]="^(\* ${NODE}:(.*):(.*))$" + REPLACE[1]='\@comment --- '`gettext "Removed"`'(\1) ---' + + # Define list of entries to process. + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --pattern=".+\.${MANUAL_EXTENSION}") + + # Update node-related cross references. The node-related cross + # reference definition, long ones specially, could require more + # than one line to be set. By default, GNU sed does not matches + # newline characters in the pattern space, so we need to make use + # of `label' feature and the `N' command in order to build a + # pattern space that includes the newline character in it. Here we + # use the `a' letter to name the label we use, followed by N + # command to add a newline to the pattern space, the s command to + # make the pattern replacement using the `g' flag to make it + # global and finaly the command `b' to branch label named `a'. + sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} + + # Update menu-related cross references. Menu-related cross + # references hardly appear in more than one line, so there is no + # need to complicate much the replacement command. + sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntry.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntry.sh new file mode 100755 index 0000000..897722e --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntry.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# texinfo_deleteEntry.sh -- This function removes a documentation +# manuals, chapters or sections from the working copy. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteEntry { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Remove manual, chapter or section based on documentation entry + # provided as non-option argument to `centos-art.sh' script. + if [[ ${MANUAL_SECT[$MANUAL_DOCENTRY_ID]} != '' ]];then + + # When a section is deleted, documentation entry points to a + # section name. In this configuration, documentation entry is + # deleted through subversion in order to register the change. + # Once the documentation entry is deleted, the section menu + # and nodes definition files are updated to keep manual in a + # consistent state. + texinfo_deleteEntrySection + + elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]];then + + # When a chapter is deleted, documentation entry doesn't point + # to a section name but a chapter name. In this configuration, + # it is necessary to build a list of all the section entries + # available inside the chapter before deleting it. Once the + # chapter has been marked for deletion, it is time to update + # chapter definition files and later section definition files + # using the list of section entries previously defined. + # Actualization of section definition files must be done one + # at a time because menu entries related to section + # definitions are updated one at a time. + texinfo_deleteEntryChapter + + elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]];then + + # When a manual is deleted, documentation entry doesnt' point + # to either a section or chapter but a manual name only. In + # this configuration the entire manual directory is marked for + # deletion, and that way processed. + texinfo_deleteEntryManual + + else + cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line + fi + + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh new file mode 100755 index 0000000..64983c8 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntryChapter.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# texinfo_deleteEntryChapter.sh -- This function standardizes chapter +# deletion inside the manual structure. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteEntryChapter { + + # Print action message. + cli_printMessage "$MANUAL_CHAPTER_DIR" --as-deleting-line + + # Verify existence of documentation entry before deleting it. We + # cannot delete an entry which doesn't exist. + cli_checkFiles "$MANUAL_CHAPTER_DIR" + + # Build list of section entries inside the chapter. This is + # required to delete cross references from other section entries + # that point to section entries inside the chapter that will be + # deleted. Take care don't include the chapter definition files. + local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_CHAPTER_DIR \ + --pattern=".+\.${MANUAL_EXTENSION}" \ + | egrep -v '/chapter') + + # Revert pending changes before deleting. + svn revert ${MANUAL_CHAPTER_DIR} --quiet --recursive + + # Remove chapter directory using subversion to register the + # change. + svn del ${MANUAL_CHAPTER_DIR} --quiet + + # Update chapter menu and nodes inside manual structure. + texinfo_updateChapterMenu --delete-entry + texinfo_updateChapterNodes + + # Loop through section entries retrived from chapter, before + # deleting it, in order to remove cross references pointing to + # those section entries. Since the chapter and all its sections + # have been removed, cross references pointing them will point to + # non-existent section entries. This way, all cross references + # pointing to non-existent section entries will be transformed in + # order for documentors to advertise the section entry state. + for MANUAL_ENTRY in $MANUAL_ENTRIES;do + texinfo_deleteCrossReferences ${MANUAL_ENTRY} + done + +} + diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh new file mode 100755 index 0000000..381fea5 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# texinfo_deleteEntryManual.sh -- This function standardized manual +# deletion inside the working copy. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteEntryManual { + + # Print action message. + cli_printMessage "$MANUAL_ENTRY" --as-deleting-line + + # Verify existence of documentation entry before deleting it. We + # cannot delete an entry which doesn't exist. + cli_checkFiles "$MANUAL_ENTRY" + + # Revert pending changes before deleting. + svn revert ${MANUAL_BASEDIR_L10N} --quiet --recursive + + # 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. + svn del ${MANUAL_BASEDIR_L10N} --quiet --force + + # Verify manual base directory. When the locale-specific + # documentaion manual is the last one inside the manual base + # directory, remove the manual base directory from the working + # copy. There is no need to have an empty manual base directories + # inside the working copy. + if [[ $(ls -1 $MANUAL_BASEDIR | wc -l) -le 1 ]];then + + # Remove manual base directory. + svn del ${MANUAL_BASEDIR} --quiet --force + + # Redefine absolute paths to changed directory. This is + # required in order for `cli_commitRepoChanges' to be aware + # that we are deleting MANUAL_BASEDIR, not + # MANUAL_BASEDIR_L10N. + MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR}" + + fi + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh new file mode 100755 index 0000000..f681282 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntrySection.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# +# texinfo_deleteEntrySection.sh -- This function standardized section +# deletion inside the manual structure. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_deleteEntrySection { + + # Print action message. + cli_printMessage "$MANUAL_ENTRY" --as-deleting-line + + # Verify existence of documentation entry before deleting it. We + # cannot delete an entry which doesn't exist. + cli_checkFiles "$MANUAL_ENTRY" + + # Revert pending changes inside the section entry in order to + # prepare the file for deletion. + svn revert $MANUAL_ENTRY --quiet + + # Remove documentation entry using subversion to register the + # change. + svn del $MANUAL_ENTRY --quiet + + # Update section menu, nodes and cross references. + texinfo_updateStructureSection "${MANUAL_ENTRY}" --delete + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_editEntry.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_editEntry.sh new file mode 100755 index 0000000..0a85fae --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_editEntry.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +# texinfo_editEntry.sh -- This function implements the edition flow of +# documentation entries inside the working copy. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_editEntry { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Verify section definition inside chapters. + if [[ ! -f $MANUAL_ENTRY ]];then + + # Verify chapter related to documentation entry. Inside + # manuals, all documentation entries are stored directly under + # its chapter directory. There is no more levels deep so it is + # possible to perform a direct chapter verification here. + if [[ ! -a $(dirname $MANUAL_ENTRY)/chapter.${MANUAL_EXTENSION} ]];then + texinfo_createChapter + fi + + # Print confirmation question. + cli_printMessage "`gettext "The following documentation section will be created:"`" + cli_printMessage "$MANUAL_ENTRY" --as-response-line + cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line + + # Update section menu, nodes and cross references based on + # changes in order for manual structure to remain cosistent. + texinfo_updateStructureSection "$MANUAL_ENTRY" + + # Use default text editor to write changes on documentation entry. + $EDITOR $MANUAL_ENTRY + + else + + # Print action message. + cli_printMessage "$MANUAL_ENTRY" --as-updating-line + + # Rebuild section menu definitions before editing the + # documentation entry. This way, if there is any change in the + # section menu definition, it will be visible to you on + # edition. + texinfo_makeSeeAlso "$MANUAL_ENTRY" + + # Use default text editor to write changes on documentation entry. + $EDITOR $MANUAL_ENTRY + + # Rebuild section menu definitions after editing the + # documentation entry. This way, if there is any change or + # expansion to realize in the section menu definition, it be + # applied right now. Don't see a reason for waiting until the + # next edition for expansions to happen. + texinfo_makeSeeAlso "$MANUAL_ENTRY" + + fi + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntry.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntry.sh new file mode 100755 index 0000000..2f4162e --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntry.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# texinfo_getEntry.sh -- This function builds a documentation entry +# based on location specified as first positional parameter. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_getEntry { + + local MANUAL_ENTRY='' + local MANUAL_SECTION_NAME='' + local MANUAL_SECTION_NAMES="$@" + + # Loop through list of section names. + for MANUAL_SECTION_NAME in $MANUAL_SECTION_NAMES;do + + # Define absolute path to documentation entry. + MANUAL_ENTRY=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}/${MANUAL_SECTION_NAME}.${MANUAL_EXTENSION} + + # Output entry's absolute path. + echo ${MANUAL_ENTRY} + + done + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryIndex.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryIndex.sh new file mode 100755 index 0000000..4e5762e --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryIndex.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# texinfo_getEntryTitle.sh -- This function standardizes the way +# values for chapter and section index definitions are printed out. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_getEntryIndex { + + # Initialize phrase we want to transform based on style provided. + local PHRASE="$1" + + # In the entire phrase provided, capitalize the first word only. + PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ + | sed -r 's!^([[:alpha:]])!\u\1!') + + # Output transformed phrase. + echo "$PHRASE" + +} + diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryNode.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryNode.sh new file mode 100755 index 0000000..5472959 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryNode.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# texinfo_getEntryNode.sh -- This function cleans up the action value +# (ACTIONVAL) directory to make a node name from it. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_getEntryNode { + + # Define documentation entry. + local MANUAL_ENTRY="$1" + + # Verify documentation entry. + if [[ $MANUAL_ENTRY == '' ]];then + cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line + fi + + # Define node from documentation entry. + local NODE=$(echo "$MANUAL_ENTRY" | sed -r \ + -e "s!^${MANUAL_BASEDIR_L10N}/!!" \ + -e "s/\.${MANUAL_EXTENSION}$//" \ + -e "s!chapter!!" \ + -e 's!(/|-)! !g' \ + -e 's!\<([[:alpha:]]+)\>!\u\1!g' \ + -e 's!^[[:space:]]+!!') + + echo "$NODE" + +} + diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryTitle.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryTitle.sh new file mode 100755 index 0000000..a733095 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_getEntryTitle.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# +# texinfo_getEntryTitle.sh -- This function standardizes the way entry +# titles for chapters and sections are printed out. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_getEntryTitle { + + # Initialize phrase we want to transform based on style provided. + local PHRASE="$1" + + # Define section style. Through this property you can customize + # the section title in predefined ways. By default, section + # titles are printed with each word capitalized (`cap-each-word'). + # Other values to this option are `cap-first-only' (to capitalize + # just the first word in the title) or `directory' to transform + # each word to a directory path. + local MANUAL_SECTION_STYLE=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_style") + if [[ ! $MANUAL_SECTION_STYLE =~ '^(cap-each-word|cap-first-only|directory)$' ]];then + MANUAL_SECTION_STYLE='cap-each-word' + fi + + # Verify section style provided and transform the phrase value in + # accordance with it. + case $MANUAL_SECTION_STYLE in + + 'cap-first-only' ) + + # In the entire phrase provided, capitalize the first word + # only. + PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ + | sed -r 's!^([[:alpha:]])!\u\1!') + ;; + + 'directory' ) + + # In the entire phrase provided, concatenate all words + # with slash (/) character and remark the fact it is a + # directory. + PHRASE=$(echo "${PHRASE}" | sed -r \ + -e 's/(Trunk|Branches|Tags)/\l\1/' \ + -e 's/ /\//g' \ + -e 's/\/([[:alpha:]])/\/\u\1/g') + + PHRASE="@file{$PHRASE}" + ;; + + 'cap-each-word' | * ) + + # In the entire phrase provided, capitalize all words. + PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ + | sed -r 's!\<([[:alpha:]]+)\>!\u\1!g') + ;; + + esac + + # Output transformed phrase. + echo "$PHRASE" + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh new file mode 100755 index 0000000..310d95d --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_makeSeeAlso.sh @@ -0,0 +1,149 @@ +#!/bin/bash +# +# texinfo_makeSeeAlso.sh -- This function creates a list of links with +# section entries one level ahead from the current section entry being +# processed. Desition of what of these texinfo definitions to use is +# set inside the section entry itself, through the following +# construction: +# +# @c -- <[centos-art(SeeAlso,TYPE) +# @c -- ]> +# +# In this construction, the TYPE variable can be either `itemize', +# `enumerate' or `menu'. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_makeSeeAlso { + + # Initialize variables. + local CHILD_ENTRIES='' + local CHILD_ENTRY='' + local ENTRY_PATTERN='' + local LIST_DEF='' + local LIST_ENTRIES='' + local LIST_TYPE='' + local LIST_TYPE_PATTERN='' + local MANUAL_ENTRY='' + local TMARK='' + local TMARK_PATTERN='' + local TMARKS='' + + # Define absolute path to section entry. + MANUAL_ENTRY="$1" + + # Verify section entry. When section entries are deleted, there is + # no menu definition to set. + if [[ ! -f $MANUAL_ENTRY ]];then + return + fi + + # Define `SeeAlso' transltaion marker regular expression pattern. + TMARK_PATTERN="^@c -- <\[${CLI_PROGRAM}\(SeeAlso(,(itemize|enumerate|menu))?\)$" + + # Retrive `SeeAlso' translation marker definition lines. Be sure + # to retrive unique definitions only. If the same definition is + # present more than once, it will be expanded in one pass. There's + # no need to go through different passes in order to expand + # repeated translation marker definition. + TMARKS=$(egrep "${TMARK_PATTERN}" $MANUAL_ENTRY | sort | uniq) + + # Remove spaces from translation marker definition lines in order + # to process them correctly. Otherwise the definition line would + # be broken on each space character and then that wouldn't be the + # definition line we initially conceived. + TMARKS=$(echo "$TMARKS" | sed -r 's/ /\\040/g') + + # Define pattern used to build list of child sections. A child + # section shares the same path information of its parent with out + # file extension. For example, if you have the `identity', + # `identity-images' and `identity-images-themes' section entries, + # `identity-images' is a child entry of `identity' likewise + # `identity-images-themes' is a child entry of `identity-images'. + ENTRY_PATTERN=$(echo "$MANUAL_ENTRY" | sed -r "s/\.${MANUAL_EXTENSION}$//") + + # Define list of child entries we'll use as reference to build the + # menu nodes. Reverse the output here to produce the correct value + # based on menu nodes definition set further. + CHILD_ENTRIES=$(cli_getFilesList $(dirname ${MANUAL_ENTRY}) \ + --pattern="${ENTRY_PATTERN}-[[:alnum:]]+\.${MANUAL_EXTENSION}" | sort -r | uniq ) + + # Loop through translation marker definition lines. + for TMARK in $TMARKS;do + + # Define list type based on translation marker definition. + # Remember to revert back the space character transformation + # we previously did, in order for the translation marker + # regular expression pattern to match. + LIST_TYPE=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\2/") + + # Define list type default value. This is, the list type used + # when no list type is specified in the translation marker + # construction properties field. + if [[ $LIST_TYPE == '' ]];then + LIST_TYPE="itemize" + fi + + # Define list properties (type included). + LIST_PROP=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\1/") + + # Define `SeeAlso' transltaion marker regular expression + # pattern that matches the translation marker definition. + # Notice that we cannot use TMARK_PATTERN here because it + # includes a selection list of all possible translation + # markers that can provided and here we need to precisely set + # the one being currently processed, not those whose could be + # processed. + LIST_TYPE_PATTERN="^@c -- <\[${CLI_PROGRAM}\(SeeAlso${LIST_PROP}\)$" + + # Redefine list's entry based on translation marker definition. + if [[ $LIST_TYPE =~ '^menu$' ]];then + for CHILD_ENTRY in $CHILD_ENTRIES;do + LIST_ENTRIES="* $(texinfo_getEntryNode "$CHILD_ENTRY")::\n${LIST_ENTRIES}" + done + elif [[ $LIST_TYPE =~ '^(itemize|enumerate)$' ]];then + for CHILD_ENTRY in $CHILD_ENTRIES;do + LIST_ENTRIES="@item @ref{$(texinfo_getEntryNode "$CHILD_ENTRY")}\n${LIST_ENTRIES}" + done + else + # When an translation marker isn't recognize, go on with + # the next one in the list. + continue + fi + + # Define menu using menu nodes. + LIST_DEF="@c -- <[${CLI_PROGRAM}(SeeAlso${LIST_PROP})\n@${LIST_TYPE}\n${LIST_ENTRIES}@end ${LIST_TYPE}\n@c -- ]>" + + # Expand list definition using translation marker and list + # definition itself. Be sure that no expansion be done when + # the closing tag of translation marker isn't specified. + # Otherwise, there might be lost of content. + sed -r -i "/${LIST_TYPE_PATTERN}/{:a;N;/\n@c -- ]>$/!ba;s/.*/${LIST_DEF}/;}" $MANUAL_ENTRY + + # Clean up both list definition and list entries. Otherwise + # undesired concatenations happen. + LIST_DEF='' + LIST_ENTRIES='' + LIST_TYPE='' + + done + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh new file mode 100755 index 0000000..0ffc543 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameCrossReferences.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# +# texinfo_renameCrossReferences.sh -- This function renames menu, +# nodes and cross references related to chapters and sections that +# have been renamed previously. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_renameCrossReferences { + + local -a PATTERN + local -a REPLACE + + # Build source and target node definitions. + local NODE_SRC="$(texinfo_getEntryNode "$MANUAL_ENTRY_SRC")" + local NODE_DST="$(texinfo_getEntryNode "$MANUAL_ENTRY_DST")" + + # Define regular expression pattern and its replacement for node + # definitions that have been previously removed. + PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):\<${NODE_SRC}\>(.*)\) ---" + REPLACE[0]="\@\1{${NODE_DST}\2}" + + # Define regular expression pattern and its replacement for menu + # definitions that have been previously removed. + PATTERN[1]="^@comment --- `gettext "Removed"`\(\* \<${NODE_SRC}\>(.*)\) ---$" + REPLACE[1]="* ${NODE_DST}\1" + + # Define list of entries to process. This is, all the texinfo + # source files the documentation manual is made of. + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --pattern=".+\.${MANUAL_EXTENSION}") + + # Update node cross references. The node-related cross reference + # definition, long ones specially, could require more than one + # line to be set. By default, GNU sed does not matches newline + # characters in the pattern space, so we need to make use of + # `label' feature and the `N' command in order to build a pattern + # space that includes the newline character in it. Here we use the + # `a' letter to name the label we use, followed by N command to + # add a newline to the pattern space, the s command to make the + # pattern replacement using the `g' flag to make it global and + # finaly the command `b' to branch label named `a'. + # + # Inside the pattern space, the `\<' and `\>' are used to restrict + # the match pattern to a word boundary. The word boundary + # restriction applied here is required to avoid undesired + # replacements when we replace singular words with their plurals. + # For example, if we need to change the node `Manual' to its + # plular (i.e., `Manuals'), and no boundary restriction is used in + # the pattern space to do that, we might end up having nodes like + # `Manualsssss' which probably doesn't exist. This is because this + # sed command might be applied to the same file more than once; + # and each time it is applied, a new `Manuals' replaces the + # previous `Manuals' replacement to form `Manualss', `Manualsss', + # and so on for each interaction. Using word boundaries + # restrictions prevent such issue from happening. + sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} + + # Update menu cross references. Menu cross reference definitions + # hardly appear in more than one line, so there is no need to + # complicate the replacement command. + sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntry.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntry.sh new file mode 100755 index 0000000..8497a31 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntry.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# texinfo_renameEntry.sh -- This function standardizes renaming tasks +# related to manual, chapters and sections inside the working copy. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_renameEntry { + + # Initialize source and target locations. + local MANUAL_ENTRY_SRC='' + local MANUAL_ENTRY_DST='' + + # Define both source and target documentation entries. To build + # the source and target documentation entries we take into + # consideration the manual's main definition file, the chapter's + # main definition file and non-option arguments passed to + # centos-art.sh script through the command-line. + if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then + + # When a section is renamed, the section source location is + # duplicated into the section target location and later + # removed from the working copy. Once the section source + # location has been renamed, the section menu, nodes and cross + # references are updated to keep consistency inside the + # manual. + texinfo_renameEntrySection + + elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]] \ + && [[ ${MANUAL_CHAP[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]];then + + # When a chapter is renamed, the chapter source location is + # duplicated into the chapter source location and later + # removed from the working copy. Once the chapter source + # location has been renamed, the chapter and section menu, + # nodes and cross references are updated to keep consistency + # inside the manual. + texinfo_renameEntryChapter + + elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]] \ + && [[ ${MANUAL_DIRN[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]] ;then + + # When a manual is renamed, a new manual structure is created + # in the manual target location and all chapters and sections + # are duplicated from manual source location to manual target + # location. Once the source manual has been renamed, chapter + # and section menu, nodes and cross references are updated to + # keep consistency inside the manual. + texinfo_renameEntryManual + + else + cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line + fi + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh new file mode 100755 index 0000000..f0ab38c --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntryChapter.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# texinfo_renameEntryChapter.sh -- This function standardizes renaming +# tasks related to manual chapters inside documentation manuals +# written in texinfo format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_renameEntryChapter { + + # Copy section source entry to target location. + texinfo_copyEntryChapter + + # Delete section source entry. + texinfo_deleteEntryChapter + + # Rename menu, nodes and cross references related entries. + texinfo_renameCrossReferences + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntryManual.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntryManual.sh new file mode 100755 index 0000000..4a4f7f9 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntryManual.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# texinfo_renameEntryManual.sh -- This function standardizes renaming +# tasks related to documenation manuals written in texinfo format +# inside the working copy. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_renameEntryManual { + + # Copy section source entry to target location. + texinfo_copyEntryManual + + # Delete section source entry. + texinfo_deleteEntryManual + + # Redefine absolute paths to changed directories. This is + # required in order for `cli_commitRepoChanges' to be aware of + # manual source and target locations we've just renamed. + MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR} $(echo $MANUAL_BASEDIR \ + | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" + + # From this time on, the manual information set so far is no + # longer useful. Redefine it to start using the new manual + # information instead. + + # Redefine manual name using manual name passed to `centos-art.sh' + # script as second non-option argument. + MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]} + + # Redefine absolute path to manual directory using manual name + # passed to `centos-art.sh' script as second non-option argument. + MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \ + | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" + + # Redefine absolute path to manual directory using manual name + # passed to `centos-art.sh' script as second non-option argument. + MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" + + # Redefine absolute path to base file using manual name passed to + # `centos-art.sh' script as second non-option argument. + MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntrySection.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntrySection.sh new file mode 100755 index 0000000..a0694cb --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_renameEntrySection.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# texinfo_renameEntrySection.sh -- This function standardizes renaming +# tasks related to chapter sections inside documentation manuals +# written in texinfo format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_renameEntrySection { + + # Copy section source entry to target location. + texinfo_copyEntrySection + + # Delete section source entry. + texinfo_deleteEntrySection + + # Rename menu, nodes and cross references related entries. + texinfo_renameCrossReferences + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh new file mode 100755 index 0000000..cc7713d --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_restoreCrossReferences.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# +# texinfo_restoreCrossReferences.sh -- This function looks inside +# texinfo source files, from section level on, and restores any cross +# reference related to a documentation entry. This function is used in +# those cases where documentation entries are created/recreated to +# documentation structure. It is a verification that looks for +# matching documentation entries previously defined as removed by +# texinfo_deleteCrossReferences function. The +# texinfo_restoreCrossReferences function relays in the removed +# message format produced by texinfo_deleteCrossReferences +# function, in order to return them back into the link format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_restoreCrossReferences { + + local -a PATTERN + local -a REPLACE + + # Define documentation entry. + local MANUAL_ENTRY="$1" + + # Verify documentation entry. If documentation entry is empty, + # stop script execution with an error message. + if [[ $MANUAL_ENTRY == '' ]];then + cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line + fi + + # Build the node string using entry location. + local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" + + # Define regular expression patterns to match removed message + # format produced by message_removeCrossReferences function. + PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):(${NODE})\) ---" + PATTERN[1]="^@comment --- `gettext "Removed"`\((\* ${NODE}:(.*)?:(.*)?)\) ---$" + + # Define replacement string to turn removed message back to cross + # reference link. + REPLACE[0]='\@\1{\2}' + REPLACE[1]='\1' + + # Define list of entries to process. + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --pattern=".+\.${MANUAL_EXTENSION}") + + # Update node-related cross references. The node-related cross + # reference definition, long ones specially, could require more + # than one line to be set. By default, GNU sed does not matches + # newline characters in the pattern space, so we need to make use + # of `label' feature and the `N' command in order to build a + # pattern space that includes the newline character in it. Here we + # use the `a' letter to name the label we use, followed by N + # command to add a newline to the pattern space, the s command to + # make the pattern replacement using the `g' flag to make it + # global and finaly the command `b' to branch label named `a'. + sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} + + # Update menu-related cross references. Menu-related cross + # references hardly appear in more than one line, so there is no + # need to complicate the replacement command. + sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_searchIndex.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_searchIndex.sh new file mode 100755 index 0000000..5b1b145 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_searchIndex.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# texinfo_searchIndex.sh -- This function does an index search inside the +# info document. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_searchIndex { + + # Verify manual output files and, if they don't exist, create + # them. + if [[ ! -f ${MANUAL_BASEFILE}.info.bz2 ]];then + texinfo_updateOutputFiles + fi + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Print action message. + cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-reading-line + + # Execute info command to perform an index-search. + /usr/bin/info --index-search="$FLAG_SEARCH" --file=${MANUAL_BASEFILE}.info.bz2 + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_searchNode.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_searchNode.sh new file mode 100755 index 0000000..1004858 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_searchNode.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# texinfo_searchNode.sh -- This function converts the documentation +# entry provided to `centos-art.sh' script command-line into a node +# and tries to read it from the manual's `.info' output file. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_searchNode { + + # Verify documentation entry and, if it doesn't exist, prompt out + # its creation. + if [[ ! -f "$MANUAL_ENTRY" ]];then + texinfo_editEntry + fi + + # Verify manual output files and, if they don't exist, create + # them. + if [[ ! -f ${MANUAL_BASEFILE}.info.bz2 ]];then + texinfo_updateOutputFiles + fi + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Print action message. + cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-reading-line + + # Define manual node that will be read. + local MANUAL_NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" + + # Verify manual node that will be read. When the manual name is + # the only value passed as documentation entry, then use the `Top' + # node as manual node to be read. + if [[ $MANUAL_NODE =~ $(texinfo_getEntryNode "$MANUAL_NAME") ]];then + MANUAL_NODE='Top' + fi + + # Use info reader to read the manual node. + info --node="${MANUAL_NODE}" --file="${MANUAL_BASEFILE}.info.bz2" + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh new file mode 100755 index 0000000..e0631c8 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateChapterMenu.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# +# texinfo_updateChapterMenu.sh -- This function updates chapter menu. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateChapterMenu { + + local ACTION=$1 + local MENUCHAPTERS='' + + # Build menu of chapters. The Index node is not included as other + # nodes are. The Index node is defined inside the master texinfo + # file (repository.texinfo) as an included file. To create the final + # .info file correctly, the Index line in the menu should remain, + # even no other node exist. + if [[ -f ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} ]];then + MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ + | egrep -v "^@(end )?menu$" \ + | egrep -v '^\* (Licenses|Index)::$') + fi + + # Re-defined menu of chapters based on action. + case $ACTION in + + --delete-entry ) + # Remove chapter from menu. + MENUCHAPTERS=$(echo "${MENUCHAPTERS}" \ + | egrep -v '^\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') + ;; + + --add-entry | * ) + # Update chapter menu using texinfo format. Be sure the + # chapter node itself is not included here, that would + # duplicate it inside the menu definition file which end + # up being a definition error. Take care the way you quote + # egrep's pattern, prevent to end up using the syntax + # `$"..."' which has security risks. + MENUCHAPTERS="$(echo "${MENUCHAPTERS}" \ + | egrep -v '\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') + * ${MANUAL_CHAPTER_NAME}::" + ;; + esac + + # Remove opening spaces/tabs and empty line from the menu of + # chapters. Empty lines may occur the first time the menu of + # chapters is created. + MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ + | egrep -v '^[[:space:]]*$') + + # Organize menu of chapters alphabetically and verify that no + # duplicated line be included on the list. Notice that organizing + # menu this way supresses the idea of putting the last chapter + # created at the end of the list. + #MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sort | uniq) + + # Give format to final menu output. + MENUCHAPTERS="@menu + ${MENUCHAPTERS} + * Licenses:: + * Index:: + @end menu" + + # Remove opening space/tabs from menu's final definition. + MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ + | egrep -v '^[[:space:]]*$') + + # Dump organized menu of chapters into file. + echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh new file mode 100755 index 0000000..06b3acb --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateChapterNodes.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# texinfo_updateChapterNodes.sh -- This function updates nodes of +# chapters based on menu of chapters. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateChapterNodes { + + # Build chapter nodes using entries from chapter menu as + # reference. Don't include `Licenses' or `Index' chapters here. + # These chapters are part of our manual's main defintion file and + # shouldn't be handled as regular chapters. + local CHAPTERNODES=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ + | egrep -v '^@(end )?menu$' | egrep -v '^\* (Licenses|Index)::$'\ + | sed -r 's!^\* !!' | sed -r 's!::[[:print:]]*$!!g' \ + | sed -r 's! !_!g') + + # Build list of inclusions from chapter nodes. + local FILENODE=$(\ + for CHAPTERNODE in ${CHAPTERNODES};do + INCL=$(echo ${CHAPTERNODE} \ + | sed -r "s!(${CHAPTERNODE})!\1/chapter\.${MANUAL_EXTENSION}!") + # Output inclusion line using texinfo format. + echo "@include $INCL" + done) + + # Dump organized nodes of chapters into file. + echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION} + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh new file mode 100755 index 0000000..2ab4a56 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileDocbook.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# texinfo_updateOutputFileDocbook.sh -- This function exports +# documentation manual to DocBook format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFileDocbook { + + # Print action message. + cli_printMessage "${MANUAL_BASEFILE}.docbook" --as-response-line + + # Update xml output format. + /usr/bin/makeinfo --docbook --output=${MANUAL_BASEFILE}.docbook \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --no-warn + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh new file mode 100755 index 0000000..116e3a9 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileInfo.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# texinfo_updateOutputFileInfo.sh -- This function exports +# documentation manual to info format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFileInfo { + + # Output action message. + cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-response-line + + # Update info file. + /usr/bin/makeinfo --output=${MANUAL_BASEFILE}.info \ + --enable-encoding \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} + + # Compress info file. + if [[ $? -eq 0 ]];then + bzip2 -f ${MANUAL_BASEFILE}.info + fi + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh new file mode 100755 index 0000000..9d33698 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFilePdf.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# texinfo_updateOutputFilePdf.sh -- This function exports documentation +# manual to PDF format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFilePdf { + + # Output action message. + cli_printMessage "${MANUAL_BASEFILE}.pdf" --as-response-line + + # Update plaintext output directory. + /usr/bin/texi2pdf --quiet \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.pdf + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh new file mode 100755 index 0000000..27bfb0e --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# texinfo_updateOutputFilePlaintext.sh -- This function exports +# documentation manual to plain-text format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFilePlaintext { + + # Output action message. + cli_printMessage "${MANUAL_BASEFILE}.txt.bz2" --as-response-line + + # Update plaintext output directory. + /usr/bin/makeinfo --plaintext \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.txt + + # Compress plaintext output file. + if [[ -f ${MANUAL_BASEFILE}.txt ]];then + bzip2 ${MANUAL_BASEFILE}.txt --force + fi + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh new file mode 100755 index 0000000..44d5e66 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileXhtml.sh @@ -0,0 +1,95 @@ +#!/bin/bash +# +# texinfo_updateOutputFileXhtml.sh -- This function exports +# documentation manual to HTML format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFileXhtml { + + # Output action message. + cli_printMessage "${MANUAL_BASEFILE}.xhtml.tar.bz2" --as-response-line + + # Verify initialization files used by texi2html. + cli_checkFiles ${MANUAL_TEMPLATE}/manual-init.pl + cli_checkFiles ${MANUAL_TEMPLATE_L10N}/manual-init.pl + + # Verify transformation files used to modify texi2html output. + cli_checkFiles ${MANUAL_TEMPLATE}/manual.sed + cli_checkFiles ${MANUAL_TEMPLATE_L10N}/manual.sed + + # Redefine manual base file to use just the file base name. + local MANUAL_BASEFILE=$(basename "$MANUAL_BASEFILE") + + # Add manual base directory path into directory stack to make it + # the current working directory. This is done to reduce the path + # information packaged inside `repository.xhtml.tar.bz2' file. + pushd ${MANUAL_BASEDIR_L10N} > /dev/null + + # Clean up directory structure where xhtml files will be stored. + # We don't want to have unused files inside it. + if [[ -d ${MANUAL_NAME}-xhtml ]];then + rm -r ${MANUAL_NAME}-xhtml + fi + + # Prepare directory structure where xhtml files will be stored in. + mkdir ${MANUAL_NAME}-xhtml + + # Add directory where xhtml files will be sotred in into directory + # stack to make it the current working directory. This is required + # in order for include paths to be constructed correctly. + pushd ${MANUAL_NAME}-xhtml > /dev/null + + # Update xhtml files. Use texi2html to export from texinfo file + # format to xhtml using The CentOS Web default visual style. + texi2html --lang=$(cli_getCurrentLocale --langcode-only) \ + --init-file=${MANUAL_TEMPLATE}/manual-init.pl \ + --init-file=${MANUAL_TEMPLATE_L10N}/manual-init.pl \ + --output=${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}-xhtml \ + ${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}.${MANUAL_EXTENSION} + + # Remove directory where xhtml files are stored from directory + # stack. The xhtml files have been already created. + popd > /dev/null + + # Apply xhtml transformations. This transformation cannot be built + # inside the initialization script (repository-init.pl). For example, + # Would it be a possible way to produce different quotation HTML + # outputs from the same texinfo quotation definition? Instead, + # once the HTML code is produced we can take que quotation HTML + # definition plus the first letters inside it and transform the + # structure to a completly different thing that can be handle + # through classed inside CSS definitions. + sed -r -i \ + -f ${MANUAL_TEMPLATE}/manual.sed \ + -f ${MANUAL_TEMPLATE_L10N}/manual.sed \ + ${MANUAL_BASEFILE}-xhtml/*.xhtml + + # Compress directory structure where xhtml files are stored in. + # This compressed version is the one we put under version control. + # The directory used to build the compressed version is left + # unversion for the matter of human revision. + tar -cjf ${MANUAL_BASEFILE}.xhtml.tar.bz2 ${MANUAL_BASEFILE}-xhtml + + # Remove manual base directory from directory stack. + popd > /dev/null + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh new file mode 100755 index 0000000..3fbe661 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFileXml.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# texinfo_updateOutputFileXml.sh -- This function exports documentation +# manual to XML format. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFileXml { + + # Print action message. + cli_printMessage "${MANUAL_BASEFILE}.xml" --as-response-line + + # Update xml output format. + /usr/bin/makeinfo --xml \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.xml \ + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh new file mode 100755 index 0000000..97f4472 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateOutputFiles.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# texinfo_updateOutputFiles.sh -- This function exports documentation +# manual to different output formats. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateOutputFiles { + + # Verify manual base file. We can update manual outputs only if + # its base file exists. For example, we cannot update manual + # outputs if the manual has been deleted previously. + if [[ ! -a ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then + return + fi + + # Print separator line. + cli_printMessage "`gettext "Updating output files"`" --as-banner-line + + # Add the working copy root directory to directory stack to make + # path construction correctly. Otherwise, makeinfo may produce + # paths incorrectly. + pushd ${CLI_WRKCOPY} > /dev/null + + texinfo_updateOutputFileInfo + texinfo_updateOutputFileXhtml + texinfo_updateOutputFileXml + texinfo_updateOutputFileDocbook + texinfo_updateOutputFilePdf + texinfo_updateOutputFilePlaintext + + # Remove the working copy root directory from directory stack. + popd > /dev/null + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh new file mode 100755 index 0000000..2e71a5c --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateSectionMenu.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# +# texinfo_updateSectionMenu.sh -- This function updates the section's +# menu definition file of a chapter. If this function is called with +# the '--delete-entry' string as first argument, the menu line related +# to the entry being processed is removed. Otherwise, if this function +# is called with the '--add-entry' string as first argument, the menu +# line related to the entry being processed is added to menu's bottom. +# If no argument is passed to this function, the '--add-entry' action +# is assumed. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateSectionMenu { + + # Specify which action to do with documentation entry inside the + # chapter menu. + local ACTION="$1" + + # Define section order. Through this property you can customize + # the section order inside the manual. Possible arguments to this + # option are `ordered', `reversed', `created'. From these three + # values `created' is used by default (i.e., new menu entries are + # added to menu's bottom as last entry.). Notice that, once + # you've sorted the menu using `ordered' or `reversed' values, it + # is hard to sort the list back to former creation orders. Go + # sorted or not sorted at all. + local MANUAL_SECTION_ORDER=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_order") + if [[ ! $MANUAL_SECTION_ORDER =~ '^(created|ordered|reversed)$' ]];then + MANUAL_SECTION_ORDER='created' + fi + + # Build node information used inside chapter menu. + local MENUNODE=$(texinfo_getEntryNode "$MANUAL_ENTRY") + + # Define menu entry using texinfo style and node information as + # reference. + local MENULINE="* ${MENUNODE}::" + + # Retrive list of menu entries from chapter menu and exclude + # `@menu', `@end menu' and empty lines from output. + local MENU=$(cat $(dirname ${MANUAL_ENTRY})/chapter-menu.${MANUAL_EXTENSION} \ + | egrep -v '^[[:space:]]*$' | egrep -v '^@(end )?menu') + + # Re-defined chapter menu entries based on action provided to this + # function as first positional parameter. + case $ACTION in + + --delete-entry ) + # Remove menu entry from chapter menu. + MENU="$(echo "$MENU" | egrep -v "$MENULINE")" + ;; + + --add-entry | * ) + # Add menu entry to chapter menu list as last entry. + MENU="$(echo "$MENU" | egrep -v "$MENULINE" ) + ${MENULINE}" + ;; + + esac + + # Remove opening spaces/tabs and empty lines from final menu + # entries. + MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ + | egrep -v '^[[:space:]]*$') + + # Sort menu entries based on section order property. + case $MANUAL_SECTION_ORDER in + + 'ordered' ) + MENU="$(echo "$MENU" | sort )" + ;; + + 'reversed' ) + MENU="$(echo "$MENU" | sort -r )" + ;; + + esac + + # Rebuild list of chapter menu entries including '@menu' and '@end + # menu' lines back into chapter menu. + MENU="@menu + $MENU + @end menu" + + # Remove opening spaces/tabs and empty lines from final menu + # structure. + MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ + | egrep -v '^[[:space:]]*$') + + # Dump chapter menu entries back into chapter's menu definition + # file. + echo "$MENU" > $(dirname ${MANUAL_ENTRY})/chapter-menu.${MANUAL_EXTENSION} + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh new file mode 100755 index 0000000..0914c93 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateSectionNodes.sh @@ -0,0 +1,142 @@ +#!/bin/bash +# +# texinfo_updateSectionNodes.sh -- This function updates section's +# nodes definition files using section's menu definition file both +# inside the same chapter. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateSectionNodes { + + # Build list of chapter nodes using entries from chapter menu as + # reference. + local NODES=$(cat $(dirname ${MANUAL_ENTRY})/chapter-menu.${MANUAL_EXTENSION} \ + | sed -r 's!^\* !!' | sed -r 's!:{1,2}.*$!!g' \ + | egrep -v '^@(end )?menu$' | sed -r 's! !:!g') + + # Build chapter nodes based on chapter menu. + for NODE in $NODES;do + + local NODE=$(echo "${NODE}" | sed -r 's!:! !g') + local INCL=$(echo "${NODE}" | sed -r 's! !/!' | sed -r 's! !-!g' | sed -r 's!/(.+)!/\L\1!').${MANUAL_EXTENSION} + local SECT=$(texinfo_getEntryTitle "$NODE") + local CIND=$(texinfo_getEntryIndex "$NODE") + + # Create texinfo section file using templates, only if the + # section file doesn't exist and hasn't been marked for + # deletion. Otherwise, when the files have been marked for + # deletion, they will be created again from texinfo template + # to working copy and that might create confusion. + if [[ ! -f ${MANUAL_BASEDIR_L10N}/$INCL ]] \ + && [[ $(cli_getRepoStatus ${MANUAL_BASEDIR_L10N}/$INCL) != 'D' ]];then + + # Retrive configuration lines from configuration file. Be + # sure no line begining with `#' or space remain in the + # line. Otherwise, it would be difficult to loop through + # configuration lines. + local CONFLINE='' + local CONFLINES=$(cli_getConfigLines "${MANUAL_CONFIG_FILE}" "templates") + + # Initialize both left hand side and right hand side + # configuration values. + local CONFLHS='' + local CONFRHS='' + + # Initialize absolute path to final texinfo template. + local TEMPLATE='' + + # Define what section template to apply using + # documentation entry absolute path and values provided by + # configuration line. Be sure to break the loop in the + # first match. + for CONFLINE in $CONFLINES;do + + CONFLHS=$(echo $CONFLINE \ + | gawk 'BEGIN{FS="="}; { print $1 }' \ + | sed -r 's![[:space:]]*!!g') + + CONFRHS=$(echo $CONFLINE \ + | gawk 'BEGIN{FS="="}; { print $2 }' \ + | sed -r 's![[:space:]]*!!g' | sed -r 's!^"(.+)"$!\1!') + + if [[ ${MANUAL_BASEDIR_L10N}/${INCL} =~ $CONFRHS ]];then + TEMPLATE="${MANUAL_TEMPLATE_L10N}/${CONFLHS}" + break + fi + + done + + # Verify existence of texinfo template file. If no + # template is found, stop script execution with an error + # message. We cannot continue without it. + cli_checkFiles $TEMPLATE + + # Create documentation entry using texinfo template as + # reference. + svn cp ${TEMPLATE} ${MANUAL_BASEDIR_L10N}/$INCL --quiet + + fi + + # Expand common translation markers in documentation entry. + cli_expandTMarkers "${MANUAL_BASEDIR_L10N}/$INCL" + + # Replace node, section and concept index definitions already + # defined with node, section and concept index translation + # markers. Otherwise, incorrect sectioning may happen. Take + # care with index definitions, more than one index definition + # might be found in the section file but only the first + # concept index entry (i.e., `cindex') will be updated, the + # rest will remain as they are. + sed -i -r \ + -e '/^@node/c@node =NODE=' \ + -e '/^@section/c@section =SECT=' \ + -e '0,/^@cindex/c@cindex =CIND=' \ + "${MANUAL_BASEDIR_L10N}/$INCL" + + # Before expading node, section and concept index, be sure + # that all slash characters (`/') be escaped. Otherwise, they + # might be interpreted as separators and that isn't + # desireable in anyway. + NODE=$(echo "$NODE" | sed -r 's/\//\\\//g') + SECT=$(echo "$SECT" | sed -r 's/\//\\\//g') + CIND=$(echo "$CIND" | sed -r 's/\//\\\//g') + + # Expand node, section and concept index translation + # markers in documentation entry. + sed -i -r \ + -e "s/=NODE=/${NODE}/g" \ + -e "s/=SECT=/${SECT}/g" \ + -e "s/=CIND=/${CIND}/g" \ + "${MANUAL_BASEDIR_L10N}/$INCL" + + # Verify existence of chapter-nodes template file. If no + # chapter-nodes template is found, stop script execution with + # an error message. We cannot continue without it. + cli_checkFiles ${MANUAL_TEMPLATE_L10N}/Chapters/chapter-nodes.${MANUAL_EXTENSION} + + # Expand chapter node inclusion definition. + cat ${MANUAL_TEMPLATE_L10N}/Chapters/chapter-nodes.${MANUAL_EXTENSION} \ + | sed -r "s!=INCL=!${INCL}!g" + + # Dump chapter node definition into manual structure. + done > $(dirname ${MANUAL_ENTRY})/chapter-nodes.${MANUAL_EXTENSION} + +} diff --git a/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateStructureSection.sh b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateStructureSection.sh new file mode 100755 index 0000000..6545524 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/Texinfo/texinfo_updateStructureSection.sh @@ -0,0 +1,140 @@ +#!/bin/bash +# +# texinfo_updateStructureSection.sh -- This function looks for all +# section entry files inside manual's base directory and updates menu, +# nodes and cross references definitions for them all, one at a time. +# +# Copyright (C) 2009, 2010, 2011 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 texinfo_updateStructureSection { + + # Print action message. These actions might consume some time to + # finish. The more section entries the regular expression pattern + # matches, the more time it will take to finish. + cli_printMessage "`gettext "Updating section menus, nodes and cross references"`" --as-banner-line + + local PATTERN='' + local MANUAL_ENTRIES='' + local ACTIONNAM_SECMENU='' + local ACTIONNAM_CROSREF='' + + # Define regular expression pattern used to build the list of + # section entries that will be processed. + if [[ "$1" != '' ]];then + PATTERN="$1" + else + PATTERN="${MANUAL_ENTRY}" + fi + + # Verify the pattern value considering both the chapter and + # section names. This is required when no chapter or section name + # is provided to `centos-art.sh' script, as non-option argument in + # the command-line (e.g., `centos-art help --update-structure'). + if [[ $PATTERN =~ "${MANUAL_NAME}\.${MANUAL_EXTENSION}$" ]] \ + || [[ $PATTERN =~ "chapter\.${MANUAL_EXTENSION}$" ]];then + PATTERN="$(dirname ${MANUAL_ENTRY})/.+\.${MANUAL_EXTENSION}" + fi + + # Define action to perform on menu, nodes and cross references + # definitions. + case "$2" in + + --delete ) + + # Remove menu and node definitions for sections inside + # manual, in order to reflect the changes. + ACTIONNAM_SECMENU='updateSectionMenu --delete-entry' + + # Remove cross reference definitions inside manual + # structure. + ACTIONNAM_CROSREF='deleteCrossReferences' + ;; + + --update | * ) + + # Update menu and node definitions for sections inside + # manual, in order to reflect the changes. + ACTIONNAM_SECMENU='updateSectionMenu --add-entry' + + # Resotre cross reference definitions inside manual + # structure. If a documentation entry has been removed by + # mistake and that mistake is later fixed by adding the + # removed documentation entry back into the manual + # structure, it is necessary to rebuild the missing cross + # reference information inside the manual structure in + # order to reactivate the removed cross refereces, as + # well. + ACTIONNAM_CROSREF='restoreCrossReferences' + ;; + + esac + + # Define list of target entries using find's regular expression + # pattern as reference. Notice that, when we update section + # definition files, the files already exist in the working copy so + # the pattern can be its absolute path without any problem. If the + # pattern is built correctly, it will match the location and so be + # returned to build the list of entries to process. Notice also + # that, when updating, it is possible to use a regular expression + # to match more than one location and build the list of entries + # based on such matching. In this last configuration, let you to + # update menu, nodes and cross references to many section + # definitions (i.e., all those section definition file that match + # the pattern you specified). + MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ + --pattern="${PATTERN}" | egrep -v "/(${MANUAL_NAME}|chapter)") + + # Verify list of target entries. Assuming is is empty, define + # list of target documentation entries using pattern as reference + # instead. When we delete a section entry from the working copy, + # using find to retrive its path isn't possible because the + # section definition file is removed before executing find and by + # consequence no match is found. This issue provokes no section + # entry to be removed from menu, nodes and cross references. In + # order to solve this, use the pattern value as list of target + # entries. Notice that, in this case, the pattern value must be + # the absolute path to that documentation entry which doesn't + # exist and we want to update menu, nodes and cross references + # information for. + if [[ $MANUAL_ENTRIES == '' ]] && [[ $PATTERN =~ '^[[:alnum:]./_-]+$' ]];then + MANUAL_ENTRIES=${PATTERN} + fi + + # Verify list of target entries. Assumming it is still empty, + # there is nothing else to do here but printing an error message + # describing the fact that no section entry was found to process. + if [[ $MANUAL_ENTRIES == '' ]];then + cli_printMessage "`gettext "No section entry found to process."`" --as-error-line + fi + + # Loop through target documentation entries in order to update the + # documentation structure (e.g., it is not enough with copying + # documentation entry files, it is also needed to update menu, + # nodes and related cross-references). + for MANUAL_ENTRY in ${MANUAL_ENTRIES};do + cli_printMessage "${MANUAL_ENTRY}" --as-response-line + texinfo_${ACTIONNAM_SECMENU} + texinfo_updateSectionNodes + texinfo_makeSeeAlso "${MANUAL_ENTRY}" + texinfo_${ACTIONNAM_CROSREF} "${MANUAL_ENTRY}" + done + +} diff --git a/Scripts/centos-art/Functions/Help/help.sh b/Scripts/centos-art/Functions/Help/help.sh new file mode 100755 index 0000000..31d43b2 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/help.sh @@ -0,0 +1,237 @@ +#!/bin/bash +# +# help.sh -- This function initializes the interface used by +# centos-art.sh script to perform documentation tasks through +# different documentation backends. +# +# Copyright (C) 2009, 2010, 2011 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 help { + + # Initialize action name with an empty value. + local ACTIONNAM='' + + # Initialize search option (`--search'). This option is used to + # look for documentation inside documentation backends. + local FLAG_SEARCH="" + + # Initialize manual's language. + local MANUAL_L10N=$(cli_getCurrentLocale) + + # Initialize manuals's top-level directory. This is the place + # where the manual will be stored in. To provide flexibility, the + # current directory where the `centos-art.sh' script was called + # from is used as manual's top-level directory. Notice that this + # relaxation is required because we need to create/maintain + # manuals both under `trunk/Manuals/' and `branches/Manuals/' + # directories. + local MANUAL_TLDIR=${PWD} + + # Verify manual's top-level directory. To prevent messing the + # things up, we need to restrict the possible locations + # where documentation manuals can be created in the working copy. + # When manual's top-level location is other but the ones + # permitted, use `trunk/Manuals' directory structure as default + # location to store documentation manuals. + if [[ ! $MANUAL_TLDIR =~ "^${CLI_WRKCOPY}/(trunk/Manuals|branches/Manuals/[[:alnum:]-]+)$" ]];then + MANUAL_TLDIR="${CLI_WRKCOPY}/trunk/Manuals" + fi + + # Initialize documentation entries arrays. Arrays defined here + # contain all the information needed to process documentation + # entries (e.g., manual, part, chapter and section). + local -a MANUAL_SLFN + local -a MANUAL_DIRN + local -a MANUAL_PART + local -a MANUAL_CHAP + local -a MANUAL_SECT + + # Initialize documentation entries counter. + local MANUAL_DOCENTRY_COUNT=0 + local MANUAL_DOCENTRY_ID=0 + + # Interpret option arguments passed through the command-line. + help_getOptions + + # Redefine arrays related to documentation entries using + # non-option arguments passed through the command-line. At this + # point all options have been removed from ARGUMENTS and + # non-option arguments remain. Evaluate ARGUMENTS to retrive the + # information related documentation entries from there. + help_getEntries + + # Execute backend-specific documentation tasks for each + # documentation entry specified in the command-line, individually. + # Notice that we've stored all documentation entries passed as + # non-option arguments in array variables in order to process them + # now, one by one. This is particularily useful when we need to + # reach items in the array beyond the current iteration cycle. For + # example, when we perform actions that require source and target + # locations (e.g., copying and renaming): we use the current value + # as source location and the second value in the array as target + # location; both defined from the first iteration cycle. + while [[ $MANUAL_DOCENTRY_ID -lt $MANUAL_DOCENTRY_COUNT ]];do + + # Define name used by manual's main definition file. + MANUAL_NAME=${MANUAL_SLFN[${MANUAL_DOCENTRY_ID}]} + + # Define absolute path to directory holding language-specific + # directories. + MANUAL_BASEDIR="${MANUAL_TLDIR}/${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}" + + # Define absolute path to directory holding language-specific + # texinfo source files. + MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" + + # Define absolute path to changed directories inside the + # manual. For example, when a section entry is edited, copied + # or renamed inside the same manual there is only one + # aboslute path to look for changes, the one holding the + # section entry. However, when an entire manual is renamed, + # there might be two different locations to look changes for, + # the source location deleted and the target location added. + MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR_L10N}" + + # Define absolute path to base file. This is the main file + # name (without extension) we use as reference to build output + # files in different formats (.info, .pdf, .xml, etc.). + MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" + + # Define manual's part name. + MANUAL_PART_NAME=${MANUAL_PART[${MANUAL_DOCENTRY_ID}]} + + # Define absolute path to manual's part directory. + MANUAL_PART_DIR="${MANUAL_BASEDIR_L10N}/${MANUAL_PART_NAME}" + + # Define manual's chapter name. + MANUAL_CHAPTER_NAME=${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} + + # Define absolute path to chapter's directory. This is the + # place where chapter-specific files are stored in. Be sure no + # extra slash be present in the value (e.g., when the part + # name isn't provided). + MANUAL_CHAPTER_DIR="$(echo ${MANUAL_PART_DIR}/${MANUAL_CHAPTER_NAME} \ + | sed -r 's!/{2,}!/!g' )" + + # Define section name. + MANUAL_SECTION_NAME=${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} + + # Define absolute path to manual's configuration file. This + # is the file that controls the way template files are applied + # to documentation entries once they have been created as well + # as the style and order used for printing sections. + MANUAL_CONFIG_FILE="${MANUAL_BASEFILE}.conf" + + # Define documentation backend. This information defines the + # 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.). + if [[ -f ${MANUAL_CONFIG_FILE} ]];then + + # Retrive documentation backend from configuration file. + MANUAL_BACKEND=$(cli_getConfigValue \ + "${MANUAL_CONFIG_FILE}" "main" "manual_backend") + + # Verify documentation backend. This is required in order + # to prevent malformed values from being used. Be sure + # only supported documentation backends can be provided as + # value to `manual_backend' option inside configuration + # files. + if [[ ! $MANUAL_BACKEND =~ '^(texinfo)$' ]];then + cli_printMessage "`gettext "The documentation backend provided isn't supported."`" --as-error-line + fi + + else + + # When the current documentation manual is being created + # for first time, there's no way to get the documentation + # backend to use in the future manual, but asking the user + # creating it which one to use. + cli_printMessage "`gettext "Select one of the following documentation backends:"`" + MANUAL_BACKEND=$(cli_printMessage "texinfo" --as-selection-line) + + fi + + # Notice that, because we are processing non-option arguments + # one by one, there is no need to sycronize changes or + # initialize functionalities to the same manual time after + # time (assuming all documentation entries passed as + # non-option arguments refer the same manual directory name). + # That would be only necessary when documentation entries + # refer to different manual directory names that could be + # written in different documentation backends. + if [[ ${MANUAL_DOCENTRY_ID} -eq 0 \ + || ( ( ${MANUAL_DOCENTRY_ID} -gt 0 ) && ( \ + ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} - 1))]} ) ) ]];then + + # Syncronize changes between repository and working copy. + # At this point, changes in the repository are merged in + # the working copy and changes in the working copy + # committed up to repository. + if [[ -d ${MANUAL_CHANGED_DIRS} ]];then + cli_syncroRepoChanges ${MANUAL_CHANGED_DIRS} + fi + + # Initialize documentation backend functionalities. At + # this point we load all functionalities required into + # `centos-art.sh''s execution environment and make them + # available, this way, to perform backend-specific + # documentation tasks. + cli_exportFunctions "${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/$(cli_getRepoName \ + ${MANUAL_BACKEND} -d)" "${MANUAL_BACKEND}" + + fi + + # Execute backend-specific documentation tasks. + ${MANUAL_BACKEND} + + # Unset the exported functions before go on with the next + # documentation entry provided as non-option argument to + # `centos-art.sh' script. Different documentation entries may + # be written in different documentation backends. Each + # documentation backend is loaded in order to perform their + # related documentation tasks. Assuming more that one + # documentation entry be passed as non-option argument to + # `centos-art.sh' script and they are written in different + # formats, we might end up loading documentation backend + # functionalities that aren't used in the current + # documentation entry being processed. In that sake, unset + # documentation bakend functionalities when the next + # documentation entry refers to a manual directory different + # to that one being currently processed. + if [[ ${MANUAL_DOCENTRY_ID} -gt 0 \ + && ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} ]];then + cli_unsetFunctions "${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/$(cli_getRepoName \ + ${MANUAL_BACKEND} -d)" "${MANUAL_BACKEND}" + fi + + # Increment documentation entry counter id. + MANUAL_DOCENTRY_ID=$(($MANUAL_DOCENTRY_ID + 1)) + + done + + # Syncronize changes between repository and working copy. At this + # point, changes in the repository are merged in the working copy + # and changes in the working copy committed up to repository. + cli_syncroRepoChanges ${MANUAL_CHANGED_DIRS} + +} diff --git a/Scripts/centos-art/Functions/Help/help_getEntries.sh b/Scripts/centos-art/Functions/Help/help_getEntries.sh new file mode 100755 index 0000000..a1c0ec8 --- /dev/null +++ b/Scripts/centos-art/Functions/Help/help_getEntries.sh @@ -0,0 +1,126 @@ +#!/bin/bash +# +# help_getEntries.sh -- This function interpretes non-option +# arguments passed to `help' functionality through the command-line +# and redefines array variables related to documentation entries. +# +# Copyright (C) 2009, 2010, 2011 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 help_getEntries { + + # Initialize manual's documentation entry as an empty value local + # to this function. + local MANUAL_DOCENTRY='' + + # 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" + + if [[ $@ == '' ]];then + + # Define default documentation entry. This happens when + # non-option arguments aren't provided to centos-art.sh + # script. Default documentation entry defined here points to + # manual's main definition file, so only the manual's self + # name and manual's directory name need to be defined here. + MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' + MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]='Tcar-fs' + MANUAL_DOCENTRY_COUNT=$(($MANUAL_DOCENTRY_COUNT + 1)) + + else + + # Retrive documentation entries passed to `centos-art.sh' + # script as non-option arguments and store them in array + # variables in order to describe their parts (e.g., manual + # name, chapter name and section name) that way. + # Documentation entries passed as non-opiton arguments must be + # written either in `MANUAL:PART:CHAPTER:SECTION' or + # `path/to/dir' formats in order to be processed correctly + # here. Empty spaces are not permitted. To separate words, use + # the minus sign (e.g., hello-world) or cammel case (e.g., + # HelloWorld). + for MANUAL_DOCENTRY in $@;do + + if [[ ${MANUAL_DOCENTRY} =~ '^([A-Za-z0-9-]+)(:[A-Za-z0-9-]*){0,3}$' ]];then + + # When `MANUAL:PART:CHAPTER:SECTION' is used as format + # to documentation entry, you can specify the manual, + # chapter and section where documentation actions will + # take place on. + + # Manual self name. + MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(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 ) + + # Manual part name. + MANUAL_PART[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(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 ) + + # Manual section name. + MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $4 }') -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. + + # Manual's self name. + MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' + + # Manual's self directory name. + MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]='Tcar-fs' + + # Manual's chapter name. + MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 1 ) print $1 }' ) -d ) + + # Manual's section name. + MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 2 ) print $0 }' \ + | cut -d/ -f2- | tr '/' '-') -f ) + + else + cli_printMessage "`gettext "The documentation entry provided isn't supported."`" --as-error-line + fi + + # Increment counting of non-option arguments. + MANUAL_DOCENTRY_COUNT=$(($MANUAL_DOCENTRY_COUNT + 1)) + + done + + fi + +} diff --git a/Scripts/centos-art/Functions/Help/help_getOptions.sh b/Scripts/centos-art/Functions/Help/help_getOptions.sh new file mode 100755 index 0000000..c76116e --- /dev/null +++ b/Scripts/centos-art/Functions/Help/help_getOptions.sh @@ -0,0 +1,122 @@ +#!/bin/bash +# +# help_getOptions.sh -- This function interpretes option arguments +# passed to `help' functionality through the command-line and defines +# action names accordingly. +# +# Copyright (C) 2009, 2010, 2011 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 help_getOptions { + + # Define short options we want to support. + local ARGSS="" + + # Define long options we want to support. + local ARGSL="quiet,answer-yes,dont-commit-changes,read,search:,edit,update-output,update-structure,copy,delete,rename" + + # Parse arguments using getopt(1) command parser. + cli_parseArguments + + # Reset positional parameters using output from (getopt) argument + # parser. + eval set -- "$ARGUMENTS" + + # Define action to take for each option passed. + while true; do + case "$1" in + + --quiet ) + FLAG_QUIET="true" + FLAG_DONT_COMMIT_CHANGES="true" + shift 1 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --dont-commit-changes ) + FLAG_DONT_COMMIT_CHANGES="true" + shift 1 + ;; + + --search ) + ACTIONNAM="searchIndex" + FLAG_SEARCH="$2" + shift 2 + ;; + + --edit ) + ACTIONNAM="editEntry" + shift 1 + ;; + + --copy ) + ACTIONNAM="copyEntry" + shift 1 + ;; + + --delete ) + ACTIONNAM="deleteEntry" + shift 1 + ;; + + --rename ) + ACTIONNAM="renameEntry" + shift 1 + ;; + + --update-output ) + ACTIONNAM="updateOutputFiles" + shift 1 + ;; + + --update-structure ) + ACTIONNAM="updateStructureSection" + shift 1 + ;; + + --read ) + ACTIONNAM="searchNode" + 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/centos-art/Functions/Locale/locale.sh b/Scripts/centos-art/Functions/Locale/locale.sh new file mode 100755 index 0000000..5eb64c7 --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# +# locale.sh -- This function provides internationalization features +# for centos-art.sh script through GNU gettext standard processes. +# +# Copyright (C) 2009, 2010, 2011 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 locale { + + # Verify current locale information to avoid English messages from + # being localized to themselves. The English language is used as + # reference to write translatable strings inside the source files. + if [[ $(cli_getCurrentLocale) =~ '^en' ]];then + cli_printMessage "`gettext "The English language cannot be localized to itself."`" --as-error-line + fi + + local ACTIONNAMS='' + local ACTIONNAM='' + local ACTIONVAL='' + + # Initialize machine object flag (`--dont-create-mo'). This flag + # controls whether the centos-art.sh script does create/update + # machine object (MO) files from related portable object (PO) + # files or not. By default, MO files are created. + local FLAG_DONT_CREATE_MO='false' + + # Define localization (l10n) base directory. This is the place + # where all translation messages are organized in. Translation + # messages are organized herein using the same layout of the + # components they represent under the `trunk/Identity', + # `trunk/Manuals' or `trunk/Scripts' directory structures. The + # localization base directory must be used as source location for + # subversion operations (e.g., status, update, commit, etc.). + # Otherwise, it would be difficult to add directory structures + # that have several levels down from the localization base + # directory up to the repository (e.g., it is not possible in + # subversion to add a directory which parent directory hasn't been + # added to the repository previously.). + L10N_BASEDIR="$(cli_getRepoTLDir)/L10n" + + # Interpret arguments and options passed through command-line. + locale_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}" + + # Syncronize changes between repository and working copy. At this + # point, changes in the repository are merged in the working copy + # and changes in the working copy committed up to repository. + cli_syncroRepoChanges "${L10N_BASEDIR}" + + # Loop through non-option arguments passed to centos-art.sh script + # through its command-line. + for ACTIONVAL in "$@";do + + # Sanitate non-option argument to be sure it matches the + # directory convenctions stablished by centos-art.sh script + # against source locations in the working copy. + ACTIONVAL=$(cli_checkRepoDirSource "${ACTIONVAL}") + + # Verify directory passed as non-option argument to be sure it + # supports localization. + if [[ ! $(cli_isLocalized "${ACTIONVAL}") == 'true' ]];then + cli_printMessage "`gettext "The path provided does not support localization."`" --as-error-line + fi + + # Define localization working directory using directory passed + # as non-option argument. The localization working directory + # is the place where POT and PO files are stored inside the + # working copy. + L10N_WORKDIR=$(echo "${ACTIONVAL}" \ + | sed -r -e "s!trunk/(Identity|Scripts|Manuals)!trunk/L10n/\1!")/$(cli_getCurrentLocale) + + # Execute localization actions provided to centos-art.sh + # script through its command-line. Notice that localization + # actions will be executed in the same order they were + # provided in the command-line. + for ACTIONNAM in ${ACTIONNAMS};do + ${ACTIONNAM} + done + + done + + # Syncronize changes between repository and working copy. At this + # point, changes in the repository are merged in the working copy + # and changes in the working copy committed up to repository. + cli_syncroRepoChanges "${L10N_BASEDIR}" + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_deleteMessages.sh b/Scripts/centos-art/Functions/Locale/locale_deleteMessages.sh new file mode 100755 index 0000000..be98e0a --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_deleteMessages.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# +# locale_deleteMessages.sh -- This function deletes the source files' +# localization directory from the working copy in conjunction with all +# portable objects and machine objects inside it. +# +# Copyright (C) 2009, 2010, 2011 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 locale_deleteMessages { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Print action message. + cli_printMessage "$L10N_WORKDIR" --as-deleting-line + + # Verify existence of localization working directory. We cannot + # remove translation files that don't exist. + cli_checkFiles "$L10N_WORKDIR" + + # Delete localization working directory using subversion quietly. + svn del "$L10N_WORKDIR" --quiet + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_editMessages.sh b/Scripts/centos-art/Functions/Locale/locale_editMessages.sh new file mode 100755 index 0000000..313b832 --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_editMessages.sh @@ -0,0 +1,97 @@ +#!/bin/bash +# +# locale_editMessages.sh -- This function edits portable objects (.po) +# using default text editor. +# +# Copyright (C) 2009, 2010, 2011 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 locale_editMessages { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + local PO_FILE='' + local PO_FILES='' + + # Prepare localization working directory for receiving translation + # files. + if [[ ! -d ${L10N_WORKDIR} ]];then + + # Print separator line. + cli_printMessage "-" --as-separator-line + + # Output action message. + cli_printMessage "${L10N_WORKDIR}" --as-creating-line + + # Create localization working directory making parent + # directories as needed. Subversion doesn't create directories + # recursively, so we use the system's `mkdir' command and then + # subversion to register the changes. + mkdir -p ${L10N_WORKDIR} + + # Commit changes from working copy to central repository only. + # At this point, changes in the repository are not merged in + # the working copy, but chages in the working copy do are + # committed up to repository. + cli_commitRepoChanges "${L10N_BASEDIR}" + + fi + + # Define list of PO files to process based on paths provided as + # non-option arguments through centos-art.sh script command-line. + if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/(Manuals|Identity/Models)/.*$" ]];then + + # Define list of PO files for XML-based files. + PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --pattern=".*/messages\.po") + + # Do not create MO files for XML-based files. + FLAG_DONT_CREATE_MO='true' + + elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Scripts$" ]];then + + # Define list of PO files for shell scripts. + PO_FILES=$(cli_getFilesList ${L10N_WORKDIR} --pattern=".*/${TEXTDOMAIN}\.po") + + else + cli_printMessage "`gettext "The path provided does not support localization."`" --as-error-line + fi + + # Loop through list of PO files to process in order to edit them + # one by one using user's default text editor. + for PO_FILE in ${PO_FILES};do + + # Print the file we are editing. + cli_printMessage "${PO_FILE}" --as-updating-line + + # Use default text editor to edit the PO file. + eval ${EDITOR} ${PO_FILE} + + # At this point some changes might be realized inside the PO + # file, so we need to update the related MO files based on + # recently updated PO files here in order for `centos-art.sh' + # script to print out the most up to date revision of + # localized messages. Notice that this is required only if we + # were localizaing shell scripts. + locale_updateMessageBinary ${PO_FILE} + + done + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_getOptions.sh b/Scripts/centos-art/Functions/Locale/locale_getOptions.sh new file mode 100755 index 0000000..3c232ff --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_getOptions.sh @@ -0,0 +1,119 @@ +#!/bin/bash +# +# locale_getOptions.sh -- This function interprets option parameters +# passed to `locale' functionality and defines action names +# accordingly. +# +# Copyright (C) 2009, 2010, 2011 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 locale_getOptions { + + # Define short options we want to support. + local ARGSS="" + + # Define long options we want to support. + local ARGSL="filter:,quiet,answer-yes,dont-commit-changes,update,edit,delete,dont-create-mo" + + # Parse arguments using getopt(1) command parser. + cli_parseArguments + + # Reset positional parameters using output from (getopt) argument + # parser. + eval set -- "${ARGUMENTS}" + + # Look for options passed through command-line. + while true; do + case "$1" in + + --filter ) + FLAG_FILTER="$2" + shift 2 + ;; + + --quiet ) + FLAG_QUIET="true" + FLAG_DONT_COMMIT_CHANGES="true" + shift 1 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --dont-commit-changes ) + FLAG_DONT_COMMIT_CHANGES="true" + shift 1 + ;; + + --update ) + ACTIONNAMS="$ACTIONNAMS locale_updateMessages" + shift 1 + ;; + + --edit ) + ACTIONNAMS="$ACTIONNAMS locale_editMessages" + shift 1 + ;; + + --delete ) + ACTIONNAMS="$ACTIONNAMS locale_deleteMessages" + shift 1 + ;; + + --dont-create-mo ) + FLAG_DONT_CREATE_MO="true" + 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 + + # Verify action names. When no action name is specified, use + # edition as default action name. + if [[ $ACTIONNAMS == '' ]];then + ACTIONNAMS="locale_editMessages" + fi + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Verify non-option arguments passed to command-line. If there + # isn't any, redefine the ARGUMENTS variable to use the current + # location the functionality was called from. + if [[ $ARGUMENTS == '' ]];then + ARGUMENTS=${PWD} + fi + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_updateMessageBinary.sh b/Scripts/centos-art/Functions/Locale/locale_updateMessageBinary.sh new file mode 100755 index 0000000..4b593ee --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_updateMessageBinary.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# +# locale_updateMessageBinary.sh -- This function creates/updates +# machine objects (.mo) from portable objects (.po). +# +# Copyright (C) 2009, 2010, 2011 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 locale_updateMessageBinary { + + # Verify machine object creation flag. + if [[ ${FLAG_DONT_CREATE_MO} == 'true' ]];then + return + fi + + # Define absolute path to portable object file. + local PO_FILE="$1" + + # Verify existence of portable object file. + cli_checkFiles "${PO_FILE}" + + # Define absolute path to machine object directory. + local MO_DIR="${L10N_WORKDIR}/LC_MESSAGES" + + # Define absolute path to machine object file. + local MO_FILE="${MO_DIR}/${CLI_PROGRAM}.sh.mo" + + # Print action message. + cli_printMessage "${MO_FILE}" --as-creating-line + + # Verify absolute path to machine object directory, if it doesn't + # exist create it. + if [[ ! -d ${MO_DIR} ]];then + mkdir -p ${MO_DIR} + fi + + # Create machine object from portable object. + msgfmt --check ${PO_FILE} --output-file=${MO_FILE} + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_updateMessageMetadata.sh b/Scripts/centos-art/Functions/Locale/locale_updateMessageMetadata.sh new file mode 100755 index 0000000..2ed19e0 --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_updateMessageMetadata.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# +# locale_updateMessageMetadata.sh -- This function sanitates .pot and +# .po files to use common translation markers inside top comment. +# Later, replacement of common translation markers is applied to set +# the final information. +# +# Copyright (C) 2009, 2010, 2011 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 locale_updateMessageMetadata { + + local COUNT=0 + local -a SRC + local -a DST + + # Retrive absolute path of portable object we'll work with. + local FILE="$1" + + # Define current locale. + local CURRENTLOCALE=$(cli_getCurrentLocale) + + # Define language name from current locale. + local LANGNAME=$(cli_getLangName ${CURRENTLOCALE}) + + # Check existence of file before work with it. + cli_checkFiles "${FILE}" + + # Define pattern lines. The pattern lines are put inside portable + # objects through xgettext and xml2po commands . + SRC[0]="\"Project-Id-Version:" + SRC[1]="\"Report-Msgid-Bugs-To:" + SRC[2]="\"Last-Translator:" + SRC[3]="\"Language-Team:" + SRC[4]="\"PO-Revision-Date:" + + # Define replacement lines for pattern line. + DST[0]="\"Project-Id-Version: ${CLI_PROGRAM}.sh\\\n\"" + DST[1]="\"Report-Msgid-Bugs-To: The CentOS L10n SIG <=MAIL_L10N=>\\\n\"" + DST[2]="\"Last-Translator: The CentOS L10n SIG <=MAIL_L10N=>\\\n\"" + DST[3]="\"Language-Team: ${LANGNAME}\\\n\"" + DST[4]="\"PO-Revision-Date: $(date "+%F %H:%M%z")\\\n\"" + + # Change pattern lines with their replacement lines. + while [[ $COUNT -lt ${#SRC[*]} ]];do + sed -i -r "/${SRC[$COUNT]}/c${DST[$COUNT]}" ${FILE} + COUNT=$(($COUNT + 1)) + done + + # When the .pot file is created using xml2po the + # `Report-Msgid-Bugs-To:' metadata field isn't created like it + # does when xgettext is used. So, in order to have such metadata + # field in all .pot files, verify its existence and add it if it + # doesn't exist. + egrep "^\"${SRC[1]}" $FILE > /dev/null + if [[ $? -ne 0 ]];then + sed -i -r "/^\"${SRC[0]}/a${DST[1]}" $FILE + fi + + # Replace package information using gettext domain information. + sed -i -r "s/PACKAGE/${TEXTDOMAIN}/g" ${FILE} + + # Expand translation markers inside file. + cli_expandTMarkers ${FILE} + + # Unset array variables to avoid undesired concatenations. + unset SRC + unset DST + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_updateMessagePObjects.sh b/Scripts/centos-art/Functions/Locale/locale_updateMessagePObjects.sh new file mode 100755 index 0000000..416b5e2 --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_updateMessagePObjects.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# locale_updateMessagePObjects.sh -- This function initializes the +# portable object when it doesn't exist. When the portable object does +# exist, it is updated instead. In both cases, the portable object +# template is used as source to merge changes inside the portable +# object. +# +# Copyright (C) 2009, 2010, 2011 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 locale_updateMessagePObjects { + + local FILE="$1" + + # Verify the portable object template. The portable object + # template is used to create the portable object. We cannot + # continue without it. + cli_checkFiles "${FILE}.pot" + + # Print action message. + cli_printMessage "${FILE}.po" --as-creating-line + + # Verify existence of portable object. The portable object is the + # file translators edit in order to make translation works. + if [[ -f ${FILE}.po ]];then + + # Update portable object merging both portable object and + # portable object template. + msgmerge --output="${FILE}.po" "${FILE}.po" "${FILE}.pot" --quiet + + else + + # Initiate portable object using portable object template. + # Do not print msginit sterr output, use centos-art action + # message instead. + msginit -i ${FILE}.pot -o ${FILE}.po --width=70 \ + --no-translator 2> /dev/null + + fi + + # Sanitate metadata inside the PO file. + locale_updateMessageMetadata "${FILE}.po" + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_updateMessageShell.sh b/Scripts/centos-art/Functions/Locale/locale_updateMessageShell.sh new file mode 100755 index 0000000..5d671c7 --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_updateMessageShell.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# locale_updateMessageShell.sh -- This function parses shell scripts +# source files under action value and retrives translatable strings in +# order to creates/updates both the portable object template (.pot) +# and the portable object (.po) related. +# +# Copyright (C) 2009, 2010, 2011 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 locale_updateMessageShell { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Define absolute path to file used as reference to create + # portable object templates (.pot), portable objects (.po) and + # machine objects (.mo). + local MESSAGES="${L10N_WORKDIR}/${TEXTDOMAIN}" + + # Define regular expression to match extensions of shell scripts + # we use inside the repository. + local EXTENSION='sh' + + # Build list of files to process. When building the patter, be + # sure the value passed through `--filter' be exactly evaluated + # with the extension as prefix. Otherwise it would be difficult to + # match files that share the same characters in their file names + # (e.g., it would be difficult to match only `hello.sh' if + # `hello-world.sh' also exists in the same location). + local FILES=$(cli_getFilesList ${ACTIONVAL} --pattern="${FLAG_FILTER}\.${EXTENSION}") + + # Print action message. + cli_printMessage "${MESSAGES}.pot" --as-updating-line + + # Retrive translatable strings from shell script files and create + # the portable object template (.pot) from them. + xgettext --output=${MESSAGES}.pot \ + --copyright-holder="The CentOS L10n SIG" \ + --width=70 --sort-by-file ${FILES} + + # Sanitate metadata inside the POT file. + locale_updateMessageMetadata "${MESSAGES}.pot" + + # Verify, initialize or update portable objects from portable + # object templates. + locale_updateMessagePObjects "${MESSAGES}" + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_updateMessageXml.sh b/Scripts/centos-art/Functions/Locale/locale_updateMessageXml.sh new file mode 100755 index 0000000..f3a72bf --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_updateMessageXml.sh @@ -0,0 +1,112 @@ +#!/bin/bash +# +# locale_updateMessageXml.sh -- This function parses XML-based files +# (e.g., scalable vector graphics), retrives translatable strings and +# creates/update gettext portable objects. +# +# Copyright (C) 2009, 2010, 2011 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 locale_updateMessageXml { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Define filename used to create both portable object templates + # (.pot) and portable objects (.po) files. + local MESSAGES="${L10N_WORKDIR}/messages" + + # Define regular expression to match the file extension of all + # XML-based source files that can be localized inside the working + # copy. Be aware that sometimes, source files and output files + # are stored in the same location (e.g., when rendering + # `tcar-ug.docbook' file the `tcar-ug.xhtml' is saved in the same + # location). Avoid using output files as if they were source + # files, when retriving translatable strings. + local EXTENSION='(svg|docbook)' + + # Build list of files to process. When building the patter, be + # sure the value passed through `--filter' be exactly evaluated + # with the extension as prefix. Otherwise it would be difficult to + # match files that share the same characters in their file names + # (e.g., it would be difficult to match only `hello.docbook' if + # `hello-world.docbook' also exists in the same location). + local FILES=$(cli_getFilesList ${ACTIONVAL} \ + --pattern="${FLAG_FILTER}\.${EXTENSION}" \ + --maxdepth='1' --type="f" \ + | egrep -v '/[[:alpha:]]{2}_[[:alpha:]]{2}/') + + # Print action message. + cli_printMessage "${MESSAGES}.pot" --as-updating-line + + # Normalize XML files, expand entities before retriving + # translatable strings and create the portable object template + # (.pot) from such output. The translatable strings are retrived + # from the normalized output of files, not files themselves + # (because of this, we don't include `#: filename:line' output on + # .pot files). Entity expansion is also necessary for DocBook + # documents to be processed correctly. Notice that some long + # DocBook document structures might use entities to split the + # document structure into smaller pieces so they could be easier + # to maintain. Also, don't validate svg files the same way you + # validate docbook files; Docbook files have a DOCTYPE definition + # while svg files don't. Without a DOCTYPE definition, it isn't + # possible for `xmllint' to validate the document. + if [[ $ACTIONVAL =~ '^.+/(branches|trunk)/Manuals/.+$' ]];then + + # Another issue to consider is the amount of source files that + # are being processed through xml2po. When there are more than + # one file, xml2po interprets only the first one and discards + # the rest in the list. This way, when more than one file + # exists in the list, it isn't convenient to provide xmllint's + # output to xml2po's input. Once here, we can say that + # in order to expand DocBook entities it is required that only + # one file must be provided at localization time (e.g., using + # the `--filter' option). Otherwise translation messages are + # retrived from all files, but no entity expansion is realized + # because xmllint wouldn't be used in such case. + if [[ $(echo "$FILES" | wc -l) -eq 1 ]];then + + xmllint --valid --noent ${FILES} | xml2po -a - \ + | msgcat --output=${MESSAGES}.pot --width=70 --no-location - + + else + + xml2po -a ${FILES} \ + | msgcat --output=${MESSAGES}.pot --width=70 --no-location - + + fi + + elif [[ $ACTIONVAL =~ '^.+/(branches|trunk)/Identity/Models/.+$' ]];then + + xml2po -a ${FILES} \ + | msgcat --output=${MESSAGES}.pot --width=70 --no-location - + + else + + cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line + + fi + + # Verify, initialize or merge portable objects from portable object + # templates. + locale_updateMessagePObjects "${MESSAGES}" + +} diff --git a/Scripts/centos-art/Functions/Locale/locale_updateMessages.sh b/Scripts/centos-art/Functions/Locale/locale_updateMessages.sh new file mode 100755 index 0000000..742888d --- /dev/null +++ b/Scripts/centos-art/Functions/Locale/locale_updateMessages.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# locale_updateMessages.sh -- This function extracts translatable +# strings from both XML-based files (using xml2po) and shell scripts +# (using xgettext). Translatable strings are initially stored in +# portable objects templates (.pot) which are later merged into +# portable objects (.po) in order to be optionally converted as +# machine objects (.mo). +# +# Copyright (C) 2009, 2010, 2011 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 locale_updateMessages { + + # Verify existence of localization working directory. We cannot + # update translation files that don't exist. + cli_checkFiles $L10N_WORKDIR + + local ACTIONNAM='' + + # Evaluate action value to determine whether to use xml2po to + # extract translatable strings from XML-based files or to use + # xgettext to extract translatable strings from shell script + # files. + if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/(Manuals|Identity/Models)/.*$" ]];then + + # Update translatable strings inside the portable object + # template related to XML-based files (e.g., scalable vector + # graphics). + locale_updateMessageXml + + elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Scripts$" ]];then + + # Update translatable strings inside the portable object + # template related to shell scripts (e.g., the centos-art.sh + # script). + locale_updateMessageShell + + else + cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line + fi + +} diff --git a/Scripts/centos-art/Functions/Prepare/Config/vim.conf b/Scripts/centos-art/Functions/Prepare/Config/vim.conf new file mode 100755 index 0000000..5737ebd --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/Config/vim.conf @@ -0,0 +1,8 @@ +set nu +set textwidth=70 +set autoindent +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab +set tags=./tags,tags diff --git a/Scripts/centos-art/Functions/Prepare/prepare.sh b/Scripts/centos-art/Functions/Prepare/prepare.sh new file mode 100755 index 0000000..140ca5d --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/prepare.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# prepare.sh (initialization) -- This function creates the base +# execution environment required to standardize final configuration +# stuff needed by your workstation, once the working copy of The +# CentOS Artwork Repository has been downloaded in it. +# +# Copyright (C) 2009, 2010, 2011 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 prepare { + + local ACTIONNAM='' + local ACTIONNAMS='' + + # Define absolute path to directory holding prepare's + # configuration files. + local PREPARE_CONFIG_DIR=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/Config + + # Interpret arguments and options passed through command-line. + prepare_getOptions + + # Execute action names based on whether they were provided or not. + if [[ $ACTIONNAMS == '' ]];then + + # When action names are not provided, define action names that + # will take place, explicitly. + prepare_updatePackages + prepare_updateLinks + prepare_updateImages + prepare_updateManuals + + else + + # When action names are provided, loop through them and + # execute them one by one. + for ACTIONNAM in $ACTIONNAMS;do + ${ACTIONNAM} + done + + fi + +} diff --git a/Scripts/centos-art/Functions/Prepare/prepare_getEnvars.sh b/Scripts/centos-art/Functions/Prepare/prepare_getEnvars.sh new file mode 100755 index 0000000..8a3198a --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/prepare_getEnvars.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# prepare_getEnvars.sh -- This function outputs a brief description of +# relevant environment variables used by `centos-art.sh' script. +# +# Copyright (C) 2009, 2010, 2011 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 prepare_getEnvars { + + local -a VARS + local -a INFO + local COUNT=0 + + # Define name of environment variables used by centos-art.sh + # script. + VARS[0]='EDITOR' + VARS[1]='TZ' + VARS[2]='TEXTDOMAIN' + VARS[3]='TEXTDOMAINDIR' + VARS[4]='LANG' + + # Define description of environment variables. + INFO[0]="`gettext "Default text editor"`" + INFO[1]="`gettext "Default time zone representation"`" + INFO[2]="`gettext "Default domain used to retrieve translated messages"`" + INFO[3]="`gettext "Default directory used to retrive translated messages"`" + INFO[4]="`gettext "Default locale information"`" + + until [[ $COUNT -eq ${#VARS[*]} ]];do + + # Let user to reduce output using regular expression as + # reference. + if [[ ${VARS[$COUNT]} =~ $FLAG_FILTER ]];then + + # Output list of environment variables using indirect + # expansion (what a beautiful feature!) to output variable + # value. + cli_printMessage "${INFO[$COUNT]}:" + cli_printMessage "${VARS[$COUNT]}=${!VARS[$COUNT]}" --as-response-line + + fi + + # Increment counter. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Scripts/centos-art/Functions/Prepare/prepare_getLinkName.sh b/Scripts/centos-art/Functions/Prepare/prepare_getLinkName.sh new file mode 100755 index 0000000..83ab48a --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/prepare_getLinkName.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# +# prepare_getLinkName.sh -- This function standardizes link name +# construction. For the construction sake, two arguments are required, +# one to now the file's base directory, and another holding the file's +# absolute path. With this information, the base directory is removed +# from file's absolute path and the remaining path is transformed into +# a file name where each slash is converted into minus sign. +# +# For example, if the following information is provided: +# +# ARG1: /home/centos/artwork/trunk/Identity/Brushes +# ARG2: /home/centos/artwork/trunk/Identity/Brushes/Corporate/symbol.gbr +# +# the result will be: `corporate-symbol.gbr'. +# +# Copyright (C) 2009, 2010, 2011 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 prepare_getLinkName { + + local LINK_BASEDIR='' + local LINK_ABSPATH='' + local LINK_CHARSEP='' + + # Define absolute path to link's base directory. + LINK_BASEDIR="$1" + + # Define absolute path to link's file. + LINK_ABSPATH="$2" + + # Define character used as word separator on file name. + LINK_CHARSEP='-' + + # Output link name. + echo "$LINK_ABSPATH" | sed -r "s!^${LINK_BASEDIR}/!!" \ + | tr '[:upper:]' '[:lower:]' | sed -r "s!/!${LINK_CHARSEP}!g" + +} diff --git a/Scripts/centos-art/Functions/Prepare/prepare_getOptions.sh b/Scripts/centos-art/Functions/Prepare/prepare_getOptions.sh new file mode 100755 index 0000000..c6da090 --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/prepare_getOptions.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# +# prepare_getOptions.sh -- This function parses command options +# provided to `centos-art.sh' script when the first argument in the +# command-line is the `prepare' word. To parse options, this function +# makes use of getopt program. +# +# Copyright (C) 2009, 2010, 2011 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 prepare_getOptions { + + # Define short options we want to support. + local ARGSS="" + + # Define long options we want to support. + local ARGSL="quiet,answer-yes,packages,links,images,manuals,environment" + + # Parse arguments using getopt(1) command parser. + cli_parseArguments + + # Reset positional parameters using output from (getopt) argument + # parser. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + case "$1" in + + --quiet ) + FLAG_QUIET="true" + FLAG_DONT_COMMIT_CHANGES="true" + shift 1 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --packages ) + ACTIONNAMS="${ACTIONNAMS} prepare_updatePackages" + shift 1 + ;; + + --links ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateLinks" + shift 1 + ;; + + --images ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateImages" + shift 1 + ;; + + --manuals ) + ACTIONNAMS="${ACTIONNAMS} prepare_updateManuals" + shift 1 + ;; + + --environment ) + ACTIONNAMS="${ACTIONNAMS} prepare_getEnvars" + shift 1 + ;; + + * ) + break + esac + done + +} diff --git a/Scripts/centos-art/Functions/Prepare/prepare_updateImages.sh b/Scripts/centos-art/Functions/Prepare/prepare_updateImages.sh new file mode 100755 index 0000000..ca8aa54 --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/prepare_updateImages.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# prepare_updateImages.sh -- This option initializes image files inside +# the working copy. When you provide this option, the centos-art.sh +# scripts renders image files from all design models available in the +# working copy. This step is required in order to satisfy dependencies +# from different components inside the working copy. +# +# Copyright (C) 2009, 2010, 2011 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 prepare_updateImages { + + # Define list of directories that need to be rendered. + local DIRS=$(cli_getFilesList \ + ${CLI_WRKCOPY}/trunk/Identity/Images --maxdepth="1" \ + --mindepth="1" --type="d" --pattern=".+/[[:alnum:]]+$") + + # Execute the render functionality of centos-art.sh script to + # produce directories inside the list one by one. Producing + # directories one by one is important because themes directory is + # produced differently compared to others directories. This way, + # when we create a list of directories and pass them that way to + # centos-art.sh script, it is possible for ir to know how to + # produce each directory passed. + ${CLI_BASEDIR}/${CLI_PROGRAM}.sh render $DIRS --dont-commit-changes + +} diff --git a/Scripts/centos-art/Functions/Prepare/prepare_updateLinks.sh b/Scripts/centos-art/Functions/Prepare/prepare_updateLinks.sh new file mode 100755 index 0000000..c3f9134 --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/prepare_updateLinks.sh @@ -0,0 +1,139 @@ +#!/bin/bash +# +# prepare_updateLinks.sh -- This option creates/updates the symbolic links +# information required in your workstation to connect it with the +# files inside the working copy of The CentOS Artwork Repository. When +# you provide this option, the centos-art.sh put itself into your +# system's execution path and make common brushes, patterns, palettes +# and fonts available inside applications like GIMP, so you can make +# use of them without loosing version control over them. +# +# Copyright (C) 2009, 2010, 2011 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 prepare_updateLinks { + + local -a LINKS_SRC + local -a LINKS_DST + local USERFILES='' + local PALETTE='' + local BRUSH='' + local PATTERN='' + local FONT='' + local FILE='' + local COUNT=0 + + # Define user's directories. This is the place where configuration + # links are created in. + local GIMP_DIR=${HOME}/.$(rpm -q gimp | cut -d. -f-2) + local GIMP_DIR_BRUSHES=${GIMP_DIR}/brushes + local GIMP_DIR_PALETTES=${GIMP_DIR}/palettes + local GIMP_DIR_PATTERNS=${GIMP_DIR}/patterns + local INKS_DIR=${HOME}/.inkscape + local INKS_DIR_PALETTES=${INKS_DIR}/palettes + local FONT_DIR=${HOME}/.fonts + local APPS_DIR=${HOME}/bin + + # Define working copy directories. This is the place where + # configuration links point to. + local WCDIR=$(cli_getRepoTLDir)/Identity + local WCDIR_BRUSHES=${WCDIR}/Brushes + local WCDIR_PALETTES=${WCDIR}/Palettes + local WCDIR_PATTERNS=${WCDIR}/Patterns + local WCDIR_FONTS=${WCDIR}/Fonts + local WCDIR_EDITOR=${PREPARE_CONFIG_DIR} + + # Define link relation for cli. + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${APPS_DIR}/${CLI_PROGRAM} + LINKS_DST[((++${#LINKS_DST[*]}))]=${CLI_BASEDIR}/${CLI_PROGRAM}.sh + USERFILES="${APPS_DIR}/${CLI_PROGRAM}" + + # Define link relation for fonts. + for FONT in $(cli_getFilesList "${WCDIR_FONTS}" --pattern='.+\.ttf');do + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${FONT_DIR}/$(basename $FONT) + LINKS_DST[((++${#LINKS_DST[*]}))]=${FONT} + done + + # Define link relation for common palettes. + for PALETTE in $(cli_getFilesList "${WCDIR_PALETTES}" --pattern=".+\.gpl");do + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) + LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${INKS_DIR_PALETTES}/$(prepare_getLinkName ${WCDIR_PALETTES} ${PALETTE}) + LINKS_DST[((++${#LINKS_DST[*]}))]=${PALETTE} + done + + # Define link relation for common brushes. + for BRUSH in $(cli_getFilesList "${WCDIR_BRUSHES}" --pattern=".+\.(gbr|gih)");do + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_BRUSHES}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) + LINKS_DST[((++${#LINKS_DST[*]}))]=${BRUSH} + done + + # Define link relation for common patterns. + for PATTERN in $(cli_getFilesList "${WCDIR_PATTERNS}" --pattern=".+\.png");do + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${GIMP_DIR_PATTERNS}/$(prepare_getLinkName ${WCDIR_BRUSHES} ${BRUSH}) + LINKS_DST[((++${#LINKS_DST[*]}))]=${PATTERN} + done + + # Define link relation for Vim text editor's configuration. + if [[ $EDITOR == '/usr/bin/vim' ]];then + LINKS_SRC[((++${#LINKS_SRC[*]}))]=${HOME}/.vimrc + LINKS_DST[((++${#LINKS_DST[*]}))]=${WCDIR_EDITOR}/vim.conf + USERFILES="${USERFILES} ${HOME}/.vimrc" + fi + + # Define which files inside the user's configuration directories + # need to be removed in order for centos-art.sh script to make a + # fresh installation of common patterns, common palettes and + # common brushes using symbolic links from the working copy to the + # user's configuration directories inside the workstation. + USERFILES=$(echo "$USERFILES"; + cli_getFilesList ${APPS_DIR} --pattern='.+\.sh'; + cli_getFilesList ${FONT_DIR} --pattern='.+\.ttf'; + cli_getFilesList ${GIMP_DIR_BRUSHES} --pattern='.+\.(gbr|gih)'; + cli_getFilesList ${GIMP_DIR_PATTERNS} --pattern='.+\.(pat|png|jpg|bmp)'; + cli_getFilesList ${GIMP_DIR_PALETTES} --pattern='.+\.gpl'; + cli_getFilesList ${INKS_DIR_PALETTES} --pattern='.+\.gpl';) + + # Remove user-specific configuration files from user's home + # directory. Otherwise, we might end up having links insid user's + # home directory that don't exist inside the working copy. + if [[ "$USERFILES" != '' ]];then + rm -r $USERFILES + fi + + while [[ $COUNT -lt ${#LINKS_SRC[*]} ]];do + + # Print action message. + cli_printMessage "${LINKS_SRC[$COUNT]}" --as-creating-line + + # Create symbolic link's parent directory if it doesn't exist. + if [[ ! -d $(dirname ${LINKS_SRC[$COUNT]}) ]];then + mkdir -p $(dirname ${LINKS_SRC[$COUNT]}) + fi + + # Create symbolic link. + ln ${LINKS_DST[$COUNT]} ${LINKS_SRC[$COUNT]} --symbolic --force + + # Increment counter. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Scripts/centos-art/Functions/Prepare/prepare_updateManuals.sh b/Scripts/centos-art/Functions/Prepare/prepare_updateManuals.sh new file mode 100755 index 0000000..bde6e8c --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/prepare_updateManuals.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# prepare_updateManuals.sh -- This option initializes documentation files +# inside the working copy. When you provide this option, the +# centos-art.sh script renders all documentation manuals from their +# related source files so you can read them nicely. +# +# Copyright (C) 2009, 2010, 2011 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 prepare_updateManuals { + + local RELEASE=$(cat /etc/redhat-release | gawk '{ print $3 }') + + # The CentOS Artwork Repository User's Guide in docbook format. + ${CLI_BASEDIR}/${CLI_PROGRAM}.sh render \ + trunk/Manuals/Tcar-ug --filter="tcar-ug" \ + --dont-commit-changes + + # The CentOS Distribution Notes + ${CLI_BASEDIR}/${CLI_PROGRAM}.sh render \ + trunk/Manuals/Distro --releasever="${RELEASE}" \ + --dont-commit-changes + + # The CentOS Artwork Repository User's Guide in texinfo format. + ${CLI_BASEDIR}/${CLI_PROGRAM}.sh help --update \ + trunk/Manuals/Tcar-fs \ + --dont-commit-changes + +} diff --git a/Scripts/centos-art/Functions/Prepare/prepare_updatePackages.sh b/Scripts/centos-art/Functions/Prepare/prepare_updatePackages.sh new file mode 100755 index 0000000..6a75928 --- /dev/null +++ b/Scripts/centos-art/Functions/Prepare/prepare_updatePackages.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# +# prepare_updatePackages.sh -- This function verifies the required +# packages your workstation needs to have installed in order for +# `centos-art.sh' script to run correctly. If there is one or more +# missing packages, the `centos-art.sh' script asks you to confirm +# their installation through `sudo yum'. +# +# Copyright (C) 2009, 2010, 2011 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 prepare_updatePackages { + + local PACKAGE='' + local PACKAGES='' + local PACKAGES_THIRDS='' + local -a PACKAGES_MISSING + local -a PACKAGES_INSTALL + local RPM='/bin/rpm' + local YUM='/usr/bin/yum' + local YUM_OPTIONS='' + + # Check execution rights of package managers. + cli_checkFiles $RPM --execution + cli_checkFiles $YUM --execution + + # Define required packages needed by centos-art.sh script. + PACKAGES="inkscape ImageMagick netpbm netpbm-progs syslinux gimp + coreutils texinfo info tetex-latex tetex-fonts tetex-xdvi + tetex-dvips gettext texi2html gnome-doc-utils elinks + docbook-style-xsl docbook-utils docbook-dtds + docbook-style-dsssl docbook-simple docbook-utils-pdf + docbook-slides firefox sudo yum rpm ctags" + + # Define packages from third party repositories (i.e., packages + # not included in CentOS [base] repository.) required by + # centos-art to work as expected. + PACKAGES_THIRDS="(inkscape|blender)" + + # Build list of installed and missing packages. + for PACKAGE in $PACKAGES;do + $RPM -q --queryformat "%{NAME}\n" $PACKAGE --quiet + if [[ $? -ne 0 ]];then + PACKAGES_MISSING[((++${#PACKAGES_MISSING[*]}))]=$PACKAGE + else + PACKAGES_INSTALL[((++${#PACKAGES_INSTALL[*]}))]=$PACKAGE + fi + done + + # Define relation between centos-art.sh options and yum options. + [[ $FLAG_ANSWER == 'true' ]] && YUM_OPTIONS="${YUM_OPTIONS} -y" + [[ $FLAG_QUIET == 'true' ]] && YUM_OPTIONS="${YUM_OPTIONS} -q" + + # Use `sudo yum' to install missing packages in your workstation. + if [[ ${#PACKAGES_MISSING[*]} -gt 0 ]];then + sudo ${YUM} ${YUM_OPTIONS} install ${PACKAGES_MISSING[*]} + fi + + # Use `sudo yum' to update installed packages in your workstation. + if [[ ${#PACKAGES_INSTALL[*]} -gt 0 ]];then + sudo ${YUM} ${YUM_OPTIONS} update ${PACKAGES_INSTALL[*]} + fi + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2fo.xsl b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2fo.xsl new file mode 100755 index 0000000..6eac1da --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2fo.xsl @@ -0,0 +1,6 @@ + + + + diff --git a/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2pdf.dsl b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2pdf.dsl new file mode 100644 index 0000000..407a604 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2pdf.dsl @@ -0,0 +1,464 @@ + + +]]> +]> + + + + + + +;;====================================== +;;General Options +;;====================================== + +;;Do you want to print on both sides of the paper? +(define %two-side% + #t) + +;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.) +(define %section-autolabel% + #t) + +;;Show URL links? If the text of the link and the URL are identical, +;;the parenthetical URL is suppressed. +(define %show-ulinks% + #t) + +;Make Ulinks footnotes to stop bleeding in the edges - this increases +;'jade --> print' time tremendously keep this in mind before +;complaining! +(define %footnote-ulinks% + #t) + +;;Tex Backend on +(define tex-backend + #t) + +;;Define Line Spacing +(define %line-spacing-factor% 1.3) + +;;Define the Paragraph Style +(define para-style + (style + font-size: %bf-size% + font-weight: 'medium + font-posture: 'upright + font-family-name: %body-font-family% + line-spacing: (* %bf-size% %line-spacing-factor%))) + +(define ($object-titles-after$) + (list (normalize "figure"))) + +;;====================================== +;;Book Options +;;====================================== + + +;;Do you want a title page for a Book? +(define %generate-book-titlepage% + #t) + +;;Do you want a separate page for the title? +(define %generate-book-titlepage-on-separate-page% + #t) + +;;Generate Book TOC? +(define %generate-book-toc% + #t) + +;;What depth should the TOC generate? +;;!Only top level of appendixes! +(define (toc-depth nd) + (if (string=? (gi nd) (normalize "book")) + 3 + (if (string=? (gi nd) (normalize "appendix")) + 0 + 1))) + +;;Do you want a TOC for the element part? +(define %generate-part-toc% + #t) + +;;Do you want the part toc on the part titlepage or separate? +(define %generate-part-toc-on-titlepage% + #t) + +;;Generate Part Title Page? +(define %generate-part-titlepage% + #t) + +;;Do you want the Part intro on the part title page? +(define %generate-partintro-on-titlepage% + #t) + +;;What elements should have a LOT? +(define ($generate-book-lot-list$) + (list (normalize "equation"))) + +;;Do you want chapters enumerated? +(define %chapter-autolabel% + #t) + +;;Do you want Chapter's and Appendix's +;;to have automatic labels? +(define %chap-app-running-head-autolabel% + #t) + +;;====================================== +;;Article Options +;;====================================== + +;;Do you want a title page for an Article? +(define %generate-article-titlepage% + #t) + +;;Generate Article TOC? +(define %generate-article-toc% + #t) + +;;Do you want a separate page for the title? +(define %generate-article-titlepage-on-separate-page% + #t) + +;;Do you want the article toc on the titlepage or separate? +(define %generate-article-toc-on-titlepage% + #t) + +;;Do you want to start new page numbers with each article? +(define %article-page-number-restart% + #f) + +;;Titlepage Separate? +(define (chunk-skip-first-element-list) + '()) + +;;Titlepage Not Separate +;(define (chunk-skip-first-element-list) +; (list (normalize "sect1") +; (normalize "section"))) + +;;====================================== +;;Columns +;;====================================== + +;;How many columns do you want? +(define %page-n-columns% + 1) + +;;How much space between columns? +(define %page-column-sep% + 0.2in) + +;;How many Columns on the titlepage? +(define %titlepage-n-columns% + 1) + +;;Balance columns? +(define %page-balance-colums% + #t) + +;;====================================== +;;Fonts +;;====================================== + +;;Defines the general size of the text in the document. normal(10), +;;presbyopic(12), and large-type(24). +(define %visual-acuity% + "presbyopic") + +;;What font would you like for titles? +(define %title-font-family% + "Helvetica") + +;;What font would you like for the body? +(define %body-font-family% + "Palatino") + +;;What font would you like for mono-seq? +(define %mono-font-family% + "Courier New") + +;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is +;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc +(define %hsize-bump-factor% + 1.1) + +;;What size do you want the body fonts? +(define %bf-size% + (case %visual-acuity% + (("tiny") 8pt) + (("normal") 10pt) + (("presbyopic") 12pt) + (("large-type") 24pt))) + +(define-unit em %bf-size%) + +;;====================================== +;;Margins +;;====================================== + +(define %left-right-margin% 6pi) + +;;How much indentation for the body? +(define %body-start-indent% + 0pi) + +;;How big is the left margin? (relative to physical page) +(define %left-margin% + 8pi) ;white-paper-column + +;;How big is the right margin? (relative to physical page) +(define %right-margin% + 8pi) ;white-paper-column + +;;How big do you want the margin at the top? +(define %top-margin% + (if (equal? %visual-acuity% "large-type") + 7.5pi + 8pi)) + +;;How big do you want the margin at the bottom? +(define %bottom-margin% + (if (equal? %visual-acuity% "large-type") + 7.5pi + 8pi)) + +;;Define the text width. (Change the elements in the formula rather +;;than the formula itself) +;(define %text-width% (- %page-width% (* %left-right-margin% 2))) +(define %text-width% (- %page-width% (+ %left-margin% %right-margin%))) + +;;Define the body width. (Change the elements in the formula rather +;;than the formula itself) +(define %body-width% + (- %text-width% %body-start-indent%)) + +;;Define distance between paragraphs +(define %para-sep% + (/ %bf-size% 1.0)) + +;;Define distance between block elements (figures, tables, etc.). +(define %block-sep% + (* %para-sep% 1.0)) + +;;Indent block elements? +(define %block-start-indent% + 0pt) +;0pt + +;;====================================== +;;Admon Graphics +;;====================================== + +;;Do you want admon graohics on? +(define %admon-graphics% + #f) + +;;Where are the admon graphics? +(define %admon-graphics-path% + "../images/") + +;;====================================== +;;Quadding +;;====================================== + +;;What quadding do you want by default; start, center, justify, or end? +(define %default-quadding% + 'justify) + +;;What quadding for component titles(Chapter, Appendix, etc)? +(define %component-title-quadding% + 'start) + +;;What quadding for section titles? +(define %section-title-quadding% + 'start) + +;;What quadding for section sub-titles? +(define %section-subtitle-quadding% + 'start) + +;;What quadding for article title? +(define %article-title-quadding% + 'center) + +;;What quadding for article sub-titles? +(define %article-subtitle-quadding% + 'center) + +;;What quadding for division subtitles? +(define %division-subtitle-quadding% + 'start) + +;;What quadding for component subtitles? +(define %component-subtitle-quadding% + 'start) + +;;====================================== +;;Paper Options +;;====================================== + +;;What size paper do you need? A4, USletter, USlandscape, or RedHat? +(define %paper-type% + "USletter") + +;;Now define those paper types' width +(define %page-width% + (case %paper-type% + (("A4") 210mm) + (("USletter") 8.5in) + (("USlandscape") 11in))) + +;;Now define those paper types' height +(define %page-height% + (case %paper-type% + (("A4") 297mm) + (("USletter") 11in) + (("USlandscape") 8.5in))) + +;;====================================== +;;Functions +;;====================================== + +(define (OLSTEP) + (case + (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4) + ((1) 1.2em) + ((2) 1.2em) + ((3) 1.6em) + ((0) 1.4em))) + +(define (ILSTEP) 1.0em) + +(define (PROCSTEP ilvl) + (if (> ilvl 1) 1.8em 1.4em)) + +(define (PROCWID ilvl) + (if (> ilvl 1) 1.8em 1.4em)) + +(define ($comptitle$) + (make paragraph + font-family-name: %title-font-family% + font-weight: 'bold + font-size: (HSIZE 2) + line-spacing: (* (HSIZE 2) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + space-after: (* (HSIZE 2) %head-after-factor%) + start-indent: 0pt + first-line-start-indent: 0pt + quadding: 'start + keep-with-next?: #t + (process-children-trim))) + +;;Callouts are confusing in Postscript... fix them. +(define %callout-fancy-bug% + #f) + +;;By default perils are centered and dropped into a box with a really +;;big border - I have simply decreased the border thickness - +;;unfortunately it takes all this to do it - sigh. +(define ($peril$) + (let* ((title (select-elements + (children (current-node)) (normalize "title"))) + (has-title (not (node-list-empty? title))) + (adm-title (if has-title + (make sequence + (with-mode title-sosofo-mode + (process-node-list (node-list-first title)))) + (literal + (gentext-element-name + (current-node))))) + (hs (HSIZE 2))) + (if %admon-graphics% + ($graphical-admonition$) + (make display-group + space-before: %block-sep% + space-after: %block-sep% + font-family-name: %admon-font-family% + font-size: (- %bf-size% 1pt) + font-weight: 'medium + font-posture: 'upright + line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%) + (make box + display?: #t + box-type: 'border + line-thickness: .5pt + start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt) + end-indent: (inherited-end-indent) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: 1em + end-indent: 1em + font-family-name: %title-font-family% + font-weight: 'bold + font-size: hs + line-spacing: (* hs %line-spacing-factor%) + quadding: 'center + keep-with-next?: #t + adm-title) + (process-children)))))) + +;;====================================== +;;Non-printing Elements +;;====================================== +(element TITLEABBREV (empty-sosofo)) +(element SUBTITLE (empty-sosofo)) +(element SETINFO (empty-sosofo)) +(element BOOKINFO (empty-sosofo)) +(element BIBLIOENTRY (empty-sosofo)) +(element BIBLIOMISC (empty-sosofo)) +(element BOOKBIBLIO (empty-sosofo)) +(element SERIESINFO (empty-sosofo)) +(element DOCINFO (empty-sosofo)) +(element ARTHEADER (empty-sosofo)) +;;(element ADDRESS (empty-sosofo)) + +;;Show comment element? +(define %show-comments% + #t) + +;;====================================== +;;Formalpara titles +;;====================================== + +;;Change the way Formal Paragraph titles are displayed. The commented +;;out section will run the titles in the paragraphs. +(element (formalpara title) + ;(make sequence + ;font-weight: 'bold + ;($runinhead$)) + ($lowtitle$ 5 7)) + +;;====================================== +;;Inlines +;;====================================== + +(element application ($mono-seq$)) +(element command ($bold-seq$)) +(element filename ($mono-seq$)) +(element function ($mono-seq$)) +(element guibutton ($bold-seq$)) +(element guiicon ($bold-seq$)) +(element guilabel ($italic-seq$)) +(element guimenu ($bold-seq$)) +(element guimenuitem ($bold-seq$)) +(element hardware ($bold-mono-seq$)) +(element keycap ($bold-seq$)) +(element literal ($mono-seq$)) +(element parameter ($italic-mono-seq$)) +(element prompt ($mono-seq$)) +(element symbol ($charseq$)) +(element emphasis ($italic-seq$)) + + + + + + + diff --git a/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-chunks.xsl b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-chunks.xsl new file mode 100755 index 0000000..9c99ade --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-chunks.xsl @@ -0,0 +1,7 @@ + + + + + diff --git a/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-common.xsl b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-common.xsl new file mode 100755 index 0000000..619b0d2 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-common.xsl @@ -0,0 +1,10 @@ + + +=REPO_HOME=/trunk/Identity/Webenv/Css/Docbook/default.css + + + +=REPO_HOME=/trunk/Identity/Images/Webenv/ + diff --git a/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-single.xsl b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-single.xsl new file mode 100755 index 0000000..271e624 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/Styles/docbook2xhtml-single.xsl @@ -0,0 +1,7 @@ + + + + + diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook.sh new file mode 100755 index 0000000..e776abc --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# docbook.sh -- This function performs base-rendition actions for +# DocBook files. +# +# Copyright (C) 2009, 2010, 2011 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 docbook { + + # Initialize absolute path to Xsl directory. This is the location + # where customization of XSL tranformations are stored in. + DOCBOOK_STYLES_DIR="${RENDER_BACKEND_DIR}/Docbook/Styles" + + docbook_convertToXhtmlChunk + docbook_convertToXhtml + + # WARNING: There are some issues related to DocBook-to-PDF + # transformations that make the whole process not so "clean" as + # DocBook-to-XHTML transformation is. Based on this situation and + # the need of providing a clean output, PDF transformation is + # commented until these issues be corrected. If you have a release + # of CentOS greater than 5.5, uncomment this to see what happen. + #docbook_convertToPdf + + # Perform backend post-rendition. + docbook_doPostActions + + # Perform backend last-rendition. + docbook_doLastActions + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdf.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdf.sh new file mode 100755 index 0000000..1f4497c --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdf.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# docbook_convertToPdf.sh -- This function takes DocBook XML as input +# and produces two different PDF as outputs; one from DocBook XML and +# another from DocBook SGML. We decided to provide support for both +# ways of output production from DocBook XML and DocBook SGML for you +# to evaluate and if possible correct. +# +# Copyright (C) 2009, 2010, 2011 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 docbook_convertToPdf { + + # Tranform DocBook XML to PDF. + docbook_convertToPdfFromXml + + # Tranform DocBook SGML to PDF. + if [[ $(cli_getCurrentLocale) =~ '^en' ]];then + # FIXME: This is only possible when no localization is + # performed (i.e., xml2po is not involved.) to main DocBook + # file, otherwise there will be errors and the PDF output + # won't be created. The errors come out because when we passed + # the validated DocBook file to xml2po all XML decimal + # entities inside the main DocBook file are expanded and set + # in the msgid field. Such expanded characters are not + # recognized by openjade when they are used as source to + # produce the PDF output. + docbook_convertToPdfFromSgml + fi + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdfFromSgml.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdfFromSgml.sh new file mode 100755 index 0000000..0417f47 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdfFromSgml.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# +# docbook_convertToPdfFromSgml.sh -- This function transforms DocBook +# files which have set the SGML DTD in them. To produce PDF from +# DocBook SGML DTD, we take the DocBook XML DTD file and change its +# DTD from XML to SGML. Since XML is SGML shoudn't be any problem. +# Once the DTD has been changed from XML to SGML, we use openjade +# (through `jw' shell script) to convert the SGML-based DocBook file +# to PDF. Customization can be achieved through DSL +# (docbook-style-dsssl-1.79-4.1) shipped in this distribution. +# +# In this configuration and using default configuration settings, I've +# presented the following problems: +# +# 1. It is not possible to produce localized PDF outputs through +# `xml2po', the default way of producing localized content inside +# `centos-art.sh' script. +# +# In this configuration and using default configuration settins, I've +# presented the following advantages: +# +# 1. The PDF output produced from SGML-based files seem to be better +# looking an less buggy than PDF output produced from XML-based +# files, visually I mean. +# +# To make the whole process transparent, a temporal directory is +# created for intermediate works and final files are moved then to +# their final location. +# +# Copyright (C) 2009, 2010, 2011 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 docbook_convertToPdfFromSgml { + + # Print action message. + if [[ -f ${FILE}.sgml.pdf ]];then + cli_printMessage "${FILE}.sgml.pdf" --as-updating-line + else + cli_printMessage "${FILE}.sgml.pdf" --as-creating-line + fi + + local -a STYLE_TEMPLATE + local -a STYLE_INSTANCE + local STYLE_INSTANCE_FINAL='' + + # Define name of temporal directory where the DocBook to PDF + # transformation will take place. + local TMPDIR=$(cli_getTemporalFile "docbook2pdf") + + # Define absolute path to DocBook source file. This is the + # repository documentation manual file where DOCTYPE and ENTITY + # definition lines are set. + local SRC=${INSTANCE} + + # Define absolute path to PDF target file. This is the final + # location the PDF file produced as result of DocBook to PDF + # transformation will be stored in. + local DST="${FILE}.sgml.pdf" + + # Define file name of PDF file. This is the file we were looking + # for and the one moved, once produced. + local PDF=$(basename ${SRC} | sed -r 's!\.docbook$!.pdf!') + + # Replace document definition from XML to SGML. + sed -i -r \ + -e 's!"-//OASIS//DTD DocBook XML!"-//OASIS//DTD DocBook!' \ + -e 's!"http://www\.oasis-open\.org/docbook/xml/([[:digit:]])\.([[:digit:]])/docbookx\.dtd"!"docbook/sgml-dtd-\1.\2-1.0-30.1/docbook.dtd"!' \ + $SRC + + # Prepare style final instance used in transformations. + docbook_prepareStyles "${DOCBOOK_STYLES_DIR}/docbook2pdf.dsl" + + # Verify temporal directory and create it if doesn't exist. + if [[ ! -d $TMPDIR ]];then + mkdir $TMPDIR + fi + + # Move inside temporal directory. + pushd $TMPDIR > /dev/null + + # Create PDF format. + docbook2pdf --dsl ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null + + # Verify `docbook2pdf' exit status and, if everything is ok, move + # PDF file from temporal directory to its target location. + if [[ $? -eq 0 ]];then + mv $PDF $DST + else + cli_printMessage "`gettext "Cannot produce the PDF file."`" --as-error-line + fi + + # Return to where we initially were. + popd > /dev/null + + # Remove temporal directory and temporal style instances created. + rm -r $TMPDIR + rm ${STYLE_INSTANCE[*]} + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdfFromXml.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdfFromXml.sh new file mode 100755 index 0000000..b327857 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToPdfFromXml.sh @@ -0,0 +1,138 @@ +#!/bin/bash +# +# docbook_convertToPdfFromXml.sh -- This function transforms DocBook +# files which have set the XML DTD in them. To produce PDF from +# DocBook XML DTD, we need an XSLT engine (e.g., through `xsltproc' +# command) to produce formatting objects (FO), which then must be +# processed with an FO engine (e.g., through `pdfxmltex' command, +# which uses PassiveTex) to produce the PDF output. +# +# In this configuration and using default configuration settings, I've +# presented the following problems: +# +# 1. Something is wrong with headings. They are not expanded along +# the whole page-body. They seem to be rendered in a reduced width +# (1 inch approximatly). This provokes the heading to be broken in a +# two-to-five letters column and sometimes it overlaps the +# sectioning titles (e.g., chatper, section). I tried to customize +# the value of `header.column.widths' and `page.margin.top' but it +# seems to be not there where I need to touch. +# +# 2. TOC's indentation is not rendered. Even the `toc.indent.width' +# property is set to 24 by default. +# +# 3. Inside lists, when items are more than one line, the +# indentation seems to work for the first line only. All other +# lines in the same item are not indented and begin completly +# unaligned. +# +# 4. Long file paths near the end of page-body aren't hyphenated. +# Even the `hyphenate' property is set to `true' by default. +# +# In this configuration and using default configuration settings, I've +# presented the following advantages: +# +# 1. It is possible to produce localized PDF outputs through +# `xml2po', the default way of producing localized content inside +# the `centos-art.sh' script. +# +# To make the whole process transparent, a temporal directory is +# created for intermediate works and final files are moved then to +# their final location. +# +# Copyright (C) 2009, 2010, 2011 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 docbook_convertToPdfFromXml { + + # Print action message. + if [[ -f ${FILE}.sgml.pdf ]];then + cli_printMessage "${FILE}.xml.pdf" --as-updating-line + else + cli_printMessage "${FILE}.xml.pdf" --as-creating-line + fi + + local -a STYLE_TEMPLATE + local -a STYLE_INSTANCE + local STYLE_INSTANCE_FINAL='' + + # Define name of temporal directory where the DocBook to PDF + # transformation will take place. + local TMPDIR=$(cli_getTemporalFile "docbook2pdf") + + # Define absolute path to DocBook source file. This is the + # repository documentation manual file where DOCTYPE and ENTITY + # definition lines are set. + local SRC=${INSTANCE} + + # Define absolute path to PDF target file. This is the final + # location the PDF file produced as result of DocBook to PDF + # transformation will be stored in. + local DST="${FILE}.xml.pdf" + + # Define file name of formatting object (.fo) file. This file is + # an intermediate file needed to produced the PDF. + local FO=$(basename ${FILE}).fo + + # Define file name of PDF file. This is the file we were looking + # for and the one moved, once produced. + local PDF=$(basename ${FILE}).pdf + + # Prepare XSL final instances used in transformations. + docbook_prepareStyles "${DOCBOOK_STYLES_DIR}/docbook2fo.xsl" + + # Verify temporal directory and create it if doesn't exist. + if [[ ! -d $TMPDIR ]];then + mkdir $TMPDIR + fi + + # Move inside temporal directory. + pushd $TMPDIR > /dev/null + + # Create formatting object supressing output from stderr. + xsltproc --output ${FO} ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null + + # Create PDF format from formatting object. The `pdfxmltex' + # command (which use the `PassiveTex' engine) must be executed + # twice in order for the document's cross references to be built + # correctly. + if [[ $? -eq 0 ]];then + pdfxmltex ${FO} > /dev/null + pdfxmltex ${FO} > /dev/null + else + cli_printMessage "`gettext "Cannot produce the formatting object."`" --as-error-line + fi + + # Verify `pdfxmltex' exit status and, if everything is ok, move + # PDF file from temporal directory to its target location. + if [[ $? -eq 0 ]];then + mv $PDF $DST + else + cli_printMessage "`gettext "Cannot produce the PDF file."`" --as-error-line + fi + + # Return to where we initially were. + popd > /dev/null + + # Remove temporal directory and temporal style instances created. + rm -r $TMPDIR + rm ${STYLE_INSTANCE[*]} + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToText.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToText.sh new file mode 100755 index 0000000..e1c86f7 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToText.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# svg_convertToText.sh -- This function takes the XHTML file produced +# by docbook_convertToXhtml and produces one plain-text file (i.e., +# without markup inside). +# +# Copyright (C) 2009, 2010, 2011 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 docbook_convertToText { + + # Verify existence of HTML file. If `.xhtml' file doesn't exist + # don't create text file. The `.xhtml' file is required in order + # to create the `.txt' file. + if [[ ! -f ${FILE}.xhtml ]];then + return + fi + + local COMMAND='' + local OPTIONS='' + + # Define the command path to text-based web browser and options + # used to produce plain-text files. Most of these programs have a + # dump option that print formatted plain-text versions of given + # HTML file to stdout. + if [[ -x '/usr/bin/lynx' ]];then + COMMAND='/usr/bin/lynx' + OPTIONS='-force_html -nolist -width 70 -dump' + elif [[ -x '/usr/bin/elinks' ]];then + COMMAND='/usr/bin/elinks' + OPTIONS='-force_html -no-numbering -no-references -width 70 -dump' + elif [[ -x '/usr/bin/w3m' ]];then + COMMAND='/usr/bin/w3m' + OPTIONS='-dump' + fi + + if [[ $COMMAND != '' ]];then + + # Print action message. + if [[ -f ${FILE}.txt ]];then + cli_printMessage "${FILE}.txt" --as-updating-line + else + cli_printMessage "${FILE}.txt" --as-creating-line + fi + + # Convert from HTML to plain-text without markup. + ${COMMAND} ${OPTIONS} ${FILE}.xhtml > ${FILE}.txt + + else + cli_printMessage "`gettext "No way to convert from XHTML to plain-text found."`" --as-error-line + fi + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToXhtml.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToXhtml.sh new file mode 100755 index 0000000..3d02c15 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToXhtml.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# docbook_convertToXhtml.sh -- This function uses DocBook XML as input +# and applies XSL stylesheets to produce a big XHTML files as output. +# The procedure was taken from the documentation of +# `docbook-style-xsl-1.69.1-5.1' package, which says: ---To publish +# HTML from your XML documents, you just need an XSL engine.---. +# +# Copyright (C) 2009, 2010, 2011 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 docbook_convertToXhtml { + + local -a STYLE_TEMPLATE + local -a STYLE_INSTANCE + local STYLE_INSTANCE_FINAL='' + + # Print action message. + if [[ -f ${FILE}.xhtml ]];then + cli_printMessage "${FILE}.xhtml" --as-updating-line + else + cli_printMessage "${FILE}.xhtml" --as-creating-line + fi + + # Define absolute path to DocBook source file. This is the + # repository documentation manual file where DOCTYPE and ENTITY + # definition lines are set. + local SRC=${INSTANCE} + + # Define absolute path to PDF target file. This is the final + # location the PDF file produced as result of DocBook to PDF + # transformation will be stored in. + local DST="${FILE}.xhtml" + + # Prepare XSL final instances used in transformations. + docbook_prepareStyles $(cli_getFilesList \ + ${DOCBOOK_STYLES_DIR} --pattern='.*docbook2xhtml-(single|common)\.xsl') + + # Transform DocBook XML to XHTML supressing all stderr output. + xsltproc --output ${DST} ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null + + # Remove XSL instance files. + rm ${STYLE_INSTANCE[*]} + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToXhtmlChunk.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToXhtmlChunk.sh new file mode 100755 index 0000000..fe2c8fe --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_convertToXhtmlChunk.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# docbook_convertToXhtmlChunk.sh -- This function uses DocBook XML as +# input and applies XSL stylesheets to produce a directory with many +# XHTML files as output. The procedure was taken from the +# documentation of `docbook-style-xsl-1.69.1-5.1' package, which says: +# ---To publish HTML from your XML documents, you just need an XSLT +# engine.---. +# +# Copyright (C) 2009, 2010, 2011 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 docbook_convertToXhtmlChunk { + + local -a STYLE_TEMPLATE + local -a STYLE_INSTANCE + local STYLE_INSTANCE_FINAL='' + + # Define absolute path to PDF target file. This is the final + # location the PDF file produced as result of DocBook to PDF + # transformation will be stored in. + local DST="${FILE}-xhtml/" + + # Clean up output directory. This is required in order to prevent + # old files from remaining therein when they are no longer needed. + if [[ -d ${DST} ]];then + rm -r "${DST}" + fi + mkdir ${DST} + + # Print action message. + cli_printMessage "${FILE}-xhtml" --as-creating-line + + # Define absolute path to DocBook source file. This is the + # repository documentation manual file where DOCTYPE and ENTITY + # definition lines are set. + local SRC=${INSTANCE} + + # Prepare XSL final instances used in transformations. + docbook_prepareStyles $(cli_getFilesList \ + ${DOCBOOK_STYLES_DIR} --pattern='.*docbook2xhtml-(chunks|common)\.xsl') + + # Transform DocBook XML to XHTML supressing all stderr output. + xsltproc --output ${DST} ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null + + # Remove XSL instance files. + rm ${STYLE_INSTANCE[*]} + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_doLastActions.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_doLastActions.sh new file mode 100755 index 0000000..7009fec --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_doLastActions.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# docbook_doLastActions.sh -- This function performs last-rendition +# actions for DocBook files. These are the actions that take +# base-rendition and post-rendition output as input to produce output +# from it. +# +# Copyright (C) 2009, 2010, 2011 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 docbook_doLastActions { + + # Presently, there is no last-rendition action for DocBook base + # rendition but the function should exist for consistency with + # other backends. + return + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_doPostActions.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_doPostActions.sh new file mode 100755 index 0000000..d858b60 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_doPostActions.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# docbook_doPostActions.sh -- This function performs post-rendition +# actions for DocBook files. These are the actions that take +# base-rendition output as input to producing output from it. +# +# Copyright (C) 2009, 2010, 2011 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 docbook_doPostActions { + + docbook_convertToText + +} diff --git a/Scripts/centos-art/Functions/Render/Docbook/docbook_prepareStyles.sh b/Scripts/centos-art/Functions/Render/Docbook/docbook_prepareStyles.sh new file mode 100755 index 0000000..6a5f955 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Docbook/docbook_prepareStyles.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# +# docbook_prepareStyles.sh -- This function prepares styles' final +# instances used in transformations based on XSL or DSL templates. +# There are translation markers inside the XSL and DSL templates that +# need to be expand before they be used for transformations. This +# function creates temporal instances of XSL and DSL templates with +# translation markers expanded inside so as for transformation +# commands (e.g., `xmltproc' or `openjade' through `docbook2pdf') to +# use as style defintion. +# +# Copyright (C) 2009, 2010, 2011 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 docbook_prepareStyles { + + local STYLE_TEMPLATE_FILE='' + local STYLE_TEMPLATE_FILES=$@ + local STYLE_INSTANCE_COMMON='' + local COUNT=0 + + for STYLE_TEMPLATE_FILE in $STYLE_TEMPLATE_FILES;do + + STYLE_TEMPLATE[((++${#STYLE_TEMPLATE[*]}))]="${STYLE_TEMPLATE_FILE}" + STYLE_INSTANCE[((++${#STYLE_INSTANCE[*]}))]="$(cli_getTemporalFile ${STYLE_TEMPLATE_FILE})" + + # Keep track of array's real index value. Remember, it starts + # at zero but counting starts at 1 instead. So, substracting 1 + # from counting we have the real index value we need to work + # with the information stored in the array. + COUNT=$(( ${#STYLE_INSTANCE[*]} - 1 )) + + # Create style instance from style template. + cp ${STYLE_TEMPLATE[$COUNT]} ${STYLE_INSTANCE[$COUNT]} + + # Define both final an common style instances based on style + # templates. + if [[ $STYLE_TEMPLATE_FILE =~ 'docbook2fo\.xsl$' ]];then + STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[$COUNT]} + elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2pdf\.dsl$' ]];then + STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} + elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-(chunks|single)\.xsl$' ]];then + STYLE_INSTANCE_FINAL=${STYLE_INSTANCE[${COUNT}]} + elif [[ $STYLE_TEMPLATE_FILE =~ 'docbook2xhtml-common\.xsl$' ]];then + STYLE_INSTANCE_COMMON=${STYLE_INSTANCE[${COUNT}]} + fi + + done + + # Verify style final instance. This is the file used by + # transformation command (`xsltproc' or `openjade') to produce the + # specified output. We cannot continue without it. + cli_checkFiles $STYLE_INSTANCE_FINAL + + # Expand common translation markers in the common style instance, + # if it exists. + if [[ -f $STYLE_INSTANCE_COMMON ]];then + cli_expandTMarkers $STYLE_INSTANCE_COMMON + fi + + # Expand specific translation markers in final style instance. + sed -r -i "s!=STYLE_XHTML_COMMON=!${STYLE_INSTANCE_COMMON}!" ${STYLE_INSTANCE_FINAL} + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg.sh b/Scripts/centos-art/Functions/Render/Svg/svg.sh new file mode 100755 index 0000000..0419479 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# svg.sh -- This function performs base-rendition action for SVG +# files. +# +# Copyright (C) 2009, 2010, 2011 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 svg { + + # Initialize the export id used inside design templates. This + # value defines the design area we want to export. + local EXPORTID='CENTOSARTWORK' + + # Verify the export id. + svg_checkModelExportId "$INSTANCE" "$EXPORTID" + + # Check existence of external files. Inside design templates and + # their instances, external files are used to refere the + # background information required by the design template. If such + # background information is not available the image is produced + # without background information. This is something that need to + # be avoided. + svg_checkModelAbsref "$INSTANCE" + + # Render template instance using inkscape and save the output. + local INKSCAPE_OUTPUT="$(\ + inkscape $INSTANCE --export-id=$EXPORTID --export-png=${FILE}.png)" + + # Modify output from inkscape to fit the centos-art.sh script + # output visual style. + cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Area' \ + | sed -r "s!^Area!`gettext "Area"`:!")" + cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Background' \ + | sed -r "s!^Background (RRGGBBAA):(.*)!`gettext "Background"`: \1 \2!")" + cli_printMessage "$(echo "$INKSCAPE_OUTPUT" | egrep '^Bitmap saved as' \ + | sed -r "s!^Bitmap saved as:!`gettext "Saved as"`:!")" + + # Perform backend post-rendition. + svg_doPostActions + + # Perform backend last-rendition. + svg_doLastActions + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_checkColorAmount.sh b/Scripts/centos-art/Functions/Render/Svg/svg_checkColorAmount.sh new file mode 100755 index 0000000..9012829 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_checkColorAmount.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# svg_checkColorAmount.sh -- This function verifies whether the list +# of colors provided in the first argument matches the amount of +# colors specified by the second argument. +# +# Copyright (C) 2009, 2010, 2011 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 svg_checkColorAmount { + + # Define list of colors. + local COLORS=$1 + + # Define the amount of colors the list provided must have, in + # order to be considered as valid. + local NUMBER=$2 + + # Verify amount of colors provided in the list. + if [[ $(echo "$COLORS" | wc -l) -ne $NUMBER ]];then + cli_printMessage "`gettext "The palette does not have the correct number of colors."`" --as-error-line + fi + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_checkColorFormats.sh b/Scripts/centos-art/Functions/Render/Svg/svg_checkColorFormats.sh new file mode 100755 index 0000000..1f3dc74 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_checkColorFormats.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# +# svg_checkColorFormats.sh -- This function verifies formats of colors +# (i.e., the way color information is specified). +# +# Copyright (C) 2009, 2010, 2011 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 svg_checkColorFormats { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='format:' + + # Initialize ARGUMENTS with an empty value and set it as local + # variable to this function scope. + local ARGUMENTS='' + + # Initialize pattern used for color sanitation. + local PATTERN='^#[0-9a-f]{6}$' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through positional parameters. + while true;do + + case "$1" in + + --format ) + + case "$2" in + + rrggbb|*) + PATTERN='^#[0-9a-f]{6}$' + ;; + + esac + shift 2 + ;; + + -- ) + shift 1 + break + ;; + esac + done + + # Define the location we want to apply verifications to. + local COLOR='' + local COLORS="$@" + + # Loop through colors and perform format verification as specified + # by pattern. + for COLOR in $COLORS;do + + if [[ ! $COLOR =~ $PATTERN ]];then + cli_printMessage "`eval_gettext "The \\\"\\\$COLOR\\\" string is not a valid color code."`" --as-error-line + fi + + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_checkModelAbsref.sh b/Scripts/centos-art/Functions/Render/Svg/svg_checkModelAbsref.sh new file mode 100755 index 0000000..8ef23e7 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_checkModelAbsref.sh @@ -0,0 +1,141 @@ +#!/bin/bash +# +# svg_checkModelAbsref.sh -- This function retrives absolute files and +# checks their existence. In order for design templates to point +# different artistic motifs, design templates make use of external +# files which point to specific artistic motif background images. If +# such external files don't exist, try to create the background image +# required by cropping a higher background image (e.g., +# 2048x1536-final.png). If this isn't possible neither, then create +# the background image using a plain color and crop from it then. We +# can't go on without the required background information. +# +# Copyright (C) 2009, 2010, 2011 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 svg_checkModelAbsref { + + local FILE='' + local BG_DST_FILES='' + local BG_DST_FILE='' + local BG_DST_FILE_WIDTH='' + local BG_DST_FILE_HEIGHT='' + local BG_SRC_FILE='' + local BG_SRC_FILE_COLOR='' + local BG_SRC_FILE_WIDTH='' + local BG_SRC_FILE_HEIGHT='' + + # Define absolute path to the translated instance of design model. + FILE="$1" + + # Verify existence of file we need to retrive absolute paths from. + cli_checkFiles "$FILE" + + # Retrive absolute paths from file. + BG_DST_FILES=$(egrep "(sodipodi:absref|xlink:href)=\"${HOME}.+" $FILE \ + | sed -r "s,.+=\"(${HOME}.+\.png)\".*,\1," | sort | uniq) + + # Verify absolute paths retrived from file. + for BG_DST_FILE in $BG_DST_FILES;do + + # Print action message. + cli_printMessage "$BG_DST_FILE" --as-checking-line + + # Verify parent directory of absolute files retrived from + # file. This is required to prevent the construction of paths + # to locations that don't exist. For example, when including + # background images in SVG files, it is possible that the path + # information inside SVG files get outdated temporarly. If in + # that exact moment, you try to render the SVG file it won't + # be possible to create the image used for cropping because + # the path build from the location inside SVG file doesn't + # exist. In this case, centos-art.sh script will end up with + # `file ... doesn't exist' errors. + cli_checkFiles "$(dirname ${BG_DST_FILE})" -d + + if [[ ! -a $BG_DST_FILE ]];then + + # Define the source background file, the image file will + # crop when no specific background informatio be available + # for using. Generally, this is the most reusable + # background file inside the artistic motifs (e.g,. the + # `2048x1536-final.png' file). We can use this image file + # to create almost all artworks inside The CentOS + # Distribution visual manifestation when + # resolution-specific backgrounds don't exist. + BG_SRC_FILE=$(echo $BG_DST_FILE \ + | sed -r "s!(.+)/[[:digit:]]+x[[:digit:]]+(-final\.png)!\1/2048x1536\2!") + + # Verify existence of source background file. If the file + # doesn't exist create it using The CentOS Project default + # background color information, as specified in its + # corporate identity manual. + if [[ ! -f $BG_SRC_FILE ]];then + + # Define plain color that will be used as background. + BG_SRC_FILE_COLOR=$(svg_getColors) + + # Verify format of color value. + svg_checkColorFormats $BG_SRC_FILE_COLOR --format='rrggbb' + + # Define width for the source background file the + # required background information is cropped from. + BG_SRC_FILE_WIDTH=$(echo $BG_SRC_FILE \ + | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') + + # Define height for the source background file the + # required background information is cropped from. + BG_SRC_FILE_HEIGHT=$(echo $BG_SRC_FILE \ + | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') + + # Print action message. + cli_printMessage "${BG_SRC_FILE} ($BG_SRC_FILE_COLOR)" --as-creating-line + + # Create the source background file. + ppmmake -quiet ${BG_SRC_FILE_COLOR} \ + ${BG_SRC_FILE_WIDTH} ${BG_SRC_FILE_HEIGHT} \ + | pnmtopng > ${BG_SRC_FILE} + + fi + + # Print action message. + cli_printMessage "$BG_SRC_FILE" --as-cropping-line + + # Define the width of the required background information. + BG_DST_FILE_WIDTH=$(echo $BG_DST_FILE \ + | sed -r 's!.+/([[:digit:]]+)x[[:digit:]]+-final\.png!\1!') + + # Define the height of the required background information. + BG_DST_FILE_HEIGHT=$(echo $BG_DST_FILE \ + | sed -r 's!.+/[[:digit:]]+x([[:digit:]]+)-final\.png!\1!') + + # Create required backgrounnd information. + convert -quiet \ + -crop ${BG_DST_FILE_WIDTH}x${BG_DST_FILE_HEIGHT}+0+0 \ + ${BG_SRC_FILE} ${BG_DST_FILE} + + # Verify required background information. + cli_checkFiles $BG_DST_FILE + + fi + + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_checkModelExportId.sh b/Scripts/centos-art/Functions/Render/Svg/svg_checkModelExportId.sh new file mode 100755 index 0000000..7d3a9fd --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_checkModelExportId.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# svg_checkModelExportId.sh -- This function standardizes the export +# id used inside svg files and the way of verify them. +# +# Copyright (C) 2009, 2010, 2011 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 svg_checkModelExportId { + + local INSTANCE="$1" + local EXPORTID="$2" + + # Verify instance. + cli_checkFiles $INSTANCE + + # Verify export id. + if [[ $EXPORTID == '' ]];then + cli_printMessage "`gettext "The export id value cannot be empty."`" --as-error-line + fi + + # Check export id inside design templates. + grep "id=\"$EXPORTID\"" $INSTANCE > /dev/null + if [[ $? -gt 0 ]];then + cli_printMessage "`eval_gettext "There is not export id (\\\$EXPORTID) inside \\\"\\\$TEMPLATE\\\"."`" --as-error-line + fi + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertGplToHex.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertGplToHex.sh new file mode 100755 index 0000000..48aa47e --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertGplToHex.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# svg_convertGplToHex.sh -- This function takes one palette produced +# by Gimp (e.g., syslinux.gpl) as input and outputs the list of +# hexadecimal colors and their respective index position the +# `pnmtolss16' program needs (e.g., #RRGGBB=0 #RRGGBB=1 ... [all +# values in the same line]). +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertGplToHex { + + # Define path to GPL palette. This is the .gpl file we use to + # retrive color information from. + local PALETTE_GPL="$1" + + # Define path to HEX palette. This is the palette used to stored + # the color information the `ppmtolss16' program needs. + local PALETTE_HEX="$2" + + # Define the number of colors this function should return. + local NUMBER="$3" + + # Define list of colors from GPL palette. + local COLORS=$(svg_getColors $PALETTE_GPL --head=$NUMBER --tail=$NUMBER) + + # Verify number of colors returned in the list. They must match + # exactly the amount specified, no more no less. Sometimes, the + # list of colors may have less colors than it should have, so we + # need to prevent such palettes from being used. + svg_checkColorAmount "$COLORS" "$NUMBER" + + # Verify format of colors. + svg_checkColorFormats "$COLORS" --format='rrggbb' + + # Create list of colors to be processed by `pnmtolss16'. + echo "$COLORS" | nl | gawk '{ printf "%s=%d ", $2, $1 - 1 }' \ + > $PALETTE_HEX + + # Verify HEX palette existence. + cli_checkFiles $PALETTE_HEX + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertGplToPpm.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertGplToPpm.sh new file mode 100755 index 0000000..a79ef38 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertGplToPpm.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# svg_convertGplToPpm.sh -- This function takes one palette produced +# by Gimp (e.g., syslinux.gpl) as input and outputs one PPM file based +# on it (e.g., syslinux.ppm). +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertGplToPpm { + + local -a FILES + local COUNT=0 + + # Define path to GPL palette. This is the .gpl file we use to + # retrive color information from. + local PALETTE_GPL="$1" + + # Define path to PPM palette. This is the .ppm file we'll save + # color information to. + local PALETTE_PPM="$2" + + # Define the number of colors this function should return. + local NUMBER="$3" + + # Define list of colors from GPL palette. + local COLOR='' + local COLORS=$(svg_getColors "$PALETTE_GPL" --head=$NUMBER --tail=$NUMBER --format='rrrggbb') + + # Verify amount of colors in the list of colors. + svg_checkColorAmount "$COLORS" "$NUMBER" + + # Verify format of colors. + svg_checkColorFormats $COLORS --format='rrggbb' + + # Create temporal images (of 1x1 pixel each) to store each color + # retrived from Gimp's palette. + for COLOR in $COLORS;do + FILES[$COUNT]=$(cli_getTemporalFile ${COUNT}.ppm) + ppmmake $COLOR 1 1 > ${FILES[$COUNT]} + COUNT=$(($COUNT + 1)) + done + + # Concatenate each temporal image from left to right to create the + # PPM file. + pnmcat -lr ${FILES[*]} > $PALETTE_PPM + + # Remove temporal images used to build the PPM palette file. + rm ${FILES[*]} + + # Verify PPM palette existence. + cli_checkFiles "$PALETTE_PPM" + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngTo.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngTo.sh new file mode 100755 index 0000000..1216e10 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngTo.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# svg_convertPngTo.sh -- This function provides post-rendition actions +# to use the `convert' command of ImageMagick tool set. +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngTo { + + # Initialize image formats. + local FORMAT='' + local FORMATS=$(render_getConfigOption "$ACTION" '2') + + # Convert from PNG to specified formats. + for FORMAT in $FORMATS;do + cli_printMessage "${FILE}.${FORMAT}" --as-savedas-line + convert -quality 85 ${FILE}.png ${FILE}.${FORMAT} + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToBranded.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToBranded.sh new file mode 100755 index 0000000..00c16b1 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToBranded.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# +# svg_convertPngToBranded.sh -- This function standardizes image +# branding. Once the base PNG image is rendered and the +# `--with-brands' option is provided, this function composites a new +# branded image using the preferences set in the `branding.conf' file. +# The `branding.conf' file must be stored in the design model root +# location used as reference to produce the base PNG image. +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToBranded { + + # Verify whether the option `--with-brands' was provided or not to + # `centos-art.sh' script command-line. + if [[ $FLAG_WITH_BRANDS == 'false' ]];then + return + fi + + local BRANDING_CONF_FILE='' + local BRANDING_CONF_SECTION='' + local BRANDING_CONF_VALUES='' + local BRANDING_CONF_VALUE='' + local BRAND='' + local POSITION='' + local POSITIONS='' + + # Define absolute path to branding configuration file. + BRANDING_CONF_FILE="$(cli_getRepoTLDir)/Identity/Models/Themes/${FLAG_THEME_MODEL}/branding.conf" + + # Define regular expression matching the variable name (i.e., the + # left column), inside the configuration line, you want to match + # on. + BRANDING_CONF_VARNAME=$(echo $TEMPLATE | cut -d/ -f10-) + + # Define list of configuration lines related to current design + # model. This are the lines that tell us how and where to apply + # branding information on base PNG image. Be sure that only + # configuration lines from supported section names (e.g., + # `symbol', `type', `logo') be read, no need to waste resources + # with others. + BRANDING_CONF_VALUES=$(\ + for BRANDING_CONF_SECTION in $(echo "types symbols logos");do + cli_getConfigValue "${BRANDING_CONF_FILE}" "${BRANDING_CONF_SECTION}" "${BRANDING_CONF_VARNAME}" + done) + + for BRANDING_CONF_VALUE in $BRANDING_CONF_VALUES;do + + # Define absolute path to image file used as brand. This is + # the image put over the PNG image produced as result of + # design models base rendition. + BRAND="$(cli_getRepoTLDir)/Identity/Images/Brands/$(echo $BRANDING_CONF_VALUE \ + | gawk 'BEGIN{ FS=":" } { print $1 }')" + + # Verify absolute path to image file used as brand. Assuming + # no brand image file is found, continue with the next + # configuration line. + if [[ ! -f $BRAND ]];then + continue + fi + + # Define list of positions using the format of ImageMagick + # `-geometry' option argument. + POSITIONS=$(echo "$BRANDING_CONF_VALUE" | cut -d: -f2- | tr ':' ' ') + + # Loop through list of brand image positions and use the + # composite command from ImageMagick, to overlap brand image + # over unbranded image just rendered. + for POSITION in $POSITIONS;do + composite -geometry $POSITION $BRAND ${FILE}.png ${FILE}.png + done + + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToBrands.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToBrands.sh new file mode 100755 index 0000000..75b41ab --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToBrands.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +# svg_convertPngToBrands.sh -- This function provides post-rendition +# actions to produce brand images in different sizes and formats from +# the same SVG design model. +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToBrands { + + # Define height dimensions you want to produce brands for. + local SIZE="" + local SIZES="16 20 22 24 32 36 38 40 48 64 72 78 96 112 124 128 148 164 196 200 512" + + # Define image formats you want to produce brands for. + local FORMAT="" + local FORMATS="xpm pdf jpg tif" + + for SIZE in ${SIZES};do + + # Redefine absolute path to file location where size-specific + # images will be stored in. + local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE) + + # Prepare directory where size-specific images will be stored + # in. If it doesn't exist create it. + if [[ ! -d $(dirname $FINALFILE) ]];then + mkdir -p $(dirname $FINALFILE) + fi + + # Print action message. + cli_printMessage "${FINALFILE}.png" --as-creating-line + + # Create size-specific PNG image ommiting all output. + inkscape $INSTANCE --export-id=$EXPORTID \ + --export-png=${FINALFILE}.png --export-height=${SIZE} \ + &> /dev/null + + for FORMAT in ${FORMATS};do + + # Print action message. + cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line + + # Convert size-specific PNG image into different formats. + convert ${FINALFILE}.png ${FINALFILE}.${FORMAT} + + done + + # Create copy of size-specific image in 2 colors. + cli_printMessage "${FINALFILE}.xbm" --as-creating-line + convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm + + # Create copy of size-specific image with emboss effect. + cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line + convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png + + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToDm.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToDm.sh new file mode 100755 index 0000000..a2dd443 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToDm.sh @@ -0,0 +1,185 @@ +#!/bin/bash +# +# svg_convertPngToDm.sh -- This function standardize production of +# display managers (e.g., Gdm and Kdm). This function copies all files +# needed into a temporal directory, realize expansion of translation +# markers and packs all the files into a tar.gz package that is used +# for installation. This function must be used as last-rendition +# action for Gdm and Kdm directory specific base-rendition actions. +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToDm { + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Initialize source and destination local variables. + local SRC='' + local DST='' + + # Initialize display manager type. + local DM=$(render_getConfigOption "${ACTION}" '2') + + # Initialize screen resolutions used by display manager theme. + # These are the different screen resolutions a display manager + # theme is built for. The amount of screen resolution a display + # manager theme can be built for is limited to the amount of + # background files provided by the artistic motif used to build + # the display manager theme. + local RESOLUTION='' + local RESOLUTIONS=$(render_getConfigOption "${ACTION}" '3') + + # Verify screen resolutions. We cannot produce display manager + # theme if no screen resolution has been specified. + if [[ "$RESOLUTIONS" == '' ]];then + cli_printMessage "`gettext "There is no resolution information to process."`" --as-error-line + fi + + # Initialize theme information we are going to build the display + # manager theme for. + local THEME=$(cli_getPathComponent $ACTIONVAL --motif) + local THEME_NAME=$(cli_getPathComponent $ACTIONVAL --motif-name) + + # Initialize temporal directory where we collect all files needed + # in order to create the tar.gz file. This intermediate step is + # also needed in order to expand translation markers from XML and + # Desktop definitions. + local TMPDIR=$(cli_getTemporalFile 'dm') + + # Initialize source location for brands. This is the place where + # brand information, needed to build the display manager theme, is + # retrived from. + local BRANDS=$(cli_getRepoTLDir)/Identity/Images/Brands + + # Initialize source location for artistic motif's backgrounds. + # This is the place where background information needed to ubild + # the display manager theme is retrived from. + local BGS=$(cli_getRepoTLDir)/Identity/Images/Themes/${THEME}/Backgrounds/Img/Png + + # Initialize file variables. File variables are used build and + # process the file relation between source and target locations. + local FILE='' + local FILES='' + + # Define major release from template. + local MAJOR_RELEASE=$(cli_getPathComponent "$TEMPLATE" "--release-major") + + # Define file relation between source and target locations, based + # on whether we are producing GDM or KDM. Use the colon character + # (`:') as separator; on the left side we put the file's source + # location and in the right side the file's target location. + # Presently, both GDM and KDM are very similar on files with the + # exception that GDM does use icons near actions buttons (e.g., + # shutdown, reboot, session, language) and KDM doesn't. + case ${DM} in + + Gdm ) + FILES="\ + ${BRANDS}/Symbols/48/centos.png:centos-symbol.png + ${BRANDS}/Types/White/112/centos-${MAJOR_RELEASE}-msg.png:centos-release.png + ${OUTPUT}/screenshot.png:screenshot.png + $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml + $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop + $(dirname $TEMPLATE)/icon-language.png:icon-language.png + $(dirname $TEMPLATE)/icon-reboot.png:icon-reboot.png + $(dirname $TEMPLATE)/icon-session.png:icon-session.png + $(dirname $TEMPLATE)/icon-shutdown.png:icon-shutdown.png + " + ;; + + Kdm ) + FILES="\ + ${BRANDS}/Symbols/48/centos.png:centos-symbol.png + ${BRANDS}/Types/White/112/centos-${MAJOR_RELEASE}-msg.png:centos-release.png + ${OUTPUT}/screenshot.png:screenshot.png + $(dirname $TEMPLATE)/GdmGreeterTheme.xml:${THEME_NAME}.xml + $(dirname $TEMPLATE)/GdmGreeterTheme.desktop:GdmGreeterTheme.desktop + " + ;; + + * ) + cli_printMessage "`eval_gettext "The \\\"\\\$DM\\\" display manager is not supported yet."`" --as-error-line + ;; + esac + + for FILE in $FILES;do + + # Define source location. + SRC=$(echo $FILE | cut -d: -f1) + + # Define target location. + DST=${TMPDIR}/${THEME_NAME}/$(echo $FILE | cut -d: -f2) + + # Verify source files. + cli_checkFiles $SRC + + # Verify parent directory for target file. + if [[ ! -d $(dirname $DST) ]];then + mkdir -p $(dirname $DST) + fi + + # Copy files from source to target location. + cp ${SRC} ${DST} + + # Expand translation markers. + if [[ ${DST} =~ "\.(xml|desktop)$" ]];then + cli_expandTMarkers "${DST}" + fi + + done + + # Move into temporal directory. + pushd $TMPDIR > /dev/null + + for RESOLUTION in $RESOLUTIONS;do + + # Verify background information. If it doesn't exist go on + # with the next one in the list. + if [[ ! -f $BGS/${RESOLUTION}-final.png ]];then + continue + fi + + # Print action message. + if [[ -f ${RESOLUTION}.tar.gz ]];then + cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-updating-line + else + cli_printMessage "${OUTPUT}/${RESOLUTION}.tar.gz" --as-creating-line + fi + + # Copy background information. + cp $BGS/${RESOLUTION}-final.png ${THEME_NAME}/background.png + + # Create tar.gz file. + tar -czf ${RESOLUTION}.tar.gz ${THEME_NAME} + + # Move from temporal directory to its final location. + mv ${RESOLUTION}.tar.gz ${OUTPUT} + + done + + # Return to where we were initially. + popd > /dev/null + + # Remove temporal directory. + rm -r ${TMPDIR} + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToGrub.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToGrub.sh new file mode 100755 index 0000000..4ecdf4e --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToGrub.sh @@ -0,0 +1,143 @@ +#!/bin/bash +# +# svg_convertPngToGrub.sh -- This function provides post-rendition +# action used to produce GRUB images. +# +# Initially, the color information is defined with GIMP (The GNU Image +# Manipulation Program) as a `.gpl' palette of color. This palette of +# colors contains 14 colors only and is saved in a file named +# `grub.gpl. The `grub.gpl' file is used to build the `grub.ppm' file +# which provide the color information needed to reduce the full color +# PNG image, produced as result of SVG base-rendition, to the amount +# of colors specified (i.e., 14 colors). Later, with the 14 color PNG +# image already created, the `grub.ppm' file is used to build the +# `splash.xpm.gz' file. +# +# In order for this function to work, the `grub.gpl' file should have +# a format similar to the following: +# +# GIMP Palette +# Name: CentOS-TreeFlower-4-Syslinux +# Columns: 14 +# # +# 32 76 141 204c8d +# 36 82 146 245292 +# 52 93 152 345d98 +# 72 108 162 486ca2 +# 102 131 176 6683b0 +# 126 153 190 7e99be +# 146 170 200 92aac8 +# 161 182 209 a1b6d1 +# 182 199 219 b6c7db +# 202 214 228 cad6e4 +# 221 230 238 dde6ee +# 235 241 245 ebf1f5 +# 246 251 254 f6fbfe +# 254 255 252 fefffc +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToGrub { + + # Define number of colors the images will be produced on. + local COLORS='14' + + # Define options using those passed to actions from pre-rendition + # configuration script. These options are applied to pnmremap when + # doing color reduction, so any option available for pnmremap + # command can be passed to renderSyslinux functionality. + local OPTIONS=$(render_getConfigOption "$ACTION" '2-') + + # Check options passed to action. This is required in order to + # aviod using options used already in this script. For example + # -verbose and -mapfile options. + for OPTION in $OPTIONS;do + # Remove anything after equal sign inside option. + OPTION=$(echo -n $OPTION | cut -d'=' -f1) + if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then + cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line + fi + done + + # Define file name prefix. + local PREFIX="-${COLORS}c" + + # Redefine file name prefix using options as reference. This is + # useful to differenciate final files produced using + # Floyd-Steinberg dithering and files which are not. + if [[ "$OPTIONS" =~ '-floyd' ]];then + PREFIX="${PREFIX}-floyd" + fi + + # Define absolute path to GPL palette. This palettes should have + # 14 colors only. For more information on this see the GRUB's + # documentation. + local PALETTE_GPL=${MOTIF_DIR}/Palettes/grub.gpl + + # Verify GPL palette existence. If it doesn't exist copy the one + # provided by the design model through subversion (to keep track + # of the change) and expand translation markers in the copied + # instance. + if [[ ! -f $PALETTE_GPL ]];then + svn cp ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/grub.gpl ${PALETTE_GPL} + cli_expandTMarkers ${PALETTE_GPL} + fi + + # Define absolute path to PPM palette. The PPM palette is built + # from source palette (PALETTE_GPL) and provides the color + # information understood by `ppmremap', the program used to + # produce images in a specific amount of colors. + local PALETTE_PPM=$(cli_getTemporalFile "grub.ppm") + + # Create image in Netpbm superformat (PNM). The PNM image file is + # created from the PNG image rendered previously as centos-art + # base-rendition output. The PNM image is an intermediate format + # used to manipulate images through Netpbm tools. + cli_printMessage "${FILE}.pnm" --as-savedas-line + pngtopnm -verbose \ + < ${FILE}.png 2>${FILE}.log > ${FILE}.pnm + + # Print the path to GPL palette. + cli_printMessage "$PALETTE_GPL" --as-palette-line + + # Create PPM palette using GPL palette. + svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" + + # Reduce colors as specified in PPM palette. Here we use the PPM + # palette to enforce the color position in the image index and the + # Floyd-Steinberg dithering in order to improve color reduction. + cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line + pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ + < ${FILE}.pnm 2>>${FILE}.log > ${FILE}${PREFIX}.ppm + + # Remove PPM palette. It is no longer needed. + if [[ -f ${PALETTE_PPM} ]];then + rm $PALETTE_PPM + fi + + # Create the 14 colors xpm.gz file. + cli_printMessage "${FILE}${PREFIX}.xpm.gz" --as-savedas-line + ppmtoxpm \ + < ${FILE}${PREFIX}.ppm 2>>${FILE}.log > ${FILE}.xpm \ + && gzip --force ${FILE}.xpm \ + && mv ${FILE}.xpm.gz ${FILE}${PREFIX}.xpm.gz + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToIcons.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToIcons.sh new file mode 100755 index 0000000..f63d7c5 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToIcons.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +# svg_convertPngToIcons.sh -- This function provides post-rendition +# actions to produce icon images in different sizes and formats from +# the same SVG design model. +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToIcons { + + # Define height dimensions you want to produce brands for. + local SIZE="" + local SIZES="16 20 22 24 32 36 40 48 64 96 128 148 164 196 200 512" + + # Define image formats you want to produce brands for. + local FORMAT="" + local FORMATS="" + + for SIZE in ${SIZES};do + + # Redefine absolute path to file location where size-specific + # images will be stored in. + local FINALFILE=$(dirname $FILE)/${SIZE}/$(basename $FILE) + + # Prepare directory where size-specific images will be stored + # in. If it doesn't exist create it. + if [[ ! -d $(dirname $FINALFILE) ]];then + mkdir -p $(dirname $FINALFILE) + fi + + # Print action message. + cli_printMessage "${FINALFILE}.png" --as-creating-line + + # Create size-specific PNG image ommiting all output. + inkscape $INSTANCE --export-id=$EXPORTID \ + --export-png=${FINALFILE}.png --export-height=${SIZE} \ + &> /dev/null + + #for FORMAT in ${FORMATS};do + # + # # Print action message. + # cli_printMessage "${FINALFILE}.${FORMAT}" --as-creating-line + # + # # Convert size-specific PNG image into different formats. + # convert ${FINALFILE}.png ${FINALFILE}.${FORMAT} + # + #done + + # Create copy of size-specific image in 2 colors. + #cli_printMessage "${FINALFILE}.xbm" --as-creating-line + #convert -colorspace gray -colors 2 ${FINALFILE}.png ${FINALFILE}.xbm + + # Create copy of size-specific image with emboss effect. + #cli_printMessage "${FINALFILE}-emboss.png" --as-creating-line + #convert -emboss 1 ${FINALFILE}.png ${FINALFILE}-emboss.png + + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToKsplash.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToKsplash.sh new file mode 100755 index 0000000..6f7049f --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToKsplash.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# +# svg_convertPngToKsplash.sh -- This function collects KDE splash +# (KSplash) required files and creates a tar.gz package that groups +# them all together. Use this function as last-rendition action for +# KSplash base-rendition action. +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToKsplash { + + local -a SRC + local -a DST + local FONT='' + local COUNT=0 + + # Define font used to print bottom splash message. + FONT=$(cli_getTTFont "DejaVuLGCSans-Bold") + + # Check existence of font file. + cli_checkFiles "$FONT" + + # Define absolute source location of files. + SRC[0]="${OUTPUT}/splash_top.png" + SRC[1]="${OUTPUT}/splash_active_bar.png" + SRC[2]="${OUTPUT}/splash_inactive_bar.png" + SRC[3]="${OUTPUT}/splash_bottom.png" + SRC[4]="$(dirname $TEMPLATE)/Theme.rc" + + # Check absolute source location of files. + cli_checkFiles "${SRC[@]}" + + # Define relative target location of files. + DST[0]="${OUTPUT}/splash_top.png" + DST[1]="${OUTPUT}/splash_active_bar.png" + DST[2]="${OUTPUT}/splash_inactive_bar.png" + DST[3]="${OUTPUT}/splash_bottom.png" + DST[4]="${OUTPUT}/Theme.rc" + + # Print action message. + cli_printMessage "${OUTPUT}/Preview.png" --as-creating-line + + # Create `Preview.png' image. + convert -append ${SRC[0]} ${SRC[1]} ${SRC[3]} ${OUTPUT}/Preview.png + + # Add bottom text to Preview.png image. The text position was set + # inside an image of 400x300 pixels. If you change the final + # preview image dimension, you probably need to change the text + # position too. + mogrify -draw 'text 6,295 "KDE is up and running."' \ + -fill \#ffffff \ + -font $FONT \ + ${OUTPUT}/Preview.png + + # Copy `Theme.rc' file. + cp ${SRC[4]} ${DST[4]} + + # Apply common translation markers to Theme.rc file. + cli_expandTMarkers "${DST[4]}" + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToSyslinux.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToSyslinux.sh new file mode 100755 index 0000000..548cb21 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToSyslinux.sh @@ -0,0 +1,184 @@ +#!/bin/bash +# +# svg_convertPngToSyslinux.sh -- This function provides post-rendition +# action used to produce LSS16 images, the images used by isolinux. +# +# Initially, the color information is defined with GIMP (The GNU Image +# Manipulation Program) as a `.gpl' palette of color. This palette of +# colors contains 16 colors only and is saved in a file named +# `syslinux.gpl. The `syslinux.gpl' file is used to build two other +# files: the `syslinux.ppm' file and the `syslinux.hex' file. The +# `syslinux.ppm' provides the color information needed to reduce the +# full color PNG image, produced as result of SVG base-rendition, to +# the amount of colors specified (i.e., 16 colors). Later, with the 16 +# color PNG image already created, the `syslinux.hex' file is used to +# build the LSS16 image. +# +# In order to produce images in LSS16 format correctly, it is required +# that both the `syslinux.ppm' and `syslinux.hex' files do contain the +# same color information. This is, both `syslinux.ppm' and +# `syslinux.hex' must represent the same color values and in the same +# color index. +# +# In order for this function to work, the `syslinux.gpl' file should +# have a format similar to the following: +# +# GIMP Palette +# Name: CentOS-TreeFlower-4-Syslinux +# Columns: 16 +# # +# 32 76 141 204c8d +# 37 82 146 255292 +# 52 94 153 345e99 +# 73 110 162 496ea2 +# 91 124 172 5b7cac +# 108 136 180 6c88b4 +# 120 146 186 7892ba +# 131 158 193 839ec1 +# 255 255 255 ffffff +# 146 170 200 92aac8 +# 162 182 209 a2b6d1 +# 183 199 219 b7c7db +# 204 216 230 ccd8e6 +# 221 229 238 dde5ee +# 235 241 245 ebf1f5 +# 246 251 254 f6fbfe +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToSyslinux { + + # Define number of colors the images will be produced on. + local COLORS='16' + + # Define options using those passed to actions from pre-rendition + # configuration script. These options are applied to pnmremap when + # doing color reduction, so any option available for pnmremap + # command can be passed to renderSyslinux functionality. + local OPTIONS=$(render_getConfigOption "$ACTION" '2-') + + # Check options passed to action. This is required in order to + # aviod using options already used in this script. For example + # -verbose and -mapfile options. + for OPTION in $OPTIONS;do + # Remove anything after equal sign inside option. + OPTION=$(echo $OPTION | cut -d'=' -f1) + if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then + cli_printMessage "`eval_gettext "The \\\"\\\$OPTION\\\" option is already used."`" --as-error-line + fi + done + + # Define default file name prefix for 16 colors images. + local PREFIX="-${COLORS}c" + + # Re-define 16 colors images default file name prefix using + # options as reference. This is useful to differenciate final + # files produced using Floyd-Steinberg dithering and final files + # which are not. + if [[ "$OPTIONS" =~ '-floyd' ]];then + PREFIX="${PREFIX}-floyd" + fi + + # Define absolute path to GPL palette. The GPL palette defines the + # color information used to build syslinux images. This palette + # should be set to 16 colors and, as specified in isolinux + # documentation, the background color should be indexed on + # position 0 and the forground in position 7 (see + # /usr/share/doc/syslinux-X.XX/isolinux.doc, for more + # information.) + local PALETTE_GPL=${MOTIF_DIR}/Palettes/syslinux.gpl + + # Verify GPL palette existence. If it doesn't exist copy the one + # provided by the design model through subversion (to keep track + # of the change) and expand translation markers in the copied + # instance. + if [[ ! -f $PALETTE_GPL ]];then + svn cp ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL} + cli_expandTMarkers ${PALETTE_GPL} + fi + + # Define absolute path to PPM palette. The PPM palette is built + # from source palette (PALETTE_GPL) and provides the color + # information understood by `ppmremap', the program used to + # produce images in a specific amount of colors. + local PALETTE_PPM=$(cli_getTemporalFile "syslinux.ppm") + + # Define the HEX palette. The HEX palette is built from source + # palette (PALETTE_GPL) and provides the color information in the + # format understood by `ppmtolss16', the program used to produce + # images in LSS16 format. The HEX palette stores just one line + # with the color information as described in isolinux + # documentation (i.e #RRGGBB=0 #RRGGBB=1 ... [all values in the + # same line]) + local PALETTE_HEX=$(cli_getTemporalFile "syslinux.hex") + + # Create image in Netpbm superformat (PNM). The PNM image file is + # created from the PNG image rendered previously as centos-art + # base-rendition output. The PNM image is an intermediate format + # used to manipulate images through Netpbm tools. + cli_printMessage "${FILE}.pnm" --as-savedas-line + pngtopnm -verbose \ + < ${FILE}.png 2>${FILE}.log > ${FILE}.pnm + + # Print the path to GPL palette. + cli_printMessage "$PALETTE_GPL" --as-palette-line + + # Create PPM palette using GPL palette. + svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" + + # Create HEX palette using GPL palette. + svg_convertGplToHex "$PALETTE_GPL" "$PALETTE_HEX" "$COLORS" + + # Reduce colors as specified in PPM palette. Here we use the PPM + # palette to enforce the color position in the image index and the + # Floyd-Steinberg dithering in order to improve color reduction. + cli_printMessage "${FILE}${PREFIX}.pnm" --as-savedas-line + pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ + < ${FILE}.pnm 2>> ${FILE}.log > ${FILE}${PREFIX}.pnm + + # Create LSS16 image. + cli_printMessage "${FILE}${PREFIX}.lss" --as-savedas-line + ppmtolss16 $(cat $PALETTE_HEX) \ + < ${FILE}${PREFIX}.pnm 2>>${FILE}.log > ${FILE}${PREFIX}.lss + + # Remove HEX palette. It is no longer needed. + if [[ -f ${PALETTE_HEX} ]];then + rm $PALETTE_HEX + fi + + # Create the PPM image indexed to 16 colors. Also the colormap + # used in the LSS16 image is saved on ${FILE}.log; this is useful to + # verify the correct order of colors in the image index. + cli_printMessage "${FILE}${PREFIX}.ppm" --as-savedas-line + lss16toppm -map \ + < ${FILE}${PREFIX}.lss 2>>${FILE}.log > ${FILE}${PREFIX}.ppm + + # Create the 16 colors PNG image. + cli_printMessage "${FILE}${PREFIX}.png" --as-savedas-line + pnmtopng -verbose -palette=$PALETTE_PPM \ + < ${FILE}${PREFIX}.pnm 2>>${FILE}.log > ${FILE}${PREFIX}.png + + # Remove PPM palette. It is no longer needed. + if [[ -f ${PALETTE_PPM} ]];then + rm $PALETTE_PPM + fi + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToThumbnail.sh b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToThumbnail.sh new file mode 100755 index 0000000..6e319e2 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_convertPngToThumbnail.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# svg_convertPngToThumbnail.sh -- This function provides +# post-rendition to create thumbnails from images produced by +# centos-art base-rendition. Thumbnails are created in PNG and JPG +# format for you to decide which is the more appropriate one. When no +# size is specified, thumbnails are created at 250 pixels width and +# height is automatically calculated to match the image ratio. +# +# Copyright (C) 2009, 2010, 2011 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 svg_convertPngToThumbnail { + + # Get image size. + local SIZE='' + local SIZES=$(render_getConfigOption "$ACTION" '2-') + + # Check image sizes and do convertion. + if [[ "$SIZES" == "" ]];then + SIZES='250' + fi + + # Check base file existence. + cli_checkFiles "${FILE}.png" + + # Create thumbnails. + for SIZE in $SIZES;do + cli_printMessage "${FILE}-thumb-${SIZE}.png" --as-savedas-line + convert -thumbnail ${SIZE} ${FILE}.png ${FILE}-thumb-${SIZE}.png + cli_printMessage "${FILE}-thumb-${SIZE}.jpg" --as-savedas-line + convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.jpg + cli_printMessage "${FILE}-thumb-${SIZE}.pdf" --as-savedas-line + convert -thumbnail ${SIZE} ${FILE}-thumb-${SIZE}.png ${FILE}-thumb-${SIZE}.pdf + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_doLastActions.sh b/Scripts/centos-art/Functions/Render/Svg/svg_doLastActions.sh new file mode 100755 index 0000000..f28eef6 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_doLastActions.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# svg_doLastActions.sh -- This function performs last-rendition +# actions for SVG files. +# +# Copyright (C) 2009, 2010, 2011 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 svg_doLastActions { + + # Verify position of file being produced in the list of files been + # currently processed. + if [[ $THIS_FILE_DIR == $NEXT_FILE_DIR ]];then + return + fi + + local ACTION='' + + # Redefine SVG last-rendition actions as local to avoid undesired + # concatenation when massive rendition is performed. + local -a LASTACTIONS + + # Define SVG directory-specific actions. This is required in order + # to provide a predictable way of producing content inside the + # repository and save you the time of writing long several + # commands each time you need to produce images inside the + # repository. + if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then + if [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Gdm/.+\.svg$" ]];then + LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Gdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' + elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Kdm/.+\.svg$" ]];then + LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToDm:Kdm:800x600 1024x768 1280x1024 1360x768 2048x1536 2560x1240' + elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Ksplash/.+\.svg$" ]];then + LASTACTIONS[((++${#LASTACTIONS[*]}))]='convertPngToKsplash:' + fi + fi + + # Define SVG last-rendition actions. Since last-rendition makes + # use of all files in the output directory structure and + # directory-specific rendition modifies all the files in the + # output directory structure as well, these actions must be + # defined after the directory-specific definition. Otherwise, + # modifications impossed by these actions may interfier the whole + # purpose of having a directory-specific rendition. + [[ $FLAG_LASTRENDITION != '' ]] && LASTACTIONS[((++${#LASTACTIONS[*]}))]="doLastActions:(png|jpg):${FLAG_LASTRENDITION}" + + # At this point centos-art.sh should be producing the last file + # from the same unique directory structure, so, before producing + # images for the next directory structure lets execute the list of + # last-rendition actions for the current directory structure. + for ACTION in "${LASTACTIONS[@]}"; do + svg_$(echo "$ACTION" | cut -d: -f1) + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_doLastCommand.sh b/Scripts/centos-art/Functions/Render/Svg/svg_doLastCommand.sh new file mode 100755 index 0000000..eae59b9 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_doLastCommand.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# svg_doLastCommand.sh -- This function standardizes the way +# last-rendition commands are applied to base-rendition and +# post-rendition outputs. +# +# Copyright (C) 2009, 2010, 2011 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 svg_doLastCommand { + + # Define the file extensions. This value is a regular expression + # pattern which must match the file extensions that last-rendition + # actions will be applied to. + local EXTENSION=$(render_getConfigOption "$ACTION" '2') + + # Define the command string that will be evaluated as + # last-rendition action. Only commands that perform in-place + # modifications can be passed here. + local COMMAND=$(render_getConfigOption "$ACTION" '3-') + + # Define the list of files to process. This value contain all the + # files in the output directory which extension match the + # extension pattern previously defined. + local FILE='' + local FILES=$(cli_getFilesList $OUTPUT --pattern=".+\.${EXTENSION}") + + for FILE in $FILES;do + + # Identify file before processing it. Only formats recognized + # by ImageMagick are supported. In case the file isn't + # supported by ImageMagick, continue with the next file in the + # list. + identify -quiet ${FILE} > /dev/null + if [[ $? -ne 0 ]];then + continue + fi + + # Print action message. + cli_printMessage "${FILE}" --as-updating-line + + # Execute mogrify action on all files inside the same + # directory structure. + eval ${COMMAND} ${FILE} + + # Be sure the command was executed correctly. Otherwise stop + # script execution. + if [[ $? -ne 0 ]];then + exit + fi + + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_doPostActions.sh b/Scripts/centos-art/Functions/Render/Svg/svg_doPostActions.sh new file mode 100755 index 0000000..1a10b2f --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_doPostActions.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# svg_doPostActions.sh -- This function performs post-rendition +# actions for SVG files. +# +# Copyright (C) 2009, 2010, 2011 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 svg_doPostActions { + + local ACTION='' + + # Redefine SVG post-rendition actions as local to avoid undesired + # concatenation when massive rendition is performed. + local -a POSTACTIONS + + # Define default comment written to base-rendition output. + local COMMENT="`gettext "Created in CentOS Artwork Repository"` ($(cli_printUrl '--projects-artwork'))" + + # Define SVG post-rendition actions. Since these actions are + # applied to base-rendition output and base-rendition output is + # used as reference to perform directory-specific rendition, these + # action must be defined before directory-specific rendition. + # Otherwise it wouldn't be possible to propagate changes impossed + # by these actions to new files produced as result of + # directory-specific rendition. + POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:mogrify -comment '$COMMENT'" + [[ $FLAG_POSTRENDITION != '' ]] && POSTACTIONS[((++${#POSTACTIONS[*]}))]="doPostCommand:png:${FLAG_POSTRENDITION}" + + # Define SVG directory-specific rendition. Directory-specfic + # rendition provides a predictable way of producing content inside + # the repository. + if [[ $FLAG_DONT_DIRSPECIFIC == 'false' ]];then + + if [[ $TEMPLATE =~ 'trunk/Identity/(Models|Images)/Themes/.+\.svg$' ]];then + + POSTACTIONS[((++${#POSTACTIONS[*]}))]="convertPngToBranded" + + if [[ $TEMPLATE =~ "Backgrounds/.+\.svg$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg' + POSTACTIONS[((++${#POSTACTIONS[*]}))]='groupBy:png jpg' + + elif [[ $TEMPLATE =~ "Concept/.+\.svg$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToThumbnail:250' + + elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Syslinux/.+\.svg$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:' + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToSyslinux:-floyd' + + elif [[ $TEMPLATE =~ "Distro/$(cli_getPathComponent --release-pattern)/Grub/.+\.svg$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:' + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToGrub:-floyd' + + elif [[ $TEMPLATE =~ "Posters/.+\.svg$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' + fi + + elif [[ $TEMPLATE =~ "trunk/Identity/Models/Brands/.+\.svg$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToBrands' + + elif [[ $TEMPLATE =~ "trunk/Identity/Models/Icons/.+\.svg$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngToIcons' + + elif [[ $TEMPLATE =~ "trunk/Identity/Models/Manuals.+\.svg$" ]];then + POSTACTIONS[((++${#POSTACTIONS[*]}))]='convertPngTo:jpg pdf' + + fi + + fi + + # Execute SVG post-rendition actions. + for ACTION in "${POSTACTIONS[@]}"; do + svg_$(echo "$ACTION" | cut -d: -f1) + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_doPostCommand.sh b/Scripts/centos-art/Functions/Render/Svg/svg_doPostCommand.sh new file mode 100755 index 0000000..10c7f4b --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_doPostCommand.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# +# svg_doPostCommand.sh -- This function standardizes the way +# post-rendition commands are applied to base-rendition output. +# +# Copyright (C) 2009, 2010, 2011 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 svg_doPostCommand { + + # Define the file extension of base-rendition output. + local EXTENSION=$(render_getConfigOption "$ACTION" '2') + + # Define the command string. + local COMMAND=$(render_getConfigOption "$ACTION" '3-') + + # Verify the absolute path of base-rendition output. + cli_checkFiles ${FILE}.${EXTENSION} + + # Execute the command string on base-rendition output. + eval $COMMAND ${FILE}.${EXTENSION} + + # Be sure the command string was executed correctly. Otherwise + # stop the script execution. + if [[ $? -ne 0 ]];then + exit + fi + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_getColors.sh b/Scripts/centos-art/Functions/Render/Svg/svg_getColors.sh new file mode 100755 index 0000000..f4dd076 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_getColors.sh @@ -0,0 +1,153 @@ +#!/bin/bash +# +# svg_getColors.sh -- This function takes one palette produced by Gimp +# (e.g., syslinux.gpl) as input and outputs a list of colors in the +# specified format. In order for this function to output the color in +# the format specified, it is needed that the fourth column in the gpl +# palette be set in the `rrggbb' format and the appropriate conversion +# be implemented here. +# +# Notice that using both the `--head' and `--tail' options it is +# possible to control how many consecutive items does the list of +# colors is going to have. It is possible to output all colors in the +# list, or a consecutive range of them. +# +# Copyright (C) 2009, 2010, 2011 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 svg_getColors { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='head:,tail:,format:' + + # Initialize ARGUMENTS with an empty value and set it as local + # variable to this function scope. + local ARGUMENTS='' + + # Initialize both head and tail values to return the first line of + # color information from the palette. + local HEAD=1 + local TAIL=1 + + # Initialize format value used as default when no format option be + # provided. + local FORMAT='rrggbb' + + # Initialize list of colors. + local COLORS='' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through positional parameters. + while true;do + + case "$1" in + + --head ) + HEAD=$2 + shift 2 + ;; + + --tail ) + TAIL=$2 + shift 2 + ;; + + --format ) + FORMAT=$2 + shift 2 + ;; + + -- ) + shift 1 + break + ;; + esac + done + + # Define path to gpl palette. This is the first file we use to + # retrive color information from. Only the first file provided + # will be used. + local PALETTE=$(echo $@ | cut -d' ' -f1) + + if [[ $PALETTE == '' ]];then + + # Define palette path inside the theme's artistic motif. + local MOTIF_PALETTE=$(cli_getRepoTLDir)/Identity/Images/Themes/$(cli_getPathComponent $ACTIONVAL --motif)/Palettes/grub.gpl + + # Define palette path inside the theme's design model. + local MODEL_PALETTE=$(cli_getRepoTLDir)/Identity/Models/Themes/${THEME_MODEL_NAME}/Palettes/grub.gpl + + # Redefine default background color using palettes provided by + # artistic motif first, and design model later. Assuming none + # of them is present, use The CentOS Project default color + # then. + if [[ -f $MOTIF_PALETTE ]];then + COLORS=$(svg_getColors $MOTIF_PALETTE --head=1 --tail=1) + elif [[ -f $MODEL_PALETTE ]];then + COLORS=$(svg_getColors $MODEL_PALETTE --head=1 --tail=1) + else + COLORS='#204c8d' + fi + + else + + # Retrive the fourth column from GPL palette. The fourth + # column of a GPL palette contains the palette commentary + # field. The palette commentary field can be anything, but for + # the sake of our own convenience we use it to store the color + # value in hexadecimal format (e.g., rrggbb). Notice that you + # can put your comments from the fifth column on using an + # space as field separator. + COLORS=$(sed -r '1,/^#/d' $PALETTE \ + | awk '{ printf "%s\n", $4 }' | head -n $HEAD | tail -n $TAIL) + + fi + + # Implement color formats convertions from rrggbb to other formats + # that you might need to use. + for COLOR in $COLORS;do + + case $FORMAT in + + rrggbb|* ) + if [[ ! $COLOR =~ '^#' ]];then + COLOR="#${COLOR}" + fi + ;; + + esac + + # Output color value. + echo "$COLOR" + + done + +} diff --git a/Scripts/centos-art/Functions/Render/Svg/svg_groupBy.sh b/Scripts/centos-art/Functions/Render/Svg/svg_groupBy.sh new file mode 100755 index 0000000..1e747d8 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/Svg/svg_groupBy.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# svg_groupBy.sh -- This function provides post-rendition action to +# group files inside directories named as their file extensions. For +# example: if the current file is a .png file, it is moved inside a +# Png/ directory; if the current file is a .jpg file, it is stored +# inside a Jpg/ directory, and so on. +# +# For this function to work correctly, you need to specify which file +# type you want to group. This is done in the post-rendition ACTIONS +# array inside the appropriate `render.conf.sh' pre-configuration +# script. This function cannot be used as last-rendition action. +# +# Copyright (C) 2009, 2010, 2011 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 svg_groupBy { + + local SOURCE='' + local TARGET='' + + # Sanitate file types passed from render.conf.sh pre-rendition + # configuration script. + local FORMAT='' + local FORMATS=$(render_getConfigOption "$ACTION" '2-') + + for FORMAT in $FORMATS;do + + # Redifine source file we want to move. + SOURCE=${FILE}.${FORMAT} + + # Define target directory where source file will be moved + # into. + TARGET=$(dirname "$FILE")/$(cli_getRepoName $FORMAT -d) + + # Check existence of source file. + cli_checkFiles $SOURCE + + # Check existence of target directory. + if [[ ! -d $TARGET ]];then + mkdir -p $TARGET + fi + + # Redifine file path to add file and its type. + TARGET=${TARGET}/$(cli_getRepoName $FILE -f).${FORMAT} + + # Move file into its final location. + cli_printMessage "$TARGET" --as-movedto-line + mv ${SOURCE} ${TARGET} + + done + +} diff --git a/Scripts/centos-art/Functions/Render/render.sh b/Scripts/centos-art/Functions/Render/render.sh new file mode 100755 index 0000000..98b4180 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/render.sh @@ -0,0 +1,139 @@ +#!/bin/bash +# +# render.sh -- This function initializes rendition variables and +# actions to centos-art.sh script. +# +# Copyright (C) 2009, 2010, 2011 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 render { + + local ACTIONNAM='' + local ACTIONVAL='' + + # Initialize `--releasever' option. The release version option + # controls the release number used to produce release-specific + # content. By default, the release number of The CentOS + # Distribution you have installed in your workstation is used. + local FLAG_RELEASEVER=$(cat /etc/redhat-release \ + | gawk '{ print $3 }') + + # Initialize `--basearch' option. The base architecture option + # controls the architecture type used to produce + # architecture-specific content. By default, the hardware + # platform of your workstation is used. + local FLAG_BASEARCH=$(uname -i) + + # Initialize `--theme-model' option. The theme model option + # specifies the the theme model name used to produce theme + # artistic motifs. + local FLAG_THEME_MODEL='Default' + + # Initialize `--post-rendition' option. This option defines what + # command to use as post-rendition. Post-rendition takes palce + # over base-rendition output. + local FLAG_POSTRENDITION='' + + # Initialize `--last-rendition' option. This option defines what + # command to use as last-rendition. Last-rendition takes palce + # once both base-rendition and post-rendition has been performed + # in the same directory structure. + local FLAG_LASTRENDITION='' + + # Initialize `--dont-dirspecific' option. This option can take two + # values only (e.g., `true' or `false') and controls whether to + # perform or not directory-specific rendition. Directory-specific + # rendition may use any of the three types of renditions (e.g., + # base-rendition, post-rendition and last-rendition) to accomplish + # specific tasks when specific directory structures are detected + # in the rendition flow. By default, the centos-art.sh script + # performs directory-specific rendition. + local FLAG_DONT_DIRSPECIFIC='false' + + # Initialize `--with-brands' option. This option controls whether + # to brand output images or not. By default output images are not + # branded. + local FLAG_WITH_BRANDS='false' + + # Initialize name of rendition backend as an empty value. The name + # of rendition backend is determined automatically based on + # template file extension, later, at rendition time. + local RENDER_BACKEND='' + + # Initialize absolute path to backend's base directory, the place + # where backend-specific directories are stored in. + local RENDER_BACKEND_DIR="${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" + + # Initialize list of supported file extensions. These file + # extensions are used by design model files, the files used as + # base-rendition input. In order for design model files to be + # correclty rendered, they must end with one of the file + # extensions listed here. + local RENDER_EXTENSIONS='svg docbook' + + # Interpret arguments and options passed through command-line. + render_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" + + # Define action value. We use non-option arguments to define the + # action value (ACTIONVAL) variable. + for ACTIONVAL in "$@";do + + # Check action value. Be sure the action value matches the + # convenctions defined for source locations inside the working + # copy. + ACTIONVAL=$(cli_checkRepoDirSource "$ACTIONVAL") + + # Syncronize changes between repository and working copy. At + # this point, changes in the repository are merged in the + # working copy and changes in the working copy committed up to + # repository. + cli_syncroRepoChanges + + # Define renderable directories and the way they are produced. + # To describe the way renderable directories are produced, we + # take the action value (ACTIONVAL) as reference and describe + # the production through an action name (ACTIONNAM). + if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Identity/Images/Themes" ]];then + ACTIONNAM="render_doThemeActions" + elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Identity/Images" ]];then + ACTIONNAM="render_doBaseActions" + elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Manuals" ]];then + ACTIONNAM="render_doBaseActions" + else + cli_printMessage "`gettext "The path provided doesn't support rendition."`" --as-error-line + fi + + # Execute action name. + ${ACTIONNAM} + + # Syncronize changes between repository and working copy. At + # this point, changes in the repository are merged in the + # working copy and changes in the working copy committed up to + # repository. + cli_syncroRepoChanges + + done + +} diff --git a/Scripts/centos-art/Functions/Render/render_doBaseActions.sh b/Scripts/centos-art/Functions/Render/render_doBaseActions.sh new file mode 100755 index 0000000..cb493fc --- /dev/null +++ b/Scripts/centos-art/Functions/Render/render_doBaseActions.sh @@ -0,0 +1,244 @@ +#!/bin/bash +# +# render_doBaseActions.sh -- This function performs base-rendition +# action for all files. +# +# Copyright (C) 2009, 2010, 2011 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 render_doBaseActions { + + local -a FILES + local FILE='' + local OUTPUT='' + local TEMPLATE='' + local TEMPLATE_HAS_DOCTYPE='' + local PARENTDIR='' + local TRANSLATION='' + local EXTERNALFILE='' + local EXTERNALFILES='' + local THIS_FILE_DIR='' + local NEXT_FILE_DIR='' + local RENDER_EXTENSION='' + local COUNT=0 + + # Verify default directory where design models are stored in. + cli_checkFiles "$(cli_getRepoTLDir)/Identity/Models/Themes/${FLAG_THEME_MODEL}" --directory + + # Redefine parent directory for current workplace. + PARENTDIR=$(basename "${ACTIONVAL}") + + # Define base location of template files. + render_getDirTemplate + + # Loop through list of supported file extensions. + for RENDER_EXTENSION in ${RENDER_EXTENSIONS};do + + # Redefine name of rendition backend based on supported file + # extension. + if [[ $RENDER_EXTENSION == '^(svg|docbook)$' ]];then + RENDER_BACKEND=${RENDER_EXTENSION} + else + cli_printMessage "`eval_gettext "The \\\"\\\$RENDER_EXTENSION\\\" file extension is not supported yet."`" --as-error-line + fi + + # Define the list of files to process. Use an array variable + # to store the list of files to process. This make posible to + # realize verifications like: is the current base directory + # equal to the next one in the list of files to process? + # Questions like this is let us to know when centos-art.sh is + # leaving a directory structure and entering another. This + # information is required in order for centos-art.sh to know + # when to apply last-rendition actions. + # + # Another issue is that some directories might be named as if + # they were files (e.g., using a renderable extension like + # .docbook). In these situations we need to avoid such + # directories from being interpreted as a renderable file. For + # this, pass the `--type="f"' option when building the list of + # files to process in order to retrive regular files only. + # + # Another issue to consider here, is that in some cases both + # templates and outputs might be in the same location. In + # these cases localized content are stored in the same + # location where template files are retrived from and we need + # to avoid using localized content from being interpreted as + # design models. In that sake, supress language-specific files + # from the list of files to process. + # + # Another issue to consider here, is the way of filtering. We + # cannot expand the pattern specified by FLAG_FILTER with a + # `.*' here (e.g., "${FLAG_FILTER}.*\.${RENDER_EXTENSION}") + # because that would suppress any possibility from the user to + # specifiy just one file name in locations where more than one + # file with the same name as prefix exists (e.g., + # `repository.docbook', `repository-preamble.docbook' and + # `repository-parts.docbook'). Instead, pass filtering + # control to the user whom can use regular expression markup + # in the `--filter' option to decide whether to match + # `repository.docbook' only (e.g., through + # `--filter="repository"') or `repository-preamble.docbook' + # and `repository-parts.docbook' but not `repository.docbook' + # (e.g., through `--filter="repository-.*"'). + for FILE in $(cli_getFilesList ${TEMPLATE} \ + --pattern="${FLAG_FILTER}\.${RENDER_EXTENSION}" --type="f" \ + | egrep -v '/[[:alpha:]]{2}_[[:alpha:]]{2}/');do + FILES[((++${#FILES[*]}))]=$FILE + done + + # Verify list of files to process. Assuming no file is found, + # evaluate the next supported file extension. + if [[ ${#FILES[*]} -eq 0 ]];then + continue + fi + + # Initialize backend-specific functionalities. + cli_exportFunctions "${RENDER_BACKEND_DIR}/$(cli_getRepoName \ + ${RENDER_BACKEND} -d)" "${RENDER_BACKEND}" + + # Start processing the base rendition list of FILES. Fun part + # approching :-). + while [[ $COUNT -lt ${#FILES[*]} ]];do + + # Define base file. + FILE=${FILES[$COUNT]} + + # Define the base directory path for the current file being + # process. + THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) + + # Define the base directory path for the next file that will + # be process. + if [[ $(($COUNT + 1)) -lt ${#FILES[*]} ]];then + NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) + else + NEXT_FILE_DIR='' + fi + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Define final location of translation file. + TRANSLATION=$(dirname $FILE \ + | sed -r 's!trunk/(Manuals|Identity)!trunk/L10n/\1!')/$(cli_getCurrentLocale)/messages.po + + # Define final location of template file. + TEMPLATE=${FILE} + + # Verify design models file existence. We cannot continue + # with out it. + if [[ ! -f $TEMPLATE ]];then + cli_printMessage "`gettext "The template file doesn't exist."`" --as-error-line + fi + + # Verify whether the design model uses DOCTYPE definition + # or not; and redefine related variable for further using. + egrep '^ /dev/null + TEMPLATE_HAS_DOCTYPE=$? + + # Validate design model before processing it. This step is + # very important in order to detect document's + # malformations and warn you about it, so you can correct + # them before processing the document as input. Notice + # that, here, validation is possible only for documents + # which have a DOCTYPE definition inside. + if [[ $TEMPLATE_HAS_DOCTYPE -eq 0 ]];then + + # Print action message. + cli_printMessage "$TEMPLATE" --as-validating-line + + # Validate document before processing it. + xmllint --valid --noent --noout $TEMPLATE + if [[ $? -ne 0 ]];then + cli_printMessage "`gettext "Validation failed."`" --as-error-line + fi + + else + # Print action message. + cli_printMessage "$TEMPLATE" --as-template-line + fi + + # Define final location of output directory. + render_getDirOutput + + # Get relative path to file. The path string (stored in + # FILE) has two parts: 1. the variable path and 2. the + # common path. The variable path is before the common + # point in the path string. The common path is after the + # common point in the path string. The common point is the + # name of the parent directory (stored in PARENTDIR). + # + # Identity/Models/Themes/.../Firstboot/3/splash-small.svg + # -------------------------^| the |^------------^ + # variable path | common | common path + # -------------------------v| point | v------------v + # Identity/Images/Themes/.../Firstboot/Img/3/splash-small.png + # + # What we do here is remove the varibale path, the common + # point, and the file extension parts in the string + # holding the path retrived from design models directory + # structure. Then we use the common path as relative path + # to store the the final image file. + # + # The file extension is removed from the common path + # because it is set when we create the final image file. + # This configuration let us use different extensions for + # the same file name. + # + # When we render using base-rendition action, the + # structure of files under the output directory will be + # the same used after the common point in the related + # design model directory structure. + FILE=$(echo ${FILE} \ + | sed -r "s!.*${PARENTDIR}/!!" \ + | sed -r "s/\.${RENDER_EXTENSION}$//") + + # Define absolute path to final file (without extension). + FILE=${OUTPUT}/$(basename "${FILE}") + + # Define instance name from design model. + INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) + + # Apply translation file to design model to produce the design + # model translated instance. + render_doTranslation + + # Expand translation markers inside design model instance. + cli_expandTMarkers ${INSTANCE} + + # Perform backend base-rendition. + ${RENDER_BACKEND} + + # Remove template instance. + if [[ -f $INSTANCE ]];then + rm $INSTANCE + fi + + # Increment file counter. + COUNT=$(($COUNT + 1)) + + done + + # Unset backend-specific functionalities. + cli_unsetFunctions "${RENDER_BACKEND_DIR}/$(cli_getRepoName \ + ${RENDER_BACKEND} -d)" "${RENDER_BACKEND}" + + done +} diff --git a/Scripts/centos-art/Functions/Render/render_doThemeActions.sh b/Scripts/centos-art/Functions/Render/render_doThemeActions.sh new file mode 100755 index 0000000..df0db5e --- /dev/null +++ b/Scripts/centos-art/Functions/Render/render_doThemeActions.sh @@ -0,0 +1,135 @@ +#!/bin/bash +# +# render_doThemeActions.sh -- This function performs theme-specific +# rendition. +# +# Copyright (C) 2009, 2010, 2011 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 render_doThemeActions { + + local -a DIRS + local COUNT=0 + local NEXT_DIR='' + local MOTIF_NAME='' + local MOTIF_DIR='' + + # Define base directory of artistic motifs. This is the location + # where all artistic motifs are stored in. + local MOTIF_BASEDIR="$(cli_getRepoTLDir $ACTIONVAL)/Identity/Images/Themes" + + # Define base directory of design models. This is the location + # where all design models are stored in. + local MODEL_BASEDIR="$(cli_getRepoTLDir $ACTIONVAL)/Identity/Models/Themes" + + # Define directory structure of design models. Design models + # directory structures are used as reference to create artistic + # motifs directory structure. Use the `--pattern' option to be + # sure any modification to FLAG_FILTER won't affect the output + # result. We need to make matching everything here, no matter what + # the FLAG_FILTER value be. + local MODEL_DIR='' + local MODEL_DIRS="$(cli_getFilesList ${MODEL_BASEDIR}/${FLAG_THEME_MODEL} \ + --pattern=".+" --type="d" | egrep -v '\.svn' | sed -r '/^[[:space:]]*$/d' | sed -r \ + "s!^.*/${FLAG_THEME_MODEL}/!!" | sed -r '/^[[:space:]]*$/d')" + + # Define design model regular expression patterns from design + # models directory structure. + local MODEL_PATTERN=$(echo "$MODEL_DIRS" | tr "\n" '|' \ + | sed -e 's!^|!!' -e 's!|$!!') + + # Define list of renderable directory structures inside the + # artistic motif. As reference, to build this list, use design + # model directory structure. Later, filter the result using the + # action value as reference to control what renderable directory + # structure to produce. The more specific you be in the path + # specification the more specific theme rendition will be. + local MOTIF_RENDERABLE_DIR='' + local MOTIF_RENDERABLE_DIRS=$(cli_getFilesList ${MOTIF_BASEDIR} \ + --pattern=".+/($MODEL_PATTERN)" --type="d" | grep "$ACTIONVAL") + + # Rebuild list of renderable directory structures using an array + # variable. This let us to predict what directory is one step + # forward or backward from the current directory structure. + for MOTIF_RENDERABLE_DIR in $MOTIF_RENDERABLE_DIRS;do + DIRS[((++${#DIRS[*]}))]=${MOTIF_RENDERABLE_DIR} + done + + # Define total number of directories to process. This is required + # in order to correct the counting value and so, make it to match + # the zero based nature of bash array variables. + local DIRS_TOTAL=$((${#DIRS[*]} - 1)) + + while [[ $COUNT -le ${DIRS_TOTAL} ]];do + + # Redefine action value to refer the theme-specific renderable + # directory. + ACTIONVAL=${DIRS[$COUNT]} + + # Refine artistic motif name using the current action value. + MOTIF_NAME=$(cli_getPathComponent $ACTIONVAL --motif) + + # Verify artistic motif name. The name of the artistic motif + # must be present in order for theme rendition to happen. + # Theme rendition takes place inside artistic motifs and the + # artistic motif name is an indispensable part of it. Take + # care of not using design models directory structure as name + # for artistic motifs. They, sometimes, match the pattern used + # to verify artistic motifs names but must not be confused. + if [[ $MOTIF_NAME == '' ]] || [[ $MOTIF_NAME =~ "^$MODEL_PATTERN" ]];then + COUNT=$(($COUNT + 1)) + continue + fi + + # Refine artistic motif directory. This is the top directory + # where all visual manifestations of an artistic motif are + # stored in (e.g., Backgrounds, Brushes, Concept, Distro, + # etc.). + MOTIF_DIR="${MOTIF_BASEDIR}/${MOTIF_NAME}" + + # Define what is the next directory in the list, so we could + # verify whether to render or not the current theme-specific + # renderable directory. + if [[ $COUNT -lt ${DIRS_TOTAL} ]];then + NEXT_DIR=$(dirname ${DIRS[(($COUNT + 1))]}) + else + NEXT_DIR='' + fi + + # Verify whether to render or not the current theme's + # renderable directory. This verification is needed in order + # to avoid unncessary rendition loops. For example, don't + # render `path/to/dir/A' when `path/to/dir/A/B' does exist, + # that configuration would produce `/path/to/dir/A/B twice. + if [[ $ACTIONVAL =~ '[[:digit:]]$' ]] || [[ $ACTIONVAL == $NEXT_DIR ]];then + COUNT=$(($COUNT + 1)) + continue + fi + + # Execute direct rendition on theme specific renderable + # directory as specified by action value. + render_doBaseActions + + # Increment counter to match the correct count value. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Scripts/centos-art/Functions/Render/render_doTranslation.sh b/Scripts/centos-art/Functions/Render/render_doTranslation.sh new file mode 100755 index 0000000..d473f5c --- /dev/null +++ b/Scripts/centos-art/Functions/Render/render_doTranslation.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# render_doTranslation.sh -- This function standardizes the way +# translation files are applied to design models in order to produce +# the translated instance that is used to expand translation markers +# and produce the base-rendition output. +# +# Assuming no translation file exists, the an untranslated instace +# from the design model is created (i.e., just a copy of it). Using a +# design model instance (translated or not) is required in order to +# expand translation markers safetly. +# +# Copyright (C) 2009, 2010, 2011 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 render_doTranslation { + + # Verify translation file existence and create template + # instance accordingly. + if [[ -f ${TRANSLATION} ]];then + + # Print final location of translation file. + cli_printMessage "${TRANSLATION}" --as-translation-line + + # Create the translated instance of design model based on + # whether the template file has DOCTYPE definition or not. + if [[ ${TEMPLATE_HAS_DOCTYPE} -eq 0 ]];then + xmllint --valid --noent ${TEMPLATE} \ + | xml2po -a -l $(cli_getCurrentLocale) -p ${TRANSLATION} -o ${INSTANCE} - + else + xml2po -a -l $(cli_getCurrentLocale) -p ${TRANSLATION} -o ${INSTANCE} ${TEMPLATE} + fi + + # Remove .xml2po.mo temporal file. + if [[ -f ${PWD}/.xml2po.mo ]];then + rm ${PWD}/.xml2po.mo + fi + + else + + # Create the non-translated instance of design model. + if [[ ${TEMPLATE_HAS_DOCTYPE} -eq 0 ]];then + xmllint --valid --noent ${TEMPLATE} > ${INSTANCE} + else + cp ${TEMPLATE} ${INSTANCE} + fi + + fi + + # Verify instance existence. + cli_checkFiles $INSTANCE + +} diff --git a/Scripts/centos-art/Functions/Render/render_getConfigOption.sh b/Scripts/centos-art/Functions/Render/render_getConfigOption.sh new file mode 100755 index 0000000..c79d864 --- /dev/null +++ b/Scripts/centos-art/Functions/Render/render_getConfigOption.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# render_getConfigOption.sh -- This function standardizes the +# configuration fields are retrived from some action-specific +# definitions. +# +# Copyright (C) 2009, 2010, 2011 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 render_getConfigOption { + + # Initialize action string. + local ACTION="$1" + + # Initialize field definition. + local FIELD="$2" + + # Initialize configuration options. + local OPTION='' + + # Check action string. The action string must be present in order + # for this function to work. It provides the information needed to + # retrive configurantion options from. + if [[ "$ACTION" == '' ]];then + cli_printMessage "`gettext "There is no action string to work with."`" --as-error-line + fi + + # Check field definition. The field definition must match any of + # the formats specified by the `-f' option of `cut' command. + if [[ ! "$FIELD" =~ '^([0-9]+|[0-9]+-|-[0-9]+|[0-9]+-[0-9]+)$' ]];then + cli_printMessage "`gettext "The field definition is not valid."`" --as-error-line + fi + + # Get configuration option from action string. + OPTION=$(echo -n "$ACTION" | cut -d: -f${FIELD}) + + # Sanitate configuration option retrived from action string. + OPTION=$(echo -n "${OPTION}" \ + | sed -r 's!^ *!!g' \ + | sed -r 's!( |,|;) *! !g' \ + | sed -r 's! *$!!g') + + # Print out the configuration option retrived from action string, + # only if it is not an empty value. Do not use `echo' or `printf' + # built-in commands here. Use the `cli_printMessage' functionality + # instead. This is required in order to reverse the apostrophe + # codification accomplished when options were retrived from + # command-line (cli_parseArgumentsReDef) in the argument of + # options like `--post-rendition' and `--last-rendition'. + if [[ $OPTION != '' ]];then + cli_printMessage "$OPTION" --as-stdout-line + fi + +} diff --git a/Scripts/centos-art/Functions/Render/render_getDirOutput.sh b/Scripts/centos-art/Functions/Render/render_getDirOutput.sh new file mode 100755 index 0000000..8796d8f --- /dev/null +++ b/Scripts/centos-art/Functions/Render/render_getDirOutput.sh @@ -0,0 +1,84 @@ +#!/bin/bash +# +# render_getDirOutput.sh -- This function defines the final +# absolute path the centos-art.sh script uses to store identity +# contents produced at rendition time. +# +# Copyright (C) 2009, 2010, 2011 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 render_getDirOutput { + + # Define base output directory using design model path as + # reference. + OUTPUT=$(dirname $FILE | sed -r \ + -e "s!/Themes/${FLAG_THEME_MODEL}!/Themes/$(cli_getPathComponent $ACTIONVAL --motif)!" \ + -e "s!/Models!/Images!" \ + -e "s!/Tpl!!") + + # By default rendered identity content is stored immediatly under + # identity entry structure, but if `Img/' directory exists use it + # instead. + if [[ -d "${OUTPUT}/Img" ]];then + OUTPUT=${OUTPUT}/Img + fi + + # Redefine base output directory to introduce specific information + # like release number and architecture. This information is + # require by directories (e.g., the `Media' directory inside + # themes and the `trunk/Manuals/Distro' directory ) whose need + # this information to be passed explicitly at the command-line + # through the `--releasever' and `--basearch' options. Other + # directories take such information from the path they are stored + # in (e.g., the `Distro/5/Anaconda' directory inside themes.). So, + # we need to differentiate the way information like release + # numbers and architectures are retrived in order to build the + # output path correctly at rendition time. + if [[ $OUTPUT =~ "^${MOTIF_DIR}/Media$" ]];then + OUTPUT=${OUTPUT}/${FLAG_RELEASEVER}/${FLAG_BASEARCH} + elif [[ $OUTPUT =~ 'trunk/Manuals/Distro$' ]];then + OUTPUT=${OUTPUT}/${FLAG_RELEASEVER} + else + OUTPUT=${OUTPUT} + fi + + # Define whether to use or not locale-specific directory to store + # content, using current locale information as reference. As + # convenction, when we produce content, only specific locations + # use locale-specific directories to organize language-specific + # content (e.g., Manuals, Anaconda, Installation media, etc.). All + # other locations do not use locale-specific directories to + # organize content. This convenction is important in order for + # the `prepare' functionality of centos-art.sh script to produce + # content in the correct location. Otherwise, we might end up + # duplicating content (e.g., icons, brands, etc.) which doesn't + # have any translation, nor any need to be translated. + if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then + if [[ $(cli_isLocalized $TEMPLATE) == 'true' ]];then + OUTPUT=${OUTPUT}/$(cli_getCurrentLocale) + fi + fi + + # Create final output directory, if it doesn't exist yet. + if [[ ! -d ${OUTPUT} ]];then + mkdir -p ${OUTPUT} + fi + +} diff --git a/Scripts/centos-art/Functions/Render/render_getDirTemplate.sh b/Scripts/centos-art/Functions/Render/render_getDirTemplate.sh new file mode 100755 index 0000000..1b0c2de --- /dev/null +++ b/Scripts/centos-art/Functions/Render/render_getDirTemplate.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# +# render_getDirTemplate.sh -- This function defines the way renderable +# directories are processed inside the repository. Inside the +# repository, renderable directories are processed either through +# direct or theme-specific rendition. +# +# Direct rendition takes one XML file from design model +# (`trunk/Identity/Models') directory structure and produces one file +# in `trunk/Identity/Images' directory strucutre. In this +# configuration, the organization used to stored the design model is +# taken as reference to build the path required to store the image +# related to it under `trunk/Identity/Images' directory structure. +# +# Theme-specific rendition takes one design model from +# `trunk/Identity/Models/Themes' directory structure to produce one or +# more images in `trunk/Identity/Images/Themes/$THEME/$VERSION/$MODEL' +# directory structure. In this configuration we have many different +# artistic motifs that use one unique design model directory structure +# as reference to produce images. +# +# Since theme design models are unified to be reused by more +# than one artistic motif, it is not possible to render artistic +# motifs in a lineal manner (i.e., as we do with direct rendition) +# because we need to establish the relation between the artistic motif +# renderable directory structure and the design model first and that +# relation happens when renderable directory structures inside +# artistic motifs are processed individually. +# +# In the first rendition category, we use a design model directory +# structure as reference to produce images one by one. In the second +# rendition category, we can't use the same procedure because one +# design model directory structure is used to produce several +# renderable directory structures, not just one. +# +# Copyright (C) 2009, 2010, 2011 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 render_getDirTemplate { + + # Initialize design models location used as reference to process + # renderable directory structures. + TEMPLATE=$ACTIONVAL + + # Sanitate design models location. Be sure design models do + # always point to trunk directory structure. This is useful to let + # `centos-art.sh' script do rendition under branches directory + # structure, reusing design models under trunk directory + # structure. + TEMPLATE=$(echo "$TEMPLATE" | sed "s!/branches/!/trunk/!") + + # Define absolute path to input files using absolute path from + # output files. + if [[ -d ${TEMPLATE}/Tpl ]];then + TEMPLATE=${TEMPLATE}/Tpl + else + TEMPLATE=$(echo "$TEMPLATE" | sed -r \ + -e "s!/Themes/$(cli_getPathComponent $ACTIONVAL --motif)!/Themes/${FLAG_THEME_MODEL}!" \ + -e "s!/Images!/Models!") + fi + + # Verify absolute path to input file. This verification is + # specially needed in those situations when the artistic motif + # directory structure has an organization different to that in + # design models directory structure. Since the path to design + # models is built from artistic motif directory structure, if + # artistic motifs directory structure is different from design + # model directory structure, as result we'll have a path to a + # design model that may not exist and that would make + # centos-art.sh script to fail. So, verify the absolute path to + # the input file and stop script execution if it doesn't exist. + cli_checkFiles $TEMPLATE + +} diff --git a/Scripts/centos-art/Functions/Render/render_getOptions.sh b/Scripts/centos-art/Functions/Render/render_getOptions.sh new file mode 100755 index 0000000..3464f6f --- /dev/null +++ b/Scripts/centos-art/Functions/Render/render_getOptions.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# +# render_getOptions.sh -- This function interprets option parameters +# passed to `render' functionality and calls actions accordingly. +# +# Copyright (C) 2009, 2010, 2011 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 render_getOptions { + + # Define short options we want to support. + local ARGSS="" + + # Define long options we want to support. + local ARGSL="filter:,quiet,answer-yes,dont-commit-changes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:,with-brands" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + + case "$1" in + + --filter ) + FLAG_FILTER="$2" + shift 2 + ;; + + --quiet ) + FLAG_QUIET="true" + FLAG_DONT_COMMIT_CHANGES="true" + shift 1 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --dont-commit-changes ) + FLAG_DONT_COMMIT_CHANGES="true" + shift 1 + ;; + + --dont-dirspecific ) + FLAG_DONT_DIRSPECIFIC="true" + shift 1 + ;; + + --post-rendition ) + FLAG_POSTRENDITION="$2" + shift 2 + ;; + + --last-rendition ) + FLAG_LASTRENDITION="$2" + shift 2 + ;; + + --basearch ) + FLAG_BASEARCH="$2" + if [[ ! $FLAG_BASEARCH =~ $(cli_getPathComponent --architecture-pattern) ]];then + cli_printMessage "`gettext "The architecture provided is not supported."`" --as-error-line + fi + shift 2 + ;; + + --releasever ) + FLAG_RELEASEVER="$2" + if [[ ! $FLAG_RELEASEVER =~ $(cli_getPathComponent --release-pattern) ]];then + cli_printMessage "`gettext "The release version provided is not supported."`" --as-error-line + fi + shift 2 + ;; + + --theme-model ) + FLAG_THEME_MODEL=$(cli_getRepoName $2 -d) + shift 2 + ;; + + --with-brands ) + FLAG_WITH_BRANDS='true' + 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 "$@" + + # Verify non-option arguments passed to command-line. If there + # isn't any, redefine the ARGUMENTS variable to use the current + # location the functionality was called from. + if [[ $ARGUMENTS == '' ]];then + ARGUMENTS=${PWD} + fi + +} diff --git a/Scripts/centos-art/Functions/Tuneup/Shell/Config/topcomment.sed b/Scripts/centos-art/Functions/Tuneup/Shell/Config/topcomment.sed new file mode 100644 index 0000000..0b3077f --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Shell/Config/topcomment.sed @@ -0,0 +1,55 @@ +#!/bin/sed +# +# topcomment.sed -- This file standardizes the top comment inside +# centos-art.sh scripts. +# +# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG +# +# 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$ +# ---------------------------------------------------------------------- +/^# +Copyright .*$/a\ +# Copyright (C) =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER=\ +#\ +# 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.\ +#\ +# ---------------------------------------------------------------------- + +# Remove previous copyright notice, just to be sure the one above be +# used always. +/^# +Copyright .*$/,/^# -{70}$/{ +d +} + +# Remove more than one space after comments. +s/^# +/# / + +# Define script first line. +1c\ +#!/bin/bash diff --git a/Scripts/centos-art/Functions/Tuneup/Shell/shell.sh b/Scripts/centos-art/Functions/Tuneup/Shell/shell.sh new file mode 100755 index 0000000..da719b2 --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Shell/shell.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# shell.sh -- This function standardizes maintainance tasks for Shell +# script files. +# +# Copyright (C) 2009, 2010, 2011 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 shell { + + # Rebuild top comment inside shell scripts, mainly to update + # copyright information. + shell_doTopComment + +} diff --git a/Scripts/centos-art/Functions/Tuneup/Shell/shell_doTopComment.sh b/Scripts/centos-art/Functions/Tuneup/Shell/shell_doTopComment.sh new file mode 100755 index 0000000..259e948 --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Shell/shell_doTopComment.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# +# shell_doTopComment.sh -- This function standardizes the top comment +# section inside shell scripts (*.sh) using a predefined template. +# +# Copyright (C) 2009, 2010, 2011 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 shell_doTopComment { + + # Define absolute path to template file. + local TEMPLATE="${TUNEUP_CONFIG_DIR}/topcomment.sed" + + # Check template file existence. + cli_checkFiles $TEMPLATE + + # Define file name to template instance. + local INSTANCE=$(cli_getTemporalFile $TEMPLATE) + + # Create template instance. + cp $TEMPLATE $INSTANCE + + # Check template instance. We cannot continue if template instance + # couldn't be created. + cli_checkFiles $INSTANCE + + # Expand translation markers in template instance. + cli_expandTMarkers $INSTANCE + + # Apply template instance to file. + sed -r -i -f $INSTANCE $FILE + + # Remove template instance. + if [[ -f ${INSTANCE} ]];then + rm ${INSTANCE} + fi + +} diff --git a/Scripts/centos-art/Functions/Tuneup/Svg/Config/metadata.sed b/Scripts/centos-art/Functions/Tuneup/Svg/Config/metadata.sed new file mode 100644 index 0000000..199c44d --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Svg/Config/metadata.sed @@ -0,0 +1,64 @@ +# This file is the metadata information used by CentOS Artwork SIG on +# its scalable vector graphics (SVG) files. This files is used with +# the regular expression '.*\.svg$' only. +# --------------------------------------------------- +# $Id$ +# --------------------------------------------------- +/\ + \ + \ + image/svg+xml\ + \ + \ + =TITLE=\ + =DATE=\ + \ + \ + =COPYRIGHT_HOLDER=\ + \ + \ + \ + \ + =COPYRIGHT_HOLDER=\ + \ + \ + \ + \ + =COPYRIGHT_HOLDER=\ + \ + \ + =URL=\ + =URL=\ + =URL=\ + =LOCALE=\ + \ + \ +=KEYWORDS=\ + \ + \ + =COPYRIGHT_HOLDER=\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + diff --git a/Scripts/centos-art/Functions/Tuneup/Svg/svg.sh b/Scripts/centos-art/Functions/Tuneup/Svg/svg.sh new file mode 100755 index 0000000..b3e55d0 --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Svg/svg.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# svg.sh -- This function standardizes maintainance of SVG files. +# +# Copyright (C) 2009, 2010, 2011 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 svg { + + # Update metadata information. + svg_doMetadata + + # Remove all unused items. + svg_doVacuumDefs + +} diff --git a/Scripts/centos-art/Functions/Tuneup/Svg/svg_doMetadata.sh b/Scripts/centos-art/Functions/Tuneup/Svg/svg_doMetadata.sh new file mode 100755 index 0000000..da58c2f --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Svg/svg_doMetadata.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# +# svg_doMetadata.sh -- This function updates metadata values inside +# scalable vector graphic (SVG) files using default values from The +# CentOS Project. +# +# Copyright (C) 2009, 2010, 2011 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 svg_doMetadata { + + # Define template file name. + local TEMPLATE="${TUNEUP_CONFIG_DIR}/metadata.sed" + + # Check template file existence. + cli_checkFiles $TEMPLATE + + # Build title from file path. + local TITLE=$(basename "$FILE") + + # Build url from file path. + local URL=$(echo $FILE | sed 's!/home/centos!https://projects.centos.org/svn!') + + # Build keywords from file path. Do not include filename, it is + # already on title. + local KEY='' + local KEYS=$(dirname "$FILE" | cut -d/ -f6- | tr '/' '\n') + + # Build keywords using SVG standard format. Note that this + # information is inserted inside template file. The template file + # is a replacement set of sed commands so we need to escape the + # new line of each line using one backslash (\). As we are doing + # this inside bash, it is required to escape the backslash with + # another backslash so one of them passes literally to template + # file. + KEYS=$(\ + for KEY in $KEYS;do + echo " $KEY\\" + done) + + # Redefine template instance file name. + local INSTANCE=$(cli_getTemporalFile $TEMPLATE) + + # Create instance. + cp $TEMPLATE $INSTANCE + + # Check template instance. We cannot continue if the template + # instance couldn't be created. + cli_checkFiles $INSTANCE + + # Expand translation markers inside template instance. + sed -r -i \ + -e "s!=TITLE=!$TITLE!" \ + -e "s!=URL=!$URL!" \ + -e "s!=DATE=!$(date "+%Y-%m-%d")!" $INSTANCE + sed -i -r "/=KEYWORDS=/c\\${KEYS}" $INSTANCE + sed -i -r 's/>$/>\\/g' $INSTANCE + cli_expandTMarkers $INSTANCE + + # Update scalable vector graphic using template instance. + sed -i -f $INSTANCE $FILE + + # Remove template instance. + if [[ -f $INSTANCE ]];then + rm $INSTANCE + fi + + # Sanitate scalable vector graphic. + sed -i -r '/^[[:space:]]*$/d' $FILE + +} diff --git a/Scripts/centos-art/Functions/Tuneup/Svg/svg_doVacuumDefs.sh b/Scripts/centos-art/Functions/Tuneup/Svg/svg_doVacuumDefs.sh new file mode 100755 index 0000000..3a4ac2f --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Svg/svg_doVacuumDefs.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# svg_doVacuumDefs.sh -- This function removes all unused items from +# the defs section of the SVG file. +# +# Copyright (C) 2009, 2010, 2011 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 svg_doVacuumDefs { + + # Vacuum unused svg definition using inkscape. + inkscape --vacuum-defs $FILE &> /dev/null + +} diff --git a/Scripts/centos-art/Functions/Tuneup/Xhtml/Config/toc.awk b/Scripts/centos-art/Functions/Tuneup/Xhtml/Config/toc.awk new file mode 100644 index 0000000..69c668f --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Xhtml/Config/toc.awk @@ -0,0 +1,79 @@ +#!/usr/bin/gawk +# +# toc.awk -- This file provides the output format required by +# `xhtml_makeToc' function, inside centos-art.sh script, to produce +# the table of contents correctly. +# +# Copyright (C) 2009-2010 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Pubdtc License as pubdtshed 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 usefdl, but +# WITHOUT ANY WARRANTY; without even the impdted warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Pubdtc License for more details. +# +# You shodld have received a copy of the GNU General Pubdtc License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +BEGIN {FS=":"} + +{ + if ($1 == 0 && $2 == $3) { + opentags = "
" + closetags = "" + } + + if ($1 > 0 && $2 > $3) { + opentags = "
" + closetags = "" + } + + if ($1 > 0 && $2 == $3) { + opentags = "
" + closetags = "" + } + + if ($1 > 0 && $2 < $3) { + opentags = "" + for (i = 1; i <= ($3 - $2); i++) { + opentags = opentags "
" + closetags = "" + } + opentags = opentags "
" + } + + printf "%s%s%s\n",opentags,$4,closetags + +} + +END { + + if ($1 > 0 && $2 >= $3 && $3 > 1) { + for (i = 1; i <= $3; i++) { + print "
" + } + } + + if ($1 > 0 && $2 >= $3 && $3 == 1) { + print "" + print "" + } + + if ($1 > 0 && $2 < $3) { + for (i = 1; i <= $2; i++) { + print "" + } + } + + print "
" +} diff --git a/Scripts/centos-art/Functions/Tuneup/Xhtml/xhtml.sh b/Scripts/centos-art/Functions/Tuneup/Xhtml/xhtml.sh new file mode 100755 index 0000000..201401a --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Xhtml/xhtml.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# xhtml.sh -- This function standardizes maintainance tasks of XHTML +# files. +# +# Copyright (C) 2009, 2010, 2011 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 xhtml { + + # Transforms xhtml headings to make them accessible (e.g., through + # a table of contents). + xhtml_doToc + +} diff --git a/Scripts/centos-art/Functions/Tuneup/Xhtml/xhtml_doToc.sh b/Scripts/centos-art/Functions/Tuneup/Xhtml/xhtml_doToc.sh new file mode 100755 index 0000000..314a310 --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/Xhtml/xhtml_doToc.sh @@ -0,0 +1,160 @@ +#!/bin/bash +# +# xhtml_doToc.sh -- This functionality transforms web page headings to +# make them accessible through a table of contents. The table of +# contents is expanded in place, wherever the
+# piece of code be in the page. Once the
+# piece of code has be expanded, there is no need to put anything else +# in the page. +# +# In order for the tuneup functionality to transform headings, you +# need to put headings in just one line using one of the following +# forms: +# +#

Title

+#

Title

+#

Title

+# +# In the example above, h1 can vary from h1 to h6. Closing tag must be +# present and also match the openning tag. The value of `name' and +# `href' options from the anchor element are set dynamically using the +# md5sum output of combining the page location, the head- string and +# the heading string. +# +# Copyright (C) 2009, 2010, 2011 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 xhtml_doToc { + + # Define variables as local to avoid conflicts outside. + local COUNT=0 + local PREVCOUNT=0 + local -a FINAL + local -a TITLE + local -a MD5SM + local -a OPTNS + local -a CLASS + local -a LEVEL + local -a PARENT + local -a TOCENTRIES + local -a LINK + + # Define table of content configuration file, the file used to + # produce the table of content XHTML output code. + local TOC_CONFIG=${TUNEUP_CONFIG_DIR}/toc.awk + + # Verify table of content configuration file. + cli_checkFiles ${TOC_CONFIG} + + # Define html heading regular expression pattern. Use parenthisis + # to save html action name, action value, and heading title. + local PATTERN='(]>)(.*[^<])' + + # Verify list of html files. Are files really html files? If they + # don't, continue with the next one in the list. + if [[ ! $(file --brief $FILE) =~ '^(XHTML|HTML|XML)' ]];then + continue + fi + + # Define list of headings to process. When building the heading, + # it is required to change spaces characters from its current + # decimal output to something different (e.g., its \040 octal + # alternative). This is required because the space character is + # used as egrep default field separator and spaces can be present + # inside heading strings we don't want to separate. + for HEADING in $(egrep "$PATTERN" $FILE \ + | sed -r -e 's!^[[:space:]]+!!' -e "s! !\\\040!g");do + + # Define previous counter value using current counter + # value as reference. + if [[ $COUNT -ne 0 ]];then + PREVCOUNT=$(($COUNT-1)) + fi + + # Define initial heading information. + FIRST[$COUNT]=$(echo $HEADING | sed -r "s!\\\040! !g") + TITLE[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\4!") + MD5SM[$COUNT]=$(echo "${FILE}${FIRST[$COUNT]}" | md5sum | sed -r 's![[:space:]]+-$!!') + OPTNS[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\3!") + CLASS[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\2!") + LEVEL[$COUNT]=$(echo ${FIRST[$COUNT]} | sed -r "s!$PATTERN!\1!") + PARENT[$COUNT]=${LEVEL[$PREVCOUNT]} + + # Transform heading information using initial heading + # information as reference. + if [[ ${OPTNS[$COUNT]} =~ '^$' ]];then + OPTNS[$COUNT]='' + elif [[ ${OPTNS[$COUNT]} =~ '^$' ]];then + OPTNS[$COUNT]='' + elif [[ ${OPTNS[$COUNT]} =~ '^$' ]];then + OPTNS[$COUNT]='' + fi + + # Build final html heading structure. + FINAL[$COUNT]=''${OPTNS[$COUNT]}${TITLE[$COUNT]}'' + + # Build html heading link structure. These links are used by + # the table of contents later. + LINK[$COUNT]=''${TITLE[$COUNT]}'' + + # Build table of contents entry with numerical + # identifications. The numerical identification is what we use + # to determine the correct position of each heading link on + # the table of content. + TOCENTRIES[$COUNT]="$COUNT:${LEVEL[$COUNT]}:${PARENT[$COUNT]}:${LINK[$COUNT]}" + + # Update heading information inside the current file being + # processed. Use the first and final heading information. + sed -i -r "s!${FIRST[$COUNT]}!${FINAL[$COUNT]}!" $FILE + + # Increase heading counter. + COUNT=$(($COUNT + 1)) + + done + + # Build the table of contents using heading numerical + # identifications as reference. The numerical identification + # describes the order of headings in one xhtml file. This + # information is processed by awk to make the appropriate + # replacements. Finnally, the result is stored in the TOC + # variable. + TOC=$(echo '
' + echo "

`gettext "Table of contents"`

" + for TOCENTRY in "${TOCENTRIES[@]}";do + echo $TOCENTRY + done \ + | awk -f ${TOC_CONFIG}) + + # Update table of contents inside the current file being + # processed. + sed -i -r '/
[^<\/div].*<\/div>/c'"$(echo -e $TOC)" $FILE + + # Clean up variables to receive the next file. + unset FINAL + unset TITLE + unset MD5SM + unset OPTNS + unset CLASS + unset LEVEL + unset PARENT + unset TOCENTRIES + unset LINK + +} diff --git a/Scripts/centos-art/Functions/Tuneup/tuneup.sh b/Scripts/centos-art/Functions/Tuneup/tuneup.sh new file mode 100755 index 0000000..b4a9efb --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/tuneup.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# +# tuneup.sh -- This function standardizes maintainance tasks for files +# inside the repository. Maintainance tasks are applied to files using +# file extension as reference. +# +# Copyright (C) 2009, 2010, 2011 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 tuneup { + + local ACTIONNAM='' + local ACTIONVAL='' + + # Initialize name of rendition backend as an empty value. The name + # of rendition backend is determined automatically based on + # template file extension, later, when files are processed. + local TUNEUP_BACKEND='' + + # Initialize absolute path to backend's base directory, the place + # where backend-specific directories are stored in. + 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. + local TUNEUP_EXTENSIONS='svg xhtml sh' + + # Interpret arguments and options passed through command-line. + tuneup_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" + + # Define action name. No matter what option be passed to + # centos-art, there is only one action to perform (i.e., build the + # list of files and interpretation of file extensions for further + # processing). + ACTIONNAM="tuneup_doBaseActions" + + # Define action value. We use non-option arguments to define the + # action value (ACTIONVAL) variable. + for ACTIONVAL in "$@";do + + # Check action value. Be sure the action value matches the + # convenctions defined for source locations inside the working + # copy. + ACTIONVAL=$(cli_checkRepoDirSource $ACTIONVAL) + + # Syncronize changes between repository and working copy. At + # this point, changes in the repository are merged in the + # working copy and changes in the working copy committed up to + # repository. + cli_syncroRepoChanges + + # Execute action name. + $ACTIONNAM + + # Syncronize changes between repository and working copy. At + # this point, changes in the repository are merged in the + # working copy and changes in the working copy committed up to + # repository. + cli_syncroRepoChanges + + done + +} diff --git a/Scripts/centos-art/Functions/Tuneup/tuneup_doBaseActions.sh b/Scripts/centos-art/Functions/Tuneup/tuneup_doBaseActions.sh new file mode 100755 index 0000000..232ee5c --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/tuneup_doBaseActions.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# +# tuneup_doBaseActions.sh -- This function builds one list of files to +# process for each file extension supported and applies maintainance +# tasks file by file for each one of them. +# +# Copyright (C) 2009, 2010, 2011 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 tuneup_doBaseActions { + + local TUNEUP_CONFIG_DIR='' + local TUNEUP_BACKEND_DIR='' + local TUNEUP_BACKEND_INIT='' + local TUNEUP_EXTENSION='' + local FILE='' + local FILES='' + + # Print separator line. + cli_printMessage '-' --as-separator-line + + # Loop through list of supported file extensions. + for TUNEUP_EXTENSION in ${TUNEUP_EXTENSIONS};do + + # Define backend name based on supported file extensions. + TUNEUP_BACKEND="${TUNEUP_EXTENSION}" + + # Define absolute path to directory where backend-specific + # functionalities are stored in. + TUNEUP_BACKEND_DIR="${TUNEUP_BASEDIR}/$(cli_getRepoName \ + ${TUNEUP_BACKEND} -d)" + + # Define absolute path to backend initialization script. + TUNEUP_BACKEND_INIT="${TUNEUP_BACKEND_DIR}/$(cli_getRepoName ${TUNEUP_BACKEND} -f)" + + # Verify absolute path to backend initialization script. When + # a file extension is provided, but no backend initialization + # script exists for it, continue with the next file extension + # in the list. + if [[ ! -f ${TUNEUP_BACKEND_INIT} ]];then + continue + fi + + # Define absolute path to directory where backend-specific + # configurations are retrived from. + TUNEUP_CONFIG_DIR="${TUNEUP_BACKEND_DIR}/Config" + + # Build list of files to process using action value as + # reference. + FILES=$(cli_getFilesList ${ACTIONVAL} --pattern="${FLAG_FILTER}\.${TUNEUP_EXTENSION}") + + # Verify list of files to process. Assuming no file is found, + # evaluate the next supported file extension. + if [[ $FILES == '' ]];then + continue + fi + + # Export backend-specific functionalities up to the + # execution environment. + cli_exportFunctions "${TUNEUP_BASEDIR}/$(cli_getRepoName \ + ${TUNEUP_BACKEND} -d)" "${TUNEUP_BACKEND}" + + # Execute backend-specific maintainance tasks. + for FILE in $FILES;do + cli_printMessage "$FILE" --as-tuningup-line + ${TUNEUP_BACKEND} + done + + # Unset backend-specific functionalities from execution + # environment. This is required to prevent end up with more + # than one backend-specifc function initialization, in those + # cases when different template files are rendered in just one + # execution of `centos-art.sh' script. + cli_unsetFunctions "${TUNEUP_BASEDIR}/$(cli_getRepoName \ + ${TUNEUP_BACKEND} -d)" "${TUNEUP_BACKEND}" + + done + +} diff --git a/Scripts/centos-art/Functions/Tuneup/tuneup_getOptions.sh b/Scripts/centos-art/Functions/Tuneup/tuneup_getOptions.sh new file mode 100755 index 0000000..38aaf9b --- /dev/null +++ b/Scripts/centos-art/Functions/Tuneup/tuneup_getOptions.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# +# tuneup_getOptions.sh -- This function interprets option parameters +# passed to `tuneup' functionality and calls actions accordingly. +# +# Copyright (C) 2009, 2010, 2011 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 tuneup_getOptions { + + # Define short options we want to support. + local ARGSS="" + + # Define long options we want to support. + local ARGSL="filter:,quiet,answer-yes,dont-commit-changes" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + + case "$1" in + + --filter ) + FLAG_FILTER="$2" + shift 2 + ;; + + --quiet ) + FLAG_QUIET="true" + FLAG_DONT_COMMIT_CHANGES="true" + shift 1 + ;; + + --answer-yes ) + FLAG_ANSWER="true" + shift 1 + ;; + + --dont-commit-changes ) + FLAG_DONT_COMMIT_CHANGES="true" + 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 "$@" + + # Verify non-option arguments passed to command-line. If there + # isn't any, redefine the ARGUMENTS variable to use the current + # location the functionality was called from. + if [[ $ARGUMENTS == '' ]];then + ARGUMENTS=${PWD} + fi + +} diff --git a/Scripts/centos-art/Functions/cli.sh b/Scripts/centos-art/Functions/cli.sh new file mode 100755 index 0000000..e9f1acb --- /dev/null +++ b/Scripts/centos-art/Functions/cli.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# +# cli.sh -- This function initiates centos-art command-line interface. +# Variables defined in this function are accesible by all other +# functions. The cli function is the first script executed by +# centos-art command-line onces invoked. +# +# Copyright (C) 2009, 2010, 2011 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 cli { + + # Initialize global variables. + local CLI_FUNCNAME='' + local CLI_FUNCDIR='' + local CLI_FUNCDIRNAM='' + local CLI_FUNCSCRIPT='' + local ARGUMENTS='' + + # Initialize default value to filter flag. The filter flag + # (--filter) is used mainly to reduce the number of files to + # process. The value of this variable is interpreted as + # egrep-posix regular expression. By default, everything matches. + local FLAG_FILTER='.+' + + # Initialize default value to verbosity flag. The verbosity flag + # (--quiet) controls whether centos-art.sh script prints messages + # or not. By default, all messages are printed out. + local FLAG_QUIET='false' + + # Initialize default value to answer flag. The answer flag + # (--answer-yes) controls whether centos-art.sh script does or + # does not pass confirmation request points. By default, it + # doesn't. + local FLAG_ANSWER='false' + + # Initialize default value to don't commit changes flag. The don't + # commit changes flag (--dont-commit-changes) controls whether + # centos-art.sh script syncronizes changes between the central + # repository and the working copy. By default, it does. + local FLAG_DONT_COMMIT_CHANGES='false' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Define function directory (CLI_FUNCDIR). The directory path where + # functionalities are stored inside the repository. + CLI_FUNCDIR=${CLI_BASEDIR}/Functions + + # Check function name. The function name is critical for + # centos-art.sh script to do something coherent. If it is not + # provided, execute the help functionality and end script + # execution. + if [[ "$1" == '' ]];then + exec ${CLI_BASEDIR}/centos-art.sh help + exit + fi + + # Define function name (CLI_FUNCNAME) variable from first command-line + # argument. As convenction we use the first argument to determine + # the exact name of functionality to call. + CLI_FUNCNAME=$(cli_getRepoName $1 -f) + + # Define function directory. + CLI_FUNCDIRNAM=$(cli_getRepoName $CLI_FUNCNAME -d) + + # Define function file name. + CLI_FUNCSCRIPT=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/${CLI_FUNCNAME}.sh + + # Check function script execution rights. + cli_checkFiles "${CLI_FUNCSCRIPT}" --execution + + # Remove the first argument passed to centos-art.sh command-line + # in order to build optional arguments inside functionalities. We + # start counting from second argument (inclusive) on. + shift 1 + + # Redefine ARGUMENTS using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Define default text editors used by centos-art.sh script. + if [[ ! "$EDITOR" =~ '/usr/bin/(vim|emacs|nano)' ]];then + EDITOR='/usr/bin/vim' + fi + + # Check text editor execution rights. + cli_checkFiles $EDITOR --execution + + # Go for function initialization. Keep the cli_exportFunctions + # function calling after all variables and arguments definitions. + cli_exportFunctions "${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}" + + # Execute function. + eval $CLI_FUNCNAME + +} diff --git a/Scripts/centos-art/Functions/cli_checkFiles.sh b/Scripts/centos-art/Functions/cli_checkFiles.sh new file mode 100755 index 0000000..56df0bb --- /dev/null +++ b/Scripts/centos-art/Functions/cli_checkFiles.sh @@ -0,0 +1,157 @@ +#!/bin/bash +# +# cli_checkFiles.sh -- This function standardizes the way file +# conditional expressions are applied inside centos-art.sh script. +# Here is where we answer questions like: is the file a regular file +# or a directory? or, is it a symbolic link? or even, does it have +# execution rights, etc. If the verification fails somehow at any +# point, an error message is output and centos-art.sh script ends its +# execution. +# +# More than one file can be passed to this function, so we want to +# process them all as specified by the options. Since we are using +# getopt output it is possible to determine where options and +# non-option arguments are in the list of arguments (e.g., options +# are on the left side of ` -- ' and non-options on the rigth side of +# ` -- '). Non-options are the files we want to verify and options how +# we want to verify them. +# +# Another issue to consider, when more than one file is passed to this +# function, is that we cannot shift positional parameters as we +# frequently do whe just one argument is passsed, doing so would +# annulate the validation for the second and later files passed to the +# function. So, in order to provide verification to all files passed +# to the function, the verification loop must be set individual for +# each option in this function. +# +# Assuming no option be passed to the function, a general verification +# is performed to determine whether or not the file exists without +# considering the file type just its existence. +# +# Copyright (C) 2009, 2010, 2011 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 cli_checkFiles { + + # Define short options. + local ARGSS='d,r,h,n,x,w' + + # Define long options. + local ARGSL='directory,regular-file,symbolic-link,execution,versioned,working-copy' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. + local ARGUMENTS='' + + # Initialize file variable as local to avoid conflicts outside + # this function scope. In the file variable will set the file path + # we'r going to verify. + local FILE='' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Define list of files we want to apply verifications to. + local FILES=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') + + # Verify files in the list. It is required at least one. + if [[ $FILES =~ '--$' ]];then + cli_printMessage "You need to provide one file at least." --as-error-line + fi + + # Look for options passed through positional parameters. + while true; do + + case "$1" in + + -d|--directory ) + for FILE in $(echo $FILES);do + if [[ ! -d $FILE ]];then + cli_printMessage "`eval_gettext "The directory \\\"\\\$FILE\\\" does not exist."`" --as-error-line + fi + done + shift 1 + ;; + + -f|--regular-file ) + for FILE in $(echo $FILES);do + if [[ ! -f $FILE ]];then + cli_printMessage "`eval_gettext "The file \\\"\\\$FILE\\\" is not a regular file."`" --as-error-line + fi + done + shift 1 + ;; + + -h|--symbolic-link ) + for FILE in $(echo $FILES);do + if [[ ! -h $FILE ]];then + cli_printMessage "`eval_gettext "The file \\\"\\\$FILE\\\" is not a symbolic link."`" --as-error-line + fi + done + shift 1 + ;; + + -n|--versioned ) + for FILE in $(echo $FILES);do + if [[ $(cli_isVersioned $FILE) == 'false' ]];then + cli_printMessage "`eval_gettext "The path \\\"\\\$FILE\\\" is not versioned."`" --as-error-line + fi + done + shift 1 + ;; + + -x|--execution ) + for FILE in $(echo $FILES);do + if [[ ! -x $FILE ]];then + cli_printMessage "`eval_gettext "The file \\\"\\\$FILE\\\" is not executable."`" --as-error-line + fi + done + shift 1 + ;; + + -w|--working-copy ) + for FILE in $(echo $FILES);do + if [[ ! $FILE =~ "^${CLI_WRKCOPY}/.+$" ]];then + cli_printMessage "`eval_gettext "The path \\\"\\\$FILE\\\" does not exist inside the working copy."`" --as-error-line + fi + done + shift 1 + ;; + + -- ) + for FILE in $(echo $FILES);do + if [[ ! -a $FILE ]];then + cli_printMessage "`eval_gettext "The path \\\"\\\$FILE\\\" does not exist."`" --as-error-line + fi + done + shift 1 + break + ;; + + esac + done + +} diff --git a/Scripts/centos-art/Functions/cli_checkPathComponent.sh b/Scripts/centos-art/Functions/cli_checkPathComponent.sh new file mode 100755 index 0000000..182850a --- /dev/null +++ b/Scripts/centos-art/Functions/cli_checkPathComponent.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# +# cli_checkPathComponent.sh -- This function checks parts/components +# from repository paths. +# +# Copyright (C) 2009, 2010, 2011 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 cli_checkPathComponent { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='release,architecture,motif' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. + local ARGUMENTS='' + + # Initialize file variable as local to avoid conflicts outside + # this function scope. In the file variable will set the file path + # we are going to verify. + local FILE='' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Define list of locations we want to apply verifications to. + local FILES=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') + + # Verify list of locations, it is required that one location be + # present in the list and also be a valid file. + if [[ $FILES == '--' ]];then + cli_printMessage "You need to provide one file at least." --as-error-line + fi + + # Look for options passed through positional parameters. + while true; do + + case "$1" in + + --release ) + for FILE in $(echo $FILES);do + if [[ ! $FILE =~ "^.+/$(cli_getPathComponent --release-pattern)/.*$" ]];then + cli_printMessage "`eval_gettext "The release \\\"\\\$FILE\\\" is not valid."`" --as-error-line + fi + done + shift 2 + break + ;; + + --architecture ) + for FILE in $(echo $FILES);do + if [[ ! $FILE =~ $(cli_getPathComponent --architecture-pattern) ]];then + cli_printMessage "`eval_gettext "The architecture \\\"\\\$FILE\\\" is not valid."`" --as-error-line + fi + done + shift 2 + break + ;; + + --motif ) + for FILE in $(echo $FILES);do + if [[ ! $FILE =~ $(cli_getPathComponent --motif-pattern) ]];then + cli_printMessage "`eval_gettext "The theme \\\"\\\$FILE\\\" is not valid."`" --as-error-line + fi + done + shift 2 + break + ;; + + -- ) + for FILE in $(echo $FILES);do + if [[ $FILE == '' ]] \ + || [[ $FILE =~ '(\.\.(/)?)' ]] \ + || [[ ! $FILE =~ '^[A-Za-z0-9\.:/_-]+$' ]]; then + cli_printMessage "`eval_gettext "The value \\\"\\\$FILE\\\" is not valid."`" --as-error-line + fi + done + shift 2 + break + ;; + + esac + done + +} diff --git a/Scripts/centos-art/Functions/cli_checkRepoDirSource.sh b/Scripts/centos-art/Functions/cli_checkRepoDirSource.sh new file mode 100755 index 0000000..7090848 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_checkRepoDirSource.sh @@ -0,0 +1,102 @@ +#!/bin/bash +# +# cli_checkRepoDirSource.sh -- This function provides input validation +# to repository entries considered as source locations. +# +# Copyright (C) 2009, 2010, 2011 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 cli_checkRepoDirSource { + + + # Define location in order to make this function reusable not just + # for action value variable but whatever value passed as first + # positional argument. + local LOCATION=$1 + + # Verify location. Assuming no location is passed as first + # positional parameter to this function, print an error message + # and stop script execution. + if [[ "$LOCATION" == '' ]];then + cli_printMessage "`gettext "The first positional parameter is required."`" --as-error-line + fi + + # Check action value to be sure strange characters are kept far + # away from path provided. + cli_checkPathComponent $LOCATION + + # Redefine source value to build repository absolute path from + # repository top level on. As we are removing + # /home/centos/artwork/ from all centos-art.sh output (in order to + # save horizontal output space), we need to be sure that all + # strings begining with trunk/..., branches/..., and tags/... use + # the correct absolute path. That is, you can refer trunk's + # entries using both /home/centos/artwork/trunk/... or just + # trunk/..., the /home/centos/artwork/ part is automatically added + # here. + if [[ $LOCATION =~ '^(trunk|branches|tags)' ]];then + LOCATION=${CLI_WRKCOPY}/$LOCATION + fi + + # Re-define source value to build repository absolute path from + # repository relative paths. This let us to pass repository + # relative paths as source value. Passing relative paths as + # source value may save us some typing; specially if we are stood + # a few levels up from the location we want to refer to as source + # value. There is no need to pass the absolute path to it, just + # refere it relatively. + if [[ -d ${LOCATION} ]];then + + # Add directory to the top of the directory stack. + pushd "$LOCATION" > /dev/null + + # Check directory existence inside the repository. + if [[ $(pwd) =~ "^${CLI_WRKCOPY}" ]];then + # Re-define source value using absolute path. + LOCATION=$(pwd) + else + cli_printMessage "`eval_gettext "The location \\\"\\\$LOCATION\\\" is not valid."`" --as-error-line + fi + + # Remove directory from the directory stack. + popd > /dev/null + + elif [[ -f ${LOCATION} ]];then + + # Add directory to the top of the directory stack. + pushd "$(dirname "$LOCATION")" > /dev/null + + # Check directory existence inside the repository. + if [[ $(pwd) =~ "^${CLI_WRKCOPY}" ]];then + # Re-define source value using absolute path. + LOCATION=$(pwd)/$(basename "$LOCATION") + else + cli_printMessage "`eval_gettext "The location \\\"\\\$LOCATION\\\" is not valid."`" --as-error-line + fi + + # Remove directory from the directory stack. + popd > /dev/null + + fi + + # Output sanitated location. + echo $LOCATION + +} diff --git a/Scripts/centos-art/Functions/cli_checkRepoDirTarget.sh b/Scripts/centos-art/Functions/cli_checkRepoDirTarget.sh new file mode 100755 index 0000000..b688c12 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_checkRepoDirTarget.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# +# cli_checkRepoDirTarget.sh -- This function provides input validation +# to repository entries considered as target location. +# +# Copyright (C) 2009, 2010, 2011 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 cli_checkRepoDirTarget { + + local LOCATION="$1" + + # Redefine target value to build repository absolute path from + # repository top level on. As we are removing + # /home/centos/artwork/ from all centos-art.sh output (in order to + # save horizontal output space), we need to be sure that all + # strings begining with trunk/..., branches/..., and tags/... use + # the correct absolute path. That is, you can refer trunk's + # entries using both /home/centos/artwork/trunk/... or just + # trunk/..., the /home/centos/artwork/ part is automatically added + # here. + if [[ $LOCATION =~ '^(trunk|branches|tags)/.+$' ]];then + LOCATION=${CLI_WRKCOPY}/$LOCATION + fi + + # Print target location. + echo $LOCATION + +} diff --git a/Scripts/centos-art/Functions/cli_commitRepoChanges.sh b/Scripts/centos-art/Functions/cli_commitRepoChanges.sh new file mode 100755 index 0000000..e3a7dc9 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_commitRepoChanges.sh @@ -0,0 +1,170 @@ +#!/bin/bash +# +# cli_commitRepoChanges.sh -- This function realizes a subversion +# commit command agains the workgin copy in order to send local +# changes up to central repository. +# +# Copyright (C) 2009, 2010, 2011 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 cli_commitRepoChanges { + + # Verify `--dont-commit-changes' option. + if [[ $FLAG_DONT_COMMIT_CHANGES == 'true' ]];then + return + fi + + local -a FILES + local -a INFO + local -a FILESNUM + local COUNT=0 + local STATUSOUT='' + local PREDICATE='' + local CHNGTOTAL=0 + local LOCATIONS='' + local LOCATION='' + + # Define source location the subversion status action will take + # place on. If arguments are provided use them as srouce location. + # Otherwise use action value as default source location. + if [[ "$@" != '' ]];then + LOCATIONS="$@" + else + LOCATIONS="$ACTIONVAL" + fi + + # 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 versioned + # status. Be sure to keep output files off from this list. + # Remember, output files are not versioned 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. + for LOCATION in $LOCATIONS;do + + # Don't process location outside of version control. + if [[ $(cli_isVersioned $LOCATION) == 'false' ]];then + continue + fi + + # Process location based on its path information. + if [[ $LOCATION =~ '(trunk/Manuals/Tcar-fs|branches/Manuals/Texinfo)' ]];then + STATUSOUT="$(svn status ${LOCATION} | egrep -v '(pdf|txt|xhtml|xml|docbook|bz2)$')\n$STATUSOUT" + elif [[ $LOCATION =~ 'trunk/Manuals' ]];then + STATUSOUT="$(svn status ${LOCATION} | egrep -v '(pdf|txt|xhtml)$')\n$STATUSOUT" + elif [[ $LOCATION =~ 'trunk/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 + + done + + # 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 fo files considered recent modifications from + # working copy up to central repository. + FILES[0]=$(echo "$STATUSOUT" | egrep "^M.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + FILES[1]=$(echo "$STATUSOUT" | egrep "^\?.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + FILES[2]=$(echo "$STATUSOUT" | egrep "^D.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + FILES[3]=$(echo "$STATUSOUT" | egrep "^A.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + + # 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]}" + + # Increase counter. + COUNT=$(($COUNT + 1)) + + done + + # Check total amount of changes and, if any, check differences and + # commit them up to central repository. + if [[ $CHNGTOTAL -gt 0 ]];then + + # Outout separator line. + cli_printMessage '-' --as-separator-line + + # In the very specific case unversioned files, we need to add + # them to the repository first, in order to make them + # available for subversion commands (e.g., `copy') Otherwise, + # if no unversioned file is found, go ahead with change + # differences and committing. Notice that if there is mix of + # changes (e.g., aditions and modifications), addition take + # preference and no other change is considered. In order + # for other changes to be considered, be sure no adition is + # present, or that they have already happened. + if [[ ${FILESNUM[1]} -gt 0 ]];then + + cli_printMessage "`ngettext "The following file is unversioned" \ + "The following files are unversioned" ${FILESNUM[1]}`:" + for FILE in ${FILES[1]};do + cli_printMessage "$FILE" --as-response-line + done + cli_printMessage "`ngettext "Do you want to add it now?" \ + "Do you want to add them now?" ${FILESNUM[1]}`" --as-yesornorequest-line + svn add ${FILES[1]} --quiet + + else + + # Verify changes on locations. + cli_printMessage "`gettext "Do you want to see changes now?"`" --as-yesornorequest-line + svn diff $LOCATIONS | less + + # Commit changes on locations. + cli_printMessage "`gettext "Do you want to commit changes now?"`" --as-yesornorequest-line + svn commit $LOCATIONS + + fi + + fi + +} diff --git a/Scripts/centos-art/Functions/cli_expandTMarkers.sh b/Scripts/centos-art/Functions/cli_expandTMarkers.sh new file mode 100755 index 0000000..1bf6c1d --- /dev/null +++ b/Scripts/centos-art/Functions/cli_expandTMarkers.sh @@ -0,0 +1,175 @@ +#!/bin/bash +# +# cli_expandTMarkers.sh -- This function standardizes +# replacements for common translation markers. Raplacements are +# applied to temporal instances used to produce the final file. +# +# Copyright (C) 2009, 2010, 2011 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 cli_expandTMarkers { + + # Initialize variables. + local -a SRC + local -a DST + local COUNT=0 + local COUNTSRC=0 + local COUNTDST=0 + local LOCATION='' + + # Define source location on which sed replacements take place. + LOCATION="$1" + + # Verify file source location. + cli_checkFiles $LOCATION + + # Define copyright translation markers. + SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR_LAST=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year)" + SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year)" + SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR_LIST=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-year-list)" + SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-holder)" + SRC[((++${#SRC[*]}))]='=COPYRIGHT_HOLDER_PREDICATE=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --copyright-holder-predicate)" + + # Define license translation markers. + SRC[((++${#SRC[*]}))]='=LICENSE=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license)" + SRC[((++${#SRC[*]}))]='=LICENSE_URL=' + DST[((++${#DST[*]}))]="$(cli_printCopyrightInfo --license-url)" + + # Define theme translation markers. + SRC[((++${#SRC[*]}))]='=THEME=' + DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif)" + SRC[((++${#SRC[*]}))]='=THEMENAME=' + DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-name)" + SRC[((++${#SRC[*]}))]='=THEMERELEASE=' + DST[((++${#DST[*]}))]="$(cli_getPathComponent $OUTPUT --motif-release)" + + # Define release-specific translation markers. + SRC[((++${#SRC[*]}))]='=RELEASE=' + DST[((++${#DST[*]}))]="$FLAG_RELEASEVER" + SRC[((++${#SRC[*]}))]='=MAJOR_RELEASE=' + DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f1)" + SRC[((++${#SRC[*]}))]='=MINOR_RELEASE=' + DST[((++${#DST[*]}))]="$(echo $FLAG_RELEASEVER | cut -d'.' -f2)" + + # Define architectures translation markers. + SRC[((++${#SRC[*]}))]='=ARCH=' + DST[((++${#DST[*]}))]="$(cli_getPathComponent $FLAG_BASEARCH --architecture)" + + # Define url translation markers. + SRC[((++${#SRC[*]}))]='=URL=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--home' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_WIKI=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--wiki' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_LISTS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--lists' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_FORUMS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--forums' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_MIRRORS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--mirrors' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_DOCS=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--docs' '--with-locale') + SRC[((++${#SRC[*]}))]='=URL_IRC=' + DST[((++${#DST[*]}))]=$(cli_printUrl '--irc') + + # Define emails translation markers. + SRC[((++${#SRC[*]}))]='=MAIL_DOCS=' + DST[((++${#DST[*]}))]="centos-docs@centos.org" + SRC[((++${#SRC[*]}))]='=MAIL_L10N=' + DST[((++${#DST[*]}))]="centos-l10n@centos.org" + + # Define locale translation markers. + SRC[((++${#SRC[*]}))]='=LOCALE_LL=' + DST[((++${#DST[*]}))]="$(cli_getCurrentLocale '--langcode-only')" + SRC[((++${#SRC[*]}))]='=LOCALE=' + DST[((++${#DST[*]}))]="$(cli_getCurrentLocale)" + + # Define domain translation markers for domains. + SRC[((++${#SRC[*]}))]='=DOMAIN_LL=' + if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then + DST[((++${#DST[*]}))]="$(cli_getCurrentLocale '--langcode-only')." + else + DST[((++${#DST[*]}))]="" + fi + + # Define repository translation markers. + SRC[((++${#SRC[*]}))]='=REPO_TLDIR=' + DST[((++${#DST[*]}))]="$(cli_getRepoTLDir)" + SRC[((++${#SRC[*]}))]='=REPO_HOME=' + DST[((++${#DST[*]}))]="${CLI_WRKCOPY}" + + # Do replacement of nested translation markers. + while [[ $COUNTDST -lt ${#DST[@]} ]];do + + # Verify existence of translation markers. If there is no + # translation marker on replacement, continue with the next + # one in the list. + if [[ ! ${DST[$COUNTDST]} =~ '=[A-Z_]+=' ]];then + # Increment destination counter. + COUNTDST=$(($COUNTDST + 1)) + # The current replacement value doesn't have translation + # marker inside, so skip it and evaluate the next + # replacement value in the list. + continue + fi + + while [[ $COUNTSRC -lt ${#SRC[*]} ]];do + + # Update replacements. + DST[$COUNTDST]=$(echo ${DST[$COUNTDST]} \ + | sed -r "s!${SRC[$COUNTSRC]}!${DST[$COUNTSRC]}!g") + + # Increment source counter. + COUNTSRC=$(($COUNTSRC + 1)) + + done + + # Reset source counter + COUNTSRC=0 + + # Increment destination counter. + COUNTDST=$(($COUNTDST + 1)) + + done + + # Apply replacements for translation markers. + while [[ ${COUNT} -lt ${#SRC[*]} ]];do + + # Use sed to replace translation markers inside the design + # model instance. + sed -r -i "s!${SRC[$COUNT]}!${DST[$COUNT]}!g" ${LOCATION} + + # Increment counter. + COUNT=$(($COUNT + 1)) + + done + + # Unset specific translation markers and specific replacement + # variables in order to clean them up. Otherwise, undesired values + # may ramain from one file to another. + unset SRC + unset DST + +} diff --git a/Scripts/centos-art/Functions/cli_exportFunctions.sh b/Scripts/centos-art/Functions/cli_exportFunctions.sh new file mode 100755 index 0000000..2a85602 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_exportFunctions.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# cli_exportFunctions.sh -- This function exports funtionalities to +# `centos-art.sh' script execution evironment. +# +# Copyright (C) 2009, 2010, 2011 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 cli_exportFunctions { + + # Define source location where function files are placed in. + local LOCATION=$1 + + # Define suffix used to retrive function files. + local SUFFIX=$2 + + # Verify suffix value used to retrive function files. Assuming no + # suffix value is passed as second argument to this function, use + # the function name value (CLI_FUNCNAME) as default value. + if [[ $SUFFIX == '' ]];then + SUFFIX=$CLI_FUNCNAME + fi + + # Define pattern used to retrive function names from function + # files. + local PATTERN="^function[[:space:]]+${SUFFIX}[[:alnum:]_]*[[:space:]]+{$" + + # Define list of files. + local FUNCFILE='' + local FUNCFILES=$(cli_getFilesList ${LOCATION} --pattern="${SUFFIX}.*\.sh" --maxdepth="1") + + # Verify list of files. If no function file exists for the + # location specified stop the script execution. Otherwise the + # script will surely try to execute a function that haven't been + # exported yet and report an error about it. + if [[ $FUNCFILES == '' ]];then + cli_printMessage "`gettext "No function file was found for this action."`" --as-error-line + fi + + # Process list of files. + for FUNCFILE in $FUNCFILES;do + + # Verify file execution rights. + cli_checkFiles $FUNCFILE --execution + + # Initialize file. + . $FUNCFILE + + # Export function names inside the file to current shell + # script environment. + export -f $(egrep "${PATTERN}" ${FUNCFILE} | gawk '{ print $2 }') + + done + +} diff --git a/Scripts/centos-art/Functions/cli_getConfigLines.sh b/Scripts/centos-art/Functions/cli_getConfigLines.sh new file mode 100755 index 0000000..248d4cf --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getConfigLines.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# +# cli_getConfigLines.sh -- This function retrives configuration lines +# form configuration files. As arguments, the configuration file +# absolute path, the configuration section name, and the configuration +# variable name must be provided. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getConfigLines { + + # Initialize absolute path to configuration file. + local CONFIG_ABSPATH="$1" + + # Verify absolute path to configuration file. + cli_checkFiles ${CONFIG_ABSPATH} + + # Initialize configuration section name where the variable value + # we want to to retrive is set in. + local CONFIG_SECTION="$2" + + # Initialize variable name we want to retrive value from. + local CONFIG_VARNAME="$3" + + # Verify configuration variable name. When no variable name is + # provided print all configuration lines that can be considered + # as well-formed paths. Be sure configuration variable name starts + # just at the begining of the line. + if [[ ! $CONFIG_VARNAME =~ '^[[:alnum:]_./-]+$' ]];then + CONFIG_VARNAME='[[:alnum:]_./-]+=' + fi + + # Retrive configuration lines from configuration file. + local CONFIG_LINES=$(cat ${CONFIG_ABSPATH} \ + | egrep -v '^#' \ + | egrep -v '^[[:space:]]*$' \ + | sed -r 's![[:space:]]*!!g' \ + | sed -r -n "/^\[${CONFIG_SECTION}\]$/,/^\[/p" \ + | egrep -v '^\[' | sort | uniq \ + | egrep "^${CONFIG_VARNAME}") + + # Output value related to variable name. + echo "$CONFIG_LINES" + +} diff --git a/Scripts/centos-art/Functions/cli_getConfigValue.sh b/Scripts/centos-art/Functions/cli_getConfigValue.sh new file mode 100755 index 0000000..4b54ec6 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getConfigValue.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# cli_getConfigValue.sh -- This function retrives configuration values +# from configuration files. As arguments, the configuration file +# absolute path, the configuration section name, and the configuration +# variable name must be provided. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getConfigValue { + + # Initialize absolute path to configuration file. + local CONFIG_ABSPATH="$1" + + # Initialize configuration section name where the variable value + # we want to to retrive is set in. + local CONFIG_SECTION="$2" + + # Initialize variable name we want to retrive value from. + local CONFIG_VARNAME="$3" + + # Retrive configuration lines from configuration file. + local CONFIG_LINES=$(cli_getConfigLines \ + "$CONFIG_ABSPATH" "$CONFIG_SECTION" "$CONFIG_VARNAME") + + # Parse configuration lines to retrive the values of variable + # names. + local CONFIG_VARVALUE=$(echo $CONFIG_LINES \ + | gawk 'BEGIN { FS="=" } { print $2 }' \ + | sed -r 's/^"(.*)"$/\1/') + + # Output values related to variable name. + echo "$CONFIG_VARVALUE" + +} diff --git a/Scripts/centos-art/Functions/cli_getCountryCodes.sh b/Scripts/centos-art/Functions/cli_getCountryCodes.sh new file mode 100755 index 0000000..a521486 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getCountryCodes.sh @@ -0,0 +1,276 @@ +#!/bin/bash +# +# cli_getCountryCodes.sh -- This function outputs a list with country +# codes as defined in ISO3166 standard. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getCountryCodes { + + local FILTER="$(echo $1 | cut -d_ -f2)" + + COUNTRYCODES='AD + AE + AF + AG + AI + AL + AM + AN + AO + AQ + AR + AS + AT + AU + AW + AZ + BA + BB + BD + BE + BF + BG + BH + BI + BJ + BM + BN + BO + BR + BS + BT + BV + BW + BY + BZ + CA + CC + CD + CF + CG + CH + CI + CK + CL + CM + CN + CO + CR + CS + CU + CV + CX + CY + CZ + DE + DJ + DK + DM + DO + DZ + EC + EE + EG + EH + ER + ES + ET + FI + FJ + FK + FM + FO + FR + GA + GB + GD + GE + GF + GH + GI + GL + GM + GN + GP + GQ + GR + GS + GT + GU + GW + GY + HK + HM + HN + HR + HT + HU + ID + IE + IL + IN + IO + IQ + IR + IS + IT + JM + JO + JP + KE + KG + KH + KI + KM + KN + KP + KR + KW + KY + KZ + LA + LB + LC + LI + LK + LR + LS + LT + LU + LV + LY + MA + MC + MD + MG + MH + MK + ML + MM + MN + MO + MP + MQ + MR + MS + MT + MU + MV + MW + MX + MY + MZ + NA + NC + NE + NF + NG + NI + NL + NO + NP + NR + NU + NZ + OM + PA + PE + PF + PG + PH + PK + PL + PM + PN + PR + PS + PT + PW + PY + QA + RE + RO + RU + RW + SA + SB + SC + SD + SE + SG + SH + SI + SJ + SK + SL + SM + SN + SO + SR + ST + SV + SY + SZ + TC + TD + TF + TG + TH + TJ + TK + TL + TM + TN + TO + TR + TT + TV + TW + TZ + UA + UG + UM + US + UY + UZ + VA + VC + VE + VG + VI + VN + VU + WF + WS + YE + YT + ZA + ZM + ZW' + + if [[ $FILTER != '' ]];then + echo $COUNTRYCODES | egrep "$FILTER" + else + echo "$COUNTRYCODES" + fi + +} diff --git a/Scripts/centos-art/Functions/cli_getCountryName.sh b/Scripts/centos-art/Functions/cli_getCountryName.sh new file mode 100755 index 0000000..0db8776 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getCountryName.sh @@ -0,0 +1,758 @@ +#!/bin/bash +# +# cli_getCountryName.sh -- This function reads one language locale +# code in the format LL_CC and outputs the name of its related +# country. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getCountryName { + + local LOCALECODE="$(echo $1 | cut -d_ -f2)" + local COUNTRYNAME="" + + case $LOCALECODE in + + 'AD' ) + COUNTRYNAME="`gettext "Andorra"`" + ;; + 'AE' ) + COUNTRYNAME="`gettext "United Arab Emirates"`" + ;; + 'AF' ) + COUNTRYNAME="`gettext "Afghanistan"`" + ;; + 'AG' ) + COUNTRYNAME="`gettext "Antigua and Barbuda"`" + ;; + 'AI' ) + COUNTRYNAME="`gettext "Anguilla"`" + ;; + 'AL' ) + COUNTRYNAME="`gettext "Albania"`" + ;; + 'AM' ) + COUNTRYNAME="`gettext "Armenia"`" + ;; + 'AN' ) + COUNTRYNAME="`gettext "Netherlands Antilles"`" + ;; + 'AO' ) + COUNTRYNAME="`gettext "Angola"`" + ;; + 'AQ' ) + COUNTRYNAME="`gettext "Antarctica"`" + ;; + 'AR' ) + COUNTRYNAME="`gettext "Argentina"`" + ;; + 'AS' ) + COUNTRYNAME="`gettext "Samoa (American)"`" + ;; + 'AT' ) + COUNTRYNAME="`gettext "Austria"`" + ;; + 'AU' ) + COUNTRYNAME="`gettext "Australia"`" + ;; + 'AW' ) + COUNTRYNAME="`gettext "Aruba"`" + ;; + 'AZ' ) + COUNTRYNAME="`gettext "Azerbaijan"`" + ;; + 'BA' ) + COUNTRYNAME="`gettext "Bosnia and Herzegovina"`" + ;; + 'BB' ) + COUNTRYNAME="`gettext "Barbados"`" + ;; + 'BD' ) + COUNTRYNAME="`gettext "Bangladesh"`" + ;; + 'BE' ) + COUNTRYNAME="`gettext "Belgium"`" + ;; + 'BF' ) + COUNTRYNAME="`gettext "Burkina Faso"`" + ;; + 'BG' ) + COUNTRYNAME="`gettext "Bulgaria"`" + ;; + 'BH' ) + COUNTRYNAME="`gettext "Bahrain"`" + ;; + 'BI' ) + COUNTRYNAME="`gettext "Burundi"`" + ;; + 'BJ' ) + COUNTRYNAME="`gettext "Benin"`" + ;; + 'BM' ) + COUNTRYNAME="`gettext "Bermuda"`" + ;; + 'BN' ) + COUNTRYNAME="`gettext "Brunei"`" + ;; + 'BO' ) + COUNTRYNAME="`gettext "Bolivia"`" + ;; + 'BR' ) + COUNTRYNAME="`gettext "Brazil"`" + ;; + 'BS' ) + COUNTRYNAME="`gettext "Bahamas"`" + ;; + 'BT' ) + COUNTRYNAME="`gettext "Bhutan"`" + ;; + 'BV' ) + COUNTRYNAME="`gettext "Bouvet Island"`" + ;; + 'BW' ) + COUNTRYNAME="`gettext "Botswana"`" + ;; + 'BY' ) + COUNTRYNAME="`gettext "Belarus"`" + ;; + 'BZ' ) + COUNTRYNAME="`gettext "Belize"`" + ;; + 'CA' ) + COUNTRYNAME="`gettext "Canada"`" + ;; + 'CC' ) + COUNTRYNAME="`gettext "Cocos (Keeling) Islands"`" + ;; + 'CD' ) + COUNTRYNAME="`gettext "Congo (Dem. Rep.)"`" + ;; + 'CF' ) + COUNTRYNAME="`gettext "Central African Rep."`" + ;; + 'CG' ) + COUNTRYNAME="`gettext "Congo (Rep.)"`" + ;; + 'CH' ) + COUNTRYNAME="`gettext "Switzerland"`" + ;; + 'CI' ) + COUNTRYNAME="`gettext "Co^te d'Ivoire"`" + ;; + 'CK' ) + COUNTRYNAME="`gettext "Cook Islands"`" + ;; + 'CL' ) + COUNTRYNAME="`gettext "Chile"`" + ;; + 'CM' ) + COUNTRYNAME="`gettext "Cameroon"`" + ;; + 'CN' ) + COUNTRYNAME="`gettext "China"`" + ;; + 'CO' ) + COUNTRYNAME="`gettext "Colombia"`" + ;; + 'CR' ) + COUNTRYNAME="`gettext "Costa Rica"`" + ;; + 'CS' ) + COUNTRYNAME="`gettext "Serbia and Montenegro"`" + ;; + 'CU' ) + COUNTRYNAME="`gettext "Cuba"`" + ;; + 'CV' ) + COUNTRYNAME="`gettext "Cape Verde"`" + ;; + 'CX' ) + COUNTRYNAME="`gettext "Christmas Island"`" + ;; + 'CY' ) + COUNTRYNAME="`gettext "Cyprus"`" + ;; + 'CZ' ) + COUNTRYNAME="`gettext "Czech Republic"`" + ;; + 'DE' ) + COUNTRYNAME="`gettext "Germany"`" + ;; + 'DJ' ) + COUNTRYNAME="`gettext "Djibouti"`" + ;; + 'DK' ) + COUNTRYNAME="`gettext "Denmark"`" + ;; + 'DM' ) + COUNTRYNAME="`gettext "Dominica"`" + ;; + 'DO' ) + COUNTRYNAME="`gettext "Dominican Republic"`" + ;; + 'DZ' ) + COUNTRYNAME="`gettext "Algeria"`" + ;; + 'EC' ) + COUNTRYNAME="`gettext "Ecuador"`" + ;; + 'EE' ) + COUNTRYNAME="`gettext "Estonia"`" + ;; + 'EG' ) + COUNTRYNAME="`gettext "Egypt"`" + ;; + 'EH' ) + COUNTRYNAME="`gettext "Western Sahara"`" + ;; + 'ER' ) + COUNTRYNAME="`gettext "Eritrea"`" + ;; + 'ES' ) + COUNTRYNAME="`gettext "Spain"`" + ;; + 'ET' ) + COUNTRYNAME="`gettext "Ethiopia"`" + ;; + 'FI' ) + COUNTRYNAME="`gettext "Finland"`" + ;; + 'FJ' ) + COUNTRYNAME="`gettext "Fiji"`" + ;; + 'FK' ) + COUNTRYNAME="`gettext "Falkland Islands"`" + ;; + 'FM' ) + COUNTRYNAME="`gettext "Micronesia"`" + ;; + 'FO' ) + COUNTRYNAME="`gettext "Faeroe Islands"`" + ;; + 'FR' ) + COUNTRYNAME="`gettext "France"`" + ;; + 'GA' ) + COUNTRYNAME="`gettext "Gabon"`" + ;; + 'GB' ) + COUNTRYNAME="`gettext "Britain (UK)"`" + ;; + 'GD' ) + COUNTRYNAME="`gettext "Grenada"`" + ;; + 'GE' ) + COUNTRYNAME="`gettext "Georgia"`" + ;; + 'GF' ) + COUNTRYNAME="`gettext "French Guiana"`" + ;; + 'GH' ) + COUNTRYNAME="`gettext "Ghana"`" + ;; + 'GI' ) + COUNTRYNAME="`gettext "Gibraltar"`" + ;; + 'GL' ) + COUNTRYNAME="`gettext "Greenland"`" + ;; + 'GM' ) + COUNTRYNAME="`gettext "Gambia"`" + ;; + 'GN' ) + COUNTRYNAME="`gettext "Guinea"`" + ;; + 'GP' ) + COUNTRYNAME="`gettext "Guadeloupe"`" + ;; + 'GQ' ) + COUNTRYNAME="`gettext "Equatorial Guinea"`" + ;; + 'GR' ) + COUNTRYNAME="`gettext "Greece"`" + ;; + 'GS' ) + COUNTRYNAME="`gettext "South Georgia and the South Sandwich Islands"`" + ;; + 'GT' ) + COUNTRYNAME="`gettext "Guatemala"`" + ;; + 'GU' ) + COUNTRYNAME="`gettext "Guam"`" + ;; + 'GW' ) + COUNTRYNAME="`gettext "Guinea-Bissau"`" + ;; + 'GY' ) + COUNTRYNAME="`gettext "Guyana"`" + ;; + 'HK' ) + COUNTRYNAME="`gettext "Hong Kong"`" + ;; + 'HM' ) + COUNTRYNAME="`gettext "Heard Island and McDonald Islands"`" + ;; + 'HN' ) + COUNTRYNAME="`gettext "Honduras"`" + ;; + 'HR' ) + COUNTRYNAME="`gettext "Croatia"`" + ;; + 'HT' ) + COUNTRYNAME="`gettext "Haiti"`" + ;; + 'HU' ) + COUNTRYNAME="`gettext "Hungary"`" + ;; + 'ID' ) + COUNTRYNAME="`gettext "Indonesia"`" + ;; + 'IE' ) + COUNTRYNAME="`gettext "Ireland"`" + ;; + 'IL' ) + COUNTRYNAME="`gettext "Israel"`" + ;; + 'IN' ) + COUNTRYNAME="`gettext "India"`" + ;; + 'IO' ) + COUNTRYNAME="`gettext "British Indian Ocean Territory"`" + ;; + 'IQ' ) + COUNTRYNAME="`gettext "Iraq"`" + ;; + 'IR' ) + COUNTRYNAME="`gettext "Iran"`" + ;; + 'IS' ) + COUNTRYNAME="`gettext "Iceland"`" + ;; + 'IT' ) + COUNTRYNAME="`gettext "Italy"`" + ;; + 'JM' ) + COUNTRYNAME="`gettext "Jamaica"`" + ;; + 'JO' ) + COUNTRYNAME="`gettext "Jordan"`" + ;; + 'JP' ) + COUNTRYNAME="`gettext "Japan"`" + ;; + 'KE' ) + COUNTRYNAME="`gettext "Kenya"`" + ;; + 'KG' ) + COUNTRYNAME="`gettext "Kyrgyzstan"`" + ;; + 'KH' ) + COUNTRYNAME="`gettext "Cambodia"`" + ;; + 'KI' ) + COUNTRYNAME="`gettext "Kiribati"`" + ;; + 'KM' ) + COUNTRYNAME="`gettext "Comoros"`" + ;; + 'KN' ) + COUNTRYNAME="`gettext "St Kitts and Nevis"`" + ;; + 'KP' ) + COUNTRYNAME="`gettext "Korea (North)"`" + ;; + 'KR' ) + COUNTRYNAME="`gettext "Korea (South)"`" + ;; + 'KW' ) + COUNTRYNAME="`gettext "Kuwait"`" + ;; + 'KY' ) + COUNTRYNAME="`gettext "Cayman Islands"`" + ;; + 'KZ' ) + COUNTRYNAME="`gettext "Kazakhstan"`" + ;; + 'LA' ) + COUNTRYNAME="`gettext "Laos"`" + ;; + 'LB' ) + COUNTRYNAME="`gettext "Lebanon"`" + ;; + 'LC' ) + COUNTRYNAME="`gettext "St Lucia"`" + ;; + 'LI' ) + COUNTRYNAME="`gettext "Liechtenstein"`" + ;; + 'LK' ) + COUNTRYNAME="`gettext "Sri Lanka"`" + ;; + 'LR' ) + COUNTRYNAME="`gettext "Liberia"`" + ;; + 'LS' ) + COUNTRYNAME="`gettext "Lesotho"`" + ;; + 'LT' ) + COUNTRYNAME="`gettext "Lithuania"`" + ;; + 'LU' ) + COUNTRYNAME="`gettext "Luxembourg"`" + ;; + 'LV' ) + COUNTRYNAME="`gettext "Latvia"`" + ;; + 'LY' ) + COUNTRYNAME="`gettext "Libya"`" + ;; + 'MA' ) + COUNTRYNAME="`gettext "Morocco"`" + ;; + 'MC' ) + COUNTRYNAME="`gettext "Monaco"`" + ;; + 'MD' ) + COUNTRYNAME="`gettext "Moldova"`" + ;; + 'MG' ) + COUNTRYNAME="`gettext "Madagascar"`" + ;; + 'MH' ) + COUNTRYNAME="`gettext "Marshall Islands"`" + ;; + 'MK' ) + COUNTRYNAME="`gettext "Macedonia"`" + ;; + 'ML' ) + COUNTRYNAME="`gettext "Mali"`" + ;; + 'MM' ) + COUNTRYNAME="`gettext "Myanmar (Burma)"`" + ;; + 'MN' ) + COUNTRYNAME="`gettext "Mongolia"`" + ;; + 'MO' ) + COUNTRYNAME="`gettext "Macao"`" + ;; + 'MP' ) + COUNTRYNAME="`gettext "Northern Mariana Islands"`" + ;; + 'MQ' ) + COUNTRYNAME="`gettext "Martinique"`" + ;; + 'MR' ) + COUNTRYNAME="`gettext "Mauritania"`" + ;; + 'MS' ) + COUNTRYNAME="`gettext "Montserrat"`" + ;; + 'MT' ) + COUNTRYNAME="`gettext "Malta"`" + ;; + 'MU' ) + COUNTRYNAME="`gettext "Mauritius"`" + ;; + 'MV' ) + COUNTRYNAME="`gettext "Maldives"`" + ;; + 'MW' ) + COUNTRYNAME="`gettext "Malawi"`" + ;; + 'MX' ) + COUNTRYNAME="`gettext "Mexico"`" + ;; + 'MY' ) + COUNTRYNAME="`gettext "Malaysia"`" + ;; + 'MZ' ) + COUNTRYNAME="`gettext "Mozambique"`" + ;; + 'NA' ) + COUNTRYNAME="`gettext "Namibia"`" + ;; + 'NC' ) + COUNTRYNAME="`gettext "New Caledonia"`" + ;; + 'NE' ) + COUNTRYNAME="`gettext "Niger"`" + ;; + 'NF' ) + COUNTRYNAME="`gettext "Norfolk Island"`" + ;; + 'NG' ) + COUNTRYNAME="`gettext "Nigeria"`" + ;; + 'NI' ) + COUNTRYNAME="`gettext "Nicaragua"`" + ;; + 'NL' ) + COUNTRYNAME="`gettext "Netherlands"`" + ;; + 'NO' ) + COUNTRYNAME="`gettext "Norway"`" + ;; + 'NP' ) + COUNTRYNAME="`gettext "Nepal"`" + ;; + 'NR' ) + COUNTRYNAME="`gettext "Nauru"`" + ;; + 'NU' ) + COUNTRYNAME="`gettext "Niue"`" + ;; + 'NZ' ) + COUNTRYNAME="`gettext "New Zealand"`" + ;; + 'OM' ) + COUNTRYNAME="`gettext "Oman"`" + ;; + 'PA' ) + COUNTRYNAME="`gettext "Panama"`" + ;; + 'PE' ) + COUNTRYNAME="`gettext "Peru"`" + ;; + 'PF' ) + COUNTRYNAME="`gettext "French Polynesia"`" + ;; + 'PG' ) + COUNTRYNAME="`gettext "Papua New Guinea"`" + ;; + 'PH' ) + COUNTRYNAME="`gettext "Philippines"`" + ;; + 'PK' ) + COUNTRYNAME="`gettext "Pakistan"`" + ;; + 'PL' ) + COUNTRYNAME="`gettext "Poland"`" + ;; + 'PM' ) + COUNTRYNAME="`gettext "St Pierre and Miquelon"`" + ;; + 'PN' ) + COUNTRYNAME="`gettext "Pitcairn"`" + ;; + 'PR' ) + COUNTRYNAME="`gettext "Puerto Rico"`" + ;; + 'PS' ) + COUNTRYNAME="`gettext "Palestine"`" + ;; + 'PT' ) + COUNTRYNAME="`gettext "Portugal"`" + ;; + 'PW' ) + COUNTRYNAME="`gettext "Palau"`" + ;; + 'PY' ) + COUNTRYNAME="`gettext "Paraguay"`" + ;; + 'QA' ) + COUNTRYNAME="`gettext "Qatar"`" + ;; + 'RE' ) + COUNTRYNAME="`gettext "Reunion"`" + ;; + 'RO' ) + COUNTRYNAME="`gettext "Romania"`" + ;; + 'RU' ) + COUNTRYNAME="`gettext "Russia"`" + ;; + 'RW' ) + COUNTRYNAME="`gettext "Rwanda"`" + ;; + 'SA' ) + COUNTRYNAME="`gettext "Saudi Arabia"`" + ;; + 'SB' ) + COUNTRYNAME="`gettext "Solomon Islands"`" + ;; + 'SC' ) + COUNTRYNAME="`gettext "Seychelles"`" + ;; + 'SD' ) + COUNTRYNAME="`gettext "Sudan"`" + ;; + 'SE' ) + COUNTRYNAME="`gettext "Sweden"`" + ;; + 'SG' ) + COUNTRYNAME="`gettext "Singapore"`" + ;; + 'SH' ) + COUNTRYNAME="`gettext "St Helena"`" + ;; + 'SI' ) + COUNTRYNAME="`gettext "Slovenia"`" + ;; + 'SJ' ) + COUNTRYNAME="`gettext "Svalbard and Jan Mayen"`" + ;; + 'SK' ) + COUNTRYNAME="`gettext "Slovakia"`" + ;; + 'SL' ) + COUNTRYNAME="`gettext "Sierra Leone"`" + ;; + 'SM' ) + COUNTRYNAME="`gettext "San Marino"`" + ;; + 'SN' ) + COUNTRYNAME="`gettext "Senegal"`" + ;; + 'SO' ) + COUNTRYNAME="`gettext "Somalia"`" + ;; + 'SR' ) + COUNTRYNAME="`gettext "Suriname"`" + ;; + 'ST' ) + COUNTRYNAME="`gettext "Sao Tome and Principe"`" + ;; + 'SV' ) + COUNTRYNAME="`gettext "El Salvador"`" + ;; + 'SY' ) + COUNTRYNAME="`gettext "Syria"`" + ;; + 'SZ' ) + COUNTRYNAME="`gettext "Swaziland"`" + ;; + 'TC' ) + COUNTRYNAME="`gettext "Turks and Caicos Islands"`" + ;; + 'TD' ) + COUNTRYNAME="`gettext "Chad"`" + ;; + 'TF' ) + COUNTRYNAME="`gettext "French Southern and Antarctic Lands"`" + ;; + 'TG' ) + COUNTRYNAME="`gettext "Togo"`" + ;; + 'TH' ) + COUNTRYNAME="`gettext "Thailand"`" + ;; + 'TJ' ) + COUNTRYNAME="`gettext "Tajikistan"`" + ;; + 'TK' ) + COUNTRYNAME="`gettext "Tokelau"`" + ;; + 'TL' ) + COUNTRYNAME="`gettext "Timor-Leste"`" + ;; + 'TM' ) + COUNTRYNAME="`gettext "Turkmenistan"`" + ;; + 'TN' ) + COUNTRYNAME="`gettext "Tunisia"`" + ;; + 'TO' ) + COUNTRYNAME="`gettext "Tonga"`" + ;; + 'TR' ) + COUNTRYNAME="`gettext "Turkey"`" + ;; + 'TT' ) + COUNTRYNAME="`gettext "Trinidad and Tobago"`" + ;; + 'TV' ) + COUNTRYNAME="`gettext "Tuvalu"`" + ;; + 'TW' ) + COUNTRYNAME="`gettext "Taiwan"`" + ;; + 'TZ' ) + COUNTRYNAME="`gettext "Tanzania"`" + ;; + 'UA' ) + COUNTRYNAME="`gettext "Ukraine"`" + ;; + 'UG' ) + COUNTRYNAME="`gettext "Uganda"`" + ;; + 'UM' ) + COUNTRYNAME="`gettext "US minor outlying islands"`" + ;; + 'US' ) + COUNTRYNAME="`gettext "United States"`" + ;; + 'UY' ) + COUNTRYNAME="`gettext "Uruguay"`" + ;; + 'UZ' ) + COUNTRYNAME="`gettext "Uzbekistan"`" + ;; + 'VA' ) + COUNTRYNAME="`gettext "Vatican City"`" + ;; + 'VC' ) + COUNTRYNAME="`gettext "St Vincent"`" + ;; + 'VE' ) + COUNTRYNAME="`gettext "Venezuela"`" + ;; + 'VG' ) + COUNTRYNAME="`gettext "Virgin Islands (UK)"`" + ;; + 'VI' ) + COUNTRYNAME="`gettext "Virgin Islands (US)"`" + ;; + 'VN' ) + COUNTRYNAME="`gettext "Vietnam"`" + ;; + 'VU' ) + COUNTRYNAME="`gettext "Vanuatu"`" + ;; + 'WF' ) + COUNTRYNAME="`gettext "Wallis and Futuna"`" + ;; + 'WS' ) + COUNTRYNAME="`gettext "Samoa (Western)"`" + ;; + 'YE' ) + COUNTRYNAME="`gettext "Yemen"`" + ;; + 'YT' ) + COUNTRYNAME="`gettext "Mayotte"`" + ;; + 'ZA' ) + COUNTRYNAME="`gettext "South Africa"`" + ;; + 'ZM' ) + COUNTRYNAME="`gettext "Zambia"`" + ;; + 'ZW' ) + COUNTRYNAME="`gettext "Zimbabwe"`" + ;; + * ) + COUNTRYNAME="`gettext "Unknown"`" + + esac + + echo $COUNTRYNAME + +} diff --git a/Scripts/centos-art/Functions/cli_getCurrentLocale.sh b/Scripts/centos-art/Functions/cli_getCurrentLocale.sh new file mode 100755 index 0000000..9181c59 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getCurrentLocale.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# cli_getCurrentLocale.sh -- This function checks LANG environment +# variable and returns the current locale information in the LL_CC +# format. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getCurrentLocale { + + local CURRENTLOCALE='' + local OPTION="$1" + + # Redefine current locale using LL_CC format. + CURRENTLOCALE=$(echo $LANG | sed -r 's!(^[a-z]{2,3}_[A-Z]{2}).+$!\1!') + + # Define centos-art.sh script default current locale. If + # centos-art.sh script doesn't support current system locale, use + # English language from United States as default current locale. + if [[ $CURRENTLOCALE == '' ]];then + CURRENTLOCALE='en_US' + fi + + # Output current locale. + case $OPTION in + + '--langcode-only' ) + echo "${CURRENTLOCALE}" | cut -d_ -f1 + ;; + + '--langcode-and-countrycode'| * ) + echo "${CURRENTLOCALE}" + ;; + esac +} diff --git a/Scripts/centos-art/Functions/cli_getFilesList.sh b/Scripts/centos-art/Functions/cli_getFilesList.sh new file mode 100755 index 0000000..5b9ff22 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getFilesList.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# +# cli_getFilesList.sh -- This function outputs the list of files to +# process. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getFilesList { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='pattern:,mindepth:,maxdepth:,type:,uid:' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. + local ARGUMENTS='' + + # Initialize pattern used to reduce the find output. + local PATTERN="$FLAG_FILTER" + + # Initialize options used with find command. + local OPTIONS='' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + while true;do + case "$1" in + + --pattern ) + PATTERN="$2" + shift 2 + ;; + + --maxdepth ) + OPTIONS="$OPTIONS -maxdepth $2" + shift 2 + ;; + + --mindepth ) + OPTIONS="$OPTIONS -mindepth $2" + shift 2 + ;; + + --type ) + OPTIONS="$OPTIONS -type $2" + shift 2 + ;; + + --uid ) + OPTIONS="$OPTIONS -uid $2" + shift 2 + ;; + + -- ) + shift 1 + break + ;; + esac + done + + # At this point all options arguments have been processed and + # removed from positional parameters. Only non-option arguments + # remain so we use them as source location for find command to + # look files for. + local LOCATIONS="$@" + + # Verify locations. + cli_checkFiles ${LOCATIONS} + + # Redefine pattern as regular expression. When we use regular + # expressions with find, regular expressions are evaluated against + # the whole file path. This way, when the regular expression is + # specified, we need to build it in a way that matches the whole + # path. Doing so, everytime we pass the `--filter' option in the + # command-line could be a tedious task. Instead, in the sake of + # reducing some typing, we prepare the regular expression here to + # match the whole path using the regular expression provided by + # the user as pattern. Do not use LOCATION variable as part of + # regular expresion so it could be possible to use path expansion. + # Using path expansion reduce the amount of places to find out + # things and so the time required to finish the task. + PATTERN="^.*(/)?${PATTERN}$" + + # Define list of files to process. At this point we cannot verify + # whether the LOCATION is a directory or a file since path + # expansion coul be introduced to it. The best we can do is + # verifying exit status and go on. + find ${LOCATIONS} -regextype posix-egrep ${OPTIONS} -regex "${PATTERN}" | sort | uniq + +} diff --git a/Scripts/centos-art/Functions/cli_getLangCodes.sh b/Scripts/centos-art/Functions/cli_getLangCodes.sh new file mode 100755 index 0000000..59f7444 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getLangCodes.sh @@ -0,0 +1,222 @@ +#!/bin/bash +# +# cli_getLangCodes.sh -- This function outputs a list with language +# codes as defined in ISO639 standard. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getLangCodes { + + local FILTER="$(echo $1 | cut -d_ -f1)" + + LANGCODES="aa + ab + ae + af + ak + am + an + ar + as + av + ay + az + ba + be + bg + bh + bi + bm + bn + bo + br + bs + ca + ce + ch + co + cr + cs + cu + cv + cy + da + de + dv + dz + ee + el + en + eo + es + et + eu + fa + ff + fi + fj + fo + fr + fy + ga + gd + gl + gn + gu + gv + ha + he + hi + ho + hr + ht + hu + hy + hz + ia + id + ie + ig + ii + ik + io + is + it + iu + ja + jv + ka + kg + ki + kj + kk + kl + km + kn + ko + kr + ks + ku + kv + kw + ky + la + lb + lg + li + ln + lo + lt + lu + lv + mg + mh + mi + mk + ml + mn + mo + mr + ms + mt + my + na + nb + nd + ne + ng + nl + nn + no + nr + nv + ny + oc + oj + om + or + os + pa + pi + pl + ps + pt + qu + rm + rn + ro + ru + rw + sa + sc + sd + se + sg + si + sk + sl + sm + sn + so + sq + sr + ss + st + su + sv + sw + ta + te + tg + th + ti + tk + tl + tn + to + tr + ts + tt + tw + ty + ug + uk + ur + uz + ve + vi + vo + wa + wo + xh + yi + yo + za + zh + zu" + + if [[ $FILTER != '' ]];then + echo "$LANGCODES" | egrep "$FILTER" | sed -r 's![[:space:]]+!!g' + else + echo "$LANGCODES" + fi + +} diff --git a/Scripts/centos-art/Functions/cli_getLangName.sh b/Scripts/centos-art/Functions/cli_getLangName.sh new file mode 100755 index 0000000..6d734b2 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getLangName.sh @@ -0,0 +1,780 @@ +#!/bin/bash +# +# cli_getLangName.sh -- This function reads one language locale code +# in the format LL_CC and outputs its language name. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getLangName { + + local LANGCODE="$(echo "$1" | cut -d_ -f1 | tr '[:upper:]' '[:lower:]')" + local LANGNAME='' + + case $LANGCODE in + + 'aa' ) + LANGNAME="`gettext "Afar"`" + ;; + + 'ab' ) + LANGNAME="`gettext "Abkhazian"`" + ;; + + 'ae' ) + LANGNAME="`gettext "Avestan"`" + ;; + + 'af' ) + LANGNAME="`gettext "Afrikaans"`" + ;; + + 'ak' ) + LANGNAME="`gettext "Akan"`" + ;; + + 'am' ) + LANGNAME="`gettext "Amharic"`" + ;; + + 'an' ) + LANGNAME="`gettext "Aragonese"`" + ;; + + 'ar' ) + LANGNAME="`gettext "Arabic"`" + ;; + + 'as' ) + LANGNAME="`gettext "Assamese"`" + ;; + + 'av' ) + LANGNAME="`gettext "Avaric"`" + ;; + + 'ay' ) + LANGNAME="`gettext "Aymara"`" + ;; + + 'az' ) + LANGNAME="`gettext "Azerbaijani"`" + ;; + + 'ba' ) + LANGNAME="`gettext "Bashkir"`" + ;; + + 'be' ) + LANGNAME="`gettext "Byelorussian"`" + ;; + + 'bg' ) + LANGNAME="`gettext "Bulgarian"`" + ;; + + 'bh' ) + LANGNAME="`gettext "Bihari"`" + ;; + + 'bi' ) + LANGNAME="`gettext "Bislama"`" + ;; + + 'bm' ) + LANGNAME="`gettext "Bambara"`" + ;; + + 'bn' ) + LANGNAME="`gettext "Bengali"`" + ;; + + 'bo' ) + LANGNAME="`gettext "Tibetan"`" + ;; + + 'br' ) + LANGNAME="`gettext "Breton"`" + ;; + + 'bs' ) + LANGNAME="`gettext "Bosnian"`" + ;; + + 'ca' ) + LANGNAME="`gettext "Catalan"`" + ;; + + 'ce' ) + LANGNAME="`gettext "Chechen"`" + ;; + + 'ch' ) + LANGNAME="`gettext "Chamorro"`" + ;; + + 'co' ) + LANGNAME="`gettext "Corsican"`" + ;; + + 'cr' ) + LANGNAME="`gettext "Cree"`" + ;; + + 'cs' ) + LANGNAME="`gettext "Czech"`" + ;; + + 'cu' ) + LANGNAME="`gettext "Church Slavic"`" + ;; + + 'cv' ) + LANGNAME="`gettext "Chuvash"`" + ;; + + 'cy' ) + LANGNAME="`gettext "Welsh"`" + ;; + + 'da' ) + LANGNAME="`gettext "Danish"`" + ;; + + 'de' ) + LANGNAME="`gettext "German"`" + ;; + + 'dv' ) + LANGNAME="`gettext "Divehi"`" + ;; + + 'dz' ) + LANGNAME="`gettext "Dzongkha"`" + ;; + + 'ee' ) + LANGNAME="`gettext "E'we"`" + ;; + + 'el' ) + LANGNAME="`gettext "Greek"`" + ;; + + 'en' ) + LANGNAME="`gettext "English"`" + ;; + + 'eo' ) + LANGNAME="`gettext "Esperanto"`" + ;; + + 'es' ) + LANGNAME="`gettext "Spanish"`" + ;; + + 'et' ) + LANGNAME="`gettext "Estonian"`" + ;; + + 'eu' ) + LANGNAME="`gettext "Basque"`" + ;; + 'fa' ) + LANGNAME="`gettext "Persian"`" + ;; + + 'ff' ) + LANGNAME="`gettext "Fulah"`" + ;; + + 'fi' ) + LANGNAME="`gettext "Finnish"`" + ;; + + 'fj' ) + LANGNAME="`gettext "Fijian"`" + ;; + + 'fo' ) + LANGNAME="`gettext "Faroese"`" + ;; + + 'fr' ) + LANGNAME="`gettext "French"`" + ;; + + 'fy' ) + LANGNAME="`gettext "Frisian"`" + ;; + + 'ga' ) + LANGNAME="`gettext "Irish"`" + ;; + + 'gd' ) + LANGNAME="`gettext "Scots"`" + ;; + + 'gl' ) + LANGNAME="`gettext "Gallegan"`" + ;; + + 'gn' ) + LANGNAME="`gettext "Guarani"`" + ;; + + 'gu' ) + LANGNAME="`gettext "Gujarati"`" + ;; + + 'gv' ) + LANGNAME="`gettext "Manx"`" + ;; + + 'ha' ) + LANGNAME="`gettext "Hausa"`" + ;; + + 'he' ) + LANGNAME="`gettext "Hebrew"`" + ;; + + 'hi' ) + LANGNAME="`gettext "Hindi"`" + ;; + + 'ho' ) + LANGNAME="`gettext "Hiri Motu"`" + ;; + + 'hr' ) + LANGNAME="`gettext "Croatian"`" + ;; + + 'ht' ) + LANGNAME="`gettext "Haitian"`" + ;; + + 'hu' ) + LANGNAME="`gettext "Hungarian"`" + ;; + + 'hy' ) + LANGNAME="`gettext "Armenian"`" + ;; + + 'hz' ) + LANGNAME="`gettext "Herero"`" + ;; + + 'ia' ) + LANGNAME="`gettext "Interlingua"`" + ;; + + 'id' ) + LANGNAME="`gettext "Indonesian"`" + ;; + + 'ie' ) + LANGNAME="`gettext "Interlingue"`" + ;; + + 'ig' ) + LANGNAME="`gettext "Igbo"`" + ;; + + 'ii' ) + LANGNAME="`gettext "Sichuan Yi"`" + ;; + + 'ik' ) + LANGNAME="`gettext "Inupiak"`" + ;; + + 'io' ) + LANGNAME="`gettext "Ido"`" + ;; + + 'is' ) + LANGNAME="`gettext "Icelandic"`" + ;; + + 'it' ) + LANGNAME="`gettext "Italian"`" + ;; + + 'iu' ) + LANGNAME="`gettext "Inuktitut"`" + ;; + + 'ja' ) + LANGNAME="`gettext "Japanese"`" + ;; + + 'jv' ) + LANGNAME="`gettext "Javanese"`" + ;; + + 'ka' ) + LANGNAME="`gettext "Georgian"`" + ;; + + 'kg' ) + LANGNAME="`gettext "Kongo"`" + ;; + + 'ki' ) + LANGNAME="`gettext "Kikuyu"`" + ;; + + 'kj' ) + LANGNAME="`gettext "Kuanyama"`" + ;; + + 'kk' ) + LANGNAME="`gettext "Kazakh"`" + ;; + + 'kl' ) + LANGNAME="`gettext "Kalaallisut"`" + ;; + + 'km' ) + LANGNAME="`gettext "Khmer"`" + ;; + + 'kn' ) + LANGNAME="`gettext "Kannada"`" + ;; + + 'ko' ) + LANGNAME="`gettext "Korean"`" + ;; + + 'kr' ) + LANGNAME="`gettext "Kanuri"`" + ;; + + 'ks' ) + LANGNAME="`gettext "Kashmiri"`" + ;; + + 'ku' ) + LANGNAME="`gettext "Kurdish"`" + ;; + + 'kv' ) + LANGNAME="`gettext "Komi"`" + ;; + + 'kw' ) + LANGNAME="`gettext "Cornish"`" + ;; + + 'ky' ) + LANGNAME="`gettext "Kirghiz"`" + ;; + + 'la' ) + LANGNAME="`gettext "Latin"`" + ;; + + 'lb' ) + LANGNAME="`gettext "Letzeburgesch"`" + ;; + + 'lg' ) + LANGNAME="`gettext "Ganda"`" + ;; + + 'li' ) + LANGNAME="`gettext "Limburgish"`" + ;; + + 'ln' ) + LANGNAME="`gettext "Lingala"`" + ;; + + 'lo' ) + LANGNAME="`gettext "Lao"`" + ;; + + 'lt' ) + LANGNAME="`gettext "Lithuanian"`" + ;; + + 'lu' ) + LANGNAME="`gettext "Luba-Katanga"`" + ;; + + 'lv' ) + LANGNAME="`gettext "Latvian"`" + ;; + + 'mg' ) + LANGNAME="`gettext "Malagasy"`" + ;; + + 'mh' ) + LANGNAME="`gettext "Marshall"`" + ;; + + 'mi' ) + LANGNAME="`gettext "Maori"`" + ;; + + 'mk' ) + LANGNAME="`gettext "Macedonian"`" + ;; + + 'ml' ) + LANGNAME="`gettext "Malayalam"`" + ;; + + 'mn' ) + LANGNAME="`gettext "Mongolian"`" + ;; + + 'mo' ) + LANGNAME="`gettext "Moldavian"`" + ;; + + 'mr' ) + LANGNAME="`gettext "Marathi"`" + ;; + + 'ms' ) + LANGNAME="`gettext "Malay"`" + ;; + + 'mt' ) + LANGNAME="`gettext "Maltese"`" + ;; + + 'my' ) + LANGNAME="`gettext "Burmese"`" + ;; + + 'na' ) + LANGNAME="`gettext "Nauru"`" + ;; + + 'nb' ) + LANGNAME="`gettext "Norwegian Bokmaal"`" + ;; + + 'nd' ) + LANGNAME="`gettext "Ndebele, North"`" + ;; + + 'ne' ) + LANGNAME="`gettext "Nepali"`" + ;; + + 'ng' ) + LANGNAME="`gettext "Ndonga"`" + ;; + + 'nl' ) + LANGNAME="`gettext "Dutch"`" + ;; + + 'nn' ) + LANGNAME="`gettext "Norwegian Nynorsk"`" + ;; + + 'no' ) + LANGNAME="`gettext "Norwegian"`" + ;; + + 'nr' ) + LANGNAME="`gettext "Ndebele, South"`" + ;; + + 'nv' ) + LANGNAME="`gettext "Navajo"`" + ;; + + 'ny' ) + LANGNAME="`gettext "Chichewa"`" + ;; + + 'oc' ) + LANGNAME="`gettext "Occitan"`" + ;; + + 'oj' ) + LANGNAME="`gettext "Ojibwa"`" + ;; + + 'om' ) + LANGNAME="`gettext "(Afan) Oromo"`" + ;; + + 'or' ) + LANGNAME="`gettext "Oriya"`" + ;; + + 'os' ) + LANGNAME="`gettext "Ossetian; Ossetic"`" + ;; + + 'pa' ) + LANGNAME="`gettext "Panjabi; Punjabi"`" + ;; + + 'pi' ) + LANGNAME="`gettext "Pali"`" + ;; + + 'pl' ) + LANGNAME="`gettext "Polish"`" + ;; + + 'ps' ) + LANGNAME="`gettext "Pashto, Pushto"`" + ;; + + 'pt' ) + LANGNAME="`gettext "Portuguese"`" + ;; + + 'qu' ) + LANGNAME="`gettext "Quechua"`" + ;; + + 'rm' ) + LANGNAME="`gettext "Rhaeto-Romance"`" + ;; + + 'rn' ) + LANGNAME="`gettext "Rundi"`" + ;; + + 'ro' ) + LANGNAME="`gettext "Romanian"`" + ;; + + 'ru' ) + LANGNAME="`gettext "Russian"`" + ;; + + 'rw' ) + LANGNAME="`gettext "Kinyarwanda"`" + ;; + + 'sa' ) + LANGNAME="`gettext "Sanskrit"`" + ;; + + 'sc' ) + LANGNAME="`gettext "Sardinian"`" + ;; + + 'sd' ) + LANGNAME="`gettext "Sindhi"`" + ;; + + 'se' ) + LANGNAME="`gettext "Northern Sami"`" + ;; + + 'sg' ) + LANGNAME="`gettext "Sango; Sangro"`" + ;; + + 'si' ) + LANGNAME="`gettext "Sinhalese"`" + ;; + + 'sk' ) + LANGNAME="`gettext "Slovak"`" + ;; + + 'sl' ) + LANGNAME="`gettext "Slovenian"`" + ;; + + 'sm' ) + LANGNAME="`gettext "Samoan"`" + ;; + + 'sn' ) + LANGNAME="`gettext "Shona"`" + ;; + + 'so' ) + LANGNAME="`gettext "Somali"`" + ;; + + 'sq' ) + LANGNAME="`gettext "Albanian"`" + ;; + + 'sr' ) + LANGNAME="`gettext "Serbian"`" + ;; + + 'ss' ) + LANGNAME="`gettext "Swati; Siswati"`" + ;; + + 'st' ) + LANGNAME="`gettext "Sesotho; Sotho, Southern"`" + ;; + + 'su' ) + LANGNAME="`gettext "Sundanese"`" + ;; + + 'sv' ) + LANGNAME="`gettext "Swedish"`" + ;; + + 'sw' ) + LANGNAME="`gettext "Swahili"`" + ;; + + 'ta' ) + LANGNAME="`gettext "Tamil"`" + ;; + + 'te' ) + LANGNAME="`gettext "Telugu"`" + ;; + + 'tg' ) + LANGNAME="`gettext "Tajik"`" + ;; + + 'th' ) + LANGNAME="`gettext "Thai"`" + ;; + + 'ti' ) + LANGNAME="`gettext "Tigrinya"`" + ;; + + 'tk' ) + LANGNAME="`gettext "Turkmen"`" + ;; + + 'tl' ) + LANGNAME="`gettext "Tagalog"`" + ;; + + 'tn' ) + LANGNAME="`gettext "Tswana; Setswana"`" + ;; + + 'to' ) + LANGNAME="`gettext "Tonga (?)"`" + ;; + + 'tr' ) + LANGNAME="`gettext "Turkish"`" + ;; + + 'ts' ) + LANGNAME="`gettext "Tsonga"`" + ;; + + + 'tt' ) + LANGNAME="`gettext "Tatar"`" + ;; + + 'tw' ) + LANGNAME="`gettext "Twi"`" + ;; + + 'ty' ) + LANGNAME="`gettext "Tahitian"`" + ;; + + 'ug' ) + LANGNAME="`gettext "Uighur"`" + ;; + + 'uk' ) + LANGNAME="`gettext "Ukrainian"`" + ;; + + 'ur' ) + LANGNAME="`gettext "Urdu"`" + ;; + + 'uz' ) + LANGNAME="`gettext "Uzbek"`" + ;; + + 've' ) + LANGNAME="`gettext "Venda"`" + ;; + + 'vi' ) + LANGNAME="`gettext "Vietnamese"`" + ;; + + 'vo' ) + LANGNAME="`gettext "Volapuk; Volapuk"`" + ;; + + 'wa' ) + LANGNAME="`gettext "Walloon"`" + ;; + + 'wo' ) + LANGNAME="`gettext "Wolof"`" + ;; + + 'xh' ) + LANGNAME="`gettext "Xhosa"`" + ;; + + 'yi' ) + LANGNAME="`gettext "Yiddish (formerly ji)"`" + ;; + + 'yo' ) + LANGNAME="`gettext "Yoruba"`" + ;; + + 'za' ) + LANGNAME="`gettext "Zhuang"`" + ;; + + 'zh' ) + LANGNAME="`gettext "Chinese"`" + ;; + + 'zu' ) + LANGNAME="`gettext "Zulu"`" + ;; + + * ) + LANGNAME="`gettext "Unknown"`" + + esac + + echo $LANGNAME; +} + diff --git a/Scripts/centos-art/Functions/cli_getLocales.sh b/Scripts/centos-art/Functions/cli_getLocales.sh new file mode 100755 index 0000000..853efc7 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getLocales.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# cli_getLocales.sh -- This function outputs/verifies locale codes in LL +# and LL_CC format. Combine both ISO639 and ISO3166 specification in +# order to build the final locale list. This function defines which +# translation locales are supported inside CentOS Artwork Repository. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getLocales { + + # Print locales supported by centos-art.sh script. + locale -a | egrep '^[a-z]{2,3}_[A-Z]{2}$' | sort | uniq + +} diff --git a/Scripts/centos-art/Functions/cli_getPathComponent.sh b/Scripts/centos-art/Functions/cli_getPathComponent.sh new file mode 100755 index 0000000..e838cf7 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getPathComponent.sh @@ -0,0 +1,131 @@ +#!/bin/bash +# +# cli_getPathComponent.sh -- This function standardizes the way +# directory structures are organized inside the working copy of CentOS +# Artwork Repository. You can use this function to retrive information +# from paths (e.g., releases, architectures and theme artistic motifs) +# or the patterns used to build the paths. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getPathComponent { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='release,release-major,release-minor,release-pattern,architecture,architecture-pattern,motif,motif-name,motif-release,motif-pattern' + + # Initialize ARGUMENTS with an empty value and set it as local + # variable to this function scope. + local ARGUMENTS='' + + # Define release pattern. + local RELEASE="(([[:digit:]]+)(\.([[:digit:]]+)){0,1})" + + # Define architecture pattern. Make it match the architectures the + # CentOS distribution is able to be installed on. + local ARCHITECTURE="(i386|x86_64)" + + # Define pattern for themes' artistic motifs. + local THEME_MOTIF="Identity/Images/Themes/(([[:alnum:]]+)/(${RELEASE}))" + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Define location we want to apply verifications to. + local LOCATION=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') + + # Look for options passed through positional parameters. + while true;do + + case "$1" in + + --release ) + echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\1!" + shift 1 + break + ;; + + --release-major ) + echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\2!" + shift 1 + break + ;; + + --release-minor ) + echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\4!" + shift 1 + break + ;; + + --release-pattern ) + echo "${RELEASE}" + shift 1 + break + ;; + + --architecture ) + echo "$LOCATION" | egrep "${ARCHITECTURE}" | sed -r "s!${ARCHITECTURE}!\1!" + shift 1 + break + ;; + + --architecture-pattern ) + echo "${ARCHITECTURE}" + shift 1 + break + ;; + + --motif ) + echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\1!" + shift 1 + break + ;; + + --motif-name ) + echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\2!" + shift 1 + break + ;; + + --motif-release ) + echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\3!" + shift 1 + break + ;; + + --motif-pattern ) + echo "${THEME_MOTIF}" + shift 1 + break + ;; + + esac + + done +} diff --git a/Scripts/centos-art/Functions/cli_getRepoName.sh b/Scripts/centos-art/Functions/cli_getRepoName.sh new file mode 100755 index 0000000..4a43eb3 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getRepoName.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# +# cli_getRepoName.sh -- This function standardize file and directories +# name convenction inside the working copy of CentOS Artowrk +# Repository. As convenction, regular files are written in lower case +# and directories are written in lower case but with the first letter +# in upper case. Use this function to sanitate the name of regular +# files and directory components of paths you work with. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getRepoName { + + # Define the name we want to apply verifications to. + local NAME="$1" + + # Avoid using options as it were names. When name value is empty + # but an option is provided, the option becomes the first + # positional argument and is evaluated as it were a name which is + # something we need to prevent from happening. + if [[ $NAME =~ '^-' ]];then + return + fi + + # Look for options passed through positional parameters. + case "$2" in + + -f|--basename ) + + # Reduce the path passed to use just the non-directory + # part of it (i.e., the last component in the path; _not_ + # the last "real" directory in the path). + NAME=$(basename $NAME) + + # Clean value. + NAME=$(echo $NAME \ + | tr -s ' ' '_' \ + | tr '[:upper:]' '[:lower:]') + ;; + + -d|--dirname ) + + local DIR='' + local DIRS='' + local CLEANDIRS='' + local PREFIXDIR='' + + # In order to sanitate each directory in a path, it is + # required to break off the path string so each component + # can be worked out individually and later combine them + # back to create a clean path string. + + # Reduce path information passed to use the directory part + # of it only. Of course, this is applied if there is a + # directory part in the path. Assuming there is no + # directory part but a non-empty value in the path, use + # that value as directory part and clean it up. + if [[ $NAME =~ '.+/.+' ]];then + + # When path information is reduced, we need to + # consider that absolute paths contain some + # directories outside the working copy directory + # structure that shouldn't be sanitated (e.g., /home, + # /home/centos, /home/centos/artwork, + # /home/centos/artwork/turnk, trunk, etc.) So, we keep + # them unchaged for later use. + PREFIXDIR=$(echo $NAME \ + | sed -r "s,^(($(cli_getRepoTLDir)/)?(trunk|branches|tags)/).+$,\1,") + + # ... and remove them from the path information we do + # want to sanitate. + DIRS=$(dirname "$NAME" \ + | sed -r "s!^${PREFIXDIR}!!" \ + | tr '/' ' ') + + else + + # At this point, there is not directory part in the + # information passed, so use the value passed as + # directory part as such. + DIRS=$NAME + + fi + + for DIR in $DIRS;do + + # Sanitate directory component. + if [[ $DIR =~ '^[a-z]' ]];then + DIR=$(echo ${DIR} \ + | tr -s ' ' '_' \ + | tr '[:upper:]' '[:lower:]' \ + | sed -r 's/^([[:alpha:]])/\u\1/') + fi + + # Rebuild path using sanitated values. + CLEANDIRS="${CLEANDIRS}/$DIR" + + done + + # Redefine path using sanitated values. + NAME=$(echo ${CLEANDIRS} | sed -r "s!^/!!") + + # Add prefix directory information to sanitated path + # information. + if [[ "$PREFIXDIR" != '' ]];then + NAME=${PREFIXDIR}${NAME} + fi + ;; + + esac + + # Print out the clean path string. + echo $NAME + +} diff --git a/Scripts/centos-art/Functions/cli_getRepoParallelDirs.sh b/Scripts/centos-art/Functions/cli_getRepoParallelDirs.sh new file mode 100755 index 0000000..f2d0bc8 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getRepoParallelDirs.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# cli_getRepoParallelDirs.sh -- This function returns the parallel +# directories related to the first positional paramenter passed as +# parent directory. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getRepoParallelDirs { + + local BOND='' + local TDIR='' + local -a PDIRS + + # Define bond string using first positional parameter as + # reference. + if [[ "$1" != '' ]];then + BOND="$1" + elif [[ "$ACTIONVAL" != '' ]];then + BOND="$ACTIONVAL" + else + cli_printMessage "`gettext "The bond string is required."`" --as-error-line + fi + + # Define repository top level directory. + TDIR=$(cli_getRepoTLDir ${BOND}) + + # Define parallel directory base structures. + PDIRS[0]=Manuals/$(cli_getCurrentLocale)/Texinfo/Repository/$(cli_getRepoTLDir ${BOND} --relative) + PDIRS[1]=Scripts/Bash/Functions/Render/Config + PDIRS[2]=L10n + + # Redefine bond string without its top level directory structure. + BOND=$(echo $BOND | sed -r "s,^${TDIR}/(.+)$,\1,") + + # Concatenate repository top level directory, parallel directory + # base structure, and bond information; in order to produce the + # final parallel directory path. + for PDIR in "${PDIRS[@]}";do + echo ${TDIR}/${PDIR}/${BOND} + done + +} diff --git a/Scripts/centos-art/Functions/cli_getRepoStatus.sh b/Scripts/centos-art/Functions/cli_getRepoStatus.sh new file mode 100755 index 0000000..dca042f --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getRepoStatus.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# +# cli_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 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 cli_getRepoStatus { + + local LOCATION="$1" + + # Define regular expression pattern to retrive 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" --quiet | sed -r "s/${PATTERN}/\1/" + +} diff --git a/Scripts/centos-art/Functions/cli_getRepoTLDir.sh b/Scripts/centos-art/Functions/cli_getRepoTLDir.sh new file mode 100755 index 0000000..bc30f2c --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getRepoTLDir.sh @@ -0,0 +1,97 @@ +#!/bin/bash +# +# cli_getRepoTLDir.sh -- This function returns the repository top +# level absolute path. The repository top level absolute path can be +# either ${CLI_WRKCOPY}/trunk, ${CLI_WRKCOPY}/branches, or +# ${CLI_WRKCOPY}/tags. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getRepoTLDir { + + # Define short options. + local ARGSS='r' + + # Define long options. + local ARGSL='relative' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. + local ARGUMENTS='' + + # Initialize path pattern and replacement. + local PATTERN='' + local REPLACE='' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Define the location we want to apply verifications to. + local LOCATION=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') + + # Verify location passed as non-option argument. If no location is + # passed as non-option argument to this function, then set the + # trunk directory structure as default location. + if [[ $LOCATION =~ '--$' ]];then + LOCATION=${CLI_WRKCOPY}/trunk + fi + + # Verify location where the working copy should be stored in the + # workstations. Whatever the location provided be, it should refer + # to one of the top level directories inside the working copy of + # CentOS Artwork Repository which, in turn, should be sotred in + # the `artwork' directory immediatly under your home directory. + if [[ ! $LOCATION =~ "^${CLI_WRKCOPY}/(trunk|branches|tags)" ]];then + cli_printMessage "`eval_gettext "The location \\\"\\\$LOCATION\\\" is not valid."`" --as-error-line + fi + + # Look for options passed through positional parameters. + while true;do + + case "$1" in + + -r|--relative ) + PATTERN="^${CLI_WRKCOPY}/(trunk|branches|tags)/.+$" + REPLACE='\1' + shift 2 + break + ;; + + -- ) + PATTERN="^(${CLI_WRKCOPY}/(trunk|branches|tags))/.+$" + REPLACE='\1' + shift 1 + break + ;; + esac + + done + + # Print out top level directory. + echo $LOCATION | sed -r "s!${PATTERN}!${REPLACE}!g" + +} diff --git a/Scripts/centos-art/Functions/cli_getTTFont.sh b/Scripts/centos-art/Functions/cli_getTTFont.sh new file mode 100755 index 0000000..d6b0cd8 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getTTFont.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# cli_getFont.sh -- This function creates a list of all True Type +# Fonts (TTF) installed in your workstation and returns the absolute +# path of the file matching the pattern passed as first argument. +# Assuming more than one value matches, the first one in the list is +# used. In case no match is found, the function verifies if there is +# any file in the list that can be used (giving preference to sans +# files). If no file is found at this point, an error will be printed +# out. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getTTFont { + + local -a FONT_PATTERNS + local FONT_PATTERN='' + local FONT_FILE='' + + # Define list of patterns used to build the list of TTF files. + FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="/${1}\.ttf$" + FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="sans\.ttf$" + FONT_PATTERNS[((++${#FONT_PATTERNS[*]}))]="\.ttf$" + + # Define directory location where fonts are installed in your + # workstation. + local FONT_DIR='/usr/share/fonts' + + # Define list of all TTF files installed in your workstation. + local FONT_FILES=$(cli_getFilesList ${FONT_DIR} --pattern="\.ttf") + + # Define TTF absolute path based on pattern. Notice that if the + # pattern matches more than one value, only the first one of a + # sorted list will be used. + for FONT_PATTERN in ${FONT_PATTERNS[@]};do + + FONT_FILE=$(echo "$FONT_FILES" | egrep ${FONT_PATTERN} \ + | head -n 1) + + if [[ -f $FONT_FILE ]];then + break + fi + + done + + # Output TTF absolute path. + if [[ -f $FONT_FILE ]];then + echo $FONT_FILE + else + cli_printMessage "`gettext "The font provided doesn't exist."`" --as-error-line + fi + +} diff --git a/Scripts/centos-art/Functions/cli_getTemporalFile.sh b/Scripts/centos-art/Functions/cli_getTemporalFile.sh new file mode 100755 index 0000000..9322da1 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_getTemporalFile.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# cli_getTemporalFile.sh -- This function returns the absolute path +# you need to use to create temporal files. Use this function whenever +# you need to create temporal files inside centos-art.sh script. +# +# Copyright (C) 2009, 2010, 2011 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 cli_getTemporalFile { + + # Define base name for temporal file. This is required when svg + # instances are created previous to be parsed by inkscape in order + # to be exported as png. In such cases .svg file exention is + # required in order to avoid complains from inkscape. + local NAME="$(cli_getRepoName $1 -f)" + + # Check default base name for temporal file, it can't be an empty + # value. + if [[ "$NAME" == '' ]];then + cli_printMessage "`gettext "The first argument cannot be empty."`" --as-error-line + fi + + # Redefine file name for the temporal file. Make it a combination + # of the program name, the program process id, a random string and + # the design model name. Using the program name and process id in + # the file name let us to relate both the shell script execution + # and the temporal files it creates, so they can be removed in + # case an interruption signal be detected. The random string let + # us to produce the same artwork in different terminals at the + # same time. the The design model name provides file + # identification. + NAME=${CLI_PROGRAM}-${CLI_PROGRAM_ID}-${RANDOM}-${NAME} + + # Define absolute path for temporal file using the program name, + # the current locale, the unique identifier and the file name. + local TEMPFILE="${CLI_TEMPDIR}/${NAME}" + + # Output absolute path to final temporal file. + echo $TEMPFILE + +} diff --git a/Scripts/centos-art/Functions/cli_isLocalized.sh b/Scripts/centos-art/Functions/cli_isLocalized.sh new file mode 100755 index 0000000..efce7f8 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_isLocalized.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# cli_isLocalized.sh -- This function determines whether a file or +# directory can have translation messages or not. This is the way we +# standardize what locations can be localized and what cannot inside +# the repository. +# +# Copyright (C) 2009, 2010, 2011 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 cli_isLocalized { + + local DIR='' + local -a DIRS + + # Initialize default value returned by this function. + local LOCALIZED='false' + + # Initialize location will use as reference to determine whether + # it can have translation messages or not. + local LOCATION="$1" + + # Redefine location to be sure we'll always evaluate a directory, + # as reference location. + if [[ -f $LOCATION ]];then + LOCATION=$(dirname $LOCATION) + fi + + # Verify location existence. If it doesn't exist we cannot go on. + cli_checkFiles $LOCATION -d + + # Define regular expresion list of all directories inside the + # repository that can have translation. These are the + # locale-specific directories will be created for. + DIRS[++((${#DIRS[*]}))]="$(cli_getRepoTLDir)/Identity/Models/Themes/[[:alnum:]-]+/(Distro/$(\ + cli_getPathComponent --release-pattern)/Anaconda|Concept|Posters|Media)" + DIRS[++((${#DIRS[*]}))]="$(cli_getRepoTLDir)/Manuals/[[:alnum:]-]+$" + DIRS[++((${#DIRS[*]}))]="$(cli_getRepoTLDir)/Scripts$" + + # Verify location passed as first argument agains the list of + # directories that can have translation messages. By default, the + # location passed as first argument is considered as a location + # that cannot have translation messages until a positive answer + # says otherwise. + for DIR in ${DIRS[@]};do + if [[ $LOCATION =~ $DIR ]];then + LOCALIZED='true' + break + fi + done + + # Output final answer to all verifications. + echo "$LOCALIZED" + +} diff --git a/Scripts/centos-art/Functions/cli_isVersioned.sh b/Scripts/centos-art/Functions/cli_isVersioned.sh new file mode 100755 index 0000000..a1f7f97 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_isVersioned.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# cli_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 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 cli_isVersioned { + + # Initialize absolute path using first positional parameter as + # reference. + local LOCATION="$1" + + # Verify location to be sure it really exists. + cli_checkFiles $LOCATION + + # Use subversion to determine whether the location is under + # version control or not. + svn info $LOCATION &> /dev/null + + # Verify subversion exit status and print output. + if [[ $? -eq 0 ]];then + echo 'true' + else + echo 'false' + fi + +} diff --git a/Scripts/centos-art/Functions/cli_parseArguments.sh b/Scripts/centos-art/Functions/cli_parseArguments.sh new file mode 100755 index 0000000..2adb19b --- /dev/null +++ b/Scripts/centos-art/Functions/cli_parseArguments.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# cli_parseArguments.sh -- This function redefines arguments +# (ARGUMENTS) global variable using getopt(1) output. +# +# Copyright (C) 2009, 2010, 2011 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 cli_parseArguments { + + # Reset positional parameters using optional arguments. + eval set -- "$ARGUMENTS" + + # Parse optional arguments using getopt. + ARGUMENTS=$(getopt -o "$ARGSS" -l "$ARGSL" -n "$CLI_PROGRAM (${FUNCNAME[1]})" -- "$@") + + # Be sure getout parsed arguments successfully. + if [[ $? != 0 ]]; then + cli_printMessage "${CLI_FUNCDIRNAM}" --as-toknowmore-line + fi + +} diff --git a/Scripts/centos-art/Functions/cli_parseArgumentsReDef.sh b/Scripts/centos-art/Functions/cli_parseArgumentsReDef.sh new file mode 100755 index 0000000..6a6c4c0 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_parseArgumentsReDef.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# +# cli_parseArgumentsReDef.sh -- This function initiates/reset and +# sanitates positional parameters passed to this function and creates +# the the list of arguments that getopt will process. +# +# Copyright (C) 2009, 2010, 2011 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 cli_parseArgumentsReDef { + + local ARG + + # Clean up arguments global variable. + ARGUMENTS='' + + # Fill up arguments global variable with current positional + # parameter information. To avoid interpretation problems, use + # single quotes to enclose each argument (ARG) from command-line + # idividually. + for ARG in "$@"; do + + # Sanitate option arguments before process them. Be sure that + # no option argument does contain any single quote (U+0027) + # inside; that would break option parsing. Remember that we + # are using single quotes to enclose option arguments in order + # to let getopt to interpret option arguments with spaces + # inside. To solve this issue, we replace all single quotes + # in the arguments list with their respective codification and + # reverse the process back when doPrint them out. + ARG=$(echo $ARG | sed "s/'/\\\0x27/g") + + # Concatenate arguments and encolose them to let getopt to + # process them when they have spaces inside. + ARGUMENTS="$ARGUMENTS '$ARG'" + + done + +} diff --git a/Scripts/centos-art/Functions/cli_printActionPreamble.sh b/Scripts/centos-art/Functions/cli_printActionPreamble.sh new file mode 100755 index 0000000..c8270bc --- /dev/null +++ b/Scripts/centos-art/Functions/cli_printActionPreamble.sh @@ -0,0 +1,146 @@ +#!/bin/bash +# +# cli_printActionPreamble -- This function standardizes the way +# preamble messages are printed out. Preamble messages are used before +# actions (e.g., file elimination, edition, creation, actualization, +# etc.) and provide a way for the user to control whether the action +# is performed or not. +# +# Copyright (C) 2009, 2010, 2011 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 cli_printActionPreamble { + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='to-create,to-delete,to-locale,to-edit' + + # Initialize arguments with an empty value and set it as local + # variable to this function scope. + local ARGUMENTS='' + + # Initialize message. + local MESSAGE='' + + # Initialize message options. + local OPTION='' + + # Initialize file variable as local to avoid conflicts outside. + # We'll use the file variable later, to show the list of files + # that will be affected by the action. + local FILE='' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Define the location we want to apply verifications to. + local FILES=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') + + # Initialize counter with total number of files. + local COUNT=$(echo $FILES | wc -l) + + # Look for options passed through positional parameters. + while true;do + + case "$1" in + + --to-create ) + if [[ $FILES == '--' ]];then + MESSAGE="`gettext "There is no entry to create."`" + OPTION='--as-error-line' + else + MESSAGE="`ngettext "The following entry will be created" \ + "The following entries will be created" $COUNT`:" + OPTION='' + fi + shift 2 + break + ;; + + --to-delete ) + if [[ $FILES == '--' ]];then + MESSAGE="`gettext "There is no file to delete."`" + OPTION='--as-error-line' + else + MESSAGE="`ngettext "The following entry will be deleted" \ + "The following entries will be deleted" $COUNT`:" + OPTION='' + fi + shift 2 + break + ;; + + --to-locale ) + if [[ $FILES == '--' ]];then + MESSAGE="`gettext "There is no file to locale."`" + OPTION='--as-error-line' + else + MESSAGE="`ngettext "Translatable strings will be retrived from the following entry" \ + "Translatable strings will be retrived from the following entries" $COUNT`:" + OPTION='' + fi + shift 2 + break + ;; + + --to-edit ) + if [[ $FILES == '--' ]];then + MESSAGE="`gettext "There is no file to edit."`" + OPTION='--as-error-line' + else + MESSAGE="`ngettext "The following file will be edited" \ + "The following files will be edited" $COUNT`:" + OPTION='' + fi + shift 2 + break + ;; + + -- ) + if [[ $FILES == '--' ]];then + MESSAGE="`gettext "There is no file to process."`" + OPTION='--as-error-line' + else + MESSAGE="`ngettext "The following file will be processed" \ + "The following files will be processed" $COUNT`:" + OPTION='' + fi + shift 1 + break + ;; + esac + done + + # Print out the preamble message. + cli_printMessage "${MESSAGE}" "${OPTION}" + for FILE in $FILES;do + cli_printMessage "$FILE" --as-response-line + done + cli_printMessage "`gettext "Do you want to continue"`" --as-yesornorequest-line + +} diff --git a/Scripts/centos-art/Functions/cli_printCopyrightInfo.sh b/Scripts/centos-art/Functions/cli_printCopyrightInfo.sh new file mode 100755 index 0000000..6f4e6e2 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_printCopyrightInfo.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# +# cli_printCopyrightInfo.sh -- This function standardizes the +# copyright information used by centos-art.sh script. +# +# As far as I understand, the copyright exists to make people create +# more. The copyright gives creators the legal power over their +# creations and so the freedom to distribute them under the ethical +# terms the creator considers better. At this moment I don't feel +# very confident about this legal affairs and their legal +# implications, but I need to decide what copyright information the +# centos-art.sh script will print out. So, in that sake, I'll assume +# the same copyright information used by The CentOS Wiki +# (http://wiki.centos.org/) as reference. +# +# Copyright (C) 2009, 2010, 2011 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 cli_printCopyrightInfo { + + case "$1" in + + --license ) + + # Print out the name of the license used by to release the + # content produced by centos-art.sh script, inside CentOS + # Artwork Repository. + echo "`gettext "Creative Common Attribution-ShareAlike 3.0 License"`" + ;; + + --license-url ) + + # Print out the url of the license used by to release the + # content produced by centos-art.sh script, inside CentOS + # Artwork Repository. + cli_printUrl --cc-sharealike + ;; + + --copyright-year-first ) + + # The former year when I (as part of The CentOS Project) + # started to consolidate The CentOS Project Corporate + # Visual Identity through the CentOS Artwork Repository. + echo '2009' + ;; + + --copyright-year|--copyright-year-last ) + + # The last year when The CentOS Project stopped working in + # its Corporate Visual Identity through the CentOS Artwork + # Repository. That is something that I hope does never + # happen, so assume the current year as last working year. + date +%Y + ;; + + --copyright-year-range ) + + local FIRST_YEAR=$(cli_printCopyrightInfo '--copyright-year-first') + local LAST_YEAR=$(cli_printCopyrightInfo '--copyright-year-last') + echo "${FIRST_YEAR}-${LAST_YEAR}" + ;; + + --copyright-year-list ) + + local FIRST_YEAR=$(cli_printCopyrightInfo '--copyright-year-first') + local LAST_YEAR=$(cli_printCopyrightInfo '--copyright-year-last') + + # Define full copyright year string based on first and + # last year. + local FULL_YEAR=$(\ + while [[ ${FIRST_YEAR} -le ${LAST_YEAR} ]];do + echo -n "${FIRST_YEAR}, " + FIRST_YEAR=$(($FIRST_YEAR + 1)) + done) + + # Prepare full copyright year string and print it out. + echo "${FULL_YEAR}" | sed 's!, *$!!' + ;; + + --copyright-holder ) + + # Output default copyright holder. + echo "`gettext "The CentOS Project"`" + ;; + + --copyright-holder-predicate ) + + local HOLDER=$(cli_printCopyrightInfo '--copyright-holder') + echo "${HOLDER}. `gettext "All rights reserved."`" + ;; + + --copyright ) + + local YEAR=$(cli_printCopyrightInfo '--copyright-year-last') + local HOLDER=$(cli_printCopyrightInfo '--copyright-holder') + echo "Copyright © ${YEAR} ${HOLDER}" + ;; + + esac + +} diff --git a/Scripts/centos-art/Functions/cli_printMessage.sh b/Scripts/centos-art/Functions/cli_printMessage.sh new file mode 100755 index 0000000..d0366b5 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_printMessage.sh @@ -0,0 +1,242 @@ +#!/bin/bash +# +# cli_printMessage.sh -- This function standardizes the way messages +# are printed out from centos-art.sh script. +# +# Copyright (C) 2009, 2010, 2011 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 cli_printMessage { + + # Verify `--quiet' option. + if [[ "$FLAG_QUIET" == 'true' ]];then + return + fi + + local MESSAGE="$1" + local FORMAT="$2" + + # Verify message variable, it cannot have an empty value. + if [[ $MESSAGE == '' ]];then + cli_printMessage "`gettext "The message cannot be empty."`" --as-error-line + fi + + # Define message horizontal width. This is the max number of + # horizontal characters the message will use to be displayed on + # the screen. + local MESSAGE_WIDTH=66 + + # Reverse the codification performed on characters that may affect + # parsing options and non-option arguments. This codification is + # realized before building the ARGUMENTS variable, at + # cli_parseArgumentsReDef, and we need to reverse it back here + # in order to show the correct character when the message be + # printed out on the screen. + MESSAGE=$(echo $MESSAGE | sed -e "s/\\\0x27/'/g") + + # Remove empty spaces from message. + MESSAGE=$(echo $MESSAGE | sed -e 's!^[[:space:]]+!!') + + # Print out messages based on format. + case "$FORMAT" in + + --as-separator-line ) + + # Build the separator line. + MESSAGE=$(\ + until [[ $MESSAGE_WIDTH -eq 0 ]];do + echo -n "$MESSAGE" + MESSAGE_WIDTH=$(($MESSAGE_WIDTH - 1)) + done) + + # Draw the separator line. + echo "$MESSAGE" > /dev/stderr + ;; + + --as-banner-line ) + cli_printMessage '-' --as-separator-line + cli_printMessage "$MESSAGE" + cli_printMessage '-' --as-separator-line + ;; + + --as-cropping-line ) + cli_printMessage "`gettext "Cropping from"`: $MESSAGE" + ;; + + --as-tuningup-line ) + cli_printMessage "`gettext "Tuning-up"`: $MESSAGE" + ;; + + --as-checking-line ) + cli_printMessage "`gettext "Checking"`: $MESSAGE" + ;; + + --as-creating-line | --as-updating-line ) + if [[ -a "$MESSAGE" ]];then + cli_printMessage "`gettext "Updating"`: $MESSAGE" + else + cli_printMessage "`gettext "Creating"`: $MESSAGE" + fi + ;; + + --as-deleting-line ) + cli_printMessage "`gettext "Deleting"`: $MESSAGE" + ;; + + --as-reading-line ) + cli_printMessage "`gettext "Reading"`: $MESSAGE" + ;; + + --as-savedas-line ) + cli_printMessage "`gettext "Saved as"`: $MESSAGE" + ;; + + --as-linkto-line ) + cli_printMessage "`gettext "Linked to"`: $MESSAGE" + ;; + + --as-movedto-line ) + cli_printMessage "`gettext "Moved to"`: $MESSAGE" + ;; + + --as-translation-line ) + cli_printMessage "`gettext "Translation"`: $MESSAGE" + ;; + + --as-validating-line ) + cli_printMessage "`gettext "Validating"`: $MESSAGE" + ;; + + --as-template-line ) + cli_printMessage "`gettext "Template"`: $MESSAGE" + ;; + + --as-configuration-line ) + cli_printMessage "`gettext "Configuration"`: $MESSAGE" + ;; + + --as-palette-line ) + cli_printMessage "`gettext "Palette"`: $MESSAGE" + ;; + + --as-response-line ) + cli_printMessage "--> $MESSAGE" + ;; + + --as-request-line ) + cli_printMessage "${MESSAGE}:\040" --as-notrailingnew-line + ;; + + --as-selection-line ) + local NAME='' + select NAME in ${MESSAGE};do + echo $NAME + break + done + ;; + + --as-error-line ) + # Define where the error was originated inside the + # centos-art.sh script. Print out the function name and + # line from the caller. + local ORIGIN="$(caller 1 | gawk '{ print $2 " " $1 }')" + + # Build the error message. + cli_printMessage "${CLI_PROGRAM} (${ORIGIN}): $MESSAGE" --as-stderr-line + cli_printMessage "${CLI_FUNCDIRNAM}" --as-toknowmore-line + ;; + + --as-toknowmore-line ) + cli_printMessage '-' --as-separator-line + cli_printMessage "`gettext "To know more, run the following command"`:" + cli_printMessage "centos-art help --read trunk/Scripts/Functions/$MESSAGE" + cli_printMessage '-' --as-separator-line + exit # <-- ATTENTION: Do not remove this line. We use this + # option as convenction to end script + # execution. + ;; + + --as-yesornorequest-line ) + # Define positive answer. + local Y="`gettext "yes"`" + + # Define negative answer. + local N="`gettext "no"`" + + # Define default answer. + local ANSWER=${N} + + if [[ $FLAG_ANSWER == 'true' ]];then + + ANSWER=${Y} + + else + + # Print the question. + cli_printMessage "$MESSAGE [${Y}/${N}]:\040" --as-notrailingnew-line + + # Redefine default answer based on user's input. + read ANSWER + + fi + + # Verify user's answer. Only positive answer let the + # script flow to continue. Otherwise, if something + # different from possitive answer is passed, the script + # terminates its execution immediatly. + if [[ ! ${ANSWER} =~ "^${Y}" ]];then + exit + fi + ;; + + --as-notrailingnew-line ) + echo -e -n "$MESSAGE" > /dev/stderr + ;; + + --as-stdout-line ) + echo "$MESSAGE" + ;; + + --as-stderr-line ) + echo "$MESSAGE" + ;; + + * ) + + # Default printing format. This is the format used when no + # other specification is passed to this function. As + # convenience, we transform absolute paths into relative + # paths in order to free horizontal space on final output + # messages. + echo "$MESSAGE" | sed -r \ + -e "s!${CLI_WRKCOPY}/(trunk|branches|tags)/!\1/!g" \ + | awk 'BEGIN { FS=": " } + { + if ( $0 ~ /^-+$/ ) + print $0 + else + printf "%-15s\t%s\n", $1, $2 + } + END {}' > /dev/stderr + ;; + + esac + +} diff --git a/Scripts/centos-art/Functions/cli_printUrl.sh b/Scripts/centos-art/Functions/cli_printUrl.sh new file mode 100755 index 0000000..5994d8d --- /dev/null +++ b/Scripts/centos-art/Functions/cli_printUrl.sh @@ -0,0 +1,138 @@ +#!/bin/bash +# +# cli_printUrl.sh -- This function standardize the way URLs are +# printed inside centos-art.sh script. This function describes the +# domain organization of The CentOS Project through its URLs and +# provides a way to print them out when needed. +# +# Copyright (C) 2009, 2010, 2011 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 cli_printUrl { + + local URL='' + + # Define short options. + local ARGSS='' + + # Define long options. + local ARGSL='home,lists,wiki,forums,bugs,planet,docs,mirrors,irc,projects,projects-artwork,cc-sharealike,with-locale,as-html-link' + + # Define ARGUMENTS as local variable in order to parse options + # internlally. + local ARGUMENTS='' + + # Redefine ARGUMENTS variable using current positional parameters. + cli_parseArgumentsReDef "$@" + + # Redefine ARGUMENTS variable using getopt output. + cli_parseArguments + + # Redefine positional parameters using ARGUMENTS variable. + eval set -- "$ARGUMENTS" + + # Look for options passed through command-line. + while true; do + case "$1" in + + --home ) + URL='http://www.centos.org/' + shift 1 + ;; + + --lists ) + URL='http://lists.centos.org/' + shift 1 + ;; + + --wiki ) + URL='http://wiki.centos.org/' + shift 1 + ;; + + --forums ) + URL='http://forums.centos.org/' + shift 1 + ;; + + --bugs ) + URL='http://bugs.centos.org/' + shift 1 + ;; + + --projects ) + URL='https://projects.centos.org/' + shift 1 + ;; + + --projects-artwork ) + URL=$(cli_printUrl '--projects')svn/artwork/ + shift 1 + ;; + + --planet ) + URL='http://planet.centos.org/' + shift 1 + ;; + + --docs ) + URL='http://docs.centos.org/' + shift 1 + ;; + + --mirrors ) + URL='http://mirrors.centos.org/' + shift 1 + ;; + + --irc ) + URL='http://www.centos.org/modules/tinycontent/index.php?id=8' + shift 1 + ;; + + --cc-sharealike ) + URL="http://creativecommons.org/licenses/by-sa/3.0/" + shift 1 + ;; + + --with-locale ) + if [[ ! $(cli_getCurrentLocale) =~ '^en' ]];then + URL="${URL}$(cli_getCurrentLocale '--langcode-only')/" + fi + shift 1 + ;; + + --as-html-link ) + URL="${URL}" + shift 1 + ;; + + -- ) + + shift 1 + break + ;; + esac + done + + # Print Url. + echo "$URL" + +} diff --git a/Scripts/centos-art/Functions/cli_syncroRepoChanges.sh b/Scripts/centos-art/Functions/cli_syncroRepoChanges.sh new file mode 100755 index 0000000..168ee6b --- /dev/null +++ b/Scripts/centos-art/Functions/cli_syncroRepoChanges.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# cli_syncroRepoChanges.sh -- This function syncronizes both central +# repository and working copy performing a subversion update command +# first and a subversion commit command later. +# +# Copyright (C) 2009, 2010, 2011 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 cli_syncroRepoChanges { + + # Verify don't commit changes flag. + if [[ $FLAG_DONT_COMMIT_CHANGES != 'false' ]];then + return + fi + + # Define source location the subversion update action will take + # place on. If arguments are provided use them as srouce location. + # Otherwise use action value as default source location. + if [[ "$@" != '' ]];then + LOCATIONS="$@" + else + LOCATIONS="$ACTIONVAL" + fi + + # Bring changes from the repository into the working copy. + cli_updateRepoChanges "$LOCATIONS" + + # Check changes in the working copy. + cli_commitRepoChanges "$LOCATIONS" + +} diff --git a/Scripts/centos-art/Functions/cli_terminateScriptExecution.sh b/Scripts/centos-art/Functions/cli_terminateScriptExecution.sh new file mode 100755 index 0000000..fd65ab4 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_terminateScriptExecution.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# +# cli_terminateScriptExecution.sh -- This function standardizes the +# actions that must be realized just before leaving the script +# execution (e.g., cleaning temporal files). This function is the one +# called when interruption signals like EXIT, SIGHUP, SIGINT and +# SIGTERM are detected. +# +# Copyright (C) 2009, 2010, 2011 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 cli_terminateScriptExecution { + + # Build list of temporal files related to this script execution. + # Remember that inside `/tmp' directory there are files and + # directories you might have no access to (due permission + # restrictions), so command cli_getFilesList to look for files in + # the first level of files that you are owner of. Otherwise, + # undesired `permission denied' messages might be output. + local FILES=$(cli_getFilesList ${CLI_TEMPDIR} \ + --pattern="${CLI_PROGRAM}-${CLI_PROGRAM_ID}-.+" \ + --maxdepth="1" --uid="$(id -u)") + + # Remove list of temporal files related to this script execution, + # if any of course. Remember that some of the temporal files can + # be directories, too. + if [[ $FILES != '' ]];then + rm -rf $FILES + fi + + # Terminate script correctly. + exit 0 + +} diff --git a/Scripts/centos-art/Functions/cli_unsetFunctions.sh b/Scripts/centos-art/Functions/cli_unsetFunctions.sh new file mode 100755 index 0000000..0977480 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_unsetFunctions.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# cli_unsetFunctions.sh -- This function unsets funtionalities from +# `centos-art.sh' script execution evironment. +# +# Copyright (C) 2009, 2010, 2011 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 cli_unsetFunctions { + + # Define source location where function files are placed in. + local LOCATION=$1 + + # Define suffix used to retrive function files. + local SUFFIX=$2 + + # Verify suffix value used to retrive function files. Assuming no + # suffix value is passed as second argument to this function, use + # the function name value (CLI_FUNCNAME) as default value. + if [[ $SUFFIX == '' ]];then + SUFFIX=$CLI_FUNCNAME + fi + + # Define list of backend-specific functionalities. This is the + # list of function definitions previously exported by + # `cli_exportFunctions'. Be sure to limit the list to function + # names that start with the suffix specified only. + local FUNCDEF='' + local FUNCDEFS=$(declare -F | gawk '{ print $3 }' | egrep "^${SUFFIX}") + + # Unset function names from current execution environment. + for FUNCDEF in $FUNCDEFS;do + unset -f $FUNCDEF + done + +} diff --git a/Scripts/centos-art/Functions/cli_updateRepoChanges.sh b/Scripts/centos-art/Functions/cli_updateRepoChanges.sh new file mode 100755 index 0000000..78a6ad4 --- /dev/null +++ b/Scripts/centos-art/Functions/cli_updateRepoChanges.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# cli_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 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 cli_updateRepoChanges { + + # Verify don't commit changes flag. + if [[ $FLAG_DONT_COMMIT_CHANGES != 'false' ]];then + return + fi + + local -a FILES + local -a INFO + local -a FILESNUM + local COUNT=0 + local UPDATEOUT='' + local PREDICATE='' + local CHNGTOTAL=0 + local LOCATIONS='' + + # Define source location the subversion update action will take + # place on. If arguments are provided use them as srouce location. + # Otherwise use action value as default source location. + if [[ "$@" != '' ]];then + LOCATIONS="$@" + else + LOCATIONS="$ACTIONVAL" + fi + + # Update working copy and retrive update output. + cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line + UPDATEOUT=$(svn update ${LOCATIONS}) + + # Define path of files considered recent modifications from + # central repository to working copy. + FILES[0]=$(echo "$UPDATEOUT" | egrep "^A.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + FILES[1]=$(echo "$UPDATEOUT" | egrep "^D.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + FILES[2]=$(echo "$UPDATEOUT" | egrep "^U.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + FILES[3]=$(echo "$UPDATEOUT" | egrep "^C.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + FILES[4]=$(echo "$UPDATEOUT" | egrep "^G.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") + + # 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]}" + + # Increase counter. + COUNT=$(($COUNT + 1)) + + done + +} diff --git a/Scripts/centos-art/centos-art.sh b/Scripts/centos-art/centos-art.sh new file mode 100755 index 0000000..4d8e3ec --- /dev/null +++ b/Scripts/centos-art/centos-art.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# +# centos-art.sh -- The CentOS Artwork Repository automation tool. +# +# Copyright (C) 2009, 2010, 2011 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$ +# ---------------------------------------------------------------------- + +# Initialize personal data. +declare -xr CLI_PROGRAM='centos-art' +declare -xr CLI_PROGRAM_ID=$$ +declare -xr CLI_VERSION='1.0 (beta)' + +# Initialize paths. +declare -xr CLI_WRKCOPY="${HOME}/artwork" +declare -xr CLI_BASEDIR="${CLI_WRKCOPY}/trunk/Scripts" +declare -xr CLI_TEMPDIR='/tmp' + +# Initialize internazionalization through GNU gettext. +. gettext.sh +declare -xr TEXTDOMAIN=${CLI_PROGRAM}.sh +declare -xr TEXTDOMAINDIR=${CLI_WRKCOPY}/trunk/L10n/Scripts + +# Verify the working copy directory. Be sure it is +# `/home/centos/artwork'. Otherwise, end the script execution. We +# cannot continue if the working copy is stored in a place other than +# `/home/centos/artwork'. This restriction is what let us to reuse +# contents using absolute paths inside a distributed environment like +# that one provided by The CentOS Artwork Repository. +if [[ ! -d ${CLI_WRKCOPY} ]];then + echo "`eval_gettext "The working copy must be under \\\"\\\$CLI_WRKCOPY\\\"."`" > /dev/stderr + exit +fi + +# Initialize common functions. +FILES=$(ls ${CLI_BASEDIR}/Functions/{cli,cli_*}.sh) +for FILE in ${FILES};do + if [[ -x ${FILE} ]];then + . ${FILE} + FUNCTION=$(grep '^function ' ${FILE} | cut -d' ' -f2) + export -f ${FUNCTION} + else + echo `eval_gettext "The \\\"\\\$FILE\\\" needs to have execution rights."` > /dev/stderr + exit + fi +done + +# Unset all variables not considered global in order to start common +# functions with a clean environment. +unset FILE +unset FILES +unset FUNCTION + +# Trap signals in order to terminate the script execution correctly +# (e.g., removing all temporal files before leaving). Trapping the +# exit signal seems to be enough by now, since it is always present as +# part of the script execution flow. Each time the centos-art.sh +# script is executed it will inevitably end with an EXIT signal at +# some point of its execution, even if it is interrupted in the middle +# of its execution (e.g., through `Ctrl+C'). +trap cli_terminateScriptExecution 0 + +# Initialize command-line interface. +cli "$@"