// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: indexcopy.cc,v 1.7 2001/03/13 05:23:42 jgg Exp $
+// $Id: indexcopy.cc,v 1.10 2002/03/26 07:38:58 jgg Exp $
/* ######################################################################
Index Copying - Aid for copying and verifying the index files
#include <apt-pkg/configuration.h>
#include <apt-pkg/tagfile.h>
-#include <iostream.h>
+#include <iostream>
#include <unistd.h>
#include <sys/stat.h>
#include <stdio.h>
/*}}}*/
+using namespace std;
+
// IndexCopy::CopyPackages - Copy the package files from the CD /*{{{*/
// ---------------------------------------------------------------------
/* */
fclose(tmp);
// Fork gzip
- int Process = fork();
+ pid_t Process = fork();
if (Process < 0)
return _error->Errno("fork","Couldn't fork gzip");
SetCloseExec(STDOUT_FILENO,false);
const char *Args[3];
- Args[0] = _config->Find("Dir::bin::gzip","gzip").c_str();
+ string Tmp = _config->Find("Dir::bin::gzip","gzip");
+ Args[0] = Tmp.c_str();
Args[1] = "-d";
Args[2] = 0;
execvp(Args[0],(char **)Args);
cout << '.' << endl;
if (Packages == 0)
- return _error->Warning("No valid records were found.");
-
+ _error->Warning("No valid records were found.");
+
if (NotFound + WrongSize > 10)
cout << "Alot of entries were discarded, something may be wrong." << endl;
return;
// Not a dists type.
- if (stringcmp(Path.begin(),Path.begin()+strlen("dists/"),"dists/") != 0)
+ if (stringcmp(Path.c_str(),Path.c_str()+strlen("dists/"),"dists/") != 0)
return;
// Isolate the dist