- renamed 'PACKAGE' class to 'Package' to avoid naming-clashes with
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 30 Sep 2003 20:13:55 +0000 (20:13 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 30 Sep 2003 20:13:55 +0000 (20:13 +0000)
  the standard autoconf macro
- include <config.h>

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@18 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/vbuild.cc
util-vserver/src/vcheck.cc
util-vserver/src/vfiles.cc
util-vserver/src/vunify.cc
util-vserver/src/vutil.cc

index 1ad79a9..adce35d 100644 (file)
        It uses hard link whenever possible instead of duplicating files.
        Once done, it sets the immutable bits.
 */
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <stdio.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
@@ -243,12 +247,12 @@ int main (int argc, char *argv[])
        }else{
                string refserv = argv[i++];
                string newserv = argv[i];
-               list<PACKAGE> packages;
+               list<Package> packages;
                // Load the files which are not configuration files from
                // the packages
                vutil_loadallpkg (refserv,packages);
                set<string> files;
-               for (list<PACKAGE>::iterator it=packages.begin(); it!=packages.end(); it++){
+               for (list<Package>::iterator it=packages.begin(); it!=packages.end(); it++){
                        (*it).loadfiles(refserv,files);
                }
                // Now, we do a recursive copy of refserv into newserv
index b2ff6e4..bd0c5bf 100644 (file)
        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 <config.h>
+#endif
+
 #include <stdio.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -55,7 +59,7 @@ static void usage()
                ;
 }
 
-typedef list<PACKAGE> PACKAGES;
+typedef list<Package> 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<PACKAGE>::iterator it=chkpkgs.begin(); it!=chkpkgs.end(); it++){
-                       list<PACKAGE>::iterator f = find_if(refpkgs.begin(),refpkgs.end(),same_name(*it));
+               for (list<Package>::iterator it=chkpkgs.begin(); it!=chkpkgs.end(); it++){
+                       list<Package>::iterator f = find_if(refpkgs.begin(),refpkgs.end(),same_name(*it));
                        if (f == refpkgs.end()){
                                added.push_back (*it);
                        }
index 00a85ac..ce301af 100644 (file)
        This utility is used to extract the list of non unified files in
        a vserver.
 */
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <stdio.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
@@ -124,12 +128,12 @@ int main (int argc, char *argv[])
        }else{
                string refserv = argv[i++];
                string newserv = argv[i];
-               list<PACKAGE> packages;
+               list<Package> packages;
                // Load the files which are not configuration files from
                // the packages
                vutil_loadallpkg (refserv,packages);
                set<string> files;
-               for (list<PACKAGE>::iterator it=packages.begin(); it!=packages.end(); it++){
+               for (list<Package>::iterator it=packages.begin(); it!=packages.end(); it++){
                        (*it).loadfiles(refserv,files);
                }
                struct stat st;
index 0faa03b..7d89a0f 100644 (file)
        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 <config.h>
+#endif
+
 #include <stdio.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
@@ -102,20 +106,20 @@ static bool vunify_inside (vector<EXCLDIR> &dirs, const char *path)
        return found;
 }
 
-class PACKAGE_UNI: public PACKAGE{
+class PACKAGE_UNI: public Package{
 public:
        list<string> 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
index 94957a3..84f78de 100644 (file)
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 #pragma implementation
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
@@ -30,6 +34,8 @@
 #include <sys/ioctl.h>
 #include <linux/ext2_fs.h>
 
+#include <pathconfig.h>
+
 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<PACKAGE> &packages)
+void vutil_loadallpkg (string &refserver, list<Package> &packages)
 {
        FILE *fin = vutil_execdistcmd (K_PKGVERSION,refserver,NULL);
        if (fin != NULL){
@@ -214,7 +220,7 @@ void vutil_loadallpkg (string &refserver, list<PACKAGE> &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);
        }