File: debian.py

package info (click to toggle)
python3-dmm 0.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 540 kB
  • sloc: python: 441; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""
debian functions for for dmm.
"""

import subprocess
from command_runner import command_runner

def update_sources(sources_list, sources_file, update_sources, chroot):
    """
    Update sources.list and optionally perform an apt-get update.
    """
    text_file = open(chroot + sources_file, "w")
    sources_write = text_file.write(sources_list)
    text_file.close()
    if update_sources:
        ecode, result = command_runner("chroot %s apt-get -q update" % (chroot),
                                shell=True)
        return ecode, result