127 lines
4.1 KiB
Python
127 lines
4.1 KiB
Python
"""
|
|
* Author: "PeppermintOS Team(peppermintosteam@proton.me)
|
|
*
|
|
* License: SPDX-License-Identifier: GPL-3.0-or-later
|
|
*
|
|
* These functions will build the base of the fusato build folders
|
|
* As well as commonly used functions
|
|
"""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
import paths
|
|
import conf
|
|
|
|
# Set the home path used regardless the user logged in
|
|
BSTRING = paths.bstring_iso_conifgs_fusato
|
|
home_folder = Path(BSTRING).expanduser()
|
|
|
|
|
|
def set_desktop_environment():
|
|
""" Create the list for the desktop environment"""
|
|
# Start in iso_configs/fusato
|
|
os.chdir(home_folder)
|
|
# set current directory
|
|
current_dir = os.getcwd().replace('/', '/')
|
|
# change to package-lists
|
|
os.chdir(current_dir + paths.de_path)
|
|
with open('desktop.list.chroot', 'x', encoding='UTF-8') as de_file:
|
|
de_file.write(conf.env_list)
|
|
|
|
|
|
def set_extra_packages():
|
|
""" Create the list for the desktop environment extras goodies"""
|
|
with open(
|
|
'extra-desktop.list.chroot', 'x', encoding='UTF-8'
|
|
) as extra_file:
|
|
extra_file.write(conf.desktop_list)
|
|
|
|
|
|
def set_general_packages():
|
|
""" Create the list for standard install packages"""
|
|
with open('packages.list.chroot', 'x', encoding='UTF-8') as general_file:
|
|
general_file.write(conf.general_list)
|
|
|
|
|
|
def set_system_packages():
|
|
""" Create the list for system management packages"""
|
|
with open('system.list.chroot', 'x', encoding='UTF-8') as system_file:
|
|
system_file.write(conf.system_list)
|
|
|
|
|
|
def set_system_packages_32():
|
|
""" Create the list for system management packages"""
|
|
with open('system.list.chroot', 'a', encoding='UTF-8') as system_file:
|
|
system_file.write(conf.system_list_32)
|
|
|
|
|
|
def set_system_packages_64():
|
|
""" Create the list for system management packages"""
|
|
with open('system.list.chroot', 'a', encoding='UTF-8') as system_file:
|
|
system_file.write(conf.system_list_64)
|
|
|
|
|
|
def set_system_packages_arm():
|
|
""" Create the list for system management packages"""
|
|
with open('system.list.chroot', 'a', encoding='UTF-8') as system_file:
|
|
system_file.write(conf.system_list_arm64)
|
|
|
|
|
|
def set_artwork_packages():
|
|
""" Create the list for icons, wallpaper and themes"""
|
|
with open('artwork.list.chroot', 'x', encoding='UTF-8') as artwork_file:
|
|
artwork_file.write(conf.artwork_list)
|
|
|
|
|
|
def set_python_packages():
|
|
""" Create the list for python related needs"""
|
|
with open('python.list.chroot', 'x', encoding='UTF-8') as python_file:
|
|
python_file.write(conf.python_list)
|
|
|
|
|
|
def set_calamares_packages():
|
|
""" Create the list for the calamares installer"""
|
|
with open(
|
|
'installer.list.chroot', 'x', encoding='UTF-8'
|
|
) as calamares_file:
|
|
calamares_file.write(conf.calamares_list)
|
|
|
|
|
|
def set_firmware_packages():
|
|
""" Create the list for the firmware support for genral ISOs"""
|
|
with open('firmware.list.chroot', 'x', encoding='UTF-8') as firmware_file:
|
|
firmware_file.write(conf.firmware_list)
|
|
|
|
|
|
def set_firmware_packages_arm():
|
|
""" Create the list for the firmware support for arm ISOs"""
|
|
with open('firmware.list.chroot', 'x', encoding='UTF-8') as firmware_file:
|
|
firmware_file.write(conf.firmware_list_arm)
|
|
|
|
|
|
def set_binary_packages_64():
|
|
""" Create the list for grub binary packages for 64 bit"""
|
|
with open('installer.list.binary', 'x', encoding='UTF-8') as binary_file:
|
|
binary_file.write(conf.binary_list_64)
|
|
|
|
|
|
def set_binary_packages_arm64():
|
|
""" Create the list for grub binary packages for 64 bit"""
|
|
with open('installer.list.binary', 'x', encoding='UTF-8') as binary_file:
|
|
binary_file.write(conf.binary_list_arm)
|
|
|
|
|
|
def set_binary_packages_32():
|
|
""" Create the list for grub binary packages for 32 bit"""
|
|
with open('installer.list.binary', 'x', encoding='UTF-8') as binary_file:
|
|
binary_file.write(conf.binary_list_32)
|
|
|
|
|
|
def set_fusato_structure():
|
|
""" Make some needed folders for the fustao build process."""
|
|
working_path = os.getcwd().replace('/', '/')
|
|
make_fldrs = paths.make_folders
|
|
# make needed folders
|
|
for f in make_fldrs:
|
|
os.makedirs(working_path + f)
|