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>
}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
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>
;
}
-typedef list<PACKAGE> PACKAGES;
+typedef list<Package> PACKAGES;
/*
Delete a directory silently
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());
}
};
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);
}
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>
}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;
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>
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
// 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>
#include <sys/ioctl.h>
#include <linux/ext2_fs.h>
+#include <pathconfig.h>
+
bool testmode;
int debug;
/*
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){
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);
}