summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.h3
-rw-r--r--apt-pkg/acquire-worker.h3
-rw-r--r--apt-pkg/acquire.h3
-rw-r--r--apt-pkg/contrib/weakptr.h62
-rw-r--r--apt-pkg/deb/debrecords.cc3
-rw-r--r--apt-pkg/makefile2
-rw-r--r--cmdline/apt-cache.cc27
-rw-r--r--cmdline/apt-get.cc50
-rwxr-xr-xcmdline/apt-mark3
-rw-r--r--configure.in2
-rw-r--r--debian/changelog83
-rw-r--r--debian/control5
-rwxr-xr-xdebian/rules3
13 files changed, 209 insertions, 40 deletions
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index bafa8263a..b338b2a41 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -27,6 +27,7 @@
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/indexrecords.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/weakptr.h>
/** \addtogroup acquire
* @{
@@ -46,7 +47,7 @@
*
* \see pkgAcquire
*/
-class pkgAcquire::Item
+class pkgAcquire::Item : public WeakPointable
{
protected:
diff --git a/apt-pkg/acquire-worker.h b/apt-pkg/acquire-worker.h
index 2942df69f..06283922e 100644
--- a/apt-pkg/acquire-worker.h
+++ b/apt-pkg/acquire-worker.h
@@ -20,6 +20,7 @@
#define PKGLIB_ACQUIRE_WORKER_H
#include <apt-pkg/acquire.h>
+#include <apt-pkg/weakptr.h>
/** \brief A fetch subprocess.
@@ -41,7 +42,7 @@
*
* \sa pkgAcqMethod, pkgAcquire::Item, pkgAcquire
*/
-class pkgAcquire::Worker
+class pkgAcquire::Worker : public WeakPointable
{
friend class pkgAcquire;
diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h
index 9e91a9f67..8e2c21151 100644
--- a/apt-pkg/acquire.h
+++ b/apt-pkg/acquire.h
@@ -67,6 +67,7 @@
#define PKGLIB_ACQUIRE_H
#include <apt-pkg/macros.h>
+#include <apt-pkg/weakptr.h>
#include <vector>
#include <string>
@@ -376,7 +377,7 @@ class pkgAcquire
*
* An item may have several assocated ItemDescs over its lifetime.
*/
-struct pkgAcquire::ItemDesc
+struct pkgAcquire::ItemDesc : public WeakPointable
{
/** \brief The URI from which to download this item. */
string URI;
diff --git a/apt-pkg/contrib/weakptr.h b/apt-pkg/contrib/weakptr.h
new file mode 100644
index 000000000..5158e393c
--- /dev/null
+++ b/apt-pkg/contrib/weakptr.h
@@ -0,0 +1,62 @@
+/* weakptr.h - An object which supports weak pointers.
+ *
+ * Copyright (C) 2010 Julian Andres Klode <jak@debian.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef WEAK_POINTER_H
+#define WEAK_POINTER_H
+
+#include <set>
+/**
+ * Class for objects providing support for weak pointers.
+ *
+ * This class allows for the registration of certain pointers as weak,
+ * which will cause them to be set to NULL when the destructor of the
+ * object is called.
+ */
+class WeakPointable {
+private:
+ std::set<WeakPointable**> pointers;
+
+public:
+
+ /**
+ * Add a new weak pointer.
+ */
+ inline void AddWeakPointer(WeakPointable** weakptr) {
+ pointers.insert(weakptr);
+ }
+
+ /**
+ * Remove the weak pointer from the list of weak pointers.
+ */
+ inline void RemoveWeakPointer(WeakPointable **weakptr) {
+ pointers.erase(weakptr);
+ }
+
+ /**
+ * Deconstruct the object, set all weak pointers to NULL.
+ */
+ ~WeakPointable() {
+ std::set<WeakPointable**>::iterator iter = pointers.begin();
+ while (iter != pointers.end())
+ **(iter++) = NULL;
+ }
+};
+
+#endif // WEAK_POINTER_H
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index 5b8538a46..34ef0d8f2 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -20,7 +20,8 @@
/* */
debRecordParser::debRecordParser(string FileName,pkgCache &Cache) :
File(FileName,FileFd::ReadOnly),
- Tags(&File,Cache.Head().MaxVerFileSize + 200)
+ Tags(&File, std::max(Cache.Head().MaxVerFileSize,
+ Cache.Head().MaxDescFileSize) + 200)
{
}
/*}}}*/
diff --git a/apt-pkg/makefile b/apt-pkg/makefile
index bdd49c089..148ad581b 100644
--- a/apt-pkg/makefile
+++ b/apt-pkg/makefile
@@ -25,7 +25,7 @@ SOURCE = contrib/mmap.cc contrib/error.cc contrib/strutl.cc \
contrib/fileutl.cc
HEADERS = mmap.h error.h configuration.h fileutl.h cmndline.h netrc.h\
md5.h crc-16.h cdromutl.h strutl.h sptr.h sha1.h sha256.h hashes.h \
- macros.h
+ macros.h weakptr.h
# Source code for the core main library
SOURCE+= pkgcache.cc version.cc depcache.cc \
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index b981e2fa7..10dbf44d2 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -14,7 +14,9 @@
/*}}}*/
// Include Files /*{{{*/
#include <apt-pkg/error.h>
+#include <cassert>
#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/cachefile.h>
#include <apt-pkg/init.h>
#include <apt-pkg/progress.h>
#include <apt-pkg/sourcelist.h>
@@ -1406,6 +1408,29 @@ bool Search(CommandLine &CmdL)
return _error->Error("Write to stdout failed");
return true;
}
+
+
+/* show automatically installed packages (sorted) */
+bool ShowAuto(CommandLine &CmdL)
+{
+ OpProgress op;
+ pkgDepCache DepCache(GCache);
+ DepCache.Init(&op);
+
+ std::vector<string> packages;
+ packages.reserve(GCache->HeaderP->PackageCount / 3);
+
+ for (pkgCache::PkgIterator P = GCache->PkgBegin(); P.end() == false; P++)
+ if (DepCache[P].Flags & pkgCache::Flag::Auto)
+ packages.push_back(P.Name());
+
+ std::sort(packages.begin(), packages.end());
+
+ for (vector<string>::iterator I = packages.begin(); I != packages.end(); I++)
+ cout << *I << "\n";
+
+ return true;
+}
/*}}}*/
// ShowPackage - Dump the package record to the screen /*{{{*/
// ---------------------------------------------------------------------
@@ -1777,6 +1802,7 @@ bool ShowHelp(CommandLine &Cmd)
" unmet - Show unmet dependencies\n"
" search - Search the package list for a regex pattern\n"
" show - Show a readable record for the package\n"
+ " showauto - Display a list of automatically installed packages\n"
" depends - Show raw dependency information for a package\n"
" rdepends - Show reverse dependency information for a package\n"
" pkgnames - List the names of all packages in the system\n"
@@ -1841,6 +1867,7 @@ int main(int argc,const char *argv[]) /*{{{*/
{"xvcg",&XVcg},
{"show",&ShowPackage},
{"pkgnames",&ShowPkgNames},
+ {"showauto",&ShowAuto},
{"policy",&Policy},
{"madison",&Madison},
{0,0}};
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index de8c7aeaf..00da0855f 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1315,6 +1315,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
break;
fuzzy = true;
Ver = Pkg.VersionList();
+ // exit right away from the Pkg.VersionList() loop if we
+ // don't have any versions
+ if (Ver.end() == true)
+ break;
}
// We match against a concrete version (or a part of this version)
if (VerTag.empty() == false &&
@@ -1934,7 +1938,7 @@ bool DoInstall(CommandLine &CmdL)
string target = Start.TargetPkg().FullName(true) + " ";
pkgCache::PkgIterator const TarPkg = Start.TargetPkg();
if (TarPkg->SelectedState == pkgCache::State::Install ||
- TarPkg->SelectedState == pkgCache::State::Hold ||
+ TarPkg->SelectedState == pkgCache::State::Hold ||
Cache[Start.TargetPkg()].Install())
{
foundInstalledInOrGroup=true;
@@ -2010,6 +2014,46 @@ bool DoInstall(CommandLine &CmdL)
return InstallPackages(Cache,false);
}
+
+/* mark packages as automatically/manually installed. */
+bool DoMarkAuto(CommandLine &CmdL)
+{
+ bool Action = true;
+ int AutoMarkChanged = 0;
+ OpTextProgress progress;
+ CacheFile Cache;
+ if (Cache.Open() == false)
+ return false;
+
+ if (strcasecmp(CmdL.FileList[0],"markauto") == 0)
+ Action = true;
+ else if (strcasecmp(CmdL.FileList[0],"unmarkauto") == 0)
+ Action = false;
+
+ for (const char **I = CmdL.FileList + 1; *I != 0; I++)
+ {
+ const char *S = *I;
+ // Locate the package
+ pkgCache::PkgIterator Pkg = Cache->FindPkg(S);
+ if (Pkg.end() == true) {
+ return _error->Error(_("Couldn't find package %s"),S);
+ }
+ else
+ {
+ if (!Action)
+ ioprintf(c1out,_("%s set to manually installed.\n"), Pkg.Name());
+ else
+ ioprintf(c1out,_("%s set to automatically installed.\n"),
+ Pkg.Name());
+
+ Cache->MarkAuto(Pkg,Action);
+ AutoMarkChanged++;
+ }
+ }
+ if (AutoMarkChanged && ! _config->FindB("APT::Get::Simulate",false))
+ return Cache->writeStateFile(NULL);
+ return false;
+}
/*}}}*/
// DoDistUpgrade - Automatic smart upgrader /*{{{*/
// ---------------------------------------------------------------------
@@ -2796,6 +2840,8 @@ bool ShowHelp(CommandLine &CmdL)
" clean - Erase downloaded archive files\n"
" autoclean - Erase old downloaded archive files\n"
" check - Verify that there are no broken dependencies\n"
+ " markauto - Mark the given packages as automatically installed\n"
+ " unmarkauto - Mark the given packages as manually installed\n"
"\n"
"Options:\n"
" -h This help text.\n"
@@ -2902,6 +2948,8 @@ int main(int argc,const char *argv[]) /*{{{*/
{"purge",&DoInstall},
{"autoremove",&DoInstall},
{"purge",&DoInstall},
+ {"markauto",&DoMarkAuto},
+ {"unmarkauto",&DoMarkAuto},
{"dist-upgrade",&DoDistUpgrade},
{"dselect-upgrade",&DoDSelectUpgrade},
{"build-dep",&DoBuildDep},
diff --git a/cmdline/apt-mark b/cmdline/apt-mark
index 12768b708..c64d4356c 100755
--- a/cmdline/apt-mark
+++ b/cmdline/apt-mark
@@ -8,7 +8,7 @@ import os.path
try:
import apt_pkg
except ImportError:
- print "Error importing apt_pkg, is python-apt installed?"
+ print >> sys.stderr, "Error importing apt_pkg, is python-apt installed?"
sys.exit(1)
actions = { "markauto" : 1,
@@ -68,6 +68,7 @@ if __name__ == "__main__":
# option parsing
parser = OptionParser()
parser.usage = "%prog [options] {markauto|unmarkauto} packages..."
+ parser.epilog = "apt-mark is deprecated, use apt-get markauto/unmarkauto."
parser.add_option("-f", "--file", action="store", type="string",
dest="filename",
help="read/write a different file")
diff --git a/configure.in b/configure.in
index 302d88d51..5e7122f33 100644
--- a/configure.in
+++ b/configure.in
@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.7.25")
+AC_DEFINE_UNQUOTED(VERSION,"0.7.26~exp4")
PACKAGE="apt"
AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
AC_SUBST(PACKAGE)
diff --git a/debian/changelog b/debian/changelog
index 144d307fa..43f76a18e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,20 +1,31 @@
-apt (0.7.26~exp4) UNRELEASED; urgency=low
+apt (0.7.26~exp5) UNRELEASED; urgency=low
- [ Michael Vogt ]
- * [ Abi break ] apt-pkg/acquire-item.{cc,h}:
- - add "IsIndexFile" to constructor of pkgAcqFile so that it sends
- the right cache control headers
- * apt-pkg/depcache.cc:
- - fix incorrect std::cout usage for debug output
- * test/libapt/getlanguages_test.cc:
- - Add test for Esperanto that has nocounty associated with them
- (LP: #560956)
+ [ David Kalnischkies ]
+ * cmdline/apt-get.cc:
+ - rerun dpkg-source in source if --fix-broken is given (Closes: #576752)
+ - don't suggest held packages as they are installed (Closes: #578135)
+ * cmdline/apt-cache.cc:
+ - use GroupCount for package names in stats and add a package struct line
+ * methods/rred.cc:
+ - use the patchfile modification time instead of the one from the
+ "old" file - thanks to Philipp Weis for noticing! (Closes: #571541)
+ * debian/rules:
+ - remove targets refering to CVS or arch as they are useless
+
+ [ Jari Aalto ]
+ * debian/rules:
+ - spell out some less known options to reduce manpage consulation-rate
+ - Use POSIX command substitution: $(<command sequence>)
+ - Remove EOL whitespace (Closes: #577804)
+
+ -- David Kalnischkies <kalnischkies@gmail.com> Thu, 06 May 2010 16:10:39 +0200
+
+apt (0.7.26~exp4) experimental; urgency=low
[ David Kalnischkies ]
* apt-pkg/depcache.cc:
- rewrite the pseudo package reinstaller to be more intelligent
in his package choices
- - return in SingleArch a package also for "any"
* apt-pkg/packagemanager.cc:
- don't try to "unpack" pseudo packages twice
* apt-pkg/contrib/fileutl.cc:
@@ -33,8 +44,6 @@ apt (0.7.26~exp4) UNRELEASED; urgency=low
- regex for package names executed on Grp- not PkgIterator
- show non-candidates as fallback for virtual packages (Closes: #578385)
- set also "all" to this version for pseudo packages in TryToChangeVer
- - rerun dpkg-source in source if --fix-broken is given (Closes: #576752)
- - don't suggest held packages as they are installed (Closes: #578135)
* apt-pkg/deb/dpkgpm.cc:
- remove Chroot-Directory from files passed to install commands.
Thanks to Kel Modderman for report & patch! (Closes: #577226)
@@ -43,7 +52,6 @@ apt (0.7.26~exp4) UNRELEASED; urgency=low
* cmdline/apt-cache.cc:
- align Installed and Candidate Version in policy so they can be compared
easier, thanks Ralf Gesellensetter for the pointer! (Closes: #578657)
- - use GroupCount for package names in stats and add a package struct line
* doc/apt.ent:
- Add a note about APT_CONFIG in the -c description (Closes: #578267)
* doc/po/de.po:
@@ -60,11 +68,6 @@ apt (0.7.26~exp4) UNRELEASED; urgency=low
* apt-pkg/pkgcache.h:
- enhance the Groups ABI by providing a ID as the other structs does
- check also the size of the Group struct then checking for the others
- * methods/rred.cc:
- - use the patchfile modification time instead of the one from the
- "old" file - thanks to Philipp Weis for noticing! (Closes: #571541)
- * debian/rules:
- - remove targets refering to CVS or arch as they are useless
[ Jari Aalto ]
* cmdline/apt-get.cc:
@@ -73,12 +76,39 @@ apt (0.7.26~exp4) UNRELEASED; urgency=low
* dselect/install:
- modernize if-statements not to use 'x' (Closes: #577117)
- replace backticks with POSIX $() (Closes: #577116)
+
+ [ Michael Vogt ]
+ * [ Abi break ] apt-pkg/acquire-item.{cc,h}:
+ - add "IsIndexFile" to constructor of pkgAcqFile so that it sends
+ the right cache control headers
+ * cmdline/apt-get.cc:
+ - fix crash when pkg.VersionList() is empty
+ * apt-pkg/depcache.cc:
+ - fix incorrect std::cout usage for debug output
+ * test/libapt/getlanguages_test.cc:
+ - Add test for Esperanto that has nocounty associated with them
+ (LP: #560956)
+ * apt-pkg/deb/debrecords.cc:
+ - fix max tag buffer size (LP: #545336, closes: #578959)
* debian/rules:
- - spell out some less known options to reduce manpage consulation-rate
- - Use POSIX command substitution: $(<command sequence>)
- - Remove EOL whitespace (Closes: #577804)
+ - install html doxygen in libapt-pkg-doc
+ * debian/control:
+ - build-depend on doxygen
+
+ [ Julian Andres Klode ]
+ * apt-pkg/contrib/weakptr.h:
+ - add a class WeakPointable which allows one to register weak pointers to
+ an object which will be set to NULL when the object is deallocated.
+ * [ABI break] apt-pkg/acquire{-worker,-item,}.h:
+ - subclass pkgAcquire::{Worker,Item,ItemDesc} from WeakPointable.
+ * apt-pkg/pkgcache.cc:
+ - Merge fix from David to correct handling in single-arch environments.
+ * cmdline/apt-cache.cc:
+ - Add a showauto command to apt-cache.
+ * cmdline/apt-get.cc:
+ - Add apt-get markauto and unmarkauto commands.
- -- David Kalnischkies <kalnischkies@gmail.com> Sat, 03 Apr 2010 14:58:39 +0200
+ -- Michael Vogt <mvo@debian.org> Thu, 06 May 2010 09:32:54 +0200
apt (0.7.26~exp3) experimental; urgency=low
@@ -1584,13 +1614,6 @@ apt (0.7.6) unstable; urgency=low
-- Otavio Salvador <otavio@debian.org> Wed, 01 Aug 2007 19:49:51 -0300
-apt (0.7.6) unstable; urgency=low
-
- * Applied patch from Aurelien Jarno <aurel32@debian.org> to fix wrong
- directory downloading on non-linux architectures (closes: #435597)
-
- -- Otavio Salvador <otavio@debian.org> Wed, 01 Aug 2007 19:49:51 -0300
-
apt (0.7.5) unstable; urgency=low
[ Otavio Salvador ]
diff --git a/debian/control b/debian/control
index f0178d571..4f41c130b 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Michael Vogt <mvo@debian.org>, Otavio Salvador <otavio@debian.org>,
Christian Perrier <bubulle@debian.org>, Daniel Burrows <dburrows@debian.org>,
Luca Bruno <lethalman88@gmail.com>, Julian Andres Klode <jak@debian.org>
Standards-Version: 3.8.4
-Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5), debiandoc-sgml, xsltproc, docbook-xsl, po4a (>= 0.34-2), autotools-dev, autoconf, automake
+Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5), debiandoc-sgml, xsltproc, docbook-xsl, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen
Build-Conflicts: autoconf2.13, automake1.4
Package: apt
@@ -51,6 +51,9 @@ Section: doc
Description: Documentation for APT development
This package contains documentation for development of the APT
Debian package manipulation program and its libraries.
+ .
+ This includes the source code documentation generated by doxygen
+ in html format.
Package: apt-utils
Architecture: any
diff --git a/debian/rules b/debian/rules
index bb2cc34c3..cb4622779 100755
--- a/debian/rules
+++ b/debian/rules
@@ -145,7 +145,8 @@ libapt-pkg-doc: build-doc debian/shlibs.local
$(BLD)/docs/files* \
$(BLD)/docs/method* \
doc/libapt-pkg2_to_3.txt \
- doc/style.txt
+ doc/style.txt \
+ $(BLD)/doc/doxygen/html
dh_installexamples -p$@
dh_installchangelogs -p$@