summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt/package.py5
-rw-r--r--debian/changelog2
-rw-r--r--python/apt_pkgmodule.cc1
-rw-r--r--python/apt_pkgmodule.h1
-rw-r--r--python/depcache.cc76
5 files changed, 81 insertions, 4 deletions
diff --git a/apt/package.py b/apt/package.py
index fb30209f..6644e139 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -365,12 +365,13 @@ class Package(object):
Fix.InstallProtect()
Fix.Resolve()
self._pcache.cachePostChange()
- def markInstall(self, autoFix=True, autoInst=True):
+ def markInstall(self, autoFix=True, autoInst=True, fromUser=True):
""" mark a package for install. Run the resolver if autoFix is set,
automatically install required dependencies if autoInst is set
+ record it as automatically installed when fromuser is set to false
"""
self._pcache.cachePreChange()
- self._depcache.MarkInstall(self._pkg, autoInst)
+ self._depcache.MarkInstall(self._pkg, autoInst, fromUser)
# try to fix broken stuff
if autoFix and self._depcache.BrokenCount > 0:
fixer = apt_pkg.GetPkgProblemResolver(self._depcache)
diff --git a/debian/changelog b/debian/changelog
index 09cd5139..1b232151 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,7 @@
python-apt (0.7.0) experimental; urgency=low
+ * support translated pacakge descriptions
+ * support automatic dependency information
* python/apt_pkgmodule.cc:
- added pkgCache::State::PkgCurrentState enums
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index 627eaced..a0352d4e 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -431,6 +431,7 @@ static PyMethodDef methods[] =
// misc
{"GetPkgProblemResolver",GetPkgProblemResolver,METH_VARARGS,"GetDepProblemResolver(DepCache) -> PkgProblemResolver"},
+ {"GetPkgActionGroup",GetPkgActionGroup,METH_VARARGS,"GetPkgActionGroup(DepCache) -> PkgActionGroup"},
// Cdrom
{"GetCdrom",GetCdrom,METH_VARARGS,"GetCdrom() -> Cdrom"},
diff --git a/python/apt_pkgmodule.h b/python/apt_pkgmodule.h
index fe7dfe88..d58f4589 100644
--- a/python/apt_pkgmodule.h
+++ b/python/apt_pkgmodule.h
@@ -67,6 +67,7 @@ PyObject *GetDepCache(PyObject *Self,PyObject *Args);
// pkgProblemResolver
extern PyTypeObject PkgProblemResolverType;
PyObject *GetPkgProblemResolver(PyObject *Self, PyObject *Args);
+PyObject *GetPkgActionGroup(PyObject *Self, PyObject *Args);
// cdrom
extern PyTypeObject PkgCdromType;
diff --git a/python/depcache.cc b/python/depcache.cc
index 60bbc1a4..71e6a2e6 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -346,11 +346,13 @@ static PyObject *PkgDepCacheMarkInstall(PyObject *Self,PyObject *Args)
PyObject *PackageObj;
char autoInst=1;
- if (PyArg_ParseTuple(Args,"O!|b",&PackageType,&PackageObj, &autoInst) == 0)
+ char fromUser=1;
+ if (PyArg_ParseTuple(Args,"O!|bb",&PackageType,&PackageObj,
+ &autoInst, &fromUser) == 0)
return 0;
pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(PackageObj);
- depcache->MarkInstall(Pkg, autoInst);
+ depcache->MarkInstall(Pkg, autoInst, 0, fromUser);
Py_INCREF(Py_None);
return HandleErrors(Py_None);
@@ -745,3 +747,73 @@ PyTypeObject PkgProblemResolverType =
};
/*}}}*/
+
+// pkgActionGroup Class /*{{{*/
+// ---------------------------------------------------------------------
+
+
+static PyObject *PkgActionGroupRelease(PyObject *Self,PyObject *Args)
+{
+ pkgDepCache::ActionGroup *ag = GetCpp<pkgDepCache::ActionGroup*>(Self);
+ if (PyArg_ParseTuple(Args,"") == 0)
+ return 0;
+ ag->release();
+ Py_INCREF(Py_None);
+ return HandleErrors(Py_None);
+}
+
+static PyMethodDef PkgActionGroupMethods[] =
+{
+ {"release", PkgActionGroupRelease, METH_VARARGS, "release()"},
+ {}
+};
+
+
+static PyObject *ActionGroupAttr(PyObject *Self,char *Name)
+{
+ pkgDepCache::ActionGroup *ag = GetCpp<pkgDepCache::ActionGroup*>(Self);
+
+ return Py_FindMethod(PkgActionGroupMethods,Self,Name);
+}
+
+
+PyTypeObject PkgActionGroupType =
+{
+ PyObject_HEAD_INIT(&PyType_Type)
+ 0, // ob_size
+ "pkgActionGroup", // tp_name
+ sizeof(CppOwnedPyObject<pkgDepCache::ActionGroup*>), // tp_basicsize
+ 0, // tp_itemsize
+ // Methods
+ CppOwnedDealloc<pkgDepCache::ActionGroup*>, // tp_dealloc
+ 0, // tp_print
+ ActionGroupAttr, // tp_getattr
+ 0, // tp_setattr
+ 0, // tp_compare
+ 0, // tp_repr
+ 0, // tp_as_number
+ 0, // tp_as_sequence
+ 0, // tp_as_mapping
+ 0, // tp_hash
+};
+
+PyObject *GetPkgActionGroup(PyObject *Self,PyObject *Args)
+{
+ PyObject *Owner;
+ if (PyArg_ParseTuple(Args,"O!",&PkgDepCacheType,&Owner) == 0)
+ return 0;
+
+ pkgDepCache *depcache = GetCpp<pkgDepCache*>(Owner);
+ pkgDepCache::ActionGroup *group = new pkgDepCache::ActionGroup(*depcache);
+ CppOwnedPyObject<pkgDepCache::ActionGroup*> *PkgActionGroupPyObj;
+ PkgActionGroupPyObj = CppOwnedPyObject_NEW<pkgDepCache::ActionGroup*>(Owner,
+ &PkgActionGroupType,
+ group);
+ HandleErrors(PkgActionGroupPyObj);
+
+ return PkgActionGroupPyObj;
+
+}
+
+
+ /*}}}*/