From: Alexey Tourbin <at@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] gb-task-repo-vercheck (vercheck): Use rpmevrcmp
Date: Mon, 16 Feb 2009 16:05:08 +0300
Message-ID: <20090216130508.GL31985@altlinux.org> (raw)
In-Reply-To: <20090216122312.GK27664@wo.int.altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]
On Mon, Feb 16, 2009 at 03:23:12PM +0300, Dmitry V. Levin wrote:
> On Mon, Feb 16, 2009 at 11:16:51AM +0300, Alexey Tourbin wrote:
> [...]
> > 0:1.0-alt1 cmp 1.0-alt2 should yield 1.
>
> Why?
>
> > Zero serial is greater than no serial.
>
> Why?
This is because how rpm-4.0 works.
lib/psm.c:
72 int rpmVersionCompare(Header first, Header second)
73 {
74 const char * one, * two;
75 int_32 * epochOne, * epochTwo;
76 int rc;
77
78 if (!headerGetEntry(first, RPMTAG_EPOCH, NULL, (void **) &epochOne, NULL))
79 epochOne = NULL;
80 if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, (void **) &epochTwo,
81 NULL))
82 epochTwo = NULL;
83
84 if (epochOne && !epochTwo)
85 return 1;
86 else if (!epochOne && epochTwo)
87 return -1;
88 else if (epochOne && epochTwo) {
89 if (*epochOne < *epochTwo)
90 return -1;
91 else if (*epochOne > *epochTwo)
92 return 1;
93 }
94
95 rc = headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL);
96 rc = headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL);
97
98 rc = rpmvercmp(one, two);
99 if (rc)
100 return rc;
101
102 (void) headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL);
103 (void) headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL);
104
105 rc = rpmvercmp(one, two);
106 if (rc)
107 return rc;
108
109 if (upgrade_honor_buildtime())
110 return rpmBuildTimeCompare(first, second);
111
112 return 0;
113 }
Thus, rpm will not upgrade a package (by default), and apt-rpm will
not consider an upgrade, if zero serial gets removed (and, say,
release number is increased).
Let's try to remove zero serial from e.g. kbd and see what happens.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-02-16 13:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-16 8:16 Alexey Tourbin
2009-02-16 12:23 ` Dmitry V. Levin
2009-02-16 13:05 ` Alexey Tourbin [this message]
2009-02-16 23:29 ` Dmitry V. Levin
2009-02-28 14:17 ` Alexey Tourbin
2009-02-28 22:37 ` Dmitry V. Levin
2009-02-28 17:36 ` Alexey Tourbin
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=20090216130508.GL31985@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