diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-04-21 20:26:25 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-04-21 20:26:25 +0200 |
commit | b84cd304bfd042642b7da48c5439c38fbabd43bf (patch) | |
tree | 58125c11feffb6f7aab527d6f132c29e82e58296 /whatmaps | |
parent | 90975d3c600a3ef43dda4922a656a8ad76eca388 (diff) |
fixup! Split out and test DebianDistro
Diffstat (limited to 'whatmaps')
-rwxr-xr-x | whatmaps/command.py | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/whatmaps/command.py b/whatmaps/command.py index f645b99..4738e10 100755 --- a/whatmaps/command.py +++ b/whatmaps/command.py @@ -31,44 +31,11 @@ except ImportError: lsb_release = None from . process import Process -from . distro import Distro +from . debiandistro import DebianDistro from . pkg import Pkg, PkgError from . debianpkg import DebianPkg from . rpmpkg import RpmPkg -class RedHatDistro(Distro): - "RPM based distribution""" - _pkg_re = re.compile(r'(?P<pkg>[\w\-\+]+)-(?P<ver>[\w\.]+)' - '-(?P<rel>[\w\.]+)\.(?P<arch>.+)') - - @classmethod - def pkg(klass, name): - return RpmPkg(name) - - @classmethod - def pkg_by_file(klass, path): - find_file = subprocess.Popen(['rpm', '-qf', path], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - output = find_file.communicate()[0] - if find_file.returncode: - return None - m = klass._pkg_re.match(output.strip()) - if m: - pkg = m.group('pkg') - else: - pkg = output.strip() - return RpmPkg(pkg) - - @classmethod - def restart_service_cmd(klass, name): - return ['service', name, 'restart'] - - -class FedoraDistro(RedHatDistro): - id = 'Fedora' - - def check_maps(procs, shared_objects): restart_procs = {} for proc in procs: |