3
* Copyright (c) 2001 Jason Gunthorpe <jgg@debian.org>
4
* 2002 Michael Vogt <mvo@debian.org>
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation; either version 2 of the
9
* License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23
// -*- mode: cpp; mode: fold -*-
24
// Description /*{{{*/
25
// $Id: indexcopy.h,v 1.3 2002/07/03 19:28:29 egon Exp $
26
/* ######################################################################
28
Index Copying - Aid for copying and verifying the index files
30
##################################################################### */
47
pkgTagSection *Section;
49
string ChopDirs(string Path,unsigned int Depth);
50
bool ReconstructPrefix(string &Prefix,string OrigPath,string CD,
52
bool ReconstructChop(unsigned long &Chop,string Dir,string File);
53
void ConvertToSourceList(string CD,string &Path);
54
bool GrabFirst(string Path,string &To,unsigned int Depth);
55
bool CopyWithReplace(FileFd &Target,const char *Tag,string New);
56
virtual bool GetFile(string &Filename,unsigned long &Size) = 0;
57
virtual bool RewriteEntry(FileFd &Target,string File) = 0;
58
virtual const char *GetFileName() = 0;
59
virtual const char *Type() = 0;
62
bool CopyPackages(string CDROM,string Name,vector<string> &List);
65
class PackageCopy : public IndexCopy
69
virtual bool GetFile(string &Filename,unsigned long &Size);
70
virtual bool RewriteEntry(FileFd &Target,string File);
71
virtual const char *GetFileName() {return "Packages";};
72
virtual const char *Type() {return "Package";};
77
class SourceCopy : public IndexCopy
81
virtual bool GetFile(string &Filename,unsigned long &Size);
82
virtual bool RewriteEntry(FileFd &Target,string File);
83
virtual const char *GetFileName() {return "Sources";};
84
virtual const char *Type() {return "Source";};