Gentoo Archives: gentoo-dev

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

Replies

Subject Author
Re: [gentoo-dev] for those that have been using portage 1.8.9_prex Geert Bevin <gbevin@××××.com>