From 1792371c2700e42a18c934a91442340c4fce7924 Mon Sep 17 00:00:00 2001 From: Ishan Jayawardena Date: Sat, 25 Jun 2011 19:31:30 +0530 Subject: Added the replacement rule for replacing regular URIs with that of debdelta repo. --- methods/debdelta.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'methods/debdelta.cc') diff --git a/methods/debdelta.cc b/methods/debdelta.cc index 6c78c3990..158beb05f 100644 --- a/methods/debdelta.cc +++ b/methods/debdelta.cc @@ -22,7 +22,6 @@ * */ class DebdeltaMethod : public pkgAcqMethod { bool Debug; - string NewPackageName; string DebdeltaFile; string FromFile; string ToFile; @@ -77,8 +76,8 @@ bool DebdeltaMethod::Fetch(FetchItem *Itm) /*{{{*/ } if (ExecWait(Process, "debpatch")) { - if (!FileExists(Itm->DestFile)) - return _error->Error("[Debdelta] Failed to patch %s", Itm->DestFile.c_str()); + if (!FileExists(ToFile)) + return _error->Error("[Debdelta] Failed to patch %s", ToFile.c_str()); // move the .deb to Dir::Cache::Archives string FinalFile = _config->FindDir("Dir::Cache::Archives") + flNotDir(ToFile); Rename(ToFile, FinalFile); @@ -97,8 +96,7 @@ bool DebdeltaMethod::Fetch(FetchItem *Itm) /*{{{*/ void DebdeltaMethod::MakeToFile() { - int Slashpos = DebdeltaFile.rfind("/", DebdeltaFile.length() - 1); - string DebdeltaName = DebdeltaFile.substr(Slashpos + 1, DebdeltaFile.length() - 1); + string DebdeltaName = flNotDir(DebdeltaFile); int NewBegin = DebdeltaName.find("_", 0); string PkgName = DebdeltaName.substr(0, NewBegin); NewBegin = DebdeltaName.find("_", NewBegin + 1); @@ -130,14 +128,14 @@ public: return 100; } _config->CndSet("Debug::pkgAcquire::Debdetla", "true"); - FetchItem *test = new FetchItem; - test->DestFile = FromFile; - test->Uri = "debdelta://" + string(DebdeltaFile); - test->FailIgnore = false; - test->IndexFile = false; - test->Next = 0; + FetchItem *Test = new FetchItem; + Test->DestFile = FromFile; + Test->Uri = "debdelta://" + string(DebdeltaFile); + Test->FailIgnore = false; + Test->IndexFile = false; + Test->Next = 0; - return Fetch(test); + return Fetch(Test); } }; -- cgit v1.2.3