Initial work with get depends
This commit is contained in:
parent
a4ef3337e5
commit
b8bf638248
@ -1,5 +1,8 @@
|
||||
#
|
||||
# vim: ts=4 et sts=4
|
||||
#
|
||||
# Copyright (C) 2007 Ali Sabil <ali.sabil@gmail.com>
|
||||
# Copyright (C) 2007 Tom Parker <palfrey@tevp.net>
|
||||
#
|
||||
# Licensed under the GNU General Public License Version 2
|
||||
#
|
||||
@ -225,7 +228,17 @@ class PackageKitAptBackend(PackageKitBaseBackend):
|
||||
pkg = Package(self._apt_cache[name], self)
|
||||
self._emit_package(pkg)
|
||||
|
||||
### Helpers ###
|
||||
def get_depends(self,package):
|
||||
'''
|
||||
Implement the {backend}-get-depends functionality
|
||||
'''
|
||||
name, version, arch, data = self.get_package_from_id(package)
|
||||
pkg = Package(self._apt_cache[name], self)
|
||||
print dir(pkg)
|
||||
print dir(pkg._depcache)
|
||||
raise Exception
|
||||
|
||||
### Helpers ###
|
||||
def _emit_package(self, package):
|
||||
id = self.get_package_id(package.name,
|
||||
package.installed_version or package.candidate_version,
|
||||
|
18
backends/apt/helpers/get-depends.py
Executable file
18
backends/apt/helpers/get-depends.py
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (C) 2007 Richard Hughes <richard@hughsie.com>
|
||||
#
|
||||
# Licensed under the GNU General Public License Version 2
|
||||
#
|
||||
# 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.
|
||||
|
||||
import sys
|
||||
|
||||
from aptBackend import PackageKitAptBackend
|
||||
package=sys.argv[1]
|
||||
backend = PackageKitAptBackend(sys.argv[1:])
|
||||
backend.get_depends(package)
|
||||
sys.exit(0)
|
Loading…
Reference in New Issue
Block a user