[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] Introduce basic support for the Enhances field



Hi,

I have two patches lying around to close Bug#137583 in apt and
Bug#416247 in python-apt; introducing support for Enhances.

The first patch, apt-support-enhances.diff, introduces basic
support for the enhances field in apt and allows it to be shown
in apt-cache depends. It changes the structure of the cache,
as far as I can tell, therefore I increased MajorVersion to 8.

The second patch, python-apt-support-enhances.diff, is the
patch for python-apt to add "Enhances" to the list of supported
dependencies.

As the second patch requires the first one, I want to ask here
what your opinion about the first one (for apt) is; and whether
it should be committed to the debian-sid branch.

Regards,
Julian


-- 
Julian Andres Klode  - Free Software Developer
   Debian Developer  - Contributing Member of SPI
   Ubuntu Member     - Fellow of FSFE

Website: http://jak-linux.org/   XMPP: juliank@jabber.org
Debian:  http://www.debian.org/  SPI:  http://www.spi-inc.org/
Ubuntu:  http://www.ubuntu.com/  FSFE: http://www.fsfe.org/
=== modified file 'apt-pkg/deb/deblistparser.cc'
--- apt-pkg/deb/deblistparser.cc	2007-09-06 13:38:32 +0000
+++ apt-pkg/deb/deblistparser.cc	2009-06-12 18:10:57 +0000
@@ -109,6 +109,8 @@ bool debListParser::NewVersion(pkgCache:
       return false;
    if (ParseDepends(Ver,"Replaces",pkgCache::Dep::Replaces) == false)
       return false;
+   if (ParseDepends(Ver,"Enhances",pkgCache::Dep::Enhances) == false)
+      return false;
 
    // Obsolete.
    if (ParseDepends(Ver,"Optional",pkgCache::Dep::Suggests) == false)

=== modified file 'apt-pkg/pkgcache.cc'
--- apt-pkg/pkgcache.cc	2009-04-09 02:36:34 +0000
+++ apt-pkg/pkgcache.cc	2009-06-12 18:30:50 +0000
@@ -49,7 +49,7 @@ pkgCache::Header::Header()
    
    /* Whenever the structures change the major version should be bumped,
       whenever the generator changes the minor version should be bumped. */
-   MajorVersion = 7;
+   MajorVersion = 8;
    MinorVersion = 0;
    Dirty = false;
    
@@ -223,7 +223,7 @@ const char *pkgCache::DepType(unsigned c
 {
    const char *Types[] = {"",_("Depends"),_("PreDepends"),_("Suggests"),
                           _("Recommends"),_("Conflicts"),_("Replaces"),
-                          _("Obsoletes"),_("Breaks")};
+                          _("Obsoletes"),_("Breaks"), _("Enhances")};
    if (Type < sizeof(Types)/sizeof(*Types))
       return Types[Type];
    return "";

=== modified file 'apt-pkg/pkgcache.h'
--- apt-pkg/pkgcache.h	2009-04-09 02:36:34 +0000
+++ apt-pkg/pkgcache.h	2009-06-12 18:02:21 +0000
@@ -70,7 +70,7 @@ class pkgCache
    struct Dep
    {
       enum DepType {Depends=1,PreDepends=2,Suggests=3,Recommends=4,
-	 Conflicts=5,Replaces=6,Obsoletes=7,DpkgBreaks=8};
+	 Conflicts=5,Replaces=6,Obsoletes=7,DpkgBreaks=8,Enhances=9};
       enum DepCompareOp {Or=0x10,NoOp=0,LessEq=0x1,GreaterEq=0x2,Less=0x3,
 	 Greater=0x4,Equals=0x5,NotEquals=0x6};
    };

=== modified file 'debian/changelog'
--- debian/changelog	2009-06-12 17:07:40 +0000
+++ debian/changelog	2009-06-12 18:39:08 +0000
@@ -24,6 +24,7 @@ apt (0.7.22) UNRELEASED; urgency=low
   [ Julian Andres Klode ]
   * apt-pkg/contrib/configuration.cc: Fix a small memory leak in
     ReadConfigFile.
+  * Introduce support for the Enhances field. (Closes: #137583) 
 
  -- Christian Perrier <bubulle@debian.org>  Wed, 22 Apr 2009 10:13:54 +0200
 

=== modified file 'debian/changelog'
--- debian/changelog	2009-06-14 16:21:05 +0000
+++ debian/changelog	2009-06-14 16:46:36 +0000
@@ -7,6 +7,7 @@ python-apt (0.7.92) UNRELEASED; urgency=
   * Bugfix: Delete pointers correctly, fixing memory leaks. (LP: #370149)
   * apt/package.py: Return VersionList objects in Package.versions, which
     are sequences and also provide features of mappings. (small API BREAK)
+  * Add support for Enhances as a dependency type (Closes: #416247)  
 
   [ Sebastian Heinlein ]
   * apt/progress.py: Extract the package name from the status message

=== modified file 'python/cache.cc'
--- python/cache.cc	2009-06-14 14:11:35 +0000
+++ python/cache.cc	2009-06-14 16:44:27 +0000
@@ -711,7 +711,7 @@ static PyObject *MakeDepends(PyObject *O
 	 {
 	    "", "Depends","PreDepends","Suggests",
 	    "Recommends","Conflicts","Replaces",
-	    "Obsoletes", "Breaks"
+	    "Obsoletes", "Breaks", "Enhances"
 	 };
 	 PyObject *Dep = PyString_FromString(Types[Start->Type]);
 	 LastDepType = Start->Type;

Attachment: signature.asc
Description: Digital signature


Reply to: