#!/usr/bin/python3
# Copyright (c) 2019 TurnKey GNU/Linux <admin@turnkeylinux.org>
# all rights reserved

import sys

from common import Chroot, DiliveDebconf, PIPE, target_mounted

pkgs_to_clean = ['di-live', 'live-boot', 'live-tools',
                 'live-boot-initramfs-tools']


def clean_target_pkgs(*pkgs, path='/target'):
    """Clean up unrequired pkgs from installed system"""
    chroot = Chroot(path)
    chroot.system(['apt-get', 'purge', '--autoremove', '-y', *pkgs], stdout=PIPE)
    chroot.exit()


def main():
    if not target_mounted('/target'):
        sys.exit(10)  # return to menu
    db = DiliveDebconf(title='Remove live packages')
    db.progress_init(2, description=
                     'Removing live packages from installed system')
    db.progress_step(1)
    clean_target_pkgs(*pkgs_to_clean, path='/target')
    db.progress_step(2)


if __name__ == "__main__":
    main()

24f601a28c36a6ddce48a2665d12afaef5fe3465
<mask token>


def clean_target_pkgs(*pkgs, path='/target'):
    """Clean up unrequired pkgs from installed system"""
    chroot = Chroot(path)
    chroot.system(['apt-get', 'purge', '--autoremove', '-y', *pkgs], stdout
        =PIPE)
    chroot.exit()


def main():
    if not target_mounted('/target'):
        sys.exit(10)
    db = DiliveDebconf(title='Remove live packages')
    db.progress_init(2, description=
        'Removing live packages from installed system')
    db.progress_step(1)
    clean_target_pkgs(*pkgs_to_clean, path='/target')
    db.progress_step(2)


<mask token>

<mask token>


def clean_target_pkgs(*pkgs, path='/target'):
    """Clean up unrequired pkgs from installed system"""
    chroot = Chroot(path)
    chroot.system(['apt-get', 'purge', '--autoremove', '-y', *pkgs], stdout
        =PIPE)
    chroot.exit()


def main():
    if not target_mounted('/target'):
        sys.exit(10)
    db = DiliveDebconf(title='Remove live packages')
    db.progress_init(2, description=
        'Removing live packages from installed system')
    db.progress_step(1)
    clean_target_pkgs(*pkgs_to_clean, path='/target')
    db.progress_step(2)


if __name__ == '__main__':
    main()

<mask token>
pkgs_to_clean = ['di-live', 'live-boot', 'live-tools',
    'live-boot-initramfs-tools']


def clean_target_pkgs(*pkgs, path='/target'):
    """Clean up unrequired pkgs from installed system"""
    chroot = Chroot(path)
    chroot.system(['apt-get', 'purge', '--autoremove', '-y', *pkgs], stdout
        =PIPE)
    chroot.exit()


def main():
    if not target_mounted('/target'):
        sys.exit(10)
    db = DiliveDebconf(title='Remove live packages')
    db.progress_init(2, description=
        'Removing live packages from installed system')
    db.progress_step(1)
    clean_target_pkgs(*pkgs_to_clean, path='/target')
    db.progress_step(2)


if __name__ == '__main__':
    main()

import sys
from common import Chroot, DiliveDebconf, PIPE, target_mounted
pkgs_to_clean = ['di-live', 'live-boot', 'live-tools',
    'live-boot-initramfs-tools']


def clean_target_pkgs(*pkgs, path='/target'):
    """Clean up unrequired pkgs from installed system"""
    chroot = Chroot(path)
    chroot.system(['apt-get', 'purge', '--autoremove', '-y', *pkgs], stdout
        =PIPE)
    chroot.exit()


def main():
    if not target_mounted('/target'):
        sys.exit(10)
    db = DiliveDebconf(title='Remove live packages')
    db.progress_init(2, description=
        'Removing live packages from installed system')
    db.progress_step(1)
    clean_target_pkgs(*pkgs_to_clean, path='/target')
    db.progress_step(2)


if __name__ == '__main__':
    main()

#!/usr/bin/python3
# Copyright (c) 2019 TurnKey GNU/Linux <admin@turnkeylinux.org>
# all rights reserved

import sys

from common import Chroot, DiliveDebconf, PIPE, target_mounted

pkgs_to_clean = ['di-live', 'live-boot', 'live-tools',
                 'live-boot-initramfs-tools']


def clean_target_pkgs(*pkgs, path='/target'):
    """Clean up unrequired pkgs from installed system"""
    chroot = Chroot(path)
    chroot.system(['apt-get', 'purge', '--autoremove', '-y', *pkgs], stdout=PIPE)
    chroot.exit()


def main():
    if not target_mounted('/target'):
        sys.exit(10)  # return to menu
    db = DiliveDebconf(title='Remove live packages')
    db.progress_init(2, description=
                     'Removing live packages from installed system')
    db.progress_step(1)
    clean_target_pkgs(*pkgs_to_clean, path='/target')
    db.progress_step(2)


if __name__ == "__main__":
    main()
