ó
²(qhc           @   s   d  Z  d d l Z d „  Z d S(   sÿ  
Determine rudimentary package and version information for click packages to
enable bucketing on the Error Tracker.

Copyright (C) 2014 Canonical Ltd.
Author: Brian Murray <brian@canonical.com>

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.  See http://www.gnu.org/copyleft/gpl.html for
the full text of the license.
iÿÿÿÿNc   	      C   sx  |  j  d ƒ } | s d  S| j d ƒ r= | j d ƒ r= d  Sd |  d <t j d d | g d t j d	 t ƒ} | j ƒ  d
 } xË | j ƒ  D]½ } d | k rÎ | j d ƒ j	 d ƒ d } | j
 d d ƒ } n  d | k r| j d ƒ j	 d ƒ d } | j
 d d ƒ } n  d | k r‹ | j d ƒ j	 d ƒ d } | j
 d d ƒ } q‹ q‹ Wd | | f |  d <| |  d <| |  d <d  S(   Nt   ExecutablePaths   /opt/click.ubuntu.coms   /usr/share/click/preinstalledt   Truet   ClickPackaget   clickt   infot   stdoutt   universal_newlinesi    t   names    ,s   : i   t   "t    t   versiont   architectures   %s %st   Packaget   SourcePackaget   PackageArchitecture(   t   gett
   startswitht
   subprocesst   Popent   PIPER   t   communicatet
   splitlinest   stript   splitt   replace(	   t   reportt   uit	   exec_patht
   click_infot   outt   linet   packageR
   t   pkg_arch(    (    s,   /usr/share/apport/general-hooks/clickinfo.pyt   add_info   s0    
		
(   t   __doc__R   R!   (    (    (    s,   /usr/share/apport/general-hooks/clickinfo.pyt   <module>   s   