Hello community, here is the log from the commit of package yast2-core for openSUSE:Factory checked in at 2016-01-28 17:19:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-core (Old) and /work/SRC/openSUSE:Factory/.yast2-core.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-core" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-core/yast2-core.changes 2015-10-28 17:15:24.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-core.new/yast2-core.changes 2016-01-28 17:19:33.000000000 +0100 @@ -1,0 +2,7 @@ +Tue Jan 19 10:08:56 UTC 2016 - [email protected] + +- ag_ini: when multifile list contain glob, evaluate it in correct + root. (bnc#962566) +- 3.1.19 + +------------------------------------------------------------------- Old: ---- yast2-core-3.1.18.tar.bz2 New: ---- yast2-core-3.1.19.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-core.spec ++++++ --- /var/tmp/diff_new_pack.fIjeAi/_old 2016-01-28 17:19:34.000000000 +0100 +++ /var/tmp/diff_new_pack.fIjeAi/_new 2016-01-28 17:19:34.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package yast2-core # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: yast2-core -Version: 3.1.18 +Version: 3.1.19 Release: 0 Url: https://github.com/yast/yast-core ++++++ yast2-core-3.1.18.tar.bz2 -> yast2-core-3.1.19.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-3.1.18/agent-ini/src/IniParser.cc new/yast2-core-3.1.19/agent-ini/src/IniParser.cc --- old/yast2-core-3.1.18/agent-ini/src/IniParser.cc 2015-10-22 14:19:12.000000000 +0200 +++ new/yast2-core-3.1.19/agent-ini/src/IniParser.cc 2016-01-21 15:49:16.000000000 +0100 @@ -163,9 +163,9 @@ else y2error ("Bad file specification: %s", f->value (i)->toString ().c_str()); } -void IniParser::initFiles (const char*fn) +void IniParser::initFiles (const char* logical_filename) { - file = fn; + file = logical_filename; multiple_files = false; } int IniParser::initMachine (const YCPMap&scr) @@ -411,10 +411,10 @@ return 0; } -int IniParser::scanner_start(const char*fn) +int IniParser::scanner_start(const char* target_filename) { - scanner.open(agent.targetPath(fn)); - scanner_file = fn; + scanner.open(target_filename); + scanner_file = target_filename; scanner_line = 0; if (!scanner.is_open()) return -1; @@ -472,14 +472,14 @@ return false; } -FileDescr::FileDescr (const char*fn_) +FileDescr::FileDescr (const char* target_filename) { - fn = fn_; - sn = fn_; + fn = target_filename; + sn = target_filename; struct stat st; - if (stat(fn_, &st)) + if (stat(target_filename, &st)) { - y2error("Unable to stat '%s': %s", fn_, strerror(errno)); + y2error("Unable to stat '%s': %s", target_filename, strerror(errno)); timestamp = 0; } timestamp = st.st_mtime; @@ -494,14 +494,14 @@ int flags = 0; for (int i = 0;i<len;i++) { - glob (files[i].c_str (),flags, NULL, &do_files); + glob (agent.targetPath(files[i]).c_str(),flags, NULL, &do_files); flags = GLOB_APPEND; } - char**f = do_files.gl_pathv; - for (unsigned int i = 0;i<do_files.gl_pathc;i++, f++) + char**tgt_f = do_files.gl_pathv; + for (unsigned int i = 0;i<do_files.gl_pathc;i++, tgt_f++) { int section_index = -1; - string section_name = *f; + string section_name = *tgt_f; //FIXME: create function out of it. // do we have name rewrite rules? for (size_t j = 0; j < rewrites.size (); j++) @@ -511,22 +511,22 @@ { section_index = j; section_name = m[1]; - y2debug ("Rewriting %s to %s", *f, section_name.c_str()); + y2debug ("Rewriting %s to %s", *tgt_f, section_name.c_str()); break; } } // do we know about the file? - map<string,FileDescr>::iterator ff = multi_files.find (*f); - if (ff == multi_files.end()) + map<string,FileDescr>::iterator tgt_fi = multi_files.find (*tgt_f); + if (tgt_fi == multi_files.end()) { // new file - if (scanner_start (*f)) - y2error ("Cannot open %s.", *f); + if (scanner_start (*tgt_f)) + y2error ("Cannot open %s.", *tgt_f); else { - FileDescr fdsc (agent.targetPath(*f).c_str()); - multi_files[*f] = fdsc; + FileDescr fdsc (*tgt_f); + multi_files[*tgt_f] = fdsc; inifile.initSection (section_name, "", -1, section_index); parse_helper(inifile.getSection(section_name.c_str())); scanner_stop(); @@ -534,15 +534,15 @@ } else { - if ((*ff).second.changed ()) + if ((*tgt_fi).second.changed ()) { - if (scanner_start (*f)) - y2error ("Cannot open %s.", *f); + if (scanner_start (*tgt_f)) + y2error ("Cannot open %s.", *tgt_f); else { - y2debug ("File %s changed. Reloading.", *f); - FileDescr fdsc (agent.targetPath(*f).c_str()); - multi_files [*f] = fdsc; + y2debug ("File %s changed. Reloading.", *tgt_f); + FileDescr fdsc (*tgt_f); + multi_files [*tgt_f] = fdsc; inifile.initSection (section_name, "", -1, section_index); parse_helper(inifile.getSection(section_name.c_str())); scanner_stop(); @@ -553,9 +553,9 @@ } else { - if (scanner_start (file.c_str())) + if (scanner_start (agent.targetPath(file).c_str())) { - y2error ("Can not open %s.", file.c_str()); + y2error ("Can not open %s.", agent.targetPath(file).c_str()); return -1; } parse_helper(inifile); @@ -970,11 +970,11 @@ deleted_sections.erase (filename); if (!s.isDirty ()) { - y2debug ("Skipping file %s that was not changed.", filename.c_str()); + y2debug ("Skipping file %s that was not changed.", agent.targetPath(filename).c_str()); continue; } s.initReadBy (); - bugs += write_file(filename, s); + bugs += write_file(agent.targetPath(filename), s); } else { @@ -994,25 +994,25 @@ } else { - bugs += write_file(file, inifile); + bugs += write_file(agent.targetPath(file), inifile); timestamp = getTimeStamp (); } return bugs ? -1 : 0; } // return 0 on success, like write -int IniParser::write_file(const string & filename, IniSection & section) +int IniParser::write_file(const string & target_filename, IniSection & section) { // ensure that the directories exist - Pathname pn(filename); + Pathname pn(target_filename.c_str()); PathInfo::assert_dir (pn.dirname ()); mode_t file_umask = section.isPrivate()? 0077: 0022; mode_t orig_umask = umask(file_umask); - ofstream of(agent.targetPath(filename)); + ofstream of(target_filename); if (!of.good()) { - y2error ("Can not open file %s for write", filename.c_str()); + y2error ("Can not open file %s for write", target_filename.c_str()); return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-3.1.18/agent-ini/src/IniParser.h new/yast2-core-3.1.19/agent-ini/src/IniParser.h --- old/yast2-core-3.1.18/agent-ini/src/IniParser.h 2015-10-22 14:19:12.000000000 +0200 +++ new/yast2-core-3.1.19/agent-ini/src/IniParser.h 2016-01-21 15:49:16.000000000 +0100 @@ -234,7 +234,7 @@ struct FileDescr { /** - * File name + * Target file name including agent root prefix */ string fn; /** @@ -263,10 +263,13 @@ /** * Times of last modification of read files, used in multiple files * mode. + * Key is target filename. */ map<string,FileDescr> multi_files; /** * File name of the ini file -- single file mode only. + * It is a logical name, so without the agent root prefix and + * it needs to be prefixed when used. */ string file; /** @@ -333,7 +336,7 @@ */ ifstream scanner; /** - * name of scanned file + * name of scanned file. It is target name including agent root. */ string scanner_file; /** @@ -352,7 +355,7 @@ */ bool multiple_files; /** - * Vector of globe-expressions. + * Vector of glob-expressions. (logical, not target paths) */ vector<string> files; @@ -363,6 +366,7 @@ /** * Open ini file. + * @param fn target path */ int scanner_start(const char*fn); /** @@ -380,8 +384,9 @@ int parse_helper(IniSection&ini); /** * Write one ini file. + * @param target_filename is with agent root prefix */ - int write_file(const string & filename, IniSection & section); + int write_file(const string & target_filename, IniSection & section); /** * Write one ini file. */ @@ -415,12 +420,12 @@ ~IniParser (); /** * Sets parser to single file mode and sets the file name to read. - * @param fn file name of ini file + * @param fn file name of ini file (logical, not target) */ void initFiles (const char*fn); /** * Sets parser to multiple file mode and sets the glob-expressions. - * @param f list of glob-expressions + * @param f list of glob-expressions (logical, not target) */ void initFiles (const YCPList&f); /** @@ -457,6 +462,7 @@ /** * Get the file name of section. If there is a rewrite rule rb, * rewrites section name to file name using the rule rb. + * It does *not* add agent root prefix, so it keeps it a logical name. * @param sec section name * @param rb index of rewrite rule * @return rewritten file name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-3.1.18/package/yast2-core.changes new/yast2-core-3.1.19/package/yast2-core.changes --- old/yast2-core-3.1.18/package/yast2-core.changes 2015-10-22 14:19:13.000000000 +0200 +++ new/yast2-core-3.1.19/package/yast2-core.changes 2016-01-21 15:49:17.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Jan 19 10:08:56 UTC 2016 - [email protected] + +- ag_ini: when multifile list contain glob, evaluate it in correct + root. (bnc#962566) +- 3.1.19 + +------------------------------------------------------------------- Tue Oct 6 14:44:02 UTC 2015 - [email protected] - In the signal handler, log the sender PID, and if present, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-3.1.18/package/yast2-core.spec new/yast2-core-3.1.19/package/yast2-core.spec --- old/yast2-core-3.1.18/package/yast2-core.spec 2015-10-22 14:19:13.000000000 +0200 +++ new/yast2-core-3.1.19/package/yast2-core.spec 2016-01-21 15:49:17.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-core -Version: 3.1.18 +Version: 3.1.19 Release: 0 Url: https://github.com/yast/yast-core
