Index: pkgadd.h =================================================================== --- pkgadd.h (revision 8) +++ pkgadd.h (working copy) @@ -43,6 +43,10 @@ bool o_upgrade; bool o_force; + template + filenames_t make_keep_list(const in_t& files, + const vector& rules) const; + class config { vector rules; unsigned int linecount; @@ -60,10 +64,6 @@ void resolve_conflicts(); virtual void run(int argc, char** argv); virtual void print_help() const; - -private: - template - filenames_t make_keep_list(const in_t& files, const vector& rules) const; }; #endif /* PKGADD_H */ Index: pkginfo.cc =================================================================== --- pkginfo.cc (revision 8) +++ pkginfo.cc (working copy) @@ -19,12 +19,12 @@ // USA. // -#include "pkginfo.h" #include #include #include #include #include +#include "pkginfo.h" void pkginfo::run(int argc, char** argv) { Index: pkgadd.cc =================================================================== --- pkgadd.cc (revision 8) +++ pkgadd.cc (working copy) @@ -248,7 +248,8 @@ #ifndef NDEBUG cerr << "Configuration:" << endl; - for (vector::const_iterator j = rules.begin(); j != rules.end(); j++) { + vector::const_iterator j; + for (j = rules.begin(); j != rules.end(); j++) { cerr << "\t" << (*j).pattern << "\t" << (*j).action << endl; } cerr << endl; @@ -263,15 +264,20 @@ filenames_t keep_list; for (typename in_t::const_iterator i = files.begin(); i != files.end(); i++) { - for (vector::const_reverse_iterator j = rules.rbegin(); j != rules.rend(); j++) { + for (vector::const_reverse_iterator j = rules.rbegin(); + j != rules.rend(); j++) { if ((*j).event == rule_t::UPGRADE) { regex_t preg; - if (regcomp(&preg, (*j).pattern.c_str(), REG_EXTENDED | REG_NOSUB)) - throw runtime_error("error compiling regular expression '" + (*j).pattern + "', aborting"); + if (regcomp(&preg, (*j).pattern.c_str(), REG_EXTENDED | REG_NOSUB)) { + throw runtime_error("error compiling regular expression '" + + (*j).pattern + "', aborting"); + } if (!regexec(&preg, (extract_filename()((conv_t)(*i))).c_str(), 0, 0, 0)) { - if (!(*j).action) - keep_list.insert(keep_list.end(), extract_filename()((conv_t)(*i))); + if (!(*j).action) { + keep_list.insert(keep_list.end(), + extract_filename()((conv_t)(*i))); + } regfree(&preg); break; }