1 |
maillog: 25/07/2005-22:33:09(+0900): Jason Stubbs types |
2 |
> On Monday 25 July 2005 22:09, Martin Schlemmer wrote: |
3 |
> > On Mon, 2005-07-25 at 20:53 +0900, Jason Stubbs wrote: |
4 |
> > > On Monday 25 July 2005 16:51, Martin Schlemmer wrote: |
5 |
> > > > Something like this maybe? (Yes, I know using $T will be frowned upon, |
6 |
> > > > but not much else you can do. Also, might use has_version(), but that |
7 |
> > > > is more difficult to parse, and I figured you normally only want those |
8 |
> > > > for system udev ...) |
9 |
> > > |
10 |
> > > Combining the pkg_preinst and pkg_postinst parts (and removing the usage |
11 |
> > > of $T ;), that pretty much shows exactly what the proposed pkg_warn would |
12 |
> > > look like. Only difference being that it would be executed before emerging |
13 |
> > > starts. |
14 |
> > |
15 |
> > Currently: |
16 |
> > - if everything is moved to pkg_preinst(), the message will not show at |
17 |
> > the end of the merge, so much higher chance of getting missed. |
18 |
> > - if everything is moved to pkg_postinst(), $udev_version will be the |
19 |
> > new version, and be of no use. |
20 |
> > - if you meant that this is for the pkg_warn() ... it still wont really |
21 |
> > help that much, as it will differ from before/after the update :/ |
22 |
> |
23 |
> What's the issue with pkg_warn? It would only be ran before the update, |
24 |
> so the ebuild it's in is the new version and the current version can be |
25 |
> obtained with has_version. |
26 |
|
27 |
So, |
28 |
|
29 |
if $(has_version "<sys-fs/udev-046"); then |
30 |
ewarn |
31 |
fi |
32 |
|
33 |
... |
34 |
|
35 |
if $(has_version "<sys-fs/udev-059"); then |
36 |
ewarn |
37 |
fi |
38 |
|
39 |
For gaim maybe something like this: |
40 |
|
41 |
+if ! $(has_version "~${PV}" ); then |
42 |
ewarn |
43 |
- ewarn "If you are merging ${P} from an earlier version, you may need" |
44 |
- ewarn "to re-merge any plugins like gaim-encryption or gaim-snpp." |
45 |
+ ewarn "You may need to re-merge any plugins like gaim-encryption or gaim-snpp." |
46 |
|
47 |
|
48 |
Maybe a function in an eclass can make this easier on people? |
49 |
|
50 |
if $(package_is "<" 046); then |
51 |
... |
52 |
|
53 |
and package_is (name derived from kernel_is, don't flame the name, it is |
54 |
for illustration only) could be something like this: |
55 |
|
56 |
package_is() { |
57 |
return $(has_version "${1}${CATEGORY}/${PN}-${2}") |
58 |
} |
59 |
|
60 |
That should be good enough for all packages, right? |
61 |
|
62 |
One more thing. has_version would not necessarily detect the version we |
63 |
are upgrading from (i.e., the version that will be removed after |
64 |
installation) if there is a slotted package. Could that become a |
65 |
problem? |
66 |
|
67 |
-- |
68 |
() Georgi Georgiev () Who is D.B. Cooper, and where is he now? () |
69 |
() chutz@×××.net () () |
70 |
() +81(90)2877-8845 () () |