diff options
author | Michael Schroeder <mls@suse.de> | 2008-08-29 18:31:45 +0000 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2008-08-29 18:31:45 +0000 |
commit | 2a270f741c5123d4aa7ec409be09da5498d754a5 (patch) | |
tree | 47457df0f45a1fb86fcdf2903011adc7bf3baff1 /src/solvable.c | |
parent | e39167fb292391ba3ae555a2ce5b902be025d981 (diff) | |
download | libsolv-2a270f741c5123d4aa7ec409be09da5498d754a5.tar.gz libsolv-2a270f741c5123d4aa7ec409be09da5498d754a5.tar.bz2 libsolv-2a270f741c5123d4aa7ec409be09da5498d754a5.zip |
- new job commands, now combinded from job type and select type
- support for distupgrade mode
Diffstat (limited to 'src/solvable.c')
-rw-r--r-- | src/solvable.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/solvable.c b/src/solvable.c index 5f79c70..c17fe25 100644 --- a/src/solvable.c +++ b/src/solvable.c @@ -604,3 +604,39 @@ pool_create_state_maps(Pool *pool, Queue *installed, Map *installedmap, Map *con } } +int +solvable_identical(Pool *pool, Solvable *s1, Solvable *s2) +{ + unsigned int bt1, bt2; + Id rq1, rq2; + Id *reqp; + + if (s1->name != s2->name) + return 0; + if (s1->arch != s2->arch) + return 0; + if (s1->evr != s2->evr) + return 0; + if (s1->vendor != s2->vendor) + return 0; + + /* first tests passed, try requires */ + rq1 = rq2 = 0; + if (s1->requires) + for (reqp = s1->repo->idarraydata + s1->requires; *reqp; reqp++) + rq1 ^= *reqp++; + if (s2->requires) + for (reqp = s2->repo->idarraydata + s2->requires; *reqp; reqp++) + rq2 ^= *reqp++; + if (rq1 != rq2) + return 0; + + /* looking good, try some fancier stuff */ + bt1 = solvable_lookup_num(s1, SOLVABLE_BUILDTIME, 0); + bt2 = solvable_lookup_num(s2, SOLVABLE_BUILDTIME, 0); + if (bt1 && bt2 && bt1 != bt2) + return 0; + + /* might also look up the package checksum here */ + return 1; +} |