[jenkinscat-docs] master: Work directory should not be hardwired in internal functions. (63dcb8f)
immanetize at fedoraproject.org
immanetize at fedoraproject.org
Fri Feb 6 07:39:45 UTC 2015
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit 63dcb8f3e5faf7c809c45fb5c9ee5ca3b6e5eb98
Author: Pavel Tisnovsky <ptisnovs at redhat.com>
Date: Thu Nov 20 10:13:36 2014 +0100
Work directory should not be hardwired in internal functions.
>---------------------------------------------------------------
ChangeLog | 5 +++++
tools/create_books_clj_file.lua | 31 +++++++++++++++++++------------
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 19eb8b5..534ba73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-20 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * tools/create_books_clj_file.lua:
+ Work directory should not be hardwired in internal functions.
+
2014-11-19 Pavel Tisnovsky <ptisnovs at redhat.com>
* tools/create_books_clj_file.lua:
diff --git a/tools/create_books_clj_file.lua b/tools/create_books_clj_file.lua
index 239e42d..031e26e 100644
--- a/tools/create_books_clj_file.lua
+++ b/tools/create_books_clj_file.lua
@@ -253,7 +253,7 @@ end
--
--
function fetchDocumentTitleFromXML(jobDirectory, docname)
- local workspace = jobDirectory .. "/workspace/en-US"
+ local workspace = jobDirectory .. "/en-US"
local command = "cd \"" .. workspace .. "\"; xmllint --xinclude --postvalid \"" .. docname .. ".xml\" 2>/dev/null | xmlstarlet sel -t -v \"//bookinfo/title|//articleinfo/title\" 2>/dev/null"
print(command)
local handle = io.popen(command)
@@ -266,7 +266,7 @@ end
--
--
function fetchProductNameFromXML(jobDirectory, docname)
- local workspace = jobDirectory .. "/workspace/en-US"
+ local workspace = jobDirectory .. "/en-US"
local command = "cd \"" .. workspace .. "\"; xmllint --xinclude --postvalid \"" .. docname .. ".xml\" 2>/dev/null | xmlstarlet sel -t -v \"//bookinfo/productname|//articleinfo/productname\" 2>/dev/null"
local handle = io.popen(command)
local result = handle:read("*a")
@@ -278,7 +278,7 @@ end
--
--
function fetchProductVersionFromXML(jobDirectory, docname, condition)
- local workspace = jobDirectory .. "/workspace/en-US"
+ local workspace = jobDirectory .. "/en-US"
local command = nil
@@ -345,7 +345,7 @@ end
--
--
--
-function getJobTitleTypeAndProduct(jobDirectory)
+function getJobTitleTypeAndProduct(jobDirectory, jobWorkDirectory)
local documentType
local productName
local productVersion
@@ -353,7 +353,7 @@ function getJobTitleTypeAndProduct(jobDirectory)
local condition
print("Processing job " .. jobDirectory)
- documentType, productName, productVersion, documentName, condition = readDocumentInfoFromPublicanCfg(jobDirectory)
+ documentType, productName, productVersion, documentName, condition = readDocumentInfoFromPublicanCfg(jobWorkDirectory)
if documentName == nil then
if documentType == "Book" then
@@ -363,15 +363,15 @@ function getJobTitleTypeAndProduct(jobDirectory)
end
end
- local documentTitle = fetchDocumentTitleFromXML(jobDirectory, documentName)
+ local documentTitle = fetchDocumentTitleFromXML(jobWorkDirectory, documentName)
print(documentTitle)
if productName == nil then
- productName = fetchProductNameFromXML(jobDirectory, documentName)
+ productName = fetchProductNameFromXML(jobWorkDirectory, documentName)
end
if productVersion == nil then
- productVersion = fetchProductVersionFromXML(jobDirectory, documentName, condition)
+ productVersion = fetchProductVersionFromXML(jobWorkDirectory, documentName, condition)
end
return documentTitle, documentType, productName, productVersion
@@ -474,7 +474,7 @@ end
--
function addJobGitRepo(allJobs)
for i, job in ipairs(allJobs) do
- job.git_repo = getJobBuildRepo(job.directory)
+ job.git_repo = getJobBuildRepo(job.workDirectory)
end
end
@@ -483,7 +483,7 @@ end
--
function addJobTitleTypeAndProduct(allJobs)
for i, job in ipairs(allJobs) do
- job.documentTitle, job.documentType, job.productName, job.productVersion = getJobTitleTypeAndProduct(job.directory)
+ job.documentTitle, job.documentType, job.productName, job.productVersion = getJobTitleTypeAndProduct(job.directory, job.workDirectory)
end
end
@@ -591,6 +591,13 @@ end
+function concatTables(table1, table2)
+ for i = 1,#table2 do
+ table1[#table1 + 1] = table2[i]
+ end
+ return table1
+end
+
function readBugDescription()
local fin = io.open("bug_summary.txt", "r")
bug_description = fin:read("*line")
@@ -618,8 +625,8 @@ function main()
performBasicCheck()
createWorkDirectory()
readBugDescriptionAndBugTemplate()
- print(bug_description)
- print(bug_template)
+ --print(bug_description)
+ --print(bug_template)
local allJobs = fetchListOfAllJobs()
addJobDirectories(allJobs)
More information about the docs-commits
mailing list