1 |
I'm sorry I used the cvs version of portage to write those scripts. I'll |
2 |
post an updated version in a little while. |
3 |
|
4 |
On Sun, 2002-02-17 at 23:12, Bart Verwilst wrote: |
5 |
> After succesfully running the sh script, i try to run convertslots2.py, |
6 |
> it errors out with the following output: |
7 |
> |
8 |
> |
9 |
> root@Gentoo verwilst # ./convertslots2.py |
10 |
> Traceback (most recent call last): |
11 |
> File "./convertslots2.py", line 16, in ? |
12 |
> slotpath=dirname(localtree.getebuildpath(package))+"/SLOT" |
13 |
> AttributeError: 'vartree' instance has no attribute 'getebuildpath' |
14 |
> |
15 |
> |
16 |
> Bye! |
17 |
> |
18 |
> On Sun, 2002-02-17 at 09:55, Geert Bevin wrote: |
19 |
> > Hello, |
20 |
> > |
21 |
> > I provide these scripts to put your /var/db/pkg tree back to a |
22 |
> > compatible state after all the slots adventures. |
23 |
> > |
24 |
> > First run convertslot.sh and then convertslots2.py, afterwards your |
25 |
> > installed package tree should be compatible with 1.8.8 again and with |
26 |
> > what slots are supposed to become in the next revisions. |
27 |
> > |
28 |
> > Happy gentooing ! |
29 |
> > |
30 |
> > Geert |
31 |
> > -- |
32 |
> > Geert Bevin Uwyn |
33 |
> > "Use what you need" Lambermontlaan 148 |
34 |
> > http://www.uwyn.com 1030 Brussels |
35 |
> > gbevin@××××.com Tel & Fax +32 2 245 41 06 |
36 |
> > ---- |
37 |
> > |
38 |
> |
39 |
> > #!/bin/sh |
40 |
> > # converts old changed dirnames to the previous format again |
41 |
> > # where slots aren't reflected in the dir path name |
42 |
> > slots=$(find /var/db/pkg -name SLOT) |
43 |
> > for slot in $slots; |
44 |
> > do |
45 |
> > dir=${slot%SLOT} |
46 |
> > pf=$(cat $dir/PF) |
47 |
> > newdir=$(dirname $dir) |
48 |
> > newdir="$newdir/$pf" |
49 |
> > if [ ! -d $newdir ] |
50 |
> > then |
51 |
> > mv $dir $newdir |
52 |
> > echo "$dir has been converted" |
53 |
> > else |
54 |
> > echo "$newdir already exists" |
55 |
> > fi |
56 |
> > done |
57 |
> > ---- |
58 |
> > |
59 |
> |
60 |
> > #!/usr/bin/env spython |
61 |
> > import os |
62 |
> > from os.path import walk, splitext, exists, basename, dirname |
63 |
> > import sys |
64 |
> > |
65 |
> > import output |
66 |
> > from output import * |
67 |
> > import portage |
68 |
> > import string |
69 |
> > from string import strip, find, replace, split |
70 |
> > |
71 |
> > """converts $PV slots to null slots""" |
72 |
> > localtree=portage.vartree() |
73 |
> > for node in localtree.getallnodes(): |
74 |
> > for package in localtree.dep_match(node): |
75 |
> > slotpath=dirname(localtree.getebuildpath(package))+"/SLOT" |
76 |
> > if os.path.exists(slotpath): |
77 |
> > package_parts=portage.catpkgsplit(package) |
78 |
> > slotfile=open(slotpath,'r+') |
79 |
> > actualslot=slotfile.readline().strip() |
80 |
> > if actualslot==package_parts[2]: |
81 |
> > slotfile.truncate(0) |
82 |
> > print slotpath,"has been set to null" |
83 |
> > slotfile.close() |
84 |
> > |
85 |
> -- |
86 |
> |
87 |
> Bart Verwilst |
88 |
> Gentoo Linux Developer, Desktop Team |
89 |
> Gent, Belgium |
90 |
> |
91 |
> _______________________________________________ |
92 |
> gentoo-dev mailing list |
93 |
> gentoo-dev@g.o |
94 |
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev |
95 |
> |
96 |
-- |
97 |
Geert Bevin Uwyn |
98 |
"Use what you need" Lambermontlaan 148 |
99 |
http://www.uwyn.com 1030 Brussels |
100 |
gbevin@××××.com Tel & Fax +32 2 245 41 06 |