diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-04-01 12:28:56 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-04-01 12:28:56 +0200 |
commit | be20eef52da4b7f361333ea70a8d705a98ae779e (patch) | |
tree | 4177a110ce6b1335fc4b85d5e53b298a65661f39 /ftparchive/multicompress.cc | |
parent | a555cf8be53d8b5557f004ecbde8482a169b79f3 (diff) | |
parent | 21b3eac8f9ab8e12b43fa8998a5aa5465f29adc5 (diff) |
Merge remote-tracking branch 'upstream/debian/sid' into feature/apt-manpage
Conflicts:
cmdline/apt.cc
Diffstat (limited to 'ftparchive/multicompress.cc')
-rw-r--r-- | ftparchive/multicompress.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index 1fea589e2..f35d5304a 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -20,12 +20,15 @@ #include <apt-pkg/strutl.h> #include <apt-pkg/error.h> #include <apt-pkg/md5.h> +#include <apt-pkg/aptconfiguration.h> +#include <apt-pkg/hashsum_template.h> +#include <ctype.h> +#include <vector> #include <sys/types.h> #include <sys/stat.h> -#include <utime.h> +#include <sys/time.h> #include <unistd.h> -#include <iostream> #include "multicompress.h" #include <apti18n.h> @@ -234,14 +237,12 @@ bool MultiCompress::Finalize(unsigned long long &OutSize) else { // Update the mtime if necessary - if (UpdateMTime > 0 && + if (UpdateMTime > 0 && (Now - St.st_mtime > (signed)UpdateMTime || St.st_mtime > Now)) { - struct utimbuf Buf; - Buf.actime = Buf.modtime = Now; - utime(I->Output.c_str(),&Buf); + utimes(I->Output.c_str(), NULL); Changed = true; - } + } } // Force the file permissions @@ -367,7 +368,7 @@ bool MultiCompress::Child(int const &FD) for (Files *I = Outputs; I != 0; I = I->Next) { // Set the correct file modes - fchmod(I->TmpFile.Fd(),Permissions); + chmod(I->TmpFile.Name().c_str(),Permissions); if (rename(I->TmpFile.Name().c_str(),I->Output.c_str()) != 0) _error->Errno("rename",_("Failed to rename %s to %s"), |