ó
ýGpNc           @   s)   d  Z  d d d „  ƒ  YZ d d l Z d S(   s$   Abstraction of packaging operations.t   PackageInfoc           B   s¹   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 e
 d d „ Z d	 „  Z d
 „  Z d „  Z d d „ Z d „  Z d „  Z d „  Z e
 d d „ Z d „  Z RS(   c         C   s   t  d ƒ ‚ d S(   sp   Return the installed version of a package.
        
        Throw ValueError if package does not exist.
        s6   this method must be implemented by a concrete subclassN(   t   NotImplementedError(   t   selft   package(    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_version   s    c         C   s   t  d ƒ ‚ d S(   sw   Return the latest available version of a package.
        
        Throw ValueError if package does not exist.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_available_version   s    c         C   s   t  d ƒ ‚ d S(   s/   Return a list of packages a package depends on.s6   this method must be implemented by a concrete subclassN(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_dependencies   s    c         C   s   t  d ƒ ‚ d S(   ss   Return the source package name for a package.
        
        Throw ValueError if package does not exist.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt
   get_source    s    c         C   s   t  d ƒ ‚ d S(   sÌ   Check package origin.

        Return True if the package is a genuine distro package, or False if it
        comes from a third-party source.

        Throw ValueError if package does not exist.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   is_distro_package'   s    c         C   s   t  d ƒ ‚ d S(   s    Return the architecture of a package.

        This might differ on multiarch architectures (e. g.  an i386 Firefox
        package on a x86_64 system)
        s6   this method must be implemented by a concrete subclassN(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_architecture1   s    c         C   s   t  d ƒ ‚ d S(   sh   Return list of files shipped by a package.

        Throw ValueError if package does not exist.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt	   get_files9   s    c         C   s   t  d ƒ ‚ d S(   s/   Return list of all modified files of a package.s6   this method must be implemented by a concrete subclassN(   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_modified_files@   s    c         C   s   t  d ƒ ‚ d S(   s   Return the package a file belongs to.
        
        Return None if the file is not shipped by any package.
        
        If uninstalled is True, this will also find files of uninstalled
        packages; this is very expensive, though, and needs network access and
        lots of CPU and I/O resources. In this case, map_cachedir can be set to
        an existing directory which will be used to permanently store the
        downloaded maps. If it is not set, a temporary directory will be used.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   t   filet   uninstalledt   map_cachedir(    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_file_packageE   s    c         C   s   t  d ƒ ‚ d S(   s}   Return the architecture of the system.
        
        This should use the notation of the particular distribution.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_system_architectureR   s    c         C   s   d S(   sà   Return a list of default library search paths.
        
        The entries should be separated with a colon ':', like for
        $LD_LIBRARY_PATH. This needs to take any multiarch directories into
        account.
        s   /lib:/usr/lib(    (   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_library_pathsY   s    c         C   s   t  d ƒ ‚ d S(   s
  Explicitly set a distribution mirror URL.
        
        This might be called for operations that need to fetch distribution
        files/packages from the network.

        By default, the mirror will be read from the system configuration
        files.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   t   url(    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt
   set_mirrorc   s    	c         C   s   t  d ƒ ‚ d S(   s+  Download a source package and unpack it into dir..
        
        dir should exist and be empty.

        This also has to care about applying patches etc., so that dir will
        eventually contain the actually compiled source.

        If version is given, this particular version will be retrieved.
        Otherwise this will fetch the latest available version.

        Return the directory that contains the actual source root directory
        (which might be a subdirectory of dir). Return None if the source is
        not available.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   t
   srcpackaget   dirt   version(    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_source_treen   s    c         C   s   t  d ƒ ‚ d S(   st   Compare two package versions.

        Return -1 for ver < ver2, 0 for ver1 == ver2, and 1 for ver1 > ver2.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   t   ver1t   ver2(    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   compare_versions   s    c         C   s   t  d ƒ ‚ d S(   sÛ  Return whether Apport should generate crash reports.

        Signal crashes are controlled by /proc/sys/kernel/core_pattern, but
        some init script needs to set that value based on a configuration file.
        This also determines whether Apport generates reports for Python,
        package, or kernel crashes.
        
        Implementations should parse the configuration file which controls
        Apport (such as /etc/default/apport in Debian/Ubuntu).
        s6   this method must be implemented by a concrete subclassN(   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   enabled†   s    c         C   s   t  d ƒ ‚ d S(   s„   Return the actual Linux kernel package name.

        This is used when the user reports a bug against the "linux" package.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   get_kernel_package“   s    c         C   s   t  d ƒ ‚ d S(   s•  Install packages into a sandbox (for apport-retrace).

        In order to work without any special permissions and without touching
        the running system, this should only download and unpack packages into
        the given root directory, not install them into the system.

        configdir points to a directory with by-release configuration files for
        the packaging system; this is completely dependent on the backend
        implementation, the only assumption is that this looks into
        configdir/release/, so that you can use retracing for multiple
        DistroReleases. As a special case, if configdir is None, it uses the
        current system configuration, and "release" is ignored.

        release is the value of the report's 'DistroRelease' field.

        packages is a list of ('packagename', 'version') tuples. If the version
        is None, it should install the most current available version.
        
        If cache_dir is given, then the downloaded packages will be stored
        there, to speed up subsequent retraces.

        Return a string with outdated packages, or None if all packages were
        installed.
        s6   this method must be implemented by a concrete subclassN(   R   (   R   t   rootdirt	   configdirt   releaset   packagest   verboset	   cache_dir(    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   install_packagesš   s    c         C   s   t  d ƒ ‚ d S(   s2   Return known package names which match given glob.s6   this method must be implemented by a concrete subclassN(   R   (   R   t   glob(    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   package_name_glob¶   s    N(   t   __name__t
   __module__R   R   R   R   R   R	   R
   R   t   Falset   NoneR   R   R   R   R   R   R   R   R#   R%   (    (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyR       s$   					
					
				iÿÿÿÿN(    (   t   __doc__R    t   apport.packaging_implt   apport(    (    (    s4   /usr/lib/python2.7/dist-packages/apport/packaging.pyt   <module>   s   ¯