1 |
Mike Payson <mike@××××××××××××××.com> writes: |
2 |
|
3 |
> This looks GREAT. |
4 |
|
5 |
thank you. :) |
6 |
|
7 |
> Exactly what I had in mind! Obviously PORTAGE_LEVEL should be in one |
8 |
> of the config files, |
9 |
|
10 |
/etc/make.conf would do nicely. see the revised patch. it got a |
11 |
bit cleaner as well, once I figured out why I'd broken a shell by |
12 |
exporting PORTAGE_LEVEL, and seeing how config worked. :) |
13 |
|
14 |
> and you need to be able to override the level by specifying a |
15 |
> specific version, |
16 |
|
17 |
I think this scheme will require you to do either: |
18 |
|
19 |
PORTAGE_LEVEL="" emerge <foo> |
20 |
|
21 |
or |
22 |
|
23 |
emerge --level=any emerge <foo> |
24 |
|
25 |
the first one already works. |
26 |
|
27 |
now, the thing is that now, suddenly, with PORTAGE_LEVEL="stable" |
28 |
set in /etc/make.conf, then you can only ask to merge packages of |
29 |
that level into the system. this is somewhat broken when it comes |
30 |
to dependencies yet (this is because I've only patched the calls to |
31 |
get package "foo", not ">foo" or anything like that. I'll try to |
32 |
get this working during the weekend or so. but, until then, if you |
33 |
emerge a package with the "stable" level, then you're (so far) not |
34 |
guaranteed that the dependencies will be stable. |
35 |
|
36 |
what I intend to do about that is theoretically simple. since there |
37 |
can only be one package with a given label at any time, check if |
38 |
that package is valid for use. otherwise bail out. |
39 |
|
40 |
> but excellent for, what, 23 lines of code?!?! |
41 |
|
42 |
nope. I've added 14 lines of code. there will be more needed to |
43 |
handle the dependencies correctly, but still. |
44 |
|
45 |
this patch gets 'PORTAGE_LEVEL' from /etc/make.conf. apply to a |
46 |
clean tree if you want to test it. |
47 |
|
48 |
--- /usr/lib/python2.2/site-packages/portage-clean.py Sat Apr 20 01:19:57 2002 |
49 |
+++ /usr/lib/python2.2/site-packages/portage.py Sat Apr 20 12:32:00 2002 |
50 |
@@ -2081,6 +2081,20 @@ |
51 |
else: |
52 |
return mymatch |
53 |
elif not isspecific(mypkgdep): |
54 |
+ |
55 |
+ if settings['PORTAGE_LEVEL']: |
56 |
+ if mypkgdep.find("/") > -1: |
57 |
+ level = settings['PORTAGE_LEVEL'] |
58 |
+ [ dir, name ] = mypkgdep.split("/") |
59 |
+ try: |
60 |
+ ebuild = os.readlink("/usr/portage/" + mypkgdep + "/" + name + "-" + level.lower()) |
61 |
+ ebuild = ebuild.replace(".ebuild", "") |
62 |
+ return self.dep_bestmatch("=" + ebuild) |
63 |
+ except OSError: |
64 |
+ print "\n>>> " + mypkgdep + " has no ebuild with label '" + level + "'." |
65 |
+ sys.exit(1) |
66 |
+ |
67 |
+ |
68 |
if not self.hasnode(mypkgdep): |
69 |
return "" |
70 |
mynodes=self.getnode(mypkgdep)[:] |
71 |
|
72 |
-- |
73 |
Terje |