Lines 3-18
Link Here
|
3 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# Distributed under the terms of the GNU General Public License v2 |
4 |
# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/build.py,v 1.3 2005/07/05 21:53:41 wolf31o2 Exp $ |
4 |
# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/build.py,v 1.3 2005/07/05 21:53:41 wolf31o2 Exp $ |
5 |
|
5 |
|
6 |
import portage,sys |
6 |
import os,portage,sys |
7 |
|
7 |
|
8 |
# this loads files from the profiles ... |
8 |
# this loads files from the profiles ... |
9 |
# wrap it here to take care of the different |
9 |
# wrap it here to take care of the different |
10 |
# ways portage handles stacked profiles |
10 |
# ways portage handles stacked profiles |
|
|
11 |
# last case is for portage-2.1_pre* |
11 |
def scan_profile(file): |
12 |
def scan_profile(file): |
12 |
if "grab_stacked" in dir(portage): |
13 |
if "grab_stacked" in dir(portage): |
13 |
return portage.grab_stacked(file, portage.settings.profiles, portage.grabfile, incremental_lines=1); |
14 |
return portage.grab_stacked(file, portage.settings.profiles, portage.grabfile, incremental_lines=1); |
14 |
else: |
15 |
else: |
15 |
return portage.stack_lists( portage.grab_multiple(file, portage.settings.profiles, portage.grabfile), incremental=1); |
16 |
if "grab_multiple" in dir(portage): |
|
|
17 |
return portage.stack_lists( portage.grab_multiple(file, portage.settings.profiles, portage.grabfile), incremental=1); |
18 |
else: |
19 |
return portage.stack_lists( [portage.grabfile_package(os.path.join(x, file)) for x in portage.settings.profiles], incremental=1); |
16 |
|
20 |
|
17 |
# loaded the stacked packages / packages.build files |
21 |
# loaded the stacked packages / packages.build files |
18 |
pkgs = scan_profile("packages") |
22 |
pkgs = scan_profile("packages") |