Remove some debug prints from depsolver.
authorKristian H?gsberg <krh@redhat.com>
Mon Jun 09 22:58:49 2008 -0400 (2008-06-09)
changeset 237715b18dc94f3
parent 236 e4900c8df461
child 238 d19dc7950c76
Remove some debug prints from depsolver.
razor.c
     1.1 --- a/razor.c	Mon Jun 09 22:41:37 2008 -0400
     1.2 +++ b/razor.c	Mon Jun 09 22:58:49 2008 -0400
     1.3 @@ -2146,35 +2146,12 @@
     1.4  static void
     1.5  mark_all_satisfied_requires(struct razor_transaction *trans)
     1.6  {
     1.7 -	struct razor_property *sp;
     1.8 -	struct prop_iter spi;
     1.9 -
    1.10  	clear_requires_flags(&trans->system);
    1.11  	clear_requires_flags(&trans->upstream);
    1.12  	mark_satisfied_requires(trans, &trans->system, &trans->system);
    1.13  	mark_satisfied_requires(trans, &trans->system, &trans->upstream);
    1.14  	mark_satisfied_requires(trans, &trans->upstream, &trans->system);
    1.15  	mark_satisfied_requires(trans, &trans->upstream, &trans->upstream);
    1.16 -
    1.17 -	prop_iter_init(&spi, &trans->system);
    1.18 -	while (prop_iter_next(&spi, RAZOR_PROPERTY_REQUIRES, &sp)) {
    1.19 -		if (spi.present[sp - spi.start] & TRANS_PROPERTY_SATISFIED)
    1.20 -			continue;
    1.21 -		fprintf(stderr, "unsatisfied system requires: %s %s %s\n",
    1.22 -			spi.pool + sp->name,
    1.23 -			relation_string[sp->relation],
    1.24 -			spi.pool + sp->version);
    1.25 -	}
    1.26 -
    1.27 -	prop_iter_init(&spi, &trans->upstream);
    1.28 -	while (prop_iter_next(&spi, RAZOR_PROPERTY_REQUIRES, &sp)) {
    1.29 -		if (spi.present[sp - spi.start] & TRANS_PROPERTY_SATISFIED)
    1.30 -			continue;
    1.31 -		fprintf(stderr, "unsatisfied upstream requires: %s %s %s\n",
    1.32 -			spi.pool + sp->name,
    1.33 -			relation_string[sp->relation],
    1.34 -			spi.pool + sp->version);
    1.35 -	}
    1.36  }
    1.37  
    1.38  static void
    1.39 @@ -2309,7 +2286,6 @@
    1.40  pull_in_all_requirements(struct razor_transaction *trans)
    1.41  {
    1.42  	struct prop_iter rpi, ppi;
    1.43 -	struct razor_property *rp;
    1.44  
    1.45  	prop_iter_init(&rpi, &trans->system);
    1.46  	prop_iter_init(&ppi, &trans->upstream);
    1.47 @@ -2318,24 +2294,6 @@
    1.48  	prop_iter_init(&rpi, &trans->upstream);
    1.49  	prop_iter_init(&ppi, &trans->upstream);
    1.50  	pull_in_requirements(trans, &rpi, &ppi);
    1.51 -
    1.52 -	prop_iter_init(&rpi, &trans->system);
    1.53 -	while (prop_iter_next(&rpi, RAZOR_PROPERTY_REQUIRES, &rp)) {
    1.54 -		if (!(rpi.present[rp - rpi.start] & TRANS_PROPERTY_SATISFIED))
    1.55 -			fprintf(stderr, "could not satisfy req %s %s %s\n",
    1.56 -				&rpi.pool[rp->name],
    1.57 -				relation_string[rp->relation],
    1.58 -				&rpi.pool[rp->version]);
    1.59 -	}
    1.60 -
    1.61 -	prop_iter_init(&rpi, &trans->upstream);
    1.62 -	while (prop_iter_next(&rpi, RAZOR_PROPERTY_REQUIRES, &rp)) {
    1.63 -		if (!(rpi.present[rp - rpi.start] & TRANS_PROPERTY_SATISFIED))
    1.64 -			fprintf(stderr, "could not satisfy req %s %s %s\n",
    1.65 -				&rpi.pool[rp->name],
    1.66 -				relation_string[rp->relation],
    1.67 -				&rpi.pool[rp->version]);
    1.68 -	}
    1.69  }
    1.70  
    1.71  static void
    1.72 @@ -2354,21 +2312,17 @@
    1.73  		if (!(trans->system.packages[p - spkgs] & TRANS_PACKAGE_UPDATE))
    1.74  			continue;
    1.75  
    1.76 -		if (!prop_iter_seek_to(&ppi, RAZOR_PROPERTY_PROVIDES, name)) {
    1.77 -			fprintf(stderr, "nothing provides %s\n", name);
    1.78 +		if (!prop_iter_seek_to(&ppi, RAZOR_PROPERTY_PROVIDES, name))
    1.79  			continue;
    1.80 -		}
    1.81  
    1.82  		pkg = pick_matching_provider(trans->upstream.set, &ppi,
    1.83  					     RAZOR_VERSION_GREATER, version);
    1.84 -		if (pkg == NULL) {
    1.85 -			fprintf(stderr,
    1.86 -				"no newer version of %s available\n", name);
    1.87 +		if (pkg == NULL)
    1.88  			continue;
    1.89 -		}
    1.90  		
    1.91 -		fprintf(stderr, "updating %s from %s to %s\n",
    1.92 -			name, version, &ppi.pool[pkg->version]);
    1.93 +		fprintf(stderr, "updating %s-%s to %s-%s\n",
    1.94 +			name, version,
    1.95 +			&ppi.pool[pkg->name], &ppi.pool[pkg->version]);
    1.96  
    1.97  		razor_transaction_remove_package(trans, p);
    1.98  		razor_transaction_install_package(trans, pkg);
    1.99 @@ -2423,6 +2377,31 @@
   1.100  	return trans->changes;
   1.101  }
   1.102  
   1.103 +void
   1.104 +razor_transaction_describe(struct razor_transaction *trans)
   1.105 +{
   1.106 +	struct prop_iter rpi;
   1.107 +	struct razor_property *rp;
   1.108 +
   1.109 +	prop_iter_init(&rpi, &trans->system);
   1.110 +	while (prop_iter_next(&rpi, RAZOR_PROPERTY_REQUIRES, &rp)) {
   1.111 +		if (!(rpi.present[rp - rpi.start] & TRANS_PROPERTY_SATISFIED))
   1.112 +			fprintf(stderr, "could not satisfy req %s %s %s\n",
   1.113 +				&rpi.pool[rp->name],
   1.114 +				relation_string[rp->relation],
   1.115 +				&rpi.pool[rp->version]);
   1.116 +	}
   1.117 +
   1.118 +	prop_iter_init(&rpi, &trans->upstream);
   1.119 +	while (prop_iter_next(&rpi, RAZOR_PROPERTY_REQUIRES, &rp)) {
   1.120 +		if (!(rpi.present[rp - rpi.start] & TRANS_PROPERTY_SATISFIED))
   1.121 +			fprintf(stderr, "could not satisfy req %s %s %s\n",
   1.122 +				&rpi.pool[rp->name],
   1.123 +				relation_string[rp->relation],
   1.124 +				&rpi.pool[rp->version]);
   1.125 +	}
   1.126 +}
   1.127 +
   1.128  int
   1.129  razor_transaction_unsatisfied_property(struct razor_transaction *trans,
   1.130  				       const char *name,