summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-10-02 13:52:22 +0200
committerMichael Vogt <egon@bottom>2007-10-02 13:52:22 +0200
commit3346b385523c596c1db7667b4874a8617718de70 (patch)
tree9bef8479ffdc2e80ae83ffdf02255aac0b0beb9d
parent36fc5dca8b8eaa38a4ebd3ec52b462df44dd1b82 (diff)
parent59d5cc74ef7c6ca820ed9d26a4d829b891214edf (diff)
- fix parse error when dpkg sends unexpected data
* fix missing SetExecClose() call when the status-fd is used * debian/apt.cron.daily: - move unattended-upgrade before apt-get autoclean * fix "purge" commandline argument, closes: #133421 (thanks to Julien Danjou for the patch) * cmdline/apt-get.cc: - do not change the auto-installed information if a package is reinstalled * apt-pkg/acquire-item.cc: - fix crash in diff acquire code * cmdline/apt-mark: - Fix chmoding after have renamed the extended-states file (LP: #140019) (thanks to Laurent Bigonville) * apt-pkg/contrib/mmap.cc: - don't fail if msync() returns > 0
-rw-r--r--README.arch2
-rw-r--r--apt-pkg/acquire-item.cc2
-rw-r--r--apt-pkg/contrib/hashes.h1
-rw-r--r--apt-pkg/contrib/mmap.cc4
-rw-r--r--apt-pkg/deb/dpkgpm.cc6
-rw-r--r--apt-pkg/packagemanager.cc22
-rw-r--r--apt-pkg/packagemanager.h13
-rw-r--r--cmdline/apt-get.cc6
-rwxr-xr-xcmdline/apt-mark4
-rw-r--r--debian/apt.cron.daily12
-rw-r--r--debian/changelog18
11 files changed, 61 insertions, 29 deletions
diff --git a/README.arch b/README.arch
index 92870d614..364e940a4 100644
--- a/README.arch
+++ b/README.arch
@@ -1,7 +1,7 @@
You can build apt from arch, but this needs the following additional
packages (in addtion to the usual build-depends):
-xmlto perlsgml sgml2x sgmlspl docbook
+autoconf automake xmlto perlsgml sgml2x sgmlspl docbook
then run:
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 32798335c..a6d01e3bb 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -345,7 +345,7 @@ void pkgAcqDiffIndex::Done(string Message,unsigned long Size,string Md5Hash,
*/
pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
string URI,string URIDesc,string ShortDesc,
- HashString ExpectedMD5,
+ HashString ExpectedHash,
vector<DiffInfo> diffs)
: Item(Owner), RealURI(URI), ExpectedHash(ExpectedHash),
available_patches(diffs)
diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h
index 93e7b25d9..264f7fe90 100644
--- a/apt-pkg/contrib/hashes.h
+++ b/apt-pkg/contrib/hashes.h
@@ -20,6 +20,7 @@
#include <algorithm>
#include <vector>
+#include <cstring>
using std::min;
using std::vector;
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index 7f814c2d2..abcae46fe 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -117,7 +117,7 @@ bool MMap::Sync()
#ifdef _POSIX_SYNCHRONIZED_IO
if ((Flags & ReadOnly) != ReadOnly)
- if (msync((char *)Base,iSize,MS_SYNC) != 0)
+ if (msync((char *)Base,iSize,MS_SYNC) < 0)
return _error->Errno("msync","Unable to write mmap");
#endif
return true;
@@ -134,7 +134,7 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop)
#ifdef _POSIX_SYNCHRONIZED_IO
unsigned long PSize = sysconf(_SC_PAGESIZE);
if ((Flags & ReadOnly) != ReadOnly)
- if (msync((char *)Base+(int)(Start/PSize)*PSize,Stop - Start,MS_SYNC) != 0)
+ if (msync((char *)Base+(int)(Start/PSize)*PSize,Stop - Start,MS_SYNC) < 0)
return _error->Errno("msync","Unable to write mmap");
#endif
return true;
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index ac63ccfdf..b92d0118c 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -392,14 +392,14 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line)
// statusfd or by rewriting the code here to deal with
// it. for now we just ignore it and not crash
TokSplitString(':', line, list, sizeof(list)/sizeof(list[0]));
- char *pkg = list[1];
- char *action = _strstrip(list[2]);
- if( pkg == NULL || action == NULL)
+ if( list[0] == NULL || list[1] == NULL || list[2] == NULL)
{
if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
std::clog << "ignoring line: not enough ':'" << std::endl;
return;
}
+ char *pkg = list[1];
+ char *action = _strstrip(list[2]);
if(strncmp(action,"error",strlen("error")) == 0)
{
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 10e2858ed..d6172c6c4 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -25,7 +25,7 @@
#include <apti18n.h>
#include <iostream>
- /*}}}*/
+#include <fcntl.h>
using namespace std;
@@ -624,6 +624,26 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
return Completed;
}
/*}}}*/
+// PM::DoInstallPostFork - Does install part that happens after the fork /*{{{*/
+// ---------------------------------------------------------------------
+pkgPackageManager::OrderResult
+pkgPackageManager::DoInstallPostFork(int statusFd)
+{
+ if(statusFd > 0)
+ // FIXME: use SetCloseExec here once it taught about throwing
+ // exceptions instead of doing _exit(100) on failure
+ fcntl(statusFd,F_SETFD,FD_CLOEXEC);
+ bool goResult = Go(statusFd);
+ if(goResult == false)
+ return Failed;
+
+ // if all was fine update the state file
+ if(Res == Completed) {
+ Cache.writeStateFile(NULL);
+ }
+ return Res;
+};
+
// PM::DoInstall - Does the installation /*{{{*/
// ---------------------------------------------------------------------
/* This uses the filenames in FileNames and the information in the
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index 53600fb61..53cd4c96f 100644
--- a/apt-pkg/packagemanager.h
+++ b/apt-pkg/packagemanager.h
@@ -90,18 +90,7 @@ class pkgPackageManager : protected pkgCache::Namespace
};
// stuff that needs to be done after the fork
- OrderResult DoInstallPostFork(int statusFd=-1) {
- bool goResult = Go(statusFd);
- if(goResult == false)
- return Failed;
-
- // if all was fine update the state file
- if(Res == Completed) {
- Cache.writeStateFile(NULL);
- }
- return Res;
- };
-
+ OrderResult DoInstallPostFork(int statusFd=-1);
bool FixMissing();
pkgPackageManager(pkgDepCache *Cache);
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index c9ec481aa..e214691f8 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1708,7 +1708,8 @@ bool DoInstall(CommandLine &CmdL)
// where foo is marked automatic
if(!Remove &&
Cache[Pkg].Install() == false &&
- (Cache[Pkg].Flags & pkgCache::Flag::Auto))
+ (Cache[Pkg].Flags & pkgCache::Flag::Auto) &&
+ _config->FindB("APT::Get::ReInstall",false) == false)
{
ioprintf(c1out,_("%s set to manual installed.\n"),
Pkg.Name());
@@ -2471,6 +2472,7 @@ bool DoBuildDep(CommandLine &CmdL)
break;
}
if (CV.end() == true)
+ {
if (hasAlternatives)
{
continue;
@@ -2483,6 +2485,7 @@ bool DoBuildDep(CommandLine &CmdL)
Last->BuildDepType((*D).Type),Src.c_str(),
(*D).Package.c_str());
}
+ }
}
else
{
@@ -2752,6 +2755,7 @@ int main(int argc,const char *argv[])
{"install",&DoInstall},
{"remove",&DoInstall},
{"autoremove",&DoInstall},
+ {"purge",&DoInstall},
{"dist-upgrade",&DoDistUpgrade},
{"dselect-upgrade",&DoDSelectUpgrade},
{"build-dep",&DoBuildDep},
diff --git a/cmdline/apt-mark b/cmdline/apt-mark
index fdc3e1856..f6e749eb5 100755
--- a/cmdline/apt-mark
+++ b/cmdline/apt-mark
@@ -40,7 +40,7 @@ if __name__ == "__main__":
if not options.filename:
STATE_FILE = apt_pkg.Config.FindDir("Dir::State") + "extended_states"
else:
- STATE_FILE=options.state_file
+ STATE_FILE=options.filename
# open the statefile
if os.path.exists(STATE_FILE):
@@ -62,4 +62,4 @@ if __name__ == "__main__":
# all done, rename the tmpfile
os.chmod(outfile.name, 0644)
os.rename(outfile.name, STATE_FILE)
- os.chmod(outfile.name, 0644)
+ os.chmod(STATE_FILE, 0644)
diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily
index 778e3cefe..34d6b164f 100644
--- a/debian/apt.cron.daily
+++ b/debian/apt.cron.daily
@@ -186,17 +186,17 @@ if check_stamp $DOWNLOAD_UPGRADEABLE_STAMP $DownloadUpgradeableInterval; then
update_stamp $DOWNLOAD_UPGRADEABLE_STAMP
fi
-AUTOCLEAN_STAMP=/var/lib/apt/periodic/autoclean-stamp
-if check_stamp $AUTOCLEAN_STAMP $AutocleanInterval; then
- apt-get -qq autoclean
- update_stamp $AUTOCLEAN_STAMP
-fi
-
UPGRADE_STAMP=/var/lib/apt/periodic/upgrade-stamp
if check_stamp $UPGRADE_STAMP $UnattendedUpgradeInterval; then
unattended-upgrade
update_stamp $UPGRADE_STAMP
fi
+AUTOCLEAN_STAMP=/var/lib/apt/periodic/autoclean-stamp
+if check_stamp $AUTOCLEAN_STAMP $AutocleanInterval; then
+ apt-get -qq autoclean
+ update_stamp $AUTOCLEAN_STAMP
+fi
+
# check cache size
check_size_constraints
diff --git a/debian/changelog b/debian/changelog
index b4870ba64..bd8562f9c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,7 @@ apt (0.7.7) UNRELEASED; urgency=low
- merged dpkg-log branch, this lets you specify a
Dir::Log::Terminal file to log dpkg output to
(ABI break)
+ - fix parse error when dpkg sends unexpected data
* merged apt--sha256 branch to fully support the new
sha256 checksums in the Packages and Release files
(ABI break)
@@ -25,6 +26,19 @@ apt (0.7.7) UNRELEASED; urgency=low
- increase MaxPipeDepth for the internal worker<->method
communication to 1000 for the debtorrent backend
* make apt build with g++ 4.3
+ * fix missing SetExecClose() call when the status-fd is used
+ * debian/apt.cron.daily:
+ - move unattended-upgrade before apt-get autoclean
+ * fix "purge" commandline argument, closes: #133421
+ (thanks to Julien Danjou for the patch)
+ * cmdline/apt-get.cc:
+ - do not change the auto-installed information if a package
+ is reinstalled
+ * apt-pkg/acquire-item.cc:
+ - fix crash in diff acquire code
+ * cmdline/apt-mark:
+ - Fix chmoding after have renamed the extended-states file (LP: #140019)
+ (thanks to Laurent Bigonville)
[ Program translations ]
- French updated
@@ -46,6 +60,10 @@ apt (0.7.7) UNRELEASED; urgency=low
[ Ian Jackson ]
* dpkg-triggers: Deal properly with new package states.
+ [ Colin Watson ]
+ * apt-pkg/contrib/mmap.cc:
+ - don't fail if msync() returns > 0
+
-- Otavio Salvador <otavio@debian.org> Mon, 06 Aug 2007 10:44:53 -0300
apt (0.7.6) unstable; urgency=low