mirror of
https://github.com/rozniak/xfce-winxp-tc.git
synced 2026-01-26 11:39:44 +00:00
Prelim: Working on outputting install progress
This commit is contained in:
@@ -39,11 +39,14 @@ def wsetup_pkg_get_pkgnames_basesystem():
|
||||
|
||||
# Read complist.ini to set up the stuff we need to install for phase 2
|
||||
#
|
||||
distpkgs_key = "DistPackages" + pkgfmt.title()
|
||||
|
||||
complist = configparser.ConfigParser()
|
||||
complist.read(f"{setup_root}/setup/complist.ini")
|
||||
|
||||
libs_arr = complist["BaseSystem"]["Libs"].split(",")
|
||||
ourpkgs_arr = complist["BaseSystem"]["OurPackages"].split(",")
|
||||
libs_arr = complist["BaseSystem"]["Libs"].split(",")
|
||||
ourpkgs_arr = complist["BaseSystem"]["OurPackages"].split(",")
|
||||
distpkgs_arr = complist["BaseSystem"][distpkgs_key].split(",")
|
||||
|
||||
for i in range(len(libs_arr)):
|
||||
if libs_arr[i] == "":
|
||||
@@ -51,18 +54,10 @@ def wsetup_pkg_get_pkgnames_basesystem():
|
||||
|
||||
libs_arr[i] = f"{pkg_src_dir}/libwintc-{libs_arr[i]}{pkgfmt_fileext}"
|
||||
|
||||
libs = " ".join(libs_arr)
|
||||
|
||||
for i in range(len(ourpkgs_arr)):
|
||||
if ourpkgs_arr[i] == "":
|
||||
continue
|
||||
|
||||
ourpkgs_arr[i] = f"{pkg_src_dir}/{ourpkgs_arr[i]}{pkgfmt_fileext}"
|
||||
|
||||
ourpkgs = " ".join(ourpkgs_arr)
|
||||
|
||||
distpkgs = " ".join(
|
||||
complist["BaseSystem"]["DistPackages" + pkgfmt.title()].split(",")
|
||||
)
|
||||
|
||||
return f"{libs} {ourpkgs} {distpkgs}"
|
||||
return (libs_arr + ourpkgs_arr + distpkgs_arr)
|
||||
|
||||
@@ -275,12 +275,13 @@ def wsetup_step_install_base(stdscr):
|
||||
|
||||
# Install the base packages to get to phase 2
|
||||
#
|
||||
pkgcmd = ""
|
||||
pkgfmt = os.environ.get("WSETUP_DIST_PKGFMT")
|
||||
pkgnames = wsetup_pkg_get_pkgnames_basesystem()
|
||||
pkgcmd = ""
|
||||
pkgfmt = os.environ.get("WSETUP_DIST_PKGFMT")
|
||||
pkgnames_arr = wsetup_pkg_get_pkgnames_basesystem()
|
||||
pkgnames = " ".join(pkgnames_arr)
|
||||
|
||||
if pkgfmt == "deb":
|
||||
pkgcmd = f"apt-get install -y -o APT::Status-Fd=2 {pkgnames}"
|
||||
pkgcmd = f"apt-get install -y -o APT::Status-Fd=1 {pkgnames}"
|
||||
else:
|
||||
raise Exception(f"No install command for format {pkgfmt}")
|
||||
|
||||
@@ -293,19 +294,26 @@ def wsetup_step_install_base(stdscr):
|
||||
)
|
||||
|
||||
while True:
|
||||
cmd_out = process.stderr.readline()
|
||||
cmd_out = process.stdout.readline()
|
||||
|
||||
if process.poll() is not None:
|
||||
break
|
||||
|
||||
if cmd_out:
|
||||
wsetup_screen_write_simple(
|
||||
stdscr,
|
||||
1, 0,
|
||||
cmd_out.strip(),
|
||||
curses.color_pair(COLOR_PAIR_NORMAL_TEXT)
|
||||
)
|
||||
stdscr.refresh()
|
||||
if pkgfmt == "deb":
|
||||
# Parse apt-get status output
|
||||
#
|
||||
if not cmd_out.startswith("pmstatus"):
|
||||
continue
|
||||
|
||||
wsetup_screen_write_simple(
|
||||
stdscr,
|
||||
1, 0,
|
||||
cmd_out.split(":")[2],
|
||||
curses.color_pair(COLOR_PAIR_NORMAL_TEXT)
|
||||
)
|
||||
|
||||
stdscr.refresh()
|
||||
|
||||
wsetup_screen_write_simple(
|
||||
stdscr,
|
||||
|
||||
Reference in New Issue
Block a user