blob: baef6dee01c6ec2042223a0e2b985b5911622a3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# Copyright 2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
import subprocess, os
from portage.sets import PackageSet
class CommandOutputSet(PackageSet):
_operations = ["merge", "unmerge"]
def __init__(self, name, command):
super(CommandOutputSet, self).__init__(name)
self._command = command
def load(self):
pipe = subprocess.Popen(self._command, stdout=subprocess.PIPE, shell=True)
if pipe.wait() == os.EX_OK:
text = pipe.stdout.read()
self._setAtoms(text.split("\n"))
|