Change the versioned provision format.

Change the 'provname provver' format to 'provname=provver'.
In .PKGINFO, the provisions are copied from the PKGBUILD without quotes. So
the provision version was actually handled as a different provision...

See FS#9171.

Dan: Unfortunately we have to change our original specification for
versioned provisions with this patch, but it ends up being the simpler and
cleaner solution in the long run, and if there is any time to change it the
time is now before many packages have been built. Keeping the ' ' based
format would have required us to do special parsing in repo-add, as well as
being susceptible to users not using quotes in their provides array.

Hopefully this will resolve the issues we had with our initial plan. Sorry
for the confusion.

Acked-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Chantry Xavier 2008-01-14 20:28:29 +01:00 committed by Dan McGee
parent 6eee9e987a
commit 0c5b68877b
9 changed files with 13 additions and 12 deletions

View file

@ -145,8 +145,9 @@ Options and Directives
a package to provide dependencies other than its own package name. For a package to provide dependencies other than its own package name. For
example, the dcron package can provide 'cron', which allows packages to example, the dcron package can provide 'cron', which allows packages to
depend on 'cron' rather than 'dcron OR fcron'. depend on 'cron' rather than 'dcron OR fcron'.
Versioned provisions are also possible. For example, dcron can provide Versioned provisions are also possible, in the 'name=version' format.
'cron 2.0' to satisfy the 'cron>=2.0' dependency of other packages. For example, dcron can provide 'cron=2.0' to satisfy the 'cron>=2.0'
dependency of other packages.
*replaces (array)*:: *replaces (array)*::
An array of packages that this package should replace, and can be used An array of packages that this package should replace, and can be used

View file

@ -650,7 +650,7 @@ int _alpm_prov_cmp(const void *provision, const void *needle)
char *tmpptr; char *tmpptr;
char *provname = strdup(provision); char *provname = strdup(provision);
int retval = 0; int retval = 0;
tmpptr = strchr(provname, ' '); tmpptr = strchr(provname, '=');
if(tmpptr != NULL) { /* provision-version */ if(tmpptr != NULL) { /* provision-version */
*tmpptr='\0'; *tmpptr='\0';

View file

@ -336,10 +336,10 @@ int SYMEXPORT alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
satisfy = (strcmp(pkgname, dep->name) == 0 satisfy = (strcmp(pkgname, dep->name) == 0
&& dep_vercmp(pkgversion, dep->mod, dep->version)); && dep_vercmp(pkgversion, dep->mod, dep->version));
/* check provisions, format : "name version" */ /* check provisions, format : "name=version" */
for(i = alpm_pkg_get_provides(pkg); i && !satisfy; i = i->next) { for(i = alpm_pkg_get_provides(pkg); i && !satisfy; i = i->next) {
char *provname = strdup(i->data); char *provname = strdup(i->data);
char *provver = strchr(provname, ' '); char *provver = strchr(provname, '=');
if(provver == NULL) { /* no provision version */ if(provver == NULL) { /* no provision version */
satisfy = (dep->mod == PM_DEP_MOD_ANY satisfy = (dep->mod == PM_DEP_MOD_ANY

View file

@ -1,7 +1,7 @@
self.description = "-S provision" self.description = "-S provision"
sp = pmpkg("pkg1") sp = pmpkg("pkg1")
sp.provides = ["provision 1.0-1"] sp.provides = ["provision=1.0-1"]
self.addpkg2db("sync", sp) self.addpkg2db("sync", sp)
self.args = "-S provision" self.args = "-S provision"

View file

@ -1,11 +1,11 @@
self.description = "-S provision" self.description = "-S provision"
sp = pmpkg("pkg1") sp = pmpkg("pkg1")
sp.provides = ["provision 1.0-1"] sp.provides = ["provision=1.0-1"]
self.addpkg2db("sync", sp) self.addpkg2db("sync", sp)
sp = pmpkg("pkg2") sp = pmpkg("pkg2")
sp.provides = ["provision 1.0-1"] sp.provides = ["provision=1.0-1"]
self.addpkg2db("sync", sp) self.addpkg2db("sync", sp)
self.args = "-S provision" self.args = "-S provision"

View file

@ -5,7 +5,7 @@ p.depends = ["provision>=1.0-2"]
self.addpkg(p) self.addpkg(p)
lp = pmpkg("pkg2", "1.0-2") lp = pmpkg("pkg2", "1.0-2")
lp.provides = ["provision 1.0-2"] lp.provides = ["provision=1.0-2"]
self.addpkg2db("local", lp) self.addpkg2db("local", lp)
self.args = "-U %s" % p.filename() self.args = "-U %s" % p.filename()

View file

@ -5,7 +5,7 @@ p.depends = ["provision>=1.0-2"]
self.addpkg(p) self.addpkg(p)
lp = pmpkg("pkg2", "1.0-2") lp = pmpkg("pkg2", "1.0-2")
lp.provides = ["provision 1.0-1"] lp.provides = ["provision=1.0-1"]
self.addpkg2db("local", lp) self.addpkg2db("local", lp)
self.args = "-U %s" % p.filename() self.args = "-U %s" % p.filename()

View file

@ -5,7 +5,7 @@ p.depends = ["provision>=1.0-2"]
self.addpkg2db("sync", p) self.addpkg2db("sync", p)
lp = pmpkg("pkg2", "1.0-2") lp = pmpkg("pkg2", "1.0-2")
lp.provides = ["provision 1.0-2"] lp.provides = ["provision=1.0-2"]
self.addpkg2db("local", lp) self.addpkg2db("local", lp)
self.args = "-S %s" % p.name self.args = "-S %s" % p.name

View file

@ -5,7 +5,7 @@ p.depends = ["provision>=1.0-2"]
self.addpkg2db("sync", p) self.addpkg2db("sync", p)
lp = pmpkg("pkg2", "1.0-2") lp = pmpkg("pkg2", "1.0-2")
lp.provides = ["provision 1.0-1"] lp.provides = ["provision=1.0-1"]
self.addpkg2db("local", lp) self.addpkg2db("local", lp)
self.args = "-S %s" % p.name self.args = "-S %s" % p.name