
    |fL	                     8    d dl mZmZ d Zd Zd Zd Zd Zd Zy)	    )SourceEntryDeb822SourceEntryc                     t        | t              r t        t        |       | j                        S t	        t        |       | j                        S )z, Return a shallow copy of the source entry. )file)
isinstancer   strr   r   )origs    @/usr/lib/python3/dist-packages/softwareproperties/sourceutils.pycopy_source_entryr      s7    $)* T;;s4ytyy11    c                 f    t        |       }|j                         D ]  \  }}t        |||        |S )z?Return a copy of the given source entry with replaced field(s).)r   itemssetattr)r	   kwargsentrykvs        r
   replace_source_entryr   
   s6    d#E,,. Aq!Lr   c                 f    | j                   j                  d      }|d   xs dj                         S )zl
    Return the pocket, or if unset return 'release'.

    This always returns the pocket in lowercase.
    -   release)dist	partitionlower)source_entrypartss     r
   get_source_entry_pocketr      s2     '',E!H!	((**r   c                 >    | j                   j                  d      d   S )z\
    Return the suite, without pocket.

    This always returns the suite in lowercase.
    r   r   )r   r   )r   s    r
   get_source_entry_suiter       s      &&s+A..r   c                     t        |t        |j                              }| D ])  }t        |t        |j                              |k(  s'|c S  y)a  
    Return the source entry from entries that matches entry, if found.
    Otherwise return None.

    This function uses a modified equality check, i.e. it considers components
    as a set rather than a list so that different ordering does not affect the
    comparison.
    )compsN)r   setr"   )entriesr   targetes       r
   get_source_entry_from_listr'   "   sI     "%s5;;/?@F QWW6&@H r   c                     | j                   |j                   k7  rydD ]/  }t        t        ||            t        t        | |            z
  s/ y y)a\  
    Return True if the source defined by b is already satisfied
    by the source defined by a.

    For example, if source a is:

    Types: deb
    URIs: http://archive.ubuntu.com/ubuntu
    Suites: jammy
    Components: main universe

    and source b is:

    Types: deb
    URIs: http://archive.ubuntu.com/ubuntu
    Suites: jammy
    Components: universe

    Then source a contains source b.

    But if source b was:

    Types: deb-src
    URIs: http://archive.ubuntu.com/ubuntu
    Suites: jammy
    Components: universe

    Then a does not contain b because it does not include deb-src.
    F)typesr"   suitesurisT)disabledr#   getattr)abattrs      r
   deb822_source_entry_containsr1   3   sN    < 	zzQZZ4 wq$ 3wq$'7#88 r   N)	aptsources.sourceslistr   r   r   r   r   r    r'   r1    r   r
   <module>r4      s&    C2+/"%r   