[jenkinscat-docs] master: Added support for autofilling info about known books. (b86fa22)

immanetize at fedoraproject.org immanetize at fedoraproject.org
Fri Feb 6 07:40:56 UTC 2015


Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git

On branch  : master

>---------------------------------------------------------------

commit b86fa22688896aac3840f7d13e507b79a666c762
Author: Pavel Tisnovsky <ptisnovs at redhat.com>
Date:   Fri Jan 16 10:44:38 2015 +0100

    Added support for autofilling info about known books.


>---------------------------------------------------------------

 ChangeLog                       |    5 ++++
 tools/create_books_clj_file.lua |   44 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 98ff1c7..d79c955 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 2015-01-16  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* tools/create_books_clj_file.lua:
+	Added support for autofilling info about known books.
+
+2015-01-16  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* tools/create_books_clj_file.lua:
 	Disabled books should be handled differently.
 
 2015-01-15  Pavel Tisnovsky  <ptisnovs at redhat.com>
diff --git a/tools/create_books_clj_file.lua b/tools/create_books_clj_file.lua
index 03600c5..a55deff 100644
--- a/tools/create_books_clj_file.lua
+++ b/tools/create_books_clj_file.lua
@@ -663,6 +663,50 @@ function filterOutDisabledJobs(books, disabledBooks)
     return result
 end
 
+function addInfoFromKnownBooks(books, knownBooks)
+    for _,book in pairs(books) do
+        local knownBook = knownBooks[book.name]
+        if knownBook then
+            if not book.git_repo or book.git_repo == "" then
+                book.git_repo = knownBook[1]
+            end
+            if not book.documentTitle or book.documentTitle == "" or knownBook[2]:startsWith("*") then
+                local title = knownBook[2]
+                if title and title:startsWith("*") then
+                    title = string.sub(title, 2)
+                end
+                book.documentTitle = title
+            end
+            if not book.documentType or book.documentType == "" then
+                book.documentType = knownBook[3]
+            end
+            if not book.productName or book.productName == "" or knownBook[4]:startsWith("*") then
+                local productName = knownBook[4]
+                if productName and productName:startsWith("*") then
+                    productName = string.sub(productName, 2)
+                end
+                book.productName = productName
+            end
+            if not book.productVersion or book.productVersion == "" or knownBook[5]:startsWith("*") then
+                local productVersion = knownBook[5]
+                if productVersion and productVersion:startsWith("*") then
+                    productVersion = string.sub(productVersion, 2)
+                end
+                book.productVersion = productVersion
+            end
+            if not book.bugzillaProductName or book.bugzillaProductName == "" then
+                book.bugzillaProductName = knownBook[6]
+            end
+            if not book.bugzillaComponentName or book.bugzillaComponentName == "" then
+                book.bugzillaComponentName = knownBook[7]
+            end
+            if not book.bugzillaUrl or book.bugzillaUrl == "" then
+                book.bugzillaUrl = knownBook[8]
+            end
+        end
+    end
+end
+
 --
 -- Entry point to this tool.
 --



More information about the docs-commits mailing list