* [gentoo-pms] REPLACING_VERSIONS
@ 2011-01-31 18:23 Ulrich Mueller
2011-01-31 18:26 ` Ciaran McCreesh
0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Mueller @ 2011-01-31 18:23 UTC (permalink / raw
To: gentoo-pms
PMS currently says: "A whitespace-separated list of versions of this
package (including revision, if specified) that are being replaced
(uninstalled or overwritten) as a result of this install."
Shouldn't the spec guarantee that it's the empty string (i.e., not
a string containing arbitrary whitespace) if the list is empty?
Otherwise simple binary tests like [[ -n ${REPLACING_VERSIONS} ]]
cannot be done.
For REPLACED_BY_VERSION, it is explicitly specified: "The single
version ..., or an empty string otherwise."
Ulrich
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-pms] REPLACING_VERSIONS
2011-01-31 18:23 [gentoo-pms] REPLACING_VERSIONS Ulrich Mueller
@ 2011-01-31 18:26 ` Ciaran McCreesh
2011-01-31 20:18 ` Ulrich Mueller
0 siblings, 1 reply; 4+ messages in thread
From: Ciaran McCreesh @ 2011-01-31 18:26 UTC (permalink / raw
To: gentoo-pms
[-- Attachment #1: Type: text/plain, Size: 931 bytes --]
On Mon, 31 Jan 2011 19:23:51 +0100
Ulrich Mueller <ulm@gentoo.org> wrote:
> PMS currently says: "A whitespace-separated list of versions of this
> package (including revision, if specified) that are being replaced
> (uninstalled or overwritten) as a result of this install."
>
> Shouldn't the spec guarantee that it's the empty string (i.e., not
> a string containing arbitrary whitespace) if the list is empty?
> Otherwise simple binary tests like [[ -n ${REPLACING_VERSIONS} ]]
> cannot be done.
>
> For REPLACED_BY_VERSION, it is explicitly specified: "The single
> version ..., or an empty string otherwise."
We had an issue with this early on with Paludis: certain eclasses were
expecting exact spacing requirements inside A and AA based upon a
quirk in how Portage created them, and it was causing weird bugs. I'd
be inclined to say that people should write more tolerant code...
--
Ciaran McCreesh
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-pms] REPLACING_VERSIONS
2011-01-31 18:26 ` Ciaran McCreesh
@ 2011-01-31 20:18 ` Ulrich Mueller
2011-02-03 7:01 ` Ulrich Mueller
0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Mueller @ 2011-01-31 20:18 UTC (permalink / raw
To: Ciaran McCreesh; +Cc: gentoo-pms
>>>>> On Mon, 31 Jan 2011, Ciaran McCreesh wrote:
>> Shouldn't the spec guarantee that it's the empty string (i.e., not
>> a string containing arbitrary whitespace) if the list is empty?
>> Otherwise simple binary tests like [[ -n ${REPLACING_VERSIONS} ]]
>> cannot be done.
> We had an issue with this early on with Paludis: certain eclasses
> were expecting exact spacing requirements inside A and AA based upon
> a quirk in how Portage created them, and it was causing weird bugs.
> I'd be inclined to say that people should write more tolerant
> code...
No, nothing like exact spacing requirements in the general case. Only
simplify developers' lifes in what I guess will be 90% of the usage.
And I think that one could already read "space separated" in that way:
If there are no elements, there is nothing to separate.
Ulrich
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-pms] REPLACING_VERSIONS
2011-01-31 20:18 ` Ulrich Mueller
@ 2011-02-03 7:01 ` Ulrich Mueller
0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Mueller @ 2011-02-03 7:01 UTC (permalink / raw
To: gentoo-pms
Anyway, another dev has also complained that the cheat sheet's wording
for these variables would not be clear enough.
A new attempt is included below, please review. (If you suggest a new
wording, I'd really like it not to exceed 5 lines in the PDF output.)
--- a/eapi-cheatsheet.tex
+++ b/eapi-cheatsheet.tex
@@ -205,9 +205,9 @@ nonetheless.
\item[\code{PROPERTIES}] Is mandatory for all package managers now
to support interactive installs.
\item[\code{REPLACING\_VERSIONS}, \code{REPLACED\_BY\_VERSION}]
- For corner cases in upgrade paths those variables can be defined
- in \code{pkg\_*} functions to define a package version that is
- replaced by or is the replacement for the current one.
+ These variables, valid in \code{pkg\_*}, contain a list of all
+ versions (\code{PVR}) of this package that we are replacing, and
+ the version that is replacing the current one, respectively.
See \featureref{replace-version-vars}.
\item[\code{MERGE\_TYPE}] This variable contains one of three
possible values to allow checks if it is normal merge with
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-03 7:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 18:23 [gentoo-pms] REPLACING_VERSIONS Ulrich Mueller
2011-01-31 18:26 ` Ciaran McCreesh
2011-01-31 20:18 ` Ulrich Mueller
2011-02-03 7:01 ` Ulrich Mueller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox