summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-03-12 20:33:05 +0100
committerMichael Vogt <mvo@debian.org>2014-03-12 20:33:05 +0100
commitc1409d1be88557529c62883be3174793481233de (patch)
tree56abe9525be918676c4f886ee19875054469e1cf /apt-pkg/contrib/fileutl.cc
parente43a426e5d402d36eb180935fbbf1430a4a86e3f (diff)
add hashsum support in apt-file download and add more tests
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 52411a762..79bcf112c 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1841,3 +1841,14 @@ std::string GetTempDir()
return string(tmpdir);
}
+
+bool Rename(std::string From, std::string To)
+{
+ if (rename(From.c_str(),To.c_str()) != 0)
+ {
+ _error->Error(_("rename failed, %s (%s -> %s)."),strerror(errno),
+ From.c_str(),To.c_str());
+ return false;
+ }
+ return true;
+}