diff options
author | Ishan Jayawardena <udeshike@gmail.com> | 2011-06-25 19:31:30 +0530 |
---|---|---|
committer | Ishan Jayawardena <udeshike@gmail.com> | 2011-06-25 19:31:30 +0530 |
commit | 1792371c2700e42a18c934a91442340c4fce7924 (patch) | |
tree | 9578dd3d2a6707110dffaba793fc8740afd78c38 /methods | |
parent | 5da0f9fd194b76fd82482fbe533d963fc87f315d (diff) |
Added the replacement rule for replacing regular URIs with that of debdelta repo.
Diffstat (limited to 'methods')
-rw-r--r-- | methods/debdelta.cc | 22 |
1 files changed, 10 insertions, 12 deletions
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); } }; |