From: Alexey Tourbin <at@altlinux.ru> To: ALT Linux Team development discussions <devel@lists.altlinux.org> Subject: [devel] permit self-conflicting packages? Date: Sat, 14 Aug 2010 23:55:41 +0400 Message-ID: <20100814195541.GA9326@imap.altlinux.org> (raw) In-Reply-To: <20100813085047.GB6072@imap.altlinux.org> On Fri, Aug 13, 2010 at 12:50:47PM +0400, Alexey Tourbin wrote: > По идее никакой пакет не должен конфликтовать сам с собой, даже если > в нём написано Provides: %name, Obsoletes: %name. Похоже, что apt так > и считает, а вот исправить rpm на этот счёт сложнее. Поскольку там > один и тот же код проверяет Requires и Conflicts зависимости. Только > если Requires зависимость удовлетворена, то это считается хорошо, а если > Conflicts зависимость удовлетворена, то это считается что плохо.-) В общем можно разрешать установку пакетов, которые конфликтуют сами с собой. Точнее, можно сделать, чтобы конфликт в пределах одного пакета не срабатывал. Но это нарушает симметрию Requires и Conflicts (поскольку Requires может разрешаться в свой собственный пакет, если есть соответствующий Provides). Впрочем, симметрия Requires и Conflicts - overgeneralization. index 304dffe..7d49491 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -534,7 +534,8 @@ int dbSatisfiesDepend(rpmTransactionSet ts, * Check key for an unsatisfied dependency. * @todo Eliminate rpmrc provides. * @param ts transaction set - * @param keyType type of dependency + * @param h header the dependency comes from + * @param tag RPMTAG_REQUIRENAME or RPMTAG_CONFLICTNAME * @param keyDepend dependency string representation * @param keyName dependency name string * @param keyEVR dependency [epoch:]version[-release] string @@ -543,10 +544,11 @@ int dbSatisfiesDepend(rpmTransactionSet ts, */ static int tsSatisfiesDepend(rpmTransactionSet ts, hashTable dbProvCache, - const char * keyType, const char * keyDepend, + Header h, rpmTag tag, const char * keyDepend, const char * keyName, const char * keyEVR, int keyFlags) /*@modifies ts @*/ { + const char *keyType = (tag == RPMTAG_CONFLICTNAME) ? " Conflicts" : " Requires"Conflicts; /* * New features in rpm packaging implicitly add versioned dependencies * on rpmlib provides. The dependencies look like "rpmlib(YaddaYadda)". @@ -561,10 +563,28 @@ static int tsSatisfiesDepend(rpmTransactionSet ts, goto unsatisfied; } - if (alSatisfiesDepend(&ts->addedPackages, keyName, keyEVR, keyFlags)) { - rpmMessage(RPMMESS_DEBUG, _("%s: %-45s YES (added provides)\n"), - keyType, keyDepend+2); - return 0; + struct availablePackage **pp = + alAllSatisfiesDepend(&ts->addedPackages, keyName, keyEVR, keyFlags); + if (pp) { + int ret = 1; + if (tag != RPMTAG_CONFLICTNAME) + ret = 0; + else { + // Conflicts are special, permit self-conflicting packages. + struct availablePackage **alpp; + for (alpp = pp; *alpp; alpp++) { + if ((*alpp)->h != h) { + ret = 0; + break; + } + } + } + pp = _free(pp); + if (ret == 0) { + rpmMessage(RPMMESS_DEBUG, _("%s: %-45s YES (added provides)\n"), + keyType, keyDepend+2); + return 0; + } } if (dbSatisfiesDepend(ts, dbProvCache, keyName, keyEVR, keyFlags) == 0) { @@ -629,7 +649,7 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, keyDepend = printDepend("R", requires[i], requiresEVR[i], requireFlags[i]); - rc = tsSatisfiesDepend(ts, dbProvCache, " Requires", keyDepend, + rc = tsSatisfiesDepend(ts, dbProvCache, h, RPMTAG_REQUIRENAME, keyDepend, requires[i], requiresEVR[i], requireFlags[i]); switch (rc) { @@ -687,7 +707,7 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, keyDepend = printDepend("C", conflicts[i], conflictsEVR[i], conflictFlags[i]); - rc = tsSatisfiesDepend(ts, dbProvCache, "Conflicts", keyDepend, + rc = tsSatisfiesDepend(ts, dbProvCache, h, RPMTAG_CONFLICTNAME, keyDepend, conflicts[i], conflictsEVR[i], conflictFlags[i]); /* 1 == unsatisfied, 0 == satsisfied */
next prev parent reply other threads:[~2010-08-14 19:55 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-08-13 8:14 ` [devel] [#27624] FAILED mpd-mini.git=0.15.12-alt2 Slava Semushin 2010-08-13 8:50 ` Alexey Tourbin 2010-08-13 9:31 ` Slava Semushin 2010-08-14 19:55 ` Alexey Tourbin [this message] 2010-08-13 14:28 ` Ildar Mulyukov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20100814195541.GA9326@imap.altlinux.org \ --to=at@altlinux.ru \ --cc=devel@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git