X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fvutil.cc;fp=src%2Fvutil.cc;h=770c79555d0a288874bae85c57ec9b6513c4b3e5;hb=780710c3d80b8776944dd1fc65a0fda64f399db0;hp=68bd4eaae53352026bfc17285964f90a400f7af2;hpb=8cf13bb177d92c93eb73dc8939777150536c2d00;p=util-vserver.git diff --git a/src/vutil.cc b/src/vutil.cc index 68bd4ea..770c795 100644 --- a/src/vutil.cc +++ b/src/vutil.cc @@ -1,4 +1,4 @@ -// $Id: vutil.cc,v 1.1.4.2 2003/11/18 22:30:44 ensc Exp $ +// $Id: vutil.cc,v 1.5 2004/02/06 17:42:53 ensc Exp $ // Copyright (C) 2003 Enrico Scholz // based on vutil.cc by Jacques Gelinas @@ -18,13 +18,9 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma implementation - #ifdef HAVE_CONFIG_H # include #endif -#include "compat.h" - -#undef PACKAGE #include #include @@ -36,9 +32,9 @@ #include #include "vutil.h" #include - #include "ext2fs.h" +#include bool testmode; int debug; @@ -216,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 (Vserver const &refserver, list &packages) { FILE *fin = vutil_execdistcmd (K_PKGVERSION,refserver,NULL); if (fin != NULL){ @@ -224,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); } @@ -245,10 +241,10 @@ const char K_PKGVERSION[]="pkgversion"; const char K_DUMPFILES[]="dumpfiles"; const char K_UNIFILES[]="unifiles"; -FILE *vutil_execdistcmd (const char *key, const string &vserver, const char *args) +FILE *vutil_execdistcmd (const char *key, Vserver const &vserver, const char *args) { - string cmd = PKGLIBDIR "/distrib-info "; - cmd += vserver; + string cmd = PKGLIBDIR "/legacy/distrib-info "; + cmd += vserver.getName(); cmd += " "; cmd += key; if (args != NULL){ @@ -272,4 +268,3 @@ FILE *vutil_execdistcmd (const char *key, const string &vserver, const char *arg } return ret; } -