summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.cc18
-rw-r--r--apt-pkg/init.cc4
-rwxr-xr-xaptget22
-rw-r--r--methods/debdelta.cc8
-rw-r--r--methods/makefile7
5 files changed, 25 insertions, 14 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 4160767b7..0224a73fe 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -2291,18 +2291,20 @@ void pkgAcqDebdelta::Finished()
bool pkgAcqDebdelta::ReplaceURI()
{
- const Configuration::Item* item =_config->Tree("Aquire::Debdelta::Replace-Rule");
- for (item = item->Child; item != 0; item = item->Next) {
+ const Configuration::Item* item = _config->Tree("Aquire::Debdelta::Replace-Rule");
+ for (item = item->Child; item != 0; item = item->Next)
+ {
size_t pos = 0;
// see if the Des.URI is available in the URI-Space
if ((pos = Desc.URI.find(item->Tag, pos)) != std::string::npos)
{
- Desc.URI.replace(pos, item->Tag.length(), item->Value);
- if (Debug) {
- std::cerr << "[Debdelta] Replaced " << item->Tag << " => " << item->Value << std::endl;
- std::cerr << " New URI: " << Desc.URI << std::endl;
- }
- return true;
+ Desc.URI.replace(pos, item->Tag.length(), item->Value);
+ if (Debug)
+ {
+ std::cerr << "[Debdelta] Replaced " << item->Tag << " => " << item->Value << std::endl;
+ std::cerr << " New URI: " << Desc.URI << std::endl;
+ }
+ return true;
}
}
return _error->Error("[Debdelta] Could not find a replacement URI.");
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index 55b6b64f4..d3f573356 100644
--- a/apt-pkg/init.cc
+++ b/apt-pkg/init.cc
@@ -41,8 +41,8 @@ bool pkgInitConfig(Configuration &Cnf)
Cnf.Set("Dir","/");
// Debdelta replacement rule
- Cnf.Set("Aquire::Debdelta::Replace-Rule::Default", "http://debdeltas.debian.net/debian-deltas/");
- Cnf.Set("Aquire::Debdelta::Replace-Rule::http://security.debian.org/", "http://debdeltas.debian.net/debian-security-deltas/");
+ Cnf.Set("Aquire::Debdelta::Replace-Rule::Default", "http://debdeltas.debian.net/debian-deltas/");// http://www.bononia.it/debian-deltas/
+ Cnf.Set("Aquire::Debdelta::Replace-Rule::http://security.debian.org/", "http://debdeltas.debian.net/debian-security-deltas/"); // http://security.ubuntu.com/ubuntu/ => http://www.bononia.it/debian-security-deltas/
// State
Cnf.Set("Dir::State","var/lib/apt/");
diff --git a/aptget2 b/aptget2
index 7b791880d..ac032d343 100755
--- a/aptget2
+++ b/aptget2
@@ -1,2 +1,2 @@
#!/bin/bash
-LD_LIBRARY_PATH=$PWD/build/bin $PWD/build/bin/apt-get $*
+LD_LIBRARY_PATH=$PWD/build/bin $PWD/build/bin/apt-get -o Dir::Bin::methods=$PWD/build/bin/methods $*
diff --git a/methods/debdelta.cc b/methods/debdelta.cc
index 158beb05f..42d91a6dc 100644
--- a/methods/debdelta.cc
+++ b/methods/debdelta.cc
@@ -57,7 +57,7 @@ bool DebdeltaMethod::Fetch(FetchItem *Itm) /*{{{*/
pid_t Process = ExecFork();
if (Process == 0)
{
- const char* Args[6] = {0};
+ const char* Args[8] = {0};
Args[0] = "/usr/bin/debpatch";
if (!FileExists(Args[0]))
return _error->Error("[Debdelta] Could not find debpatch.");
@@ -65,16 +65,18 @@ bool DebdeltaMethod::Fetch(FetchItem *Itm) /*{{{*/
Args[2] = DebdeltaFile.c_str();
Args[3] = FromFile.c_str();
Args[4] = ToFile.c_str();
+ Args[5] = "1>&2";
+ Args[6] = "2>/dev/null";
if (Debug == true)
{
std::cerr << "[Debdelta] Command:" << std::endl;
std::cerr << Args[0] << " " << Args[1] << " " << Args[2] << " " << Args[3] << " "
<< Args[4] << std::endl;
}
- std::cerr << "[Debdelta] Patching " << ToFile << "..." << std::endl;
+ std::cerr << "[Debdelta] Patching " << ToFile << "...\r";
execv(Args[0], (char **)Args);
}
- if (ExecWait(Process, "debpatch"))
+ if (ExecWait(Process, "debpatch", false))
{
if (!FileExists(ToFile))
return _error->Error("[Debdelta] Failed to patch %s", ToFile.c_str());
diff --git a/methods/makefile b/methods/makefile
index 6ba51058e..666b543f0 100644
--- a/methods/makefile
+++ b/methods/makefile
@@ -72,6 +72,13 @@ LIB_MAKES = apt-pkg/makefile
SOURCE = rred.cc
include $(PROGRAM_H)
+# The debdelta method
+PROGRAM=debdelta
+SLIBS = -lapt-pkg -lz $(SOCKETLIBS) $(INTLLIBS)
+LIB_MAKES = apt-pkg/makefile
+SOURCE = debdelta.cc
+include $(PROGRAM_H)
+
# The rsh method
PROGRAM=rsh
SLIBS = -lapt-pkg $(INTLLIBS)