diff -u newt-0.52.11/debian/changelog newt-0.52.11/debian/changelog --- newt-0.52.11/debian/changelog +++ newt-0.52.11/debian/changelog @@ -1,3 +1,17 @@ +newt (0.52.11-2ubuntu4) natty; urgency=low + + Fixes for LP: #737948 + * debian/patches/800_ubuntu_skin.patch, + debian/patches/801_configurable-palette.patch: + - drop the hardcoded color changes + - instead, read color values from /etc/newt/palette, if readable + * debian/libnewt0.52.install, debian/libnewt0.52.postinst, + debian/palette, debian/palette.ubuntu, debian/libnewt0.52.dirs: + - install the default palette, and an ubuntu palette, use the + update-alternatives system to set + + -- Dustin Kirkland Fri, 18 Mar 2011 21:56:08 -0500 + newt (0.52.11-2ubuntu3) natty; urgency=low * debian/patches/800_ubuntu_skin.patch: LP: #730672 diff -u newt-0.52.11/debian/libnewt0.52.postinst newt-0.52.11/debian/libnewt0.52.postinst --- newt-0.52.11/debian/libnewt0.52.postinst +++ newt-0.52.11/debian/libnewt0.52.postinst @@ -4,0 +5,7 @@ + +case "$1" in + configure) + update-alternatives --install /etc/newt/palette newt-palette /usr/share/newt/palette.ubuntu 50 + update-alternatives --install /etc/newt/palette newt-palette /usr/share/newt/palette 20 + ;; +esac diff -u newt-0.52.11/debian/libnewt0.52.install newt-0.52.11/debian/libnewt0.52.install --- newt-0.52.11/debian/libnewt0.52.install +++ newt-0.52.11/debian/libnewt0.52.install @@ -1,0 +2,2 @@ +../../debian/palette.ubuntu usr/share/newt/ +../../debian/palette usr/share/newt/ reverted: --- newt-0.52.11/debian/patches/800_ubuntu_skin.patch +++ newt-0.52.11.orig/debian/patches/800_ubuntu_skin.patch @@ -1,39 +0,0 @@ -diff -uprN newt-0.52.11.orig/newt.c newt-0.52.11/newt.c ---- newt-0.52.11.orig/newt.c 2011-02-17 14:37:57.278222661 -0600 -+++ newt-0.52.11/newt.c 2011-02-17 14:41:25.258222740 -0600 -@@ -518,26 +518,26 @@ static const char * const defaultHelpLin - ; - - const struct newtColors newtDefaultColorPalette = { -- "white", "blue", /* root fg, bg */ -+ "white", "magenta", /* root fg, bg */ - "black", "lightgray", /* border fg, bg */ - "black", "lightgray", /* window fg, bg */ - "white", "black", /* shadow fg, bg */ - "red", "lightgray", /* title fg, bg */ - "lightgray", "red", /* button fg, bg */ - "red", "lightgray", /* active button fg, bg */ -- "lightgray", "blue", /* checkbox fg, bg */ -+ "lightgray", "magenta", /* checkbox fg, bg */ - "lightgray", "red", /* active checkbox fg, bg */ -- "lightgray", "blue", /* entry box fg, bg */ -- "blue", "lightgray", /* label fg, bg */ -+ "lightgray", "magenta", /* entry box fg, bg */ -+ "magenta", "lightgray", /* label fg, bg */ - "black", "lightgray", /* listbox fg, bg */ -- "lightgray", "blue", /* active listbox fg, bg */ -+ "lightgray", "magenta", /* active listbox fg, bg */ - "black", "lightgray", /* textbox fg, bg */ - "lightgray", "red", /* active textbox fg, bg */ -- "white", "blue", /* help line */ -- "lightgray", "blue", /* root text */ -- "blue", /* scale full */ -+ "white", "magenta", /* help line */ -+ "lightgray", "magenta", /* root text */ -+ "magenta", /* scale full */ - "red", /* scale empty */ -- "blue", "lightgray", /* disabled entry fg, bg */ -+ "magenta", "lightgray", /* disabled entry fg, bg */ - "black", "lightgray", /* compact button fg, bg */ - "lightgray", "red", /* active & sel listbox */ - "black", "brown" /* selected listbox */ only in patch2: unchanged: --- newt-0.52.11.orig/debian/palette +++ newt-0.52.11/debian/palette @@ -0,0 +1 @@ +white,blue,black,lightgray,black,lightgray,white,black,red,lightgray,lightgray,red,red,lightgray,lightgray,blue,lightgray,red,lightgray,blue,blue,lightgray,black,lightgray,lightgray,blue,black,lightgray,lightgray,red,white,blue,lightgray,blue,blue,red,blue,lightgray,black,lightgray,lightgray,red,black,brown only in patch2: unchanged: --- newt-0.52.11.orig/debian/palette.ubuntu +++ newt-0.52.11/debian/palette.ubuntu @@ -0,0 +1 @@ +white,magenta,black,lightgray,black,lightgray,white,black,red,lightgray,lightgray,red,red,lightgray,lightgray,magenta,lightgray,red,lightgray,magenta,magenta,lightgray,black,lightgray,lightgray,magenta,black,lightgray,lightgray,red,white,magenta,lightgray,magenta,magenta,red,magenta,lightgray,black,lightgray,lightgray,red,black,brown only in patch2: unchanged: --- newt-0.52.11.orig/debian/libnewt0.52.dirs +++ newt-0.52.11/debian/libnewt0.52.dirs @@ -0,0 +1 @@ +etc/newt only in patch2: unchanged: --- newt-0.52.11.orig/debian/patches/801_configurable-palette.patch +++ newt-0.52.11/debian/patches/801_configurable-palette.patch @@ -0,0 +1,64 @@ +--- newt-0.52.11/newt.c 2009-09-24 10:03:09.000000000 -0500 ++++ newt-0.52.11.new/newt.c 2011-03-18 21:49:06.334851410 -0500 +@@ -283,6 +283,7 @@ int newtInit(void) { + char * MonoValue, * MonoEnv = "NEWT_MONO"; + const char *lang; + int ret; ++ FILE *fp = NULL; + + if ((lang = getenv("LC_ALL")) == NULL) + if ((lang = getenv("LC_CTYPE")) == NULL) +@@ -308,7 +309,52 @@ int newtInit(void) { + if ((ret = SLang_init_tty(0, 0, 0)) < 0) + return ret; + +- newtSetColors(newtDefaultColorPalette); ++ /* Support user configurable palette defined as a comma-separated list ++ of color names in /etc/newt/palette, ordered according to the ++ newtColors struct. Allows for theming and customizing newt. */ ++ if (fp = fopen("/etc/newt/palette", "r" )) { ++ char s[4096], *c; ++ int i = 0; ++ char *p[44]; ++ struct newtColors nc; ++ /* Seed the custom structure with the default values */ ++ memcpy(&nc, &newtDefaultColorPalette, sizeof(newtDefaultColorPalette)); ++ if (fgets(s, sizeof(s), fp)) { ++ if ((c = strtok(s, ",")) != NULL) ++ p[i++] = c; ++ while ((c = strtok(NULL, ",")) != NULL && i<44) ++ p[i++] = c; ++ } ++ fclose(fp); ++ i = 0; ++ /* Set each string pointer in the struct */ ++ nc.rootFg = p[i++]; nc.rootBg = p[i++]; ++ nc.borderFg = p[i++]; nc.borderBg = p[i++]; ++ nc.windowFg = p[i++]; nc.windowBg = p[i++]; ++ nc.shadowFg = p[i++]; nc.shadowBg = p[i++]; ++ nc.titleFg = p[i++]; nc.titleBg = p[i++]; ++ nc.buttonFg = p[i++]; nc.buttonBg = p[i++]; ++ nc.actButtonFg = p[i++]; nc.actButtonBg = p[i++]; ++ nc.checkboxFg = p[i++]; nc.checkboxBg = p[i++]; ++ nc.actCheckboxFg = p[i++]; nc.actCheckboxBg = p[i++]; ++ nc.entryFg = p[i++]; nc.entryBg = p[i++]; ++ nc.labelFg = p[i++]; nc.labelBg = p[i++]; ++ nc.listboxFg = p[i++]; nc.listboxBg = p[i++]; ++ nc.actListboxFg = p[i++]; nc.actListboxBg = p[i++]; ++ nc.textboxFg = p[i++]; nc.textboxBg = p[i++]; ++ nc.actTextboxFg = p[i++]; nc.actTextboxBg = p[i++]; ++ nc.helpLineFg = p[i++]; nc.helpLineBg = p[i++]; ++ nc.rootTextFg = p[i++]; nc.rootTextBg = p[i++]; ++ nc.emptyScale = p[i++]; nc.fullScale = p[i++]; ++ nc.disabledEntryFg = p[i++]; nc.disabledEntryBg = p[i++]; ++ nc.compactButtonFg = p[i++]; nc.compactButtonBg = p[i++]; ++ nc.actSelListboxFg = p[i++]; nc.actSelListboxBg = p[i++]; ++ nc.selListboxFg = p[i++]; nc.selListboxBg = p[i++]; ++ /* It would be nice if we could check the return value of this... */ ++ newtSetColors(nc); ++ } else ++ newtSetColors(newtDefaultColorPalette); ++ + newtCursorOff(); + initKeymap(); +