def _get_hold(line, pattern=__HOLD_PATTERN, full=True):
 if full:
  if (_yum() == 'dnf'):
   lock_re = '({0}-\\S+)'.format(pattern)
  else:
   lock_re = '(\\d+:{0}-\\S+)'.format(pattern)
 elif (_yum() == 'dnf'):
  lock_re = '({0}-\\S+)'.format(pattern)
 else:
  lock_re = '\\d+:({0}-\\S+)'.format(pattern)
 match = re.search(lock_re, line)
 if match:
  if (not full):
   woarch = match.group(1).rsplit('.', 1)[0]
   worel = woarch.rsplit('-', 1)[0]
   return worel.rsplit('-', 1)[0]
  else:
   return match.group(1)
 return None

def _get_hold ( line , pattern = __HOLD_PATTERN , full = True ) : if full : if ( _yum ( ) == 'dnf' ) : lock_re = '({0}-\\S+)' . format ( pattern ) else : lock_re = '(\\d+:{0}-\\S+)' . format ( pattern ) elif ( _yum ( ) == 'dnf' ) : lock_re = '({0}-\\S+)' . format ( pattern ) else : lock_re = '\\d+:({0}-\\S+)' . format ( pattern ) match = re . search ( lock_re , line ) if match : if ( not full ) : woarch = match . group ( 1 ) . rsplit ( '.' , 1 ) [ 0 ] worel = woarch . rsplit ( '-' , 1 ) [ 0 ] return worel . rsplit ( '-' , 1 ) [ 0 ] else : return match . group ( 1 ) return None
resolve a package name from a line containing the hold expression .