diff --git a/srcpkgs/urxvt-tabbedex/files/modules/postcfg/main.py b/srcpkgs/urxvt-tabbedex/files/modules/postcfg/main.py deleted file mode 100644 index 19cbf9b..0000000 --- a/srcpkgs/urxvt-tabbedex/files/modules/postcfg/main.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- -# -# === This file is part of Calamares - === -# -# Copyright 2014 - 2019, Philip Müller -# Copyright 2016, Artoo -# -# Calamares is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Calamares is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Calamares. If not, see . - -import libcalamares -import subprocess - -from shutil import copy2 -from distutils.dir_util import copy_tree -from os.path import join, exists -from libcalamares.utils import target_env_call - - -class ConfigController: - def __init__(self): - self.__root = libcalamares.globalstorage.value("rootMountPoint") - - @property - def root(self): - return self.__root - - def terminate(self, proc): - target_env_call(['killall', '-9', proc]) - - def copy_file(self, file): - if exists("/" + file): - copy2("/" + file, join(self.root, file)) - - def copy_folder(self, source, target): - if exists("/" + source): - copy_tree("/" + source, join(self.root, target)) - - def remove_pkg(self, pkg): - target_env_call(['xbps-remove', '-Ry', pkg]) - - def umount(self, mp): - subprocess.call(["umount", "-l", join(self.root, mp)]) - - def mount(self, mp): - subprocess.call(["mount", "-B", "/" + mp, join(self.root, mp)]) - - def rmdir(self, dir): - subprocess.call(["rm", "-Rf", join(self.root, dir)]) - - def mkdir(self, dir): - subprocess.call(["mkdir", "-p", join(self.root, dir)]) - - def run(self): - if exists(join(self.root, "usr/sbin/void-installer")): - target_env_call(["rm", "-f", "usr/sbin/void-installer"]) - - if exists(join(self.root, "usr/bin/startplasma-x11")): - print("Not removing Breeze") - else: - self.remove_pkg("breeze") - - # Initialize package manager databases - if libcalamares.globalstorage.value("hasInternet"): - target_env_call(["xbps-install", "-Syy"]) - - # Remove calamares - self.remove_pkg("calamares-cereus") - target_env_call(["find", "*", "-name", "calamares.desktop", "-delete"]) - - # Copy skel to root - self.copy_folder('etc/skel', 'root') - - # Update grub.cfg - if exists(join(self.root, "usr/bin/update-grub")): - target_env_call(["update-grub"]) - - # Enable 'menu_auto_hide' when supported in grubenv - if exists(join(self.root, "usr/bin/grub-set-bootflag")): - target_env_call(["grub-editenv", "-", "set", "menu_auto_hide=1", "boot_success=1"]) - -def run(): - """ Misc postinstall configurations """ - - config = ConfigController() - - return config.run() diff --git a/srcpkgs/urxvt-tabbedex/files/modules/postcfg/module.desc b/srcpkgs/urxvt-tabbedex/files/modules/postcfg/module.desc deleted file mode 100644 index 77e9ca4..0000000 --- a/srcpkgs/urxvt-tabbedex/files/modules/postcfg/module.desc +++ /dev/null @@ -1,6 +0,0 @@ -# Syntax is YAML 1.2 ---- -type: "job" -name: "postcfg" -interface: "python" -script: "main.py" #assumed relative to the current directory