src/suse.c
/*
 * solvable_trivial_installable_map - answers if a solvable is installable
 * without any other installs/deinstalls.
 * The packages considered to be installed are provided via the
 * installedmap bitmap. A additional "conflictsmap" bitmap providing
 * information about the conflicts of the installed packages can be
 * used for extra speed up. Provide a NULL pointer if you do not
 * have this information.
 * Both maps can be created with pool_create_state_maps() or
 * solver_create_state_maps().
 *
 * returns:
 * 1:  solvable is installable without any other package changes
 * 0:  solvable is not installable
 * -1: solvable is installable, but doesn't constrain any installed packages
 */
answers if a solvable is installable
without any other installs/deinstalls.
The packages considered to be installed are provided via the
installedmap bitmap. A additional "conflictsmap" bitmap providing
information about the conflicts of the installed packages can be
used for extra speed up. Provide a NULL pointer if you do not
have this information.
Both maps can be created with pool_create_state_maps() or
solver_create_state_maps().

solvable is installable without any other package changes
0:  solvable is not installable
-1: solvable is installable, but doesn't constrain any installed packages
answers if a solvable is installable without any other installs / deinstalls . The packages considered to be installed are provided via the installedmap bitmap . A additional " conflictsmap " bitmap providing information about the conflicts of the installed packages can be used for extra speed up . Provide a NULL pointer if you do not have this information . Both maps can be created with pool_create_state_maps () or solver_create_state_maps () . solvable is installable without any other package changes 0 : solvable is not installable - 1 : solvable is installable but doesn ' t constrain any installed packages
int
solvable_trivial_installable_map(Solvable *s, Map *installedmap, Map *conflictsmap, Map *multiversionmap)
{
  Pool *pool = s->repo->pool;
  Solvable *s2;
  Id p, *dp;
  Id *reqp, req;
  Id *conp, con;
  int r, interesting = 0;
  if (conflictsmap && MAPTST(conflictsmap, s - pool->solvables))
    return 0;
  if (s->requires)
    {
      reqp = s->repo->idarraydata + s->requires;
      while ((req = *reqp++) != 0)
	{
	  if (req == SOLVABLE_PREREQMARKER)
	    continue;
          r = providedbyinstalled(pool, installedmap, req, 0, 0);
	  if (!r)
	    return 0;
	  if (r > 0)
	    interesting = 1;
	}
    }
  if (s->conflicts)
    {
      int ispatch = 0;
      if (!strncmp("patch:", pool_id2str(pool, s->name), 6))
	ispatch = 1;
      conp = s->repo->idarraydata + s->conflicts;
      while ((con = *conp++) != 0)
	{
	  if (providedbyinstalled(pool, installedmap, con, ispatch, multiversionmap))
	    {
	      if (ispatch && solvable_is_irrelevant_patch(s, installedmap))
		return -1;
	      return 0;
	    }
	  if (!interesting && ISRELDEP(con))
	    {
              con = dep2name(pool, con);
	      if (providedbyinstalled(pool, installedmap, con, ispatch, multiversionmap))
		interesting = 1;
	    }
	}
      if (ispatch && interesting && solvable_is_irrelevant_patch(s, installedmap))
	interesting = 0;
    }
  if (!conflictsmap)
    {
      int i;
      p = s - pool->solvables;
      for (i = 1; i < pool->nsolvables; i++)
	{
	  if (!MAPTST(installedmap, i))
	    continue;
	  s2 = pool->solvables + i;
	  if (!s2->conflicts)
	    continue;
	  conp = s2->repo->idarraydata + s2->conflicts;
	  while ((con = *conp++) != 0)
	    {
	      dp = pool_whatprovides_ptr(pool, con);
	      for (; *dp; dp++)
		if (*dp == p)
		  return 0;
	    }
	}
     }
  return interesting ? 1 : -1;
}
int solvable_trivial_installable_map ( Solvable * s , Map * installedmap , Map * conflictsmap , Map * multiversionmap ) { Pool * pool = s -> repo -> pool ; Solvable * s2 ; Id p , * dp ; Id * reqp , req ; Id * conp , con ; int r , interesting = 0 ; if ( conflictsmap && MAPTST ( conflictsmap , s - pool -> solvables ) ) return 0 ; if ( s -> requires ) { reqp = s -> repo -> idarraydata + s -> requires ; while ( ( req = * reqp ++ ) != 0 ) { if ( req == SOLVABLE_PREREQMARKER ) continue ; r = providedbyinstalled ( pool , installedmap , req , 0 , 0 ) ; if ( ! r ) return 0 ; if ( r > 0 ) interesting = 1 ; } } if ( s -> conflicts ) { int ispatch = 0 ; if ( ! strncmp ( " " , pool_id2str ( pool , s -> name ) , 6 ) ) ispatch = 1 ; conp = s -> repo -> idarraydata + s -> conflicts ; while ( ( con = * conp ++ ) != 0 ) { if ( providedbyinstalled ( pool , installedmap , con , ispatch , multiversionmap ) ) { if ( ispatch && solvable_is_irrelevant_patch ( s , installedmap ) ) return -1 ; return 0 ; } if ( ! interesting && ISRELDEP ( con ) ) { con = dep2name ( pool , con ) ; if ( providedbyinstalled ( pool , installedmap , con , ispatch , multiversionmap ) ) interesting = 1 ; } } if ( ispatch && interesting && solvable_is_irrelevant_patch ( s , installedmap ) ) interesting = 0 ; } if ( ! conflictsmap ) { int i ; p = s - pool -> solvables ; for ( i = 1 ; i < pool -> nsolvables ; i ++ ) { if ( ! MAPTST ( installedmap , i ) ) continue ; s2 = pool -> solvables + i ; if ( ! s2 -> conflicts ) continue ; conp = s2 -> repo -> idarraydata + s2 -> conflicts ; while ( ( con = * conp ++ ) != 0 ) { dp = pool_whatprovides_ptr ( pool , con ) ; for ( ; * dp ; dp ++ ) if ( * dp == p ) return 0 ; } } } return interesting ? 1 : -1 ; }
solvable_trivial_installable_map - answers if a solvable is installable
 without any other installs/deinstalls.
solvable_trivial_installable_map - answers if a solvable is installable without any other installs / deinstalls .