summaryrefslogtreecommitdiff
path: root/methods/gzip.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:55:48 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:55:48 +0000
commit4509574a4ebc577706d2feaa8628c95c80f6e085 (patch)
tree4e573fd5dfe301ac27d57ea3a13f3faa8e678d28 /methods/gzip.cc
parentaee86e6efa7947f2985140732a63e605704c9aa9 (diff)
Fixed relative paths
Author: jgg Date: 2000-03-18 07:39:33 GMT Fixed relative paths
Diffstat (limited to 'methods/gzip.cc')
-rw-r--r--methods/gzip.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/methods/gzip.cc b/methods/gzip.cc
index 337219316..78b196115 100644
--- a/methods/gzip.cc
+++ b/methods/gzip.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: gzip.cc,v 1.9 1999/12/10 23:40:29 jgg Exp $
+// $Id: gzip.cc,v 1.10 2000/03/18 07:39:33 jgg Exp $
/* ######################################################################
GZip method - Take a file URI in and decompress it into the target
@@ -35,13 +35,14 @@ class GzipMethod : public pkgAcqMethod
bool GzipMethod::Fetch(FetchItem *Itm)
{
URI Get = Itm->Uri;
-
+ string Path = Get.Host + Get.Path; // To account for relative paths
+
FetchResult Res;
Res.Filename = Itm->DestFile;
URIStart(Res);
// Open the source and destintation files
- FileFd From(Get.Path,FileFd::ReadOnly);
+ FileFd From(Path,FileFd::ReadOnly);
FileFd To(Itm->DestFile,FileFd::WriteEmpty);
To.EraseOnFailure();
if (_error->PendingError() == true)
@@ -82,7 +83,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
// Transfer the modification times
struct stat Buf;
- if (stat(Get.Path.c_str(),&Buf) != 0)
+ if (stat(Path.c_str(),&Buf) != 0)
return _error->Errno("stat","Failed to stat");
struct utimbuf TimeBuf;