aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2010-07-31 21:38:28 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2010-07-31 21:38:28 -0300
commit25f7633a5e01f6402187d66a65ca9a3db0047b0d (patch)
tree1e83010adaa3fbbb93c5f670881e48adc1858765 /g_octave
parentrewrote the --list option (diff)
downloadg-octave-25f7633a5e01f6402187d66a65ca9a3db0047b0d.tar.gz
g-octave-25f7633a5e01f6402187d66a65ca9a3db0047b0d.tar.bz2
g-octave-25f7633a5e01f6402187d66a65ca9a3db0047b0d.zip
removed optional svn support
Diffstat (limited to 'g_octave')
-rw-r--r--g_octave/description.py1
-rw-r--r--g_octave/description_tree.py26
-rw-r--r--g_octave/ebuild.py6
3 files changed, 17 insertions, 16 deletions
diff --git a/g_octave/description.py b/g_octave/description.py
index c951a1c..8fcd383 100644
--- a/g_octave/description.py
+++ b/g_octave/description.py
@@ -18,6 +18,7 @@ from __future__ import absolute_import
__all__ = [
'Description',
+ 'SvnDescription',
're_depends',
're_pkg_atom'
]
diff --git a/g_octave/description_tree.py b/g_octave/description_tree.py
index a2a59cf..736b0c9 100644
--- a/g_octave/description_tree.py
+++ b/g_octave/description_tree.py
@@ -24,13 +24,6 @@ from portage.versions import vercmp
from .config import Config
from .description import *
from .exception import ConfigException, DescriptionTreeException
-
-has_svn = True
-try:
- from .svn import *
-except ImportError:
- has_svn = False
-
from .log import Log
log = Log('g_octave.description_tree')
@@ -174,11 +167,24 @@ class DescriptionTree(object):
for pkg in self.pkg_list[cat]:
if re_term.search(pkg['name']) is not None:
if pkg['name'] not in packages:
- packages[pkg['name']] = [pkg['version']]
- if has_svn:
- packages[pkg['name']].append('9999')
+ packages[pkg['name']] = [pkg['version'], '9999']
else:
packages[pkg['name']].insert(-1, pkg['version'])
+ packages[pkg['name']].sort(key=cmp_to_key(vercmp))
return packages
+ def list(self):
+
+ packages = {}
+
+ for cat in self.pkg_list:
+ packages[cat] = {}
+ for pkg in self.pkg_list[cat]:
+ if pkg['name'] not in packages[cat]:
+ packages[cat][pkg['name']] = [pkg['version'], '9999']
+ else:
+ packages[cat][pkg['name']].insert(-1, pkg['version'])
+ packages[cat][pkg['name']].sort(key=cmp_to_key(vercmp))
+
+ return packages
diff --git a/g_octave/ebuild.py b/g_octave/ebuild.py
index 1edfada..a744226 100644
--- a/g_octave/ebuild.py
+++ b/g_octave/ebuild.py
@@ -24,12 +24,6 @@ from .description_tree import *
from .exception import EbuildException
from .compat import open
-has_svn = True
-try:
- from .description import SvnDescription
-except:
- has_svn = False
-
import os
import portage
import re