[Pkg-debile-commits] [debile-slave] 33/100: feh
Sylvestre Ledru
sylvestre at alioth.debian.org
Mon Aug 19 14:53:04 UTC 2013
This is an automated email from the git hooks/post-receive script.
sylvestre pushed a commit to branch master
in repository debile-slave.
commit afc51ed03804e9e1c632d8df8e9b57f6413001fd
Author: Paul Tagliamonte <tag at pault.ag>
Date: Mon May 27 22:54:10 2013 -0400
feh
---
ethel/chroot.py | 66 -------------------------------------------------------
1 file changed, 66 deletions(-)
diff --git a/ethel/chroot.py b/ethel/chroot.py
index 13944aa..0c8571c 100644
--- a/ethel/chroot.py
+++ b/ethel/chroot.py
@@ -1,10 +1,4 @@
-from ethel.utils import run_command, safe_run, EthelSubprocessError
-
import configparser
-import contextlib
-import shutil
-import sys
-import os
def get_session_file(session):
@@ -32,63 +26,3 @@ def get_tarball(chroot):
raise KeyError("No such session: `%s' - %s" % (session, fil))
obj = cfg[chroot]
return obj['file']
-
-
-def scmd(session, command, expected=0, user=None):
- cmds = ['schroot', '-r', '-c', session]
- if user:
- cmds += ['-u', user]
- cmds += ['--'] + command
- return safe_run(cmds, expected=expected)
-
-
- at contextlib.contextmanager
-def schroot(chroot, source=False):
- session = "ethel-%s" % (os.getpid())
- chroot_name = chroot
- if source:
- chroot_name = "source:%s" % (chroot_name)
-
- out, err = safe_run(['schroot', '-b', '-n', session, '-c', chroot_name])
-
- try:
- session = out.strip()
- print("[ethel] Started session: %s" % (session))
- yield session
- except Exception:
- if source:
- print("[ethel] Session crashed. Aborting repack")
- safe_run(['sudo', 'schroot-abort-repack', session])
- # name ALL=NOPASSWD: /usr/local/bin/schroot-abort-repack
- raise
- finally:
- out, err = safe_run(['schroot', '-e', '-c', session])
-
-
-def copy(session, source, dest):
- root = get_mount_point(session)
- dest = os.path.join(root, dest)
- return shutil.copy2(source, dest)
-
-
-def update(chroot):
- with schroot(chroot, source=True) as session:
- print("Updating")
- scmd(session, ['apt-get', 'update'], user='root')
- print("Upgrading")
- scmd(session, ['apt-get', '-y', 'dist-upgrade'], user='root')
- print("Finished update.")
-
-
-def run_update():
- try:
- update(*sys.argv[1:])
- except EthelSubprocessError as e:
- print(e.cmd)
- print()
- print(e.out)
- print()
- print(e.err)
- print()
- print(e.ret)
- raise
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-slave.git
More information about the Pkg-debile-commits
mailing list