Rollback xml keep blanks support after parsing hybrid manifest 54/109454/1
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 10 Jan 2017 05:45:35 +0000 (14:45 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 10 Jan 2017 06:08:23 +0000 (15:08 +0900)
Hybrid installer set default blanks text node support off for
generating/merging manifest. However, this may cause unexpected result
at other library which is using libxml2. So hybrid installer should
rollback this support.

This patch fixes smoke test failures.

Change-Id: I89aa9b99a30e5068e93f44415829f94abca0ff40
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/hybrid/step/pkgmgr/step_generate_xml.cc

index 8ab0826..df049ff 100644 (file)
@@ -51,17 +51,20 @@ namespace pkgmgr {
 bool StepGenerateXml::LoadXmlDocument(const bf::path& wgt_xml_path,
     const bf::path& tpk_xml_path) {
   // trim blanks
-  xmlKeepBlanksDefault(0);
+  int keep_blanks = xmlKeepBlanksDefault(0);
   wgt_doc_ = xmlParseFile(wgt_xml_path.string().c_str());
   if (!wgt_doc_) {
     LOG(ERROR) << "Failed to parse file: " << wgt_xml_path;
+    xmlKeepBlanksDefault(keep_blanks);
     return false;
   }
   tpk_doc_ = xmlParseFile(tpk_xml_path.string().c_str());
   if (!tpk_doc_) {
     LOG(ERROR) << "Failed to parse file: " << tpk_xml_path;
+    xmlKeepBlanksDefault(keep_blanks);
     return false;
   }
+  xmlKeepBlanksDefault(keep_blanks);
   return true;
 }