cdebconf: update default color palet usage, and remove udeb profile need.

This commit is contained in:
Ark74 2024-09-09 01:59:09 -06:00
parent 9294cef9d3
commit 202f686415
3 changed files with 195 additions and 3 deletions

View file

@ -0,0 +1,96 @@
diff --git a/src/modules/frontend/newt/newt.c b/src/modules/frontend/newt/newt.c
index 838ff2f..ee754a2 100644
--- a/src/modules/frontend/newt/newt.c
+++ b/src/modules/frontend/newt/newt.c
@@ -72,6 +72,47 @@ struct newt_data {
struct question *scale_info;
};
+struct newtColors newtAltColorPalette = {
+ /*"white", "blue",*/ /* root fg, bg */
+ "white", "black", /* root fg, bg */
+ /*"black", "lightgray",*/ /* border fg, bg */
+ "white", "black", /* border fg, bg */
+ /*"black", "lightgray",*/ /* window fg, bg */
+ "white", "black", /* window fg, bg */
+ /*"white", "black",*/ /* shadow fg, bg */
+ "white", "black", /* shadow fg, bg */
+ /*"red", "lightgray",*/ /* title fg, bg */
+ "yellow", "black", /* title fg, bg */
+ /*"brightred", "gray",*/ /* button fg, bg */
+ "black", "lightgray", /* button fg, bg */
+ "gray", "brightred", /* active button fg, bg */
+ "white", "gray", /* checkbox fg, bg */
+ /*"yellow", "brown",*/ /* active checkbox fg, bg */
+ "black", "lightgray", /* active checkbox fg, bg */
+ /*"yellow", "blue",*/ /* entry box fg, bg */
+ "white", "black", /* entry box fg, bg */
+ /*"blue", "lightgray",*/ /* label fg, bg */
+ "brightred", "black", /* label fg, bg */
+ /*"black", "lightgray",*/ /* listbox fg, bg */
+ "white", "black", /* listbox fg, bg */
+ "yellow", "blue", /* active listbox fg, bg */
+ /*"black", "lightgray",*/ /* textbox fg, bg */
+ "white", "black", /* textbox fg, bg */
+ "lightgray", "black", /* active textbox fg, bg */
+ /*"white", "blue",*/ /* help line */
+ "white", "black", /* help line */
+ "yellow", "blue", /* root text */
+ /*"blue",*/ /* scale full */
+ "black", /* scale full */
+ /*"red",*/ /* scale empty */
+ "blue", /* scale empty */
+ "blue", "lightgray", /* disabled entry fg, bg */
+ /*"black", "lightgray",*/ /* compact button fg, bg */
+ "white", "black", /* compact button fg, bg */
+ "black", "lightgray", /* active & sel listbox */
+ "black", "brown" /* selected listbox */
+};
+
typedef int (newt_handler)(struct frontend *obj, struct question *q);
struct newt_help_callback_data {
@@ -153,6 +194,7 @@ cdebconf_newt_setup(void)
{
SLang_init_tty(0, 1, 0); /* disable flow control */
newtInit();
+ newtSetColors(newtAltColorPalette);
newtCls();
}
@@ -1078,7 +1120,7 @@ newt_handler_error(struct frontend *obj, struct question *q)
{
char *oldrootBg, *oldshadowBg, *oldhelpLineFg, *oldhelpLineBg;
int ret;
- struct newtColors palette = newtDefaultColorPalette;
+ struct newtColors palette = newtAltColorPalette;
oldrootBg = palette.rootBg;
oldshadowBg = palette.shadowBg;
@@ -1148,22 +1190,15 @@ newt_initialize(struct frontend *obj, struct configuration *conf)
{
int width = 80, height = 24;
const char *palette;
- const char *base = "/etc/newt/palette";
- char *path;
obj->interactive = 1;
obj->data = calloc(1, sizeof(struct newt_data));
SLang_init_tty(0, 1, 0); /* disable flow control */
- palette = getenv("FRONTEND_BACKGROUND");
- if (palette != NULL && asprintf(&path, "%s.%s", base, palette) >= 0) {
- /* Establish a symlink from /etc/newt/palette to
- * /etc/newt/palette.$FRONTEND_BACKGROUND
- */
- unlink(base);
- link(path, base);
- free(path);
- }
newtInit();
+ palette = getenv("FRONTEND_BACKGROUND");
+ if (palette == NULL || strcmp(palette, "dark") != 0)
+ newtAltColorPalette = newtDefaultColorPalette;
+ newtSetColors(newtAltColorPalette);
newtGetScreenSize(&width, &height);
newtFinished();
return DC_OK;

View file

@ -0,0 +1,96 @@
diff --git a/debian/control b/debian/control
index 0b67d83..de3d32e 100644
--- a/debian/control
+++ b/debian/control
@@ -83,7 +82,6 @@ Priority: standard
Depends: ${shlibs:Depends}, ${misc:Depends}
Provides: debconf-2.0
Package-Type: udeb
-Build-Profiles: <!noudeb>
Description: Debian Configuration Management System (C-implementation)
Debconf is a configuration management system for Debian packages. It is
used by some packages to prompt you for information before they are
@@ -99,7 +97,6 @@ Section: debian-installer
Priority: standard
Depends: cdebconf-udeb, ${misc:Depends}
Package-Type: udeb
-Build-Profiles: <!noudeb>
XB-Installer-Menu-Item: 93000
Description: Change debconf priority
This is a udeb that allows you to change the priority limit for the
@@ -110,7 +107,6 @@ Architecture: any
Section: debian-installer
Depends: ${shlibs:Depends}, ${misc:Depends}, cdebconf-udeb
Package-Type: udeb
-Build-Profiles: <!noudeb>
Description: Debian Configuration Management System (C-implementation)
Debconf is a configuration management system for Debian packages. It is
used by some packages to prompt you for information before they are
@@ -124,7 +120,6 @@ Architecture: any
Section: debian-installer
Depends: cdebconf-udeb, ${shlibs:Depends}, ${misc:Depends}
Package-Type: udeb
-Build-Profiles: <!noudeb>
Description: Plain text frontend for Debian Configuration Management System
Debconf is a configuration management system for Debian packages. It is
used by some packages to prompt you for information before they are
@@ -139,7 +134,6 @@ Architecture: any
Section: debian-installer
Depends: cdebconf-udeb, di-utils-terminfo, ${shlibs:Depends}, ${misc:Depends}
Package-Type: udeb
-Build-Profiles: <!noudeb>
Description: Newt frontend for Debian Configuration Management System
Debconf is a configuration management system for Debian packages. It is
used by some packages to prompt you for information before they are
@@ -154,7 +148,7 @@ Architecture: any
Section: debian-installer
Depends: cdebconf-udeb, ${shlibs:Depends}, ${misc:Depends}, rootskel-gtk [!s390 !s390x]
Package-Type: udeb
-Build-Profiles: <!pkg.cdebconf.nogtk !noudeb>
+Build-Profiles: <!pkg.cdebconf.nogtk>
Description: Gtk+ frontend for Debian Configuration Management System
Debconf is a configuration management system for Debian packages. It is
used by some packages to prompt you for information before they are
diff --git a/debian/rules b/debian/rules
index 3ee2ec0..a66e684 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,10 +12,6 @@ udebbuild=debian/build-udeb
include /usr/share/dpkg/architecture.mk
-ifeq (,$(filter noudeb, $(DEB_BUILD_PROFILES)))
- with_udeb = yes
-endif
-
CONFFILE=/etc/cdebconf.conf
#package names
@@ -46,7 +42,7 @@ ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEBUG_CONFIGURE_OPT=--with-debug=yes
endif
-build: build-deb $(if $(with_udeb),build-udeb)
+build: build-deb build-udeb
build-arch: build
build-indep: build
@@ -108,9 +104,7 @@ install-arch: build
dh_testroot
dh_prep
$(MAKE) -C $(debbuild) install DESTDIR=$(CURDIR)/debian/tmp/deb
-ifeq ($(with_udeb),yes)
$(MAKE) -C $(udebbuild) install DESTDIR=$(CURDIR)/debian/tmp/udeb
-endif
dh_install -a
install-indep:
@@ -152,7 +146,7 @@ endif
dh_strip -a
dh_compress -a
dh_fixperms -a
- dh_makeshlibs -a $(if $(with_udeb),--add-udeb=libdebconfclient0-udeb)
+ dh_makeshlibs -a --add-udeb=libdebconfclient0-udeb
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a