From 029c42bd92af3a0f6584cc7e3e035d643c7f0e91 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Tue, 30 Sep 2003 20:13:55 +0000 Subject: [PATCH] - renamed 'PACKAGE' class to 'Package' to avoid naming-clashes with the standard autoconf macro - include git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@18 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/vbuild.cc | 8 ++++++-- util-vserver/src/vcheck.cc | 12 ++++++++---- util-vserver/src/vfiles.cc | 8 ++++++-- util-vserver/src/vunify.cc | 12 ++++++++---- util-vserver/src/vutil.cc | 10 ++++++++-- 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/util-vserver/src/vbuild.cc b/util-vserver/src/vbuild.cc index 1ad79a9..adce35d 100644 --- a/util-vserver/src/vbuild.cc +++ b/util-vserver/src/vbuild.cc @@ -22,6 +22,10 @@ It uses hard link whenever possible instead of duplicating files. Once done, it sets the immutable bits. */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -243,12 +247,12 @@ int main (int argc, char *argv[]) }else{ string refserv = argv[i++]; string newserv = argv[i]; - list packages; + list packages; // Load the files which are not configuration files from // the packages vutil_loadallpkg (refserv,packages); set files; - for (list::iterator it=packages.begin(); it!=packages.end(); it++){ + for (list::iterator it=packages.begin(); it!=packages.end(); it++){ (*it).loadfiles(refserv,files); } // Now, we do a recursive copy of refserv into newserv diff --git a/util-vserver/src/vcheck.cc b/util-vserver/src/vcheck.cc index b2ff6e4..bd0c5bf 100644 --- a/util-vserver/src/vcheck.cc +++ b/util-vserver/src/vcheck.cc @@ -23,6 +23,10 @@ goal of this program is to run the rpm verify command, but using the RPM database of the first vserver. */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -55,7 +59,7 @@ static void usage() ; } -typedef list PACKAGES; +typedef list PACKAGES; /* Delete a directory silently @@ -134,7 +138,7 @@ static int vcheck_copydb (const string &refserv, const string &path) class cmp_name{ public: - int operator()(const PACKAGE &p1, const PACKAGE &p2){ + int operator()(const Package &p1, const Package &p2){ return strcmp(p1.name.c_str(),p2.name.c_str()); } }; @@ -181,8 +185,8 @@ int main (int argc, char *argv[]) common.push_back (*it); } } - for (list::iterator it=chkpkgs.begin(); it!=chkpkgs.end(); it++){ - list::iterator f = find_if(refpkgs.begin(),refpkgs.end(),same_name(*it)); + for (list::iterator it=chkpkgs.begin(); it!=chkpkgs.end(); it++){ + list::iterator f = find_if(refpkgs.begin(),refpkgs.end(),same_name(*it)); if (f == refpkgs.end()){ added.push_back (*it); } diff --git a/util-vserver/src/vfiles.cc b/util-vserver/src/vfiles.cc index 00a85ac..ce301af 100644 --- a/util-vserver/src/vfiles.cc +++ b/util-vserver/src/vfiles.cc @@ -21,6 +21,10 @@ This utility is used to extract the list of non unified files in a vserver. */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -124,12 +128,12 @@ int main (int argc, char *argv[]) }else{ string refserv = argv[i++]; string newserv = argv[i]; - list packages; + list packages; // Load the files which are not configuration files from // the packages vutil_loadallpkg (refserv,packages); set files; - for (list::iterator it=packages.begin(); it!=packages.end(); it++){ + for (list::iterator it=packages.begin(); it!=packages.end(); it++){ (*it).loadfiles(refserv,files); } struct stat st; diff --git a/util-vserver/src/vunify.cc b/util-vserver/src/vunify.cc index 0faa03b..7d89a0f 100644 --- a/util-vserver/src/vunify.cc +++ b/util-vserver/src/vunify.cc @@ -25,6 +25,10 @@ common package (RPM, same version), it does a hard link on non configuration file. It turns the file immutable after that. */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -102,20 +106,20 @@ static bool vunify_inside (vector &dirs, const char *path) return found; } -class PACKAGE_UNI: public PACKAGE{ +class PACKAGE_UNI: public Package{ public: list files; // Files to unify // This is loaded on demand PACKAGE_UNI(string &_name, string &_version) - : PACKAGE(_name,_version) + : Package(_name,_version) { } PACKAGE_UNI(const char *_name, const char *_version) - : PACKAGE (_name,_version) + : Package (_name,_version) { } PACKAGE_UNI(const string &line) - : PACKAGE (line) + : Package (line) { } // Load the file member of the package, but exclude configuration file diff --git a/util-vserver/src/vutil.cc b/util-vserver/src/vutil.cc index 94957a3..84f78de 100644 --- a/util-vserver/src/vutil.cc +++ b/util-vserver/src/vutil.cc @@ -18,6 +18,10 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma implementation +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -30,6 +34,8 @@ #include #include +#include + bool testmode; int debug; @@ -206,7 +212,7 @@ int vbuild_file_copy( /* Load the list of all packages in a vserver */ -void vutil_loadallpkg (string &refserver, list &packages) +void vutil_loadallpkg (string &refserver, list &packages) { FILE *fin = vutil_execdistcmd (K_PKGVERSION,refserver,NULL); if (fin != NULL){ @@ -214,7 +220,7 @@ void vutil_loadallpkg (string &refserver, list &packages) while (fgets(line,sizeof(line)-1,fin)!=NULL){ int last = strlen(line)-1; if (last >= 0 && line[last] == '\n') line[last] = '\0'; - packages.push_back (PACKAGE(line)); + packages.push_back (Package(line)); } pclose (fin); } -- 1.8.1.5