Hello community,
here is the log from the commit of package newt
checked in at Wed Apr 9 00:38:39 CEST 2008.
--------
--- newt/newt.changes 2007-12-17 18:35:09.000000000 +0100
+++ newt/newt.changes 2008-04-07 17:25:47.000000000 +0200
@@ -1,0 +2,20 @@
+Mon Apr 7 17:10:48 CEST 2008 - lrupp@suse.de
+
+- update to 0.52.9:
+ + handle component destruction (patch by Richard W.M. Jones)
+ + fix newtWinEntry definition
+ + don't use uninitialized values in newtWinMenu
+ + remove workarounds for old bug in SLsmg_write_nstring
+ + improve SIGWINCH handling in form
+ + don't abort from whiptail gauge on SIGWINCH
+ + redisplay also last line
+ + update Polish translation
+ + enable slang utf8 mode (rh#425992)
+ + support --disable-nls option (patch by Natanael Copa)
+ + redraw screen when using entry in euc encodings
+- removed upstreamed patches
+- devel package should require poptd-, python- and slang-devel and
+ recommend the main package (not really needed)
+- updated rpmlintrc
+
+-------------------------------------------------------------------
Old:
----
newt-0.52.7-snack.patch
newt-0.52.7.tar.bz2
newt-0.52.7-utf8.patch
newt-0.52.7-whiptail.patch
New:
----
newt-0.52.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ newt.spec ++++++
--- /var/tmp/diff_new_pack.nk5991/_old 2008-04-09 00:38:12.000000000 +0200
+++ /var/tmp/diff_new_pack.nk5991/_new 2008-04-09 00:38:12.000000000 +0200
@@ -1,7 +1,7 @@
#
-# spec file for package newt (Version 0.52.7)
+# spec file for package newt (Version 0.52.9)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -10,19 +10,17 @@
# norootforbuild
+
Name: newt
Url: http://cvs.fedora.redhat.com/viewcvs/devel/newt/
Summary: Nifty Erik's Windowing Toolkit
-Version: 0.52.7
-Release: 62
+Version: 0.52.9
+Release: 1
%define soname 0_52
License: LGPL v2.1 or later
Group: System/Libraries
Source: %name-%version.tar.bz2
Source10: %name-rpmlintrc
-Patch1: newt-0.52.7-snack.patch
-Patch2: newt-0.52.7-whiptail.patch
-Patch3: newt-0.52.7-utf8.patch
Requires: libnewt%soname = %version
BuildRequires: popt-devel python-devel slang-devel
%if 0%{?suse_version} < 1020
@@ -52,6 +50,7 @@
Erik Troan
%package -n libnewt0_52
+License: LGPL v2.1 or later
Summary: Shared libraries for Nifty Erik's Windowing Toolkit
Group: System/Libraries
#
@@ -72,10 +71,13 @@
Erik Troan
%package devel
+License: LGPL v2.1 or later
Summary: Development files for the Newt windowing toolkit
Requires: libnewt%soname = %{version}
-Requires: python
+Requires: python-devel
Requires: slang-devel
+Requires: popt-devel
+Recommends: newt = %{version}
Group: Development/Libraries/C and C++
#
@@ -95,6 +97,7 @@
Erik Troan
%package doc
+License: LGPL v2.1 or later
Summary: Tutorial for Nifty Erik's Windowing Toolkit
Group: Documentation/Howto
#
@@ -114,13 +117,14 @@
Erik Troan
%package static
+License: LGPL v2.1 or later
Summary: Static libraries of Nifty Erik's Windowing Toolkit
Requires: newt-devel = %{version}
Group: Development/Libraries/C and C++
#
%description static
-This package contains the static libraries needed to compile programms
+This package contains the static libraries needed to compile programs
based on newt which don't need the shared libraries.
Newt is a programming library for color text-mode widget-based user
@@ -135,6 +139,7 @@
Erik Troan
%package python
+License: GPL v2 only; GPL v2 or later; LGPL v2.1 or later
Summary: Python bindings for newt
Group: System/Libraries
Requires: newt = %{version}
@@ -152,14 +157,8 @@
%prep
%setup -q
-%patch1 -p1 -b .snack
-%patch2 -p1 -b .whiptail
-%if 0%{?suse_version} > 1000
-%patch3
-%endif
%build
-## export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%configure --without-tcl
# gpm support seems to smash the stack
# --with-gpm-support
@@ -169,9 +168,9 @@
%install
make PYTHONVERS="python%{py_ver}" instroot="%buildroot" install install-sh
# currently we don't support these languages
-#for lang in dz mg tl wo; do
-# rm -rf %buildroot%_datadir/locale/$lang
-#done
+for lang in wo; do
+ rm -rf %buildroot%_datadir/locale/$lang
+done
#
# prepare defaultdocdir with examples and scripts
#
@@ -229,11 +228,28 @@
%{py_sitedir}/*
%changelog
-* Mon Dec 17 2007 - lrupp@suse.de
+* Mon Apr 07 2008 lrupp@suse.de
+- update to 0.52.9:
+ + handle component destruction (patch by Richard W.M. Jones)
+ + fix newtWinEntry definition
+ + don't use uninitialized values in newtWinMenu
+ + remove workarounds for old bug in SLsmg_write_nstring
+ + improve SIGWINCH handling in form
+ + don't abort from whiptail gauge on SIGWINCH
+ + redisplay also last line
+ + update Polish translation
+ + enable slang utf8 mode (rh#425992)
+ + support --disable-nls option (patch by Natanael Copa)
+ + redraw screen when using entry in euc encodings
+- removed upstreamed patches
+- devel package should require poptd-, python- and slang-devel and
+ recommend the main package (not really needed)
+- updated rpmlintrc
+* Mon Dec 17 2007 lrupp@suse.de
- split libnewt0_52 to follow the shared library packaging policy
- build on older distributions
- build parallel
-* Thu Oct 11 2007 - lrupp@suse.de
+* Thu Oct 11 2007 lrupp@suse.de
- split python module to -python subpackage
- add back support for list of Entries in EntryWindow prompts in
snack (RH#248878) (newt-0.52.7-snack.patch)
@@ -241,9 +257,9 @@
(newt-0.52.7-whiptail.patch)
- fix handling of UTF-8 characters (#289291)
(newt-0.52.7-utf8.patch)
-* Tue Sep 11 2007 - cthiel@suse.de
+* Tue Sep 11 2007 cthiel@suse.de
- removed bogus Provides: snack (to avoid name clash with package snack)
-* Tue Jun 26 2007 - lrupp@suse.de
+* Tue Jun 26 2007 lrupp@suse.de
- update to 0.52.7:
+ add support to snack for multiple selection and border in listbox
and cursorAtEnd in entry (patch by Shawn Starr)
@@ -252,7 +268,7 @@
+ free helplines and windows in newtFinished, check for overflow (RH#239992)
- remove included patches
- created doc package for tutorial (N#287087)
-* Wed Jun 13 2007 - lrupp@suse.de
+* Wed Jun 13 2007 lrupp@suse.de
- included patches from Miroslav Lichvar:
+ fix cursor positioning when setting entry or checkbox flags
(newt-0.52.6-cursor.patch)
@@ -266,17 +282,17 @@
- disable gpm-support - seems to smash the stack
- remove libbz2-1 from buildreq
- re-arange buildrequires
-* Tue Jun 05 2007 - ro@suse.de
+* Tue Jun 05 2007 ro@suse.de
- buildreq: libbz2 -> libbz2-1
-* Sun Apr 01 2007 - lrupp@suse.de
+* Sun Apr 01 2007 lrupp@suse.de
- added distribution specfic parts for build service
- added libbz2 to BuildRequires for suse_version > 1020
-* Wed Mar 07 2007 - lrupp@suse.de
+* Wed Mar 07 2007 lrupp@suse.de
- update to 0.52.6:
+ add newtSetColor() to allow changing individual colors
+ add newtPopWindowNoRefresh() (patch by Forest Bond)
- branched newt-static package containing static library
-* Wed Feb 14 2007 - lrupp@suse.de
+* Wed Feb 14 2007 lrupp@suse.de
- update to 0.52.5
+ provide option to change text of buttons (rh#126768)
+ don't add escape key to hot keys by default (rh#216157)
@@ -286,14 +302,14 @@
+ update translations from debian
- removed unnecessary ldconfig call in devel package
- removed obsolete newt-0.52.4-if1close.patch
-* Thu Dec 21 2006 - lrupp@suse.de
+* Thu Dec 21 2006 lrupp@suse.de
- new upstream version 0.52.4: patches included upstream
+ fix entry corruption when reading multibyte characters
and double width character handling
+ avoid overflow/crash in scale
- makefile, configure and spec cleanup
- package whiptail.1 and locale files
-* Fri Sep 22 2006 - lrupp@suse.de
+* Fri Sep 22 2006 lrupp@suse.de
- fix build with python 2.5 (thanks to aj)
- useful fixes from RH bugzilla included:
* #137957 : fix screen corruption
@@ -306,7 +322,7 @@
* fix checkboxtree positioning
* unfocus when displaying help
* fix double width character handling in checkboxtree and listbox
-* Tue May 09 2006 - lrupp@suse.de
+* Tue May 09 2006 lrupp@suse.de
- add "Provides: snack" to specfile
- do not build whiptcl to avoid dependency on tcl (RH #177346)
(whiptcl is currently not used by anything)
@@ -315,62 +331,62 @@
- Fix a crash in checkboxtree.c (RH #165347)
- draw correct dialog sizes on the screen (see RH #185950) - applying
patch from Tomas Mraz (thanks)
-* Wed Jan 25 2006 - mls@suse.de
+* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
-* Mon Dec 12 2005 - lrupp@suse.de
+* Mon Dec 12 2005 lrupp@suse.de
- new version 0.52.2
- include whiptcl.so
-* Thu Nov 10 2005 - lrupp@suse.de
+* Thu Nov 10 2005 lrupp@suse.de
- only do gpmclose if gpmopen succeeed
(see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=118530)
- include example files (peanuts.py, popcorn.py) in devel package
- use "-fPIC -Wall -fno-strict-aliasing" in CFLAGS
-* Mon Sep 26 2005 - mls@suse.de
+* Tue Sep 27 2005 mls@suse.de
- make devel package require base package
-* Mon Jul 25 2005 - lrupp@suse.de 0.51.6
+* Mon Jul 25 2005 lrupp@suse.de 0.51.6
- use of %%run_ldconfig
-* Fri Jun 17 2005 - lrupp@suse.de 0.51.6
+* Fri Jun 17 2005 lrupp@suse.de 0.51.6
- use more macros: fix build on 64bit
-* Fri Jun 17 2005 - lrupp@suse.de 0.51.6
+* Fri Jun 17 2005 lrupp@suse.de 0.51.6
- use $RPM_OPT_FLAGS
- delete /usr/lib/phyton in build to avoid errors from abuild
=> we've a symlink to /usr/lib/python2.4
-* Thu Jun 16 2005 - ro@suse.de
+* Thu Jun 16 2005 ro@suse.de
- fix files pagaged twice (real path and over symlink)
-* Tue Feb 15 2005 - ro@suse.de
+* Tue Feb 15 2005 ro@suse.de
- added python deps
-* Mon Jan 24 2005 - ro@suse.de
+* Mon Jan 24 2005 ro@suse.de
- fix lib64 build
-* Tue Nov 30 2004 - cwh@suse.de
+* Tue Nov 30 2004 cwh@suse.de
- updated to 0.51.6
-* Wed Jun 02 2004 - ro@suse.de
+* Wed Jun 02 2004 ro@suse.de
- get rid of some compiler warnings
-* Thu Feb 26 2004 - hmacht@suse.de
+* Thu Feb 26 2004 hmacht@suse.de
- building as non-root
-* Tue Feb 24 2004 - cwh@suse.de
+* Tue Feb 24 2004 cwh@suse.de
- added soname link to package
-* Mon Sep 15 2003 - cwh@suse.de
+* Mon Sep 15 2003 cwh@suse.de
- removed wrong "Provides: snack" from spec-file
-* Wed Aug 20 2003 - ro@suse.de
+* Thu Aug 21 2003 ro@suse.de
- expand filelist
- fix lib64 issues
-* Wed Aug 20 2003 - cwh@suse.de
+* Wed Aug 20 2003 cwh@suse.de
- fixed to compile with tcl8.4
-* Tue Jan 16 2001 - schwab@suse.de
+* Tue Jan 16 2001 schwab@suse.de
- Fix missing -fPIC in Makefile.
- Fix use of varargs.
-* Wed Nov 29 2000 - ro@suse.de
+* Wed Nov 29 2000 ro@suse.de
- changed neededforbuild <tcld> to <tcl-devel>
-* Wed Nov 29 2000 - smid@suse.cz
+* Wed Nov 29 2000 smid@suse.cz
- subpackage renamed: newtd => newt-devel
-* Fri Nov 24 2000 - ro@suse.de
+* Fri Nov 24 2000 ro@suse.de
- fixes for 2.0-python
-* Sun Oct 29 2000 - kukuk@suse.de
+* Sun Oct 29 2000 kukuk@suse.de
- Add python-devel to need for build
-* Mon May 22 2000 - smid@suse.cz
+* Mon May 22 2000 smid@suse.cz
- fixed to compile with tcl8.3
-* Wed May 10 2000 - nadvornik@suse.cz
+* Wed May 10 2000 nadvornik@suse.cz
- update to 0.50.8
- added BuildRoot
-* Mon Jan 17 2000 - nashif@suse.de
+* Mon Jan 17 2000 nashif@suse.de
- Initial Release ( Version 0.50)
++++++ newt-0.52.7.tar.bz2 -> newt-0.52.9.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/button.c new/newt-0.52.9/button.c
--- old/newt-0.52.7/button.c 2007-01-31 12:14:59.000000000 +0100
+++ new/newt-0.52.9/button.c 2008-03-21 13:17:45.000000000 +0100
@@ -45,6 +45,7 @@
return NULL;
}
co->data = bu;
+ co->destroyCallback = NULL;
bu->text = strdup(text);
bu->compact = compact;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/checkbox.c new/newt-0.52.9/checkbox.c
--- old/newt-0.52.7/checkbox.c 2007-04-12 18:50:47.000000000 +0200
+++ new/newt-0.52.9/checkbox.c 2008-03-21 13:17:45.000000000 +0100
@@ -126,6 +126,7 @@
co->ops = &cbOps;
co->callback = NULL;
+ co->destroyCallback = NULL;
co->height = 1;
co->width = wstrlen(text, -1) + 4;
co->top = top;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/checkboxtree.c new/newt-0.52.9/checkboxtree.c
--- old/newt-0.52.7/checkboxtree.c 2007-04-12 19:03:57.000000000 +0200
+++ new/newt-0.52.9/checkboxtree.c 2008-03-21 13:17:45.000000000 +0100
@@ -333,6 +333,7 @@
co = malloc(sizeof(*co));
ct = malloc(sizeof(struct CheckboxTree));
co->callback = NULL;
+ co->destroyCallback = NULL;
co->data = ct;
co->left = left;
co->top = top;
@@ -490,17 +491,7 @@
currRow = co->top + i;
}
- j = 4 + (3 * (*item)->depth);
- SLsmg_write_nstring(NULL, co->width - j);
- newtGotorc(co->top + i, co->left + j);
- if (wstrlen((*item)->text, -1) > co->width - j) {
- char *tmp;
- tmp = strdup((*item)->text);
- trim_string(tmp, co->width - j);
- SLsmg_write_string(tmp);
- free(tmp);
- } else
- SLsmg_write_string((*item)->text);
+ SLsmg_write_nstring((*item)->text, co->width - 4 - (3 * (*item)->depth));
item++;
i++;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/config.h.in new/newt-0.52.9/config.h.in
--- old/newt-0.52.7/config.h.in 2007-06-15 15:01:57.000000000 +0200
+++ new/newt-0.52.9/config.h.in 2008-03-21 13:18:25.000000000 +0100
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define to 1 if NLS support is enabled */
+#undef ENABLE_NLS
+
/* Define to 1 if you have the header file. */
#undef HAVE_ALLOCA_H
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/configure new/newt-0.52.9/configure
--- old/newt-0.52.7/configure 2007-06-15 15:01:57.000000000 +0200
+++ new/newt-0.52.9/configure 2008-03-21 13:18:26.000000000 +0100
@@ -1245,6 +1245,11 @@
cat <<\_ACEOF
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-nls compile without NLS support
+
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
@@ -3690,6 +3695,20 @@
fi
+# Check whether --enable-nls was given.
+if test "${enable_nls+set}" = set; then
+ enableval=$enable_nls;
+fi
+
+
+if test "x$enable_nls" != "xno"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_NLS 1
+_ACEOF
+
+fi
+
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/configure.ac new/newt-0.52.9/configure.ac
--- old/newt-0.52.7/configure.ac 2007-01-30 10:50:16.000000000 +0100
+++ new/newt-0.52.9/configure.ac 2008-03-21 13:17:45.000000000 +0100
@@ -35,6 +35,12 @@
AC_DEFINE([USE_GPM], 1, [Define to 1 if GPM support is enabled])
fi
+AC_ARG_ENABLE([nls], [ --disable-nls compile without NLS support])
+
+if test "x$enable_nls" != "xno"; then
+ AC_DEFINE([ENABLE_NLS], 1, [Define to 1 if NLS support is enabled])
+fi
+
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/dialogboxes.c new/newt-0.52.9/dialogboxes.c
--- old/newt-0.52.7/dialogboxes.c 2007-01-31 15:17:33.000000000 +0100
+++ new/newt-0.52.9/dialogboxes.c 2008-03-21 13:17:45.000000000 +0100
@@ -137,37 +137,40 @@
newtDrawForm(form);
newtRefresh();
- while (fgets(buf, sizeof(buf) - 1, f)) {
+ do {
+ if (!fgets(buf, sizeof(buf) - 1, f))
+ continue;
buf[strlen(buf) - 1] = '\0';
if (!strcmp(buf, "XXX")) {
- if (!fgets(buf3, sizeof(buf3) - 1, f))
+ while (!fgets(buf3, sizeof(buf3) - 1, f) && !feof(f))
+ ;
+ if (feof(f))
break;
buf3[strlen(buf3) - 1] = '\0';
- arg = buf3;
i = 0;
- while (fgets(buf + i, sizeof(buf) - 1 - i, f)) {
+ do {
+ if (!fgets(buf + i, sizeof(buf) - 1 - i, f))
+ continue;
buf[strlen(buf) - 1] = '\0';
if (!strcmp(buf + i, "XXX")) {
*(buf + i) = '\0';
break;
}
i = strlen(buf);
- }
+ } while (!feof(f));
newtTextboxSetText(tb, buf);
- } else {
- arg = buf;
}
val = strtoul(buf, &end, 10);
- if (!*end) {
+ if (*buf && !*end) {
newtScaleSet(scale, val);
newtDrawForm(form);
newtRefresh();
}
- }
+ } while (!feof(f));
return DLG_OKAY;
}
@@ -333,12 +336,12 @@
buf[len] = '\0';
w = textWidth;
mystrncpyw(buf + len, itemInfo[i].text, MAXBUF-len, &w);
- newtListboxAddEntry(listBox, buf, (void *) i);
+ newtListboxAddEntry(listBox, buf, (void *)(long) i);
}
} else {
for (i = 0; i < numItems; i++) {
snprintf(buf, MAXBUF, "%s", itemInfo[i].text);
- newtListboxAddEntry(listBox, buf, (void *) i);
+ newtListboxAddEntry(listBox, buf, (void *)(long) i);
}
}
@@ -355,7 +358,7 @@
if (answer == NULL)
rc = DLG_ESCAPE;
- i = (int) newtListboxGetCurrent(listBox);
+ i = (long) newtListboxGetCurrent(listBox);
*result = itemInfo[i].tag;
return rc;
@@ -463,12 +466,13 @@
if (useRadio) {
answer = newtRadioGetCurrent(cbInfo[0].comp);
+ *selections = malloc(sizeof(char *) * 2);
+ if (*selections == NULL)
+ return DLG_ERROR;
+ (*selections)[0] = (*selections)[1] = NULL;
for (i = 0; i < numBoxes; i++)
if (cbInfo[i].comp == answer) {
- *selections = malloc(sizeof(char *) * 2);
- if (*selections == NULL) return DLG_ERROR;
(*selections)[0] = cbInfo[i].tag;
- (*selections)[1] = NULL;
break;
}
} else {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/entry.c new/newt-0.52.9/entry.c
--- old/newt-0.52.7/entry.c 2007-04-04 17:17:51.000000000 +0200
+++ new/newt-0.52.9/entry.c 2008-03-21 13:17:45.000000000 +0100
@@ -78,6 +78,7 @@
co->width = width;
co->isMapped = 0;
co->callback = NULL;
+ co->destroyCallback = NULL;
co->ops = &entryOps;
@@ -196,6 +197,8 @@
return;
}
+ newtTrashScreen();
+
/* scroll if necessary */
scroll(en, co->width);
@@ -230,13 +233,8 @@
SLsmg_write_char('_');
i++;
}
- } else {
- char *tmp;
- tmp = strdup(chptr);
- trim_string(tmp, co->width);
- SLsmg_write_string(tmp);
- free(tmp);
- }
+ } else
+ SLsmg_write_nstring(chptr, co->width);
newtGotorc(co->top, co->left + wstrlen(en->buf+en->firstChar, en->cursorPosition - en->firstChar));
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/form.c new/newt-0.52.9/form.c
--- old/newt-0.52.7/form.c 2007-05-21 15:15:11.000000000 +0200
+++ new/newt-0.52.9/form.c 2008-03-21 13:17:45.000000000 +0100
@@ -422,6 +422,8 @@
newtDefaultMappedHandler,
} ;
+int needResize = 0;
+
static inline int componentFits(newtComponent co, int compNum) {
struct form * form = co->data;
struct element * el = form->elements + compNum;
@@ -448,6 +450,7 @@
co->takesFocus = 0; /* we may have 0 components */
co->ops = &formOps;
+ co->destroyCallback = NULL;
form->help = help;
form->flags = flags;
@@ -785,6 +788,26 @@
return er;
}
+/* Destroy a component. Components which have been added to a form
+ * are destroyed when the form is destroyed; this is just for the
+ * (rare) case of components which for whatever reason weren't added
+ * to a form.
+ */
+void newtComponentDestroy(newtComponent co) {
+ /* If the user registered a destroy callback for this component,
+ * now is a good time to call it.
+ */
+ if (co->destroyCallback)
+ co->destroyCallback(co, co->destroyCallbackData);
+
+ if (co->ops->destroy) {
+ co->ops->destroy(co);
+ } else {
+ if (co->data) free(co->data);
+ free(co);
+ }
+}
+
/* this also destroys all of the components on the form */
void newtFormDestroy(newtComponent co) {
newtComponent subco;
@@ -794,12 +817,7 @@
/* first, destroy all of the components */
for (i = 0; i < form->numComps; i++) {
subco = form->elements[i].co;
- if (subco->ops->destroy) {
- subco->ops->destroy(subco);
- } else {
- if (subco->data) free(subco->data);
- free(subco);
- }
+ newtComponentDestroy(subco);
}
if (form->hotKeys) free(form->hotKeys);
@@ -976,6 +994,11 @@
timeout.tv_sec = timeout.tv_usec = 0;
}
+ if (needResize) {
+ needResize = 0;
+ newtResizeScreen(1);
+ }
+
i = select(max + 1, &readSet, &writeSet, &exceptSet,
form->timer ? &timeout : NULL);
if (i < 0) continue; /* ?? What should we do here? */
@@ -1015,11 +1038,6 @@
key = newtGetKey();
- if (key == NEWT_KEY_RESIZE) {
- newtResizeScreen(1);
- continue;
- }
-
for (i = 0; i < form->numHotKeys; i++) {
if (form->hotKeys[i] == key) {
es->reason = NEWT_EXIT_HOTKEY;
@@ -1119,6 +1137,13 @@
co->callbackData = data;
}
+/* Add a callback which is called when the component is destroyed. */
+void newtComponentAddDestroyCallback(newtComponent co,
+ newtCallback f, void * data) {
+ co->destroyCallback = f;
+ co->destroyCallbackData = data;
+}
+
void newtComponentTakesFocus(newtComponent co, int val) {
co->takesFocus = val;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/label.c new/newt-0.52.9/label.c
--- old/newt-0.52.7/label.c 2006-08-25 15:22:42.000000000 +0200
+++ new/newt-0.52.9/label.c 2008-03-21 13:17:45.000000000 +0100
@@ -28,6 +28,7 @@
co = malloc(sizeof(*co));
la = malloc(sizeof(struct label));
co->data = la;
+ co->destroyCallback = NULL;
co->ops = &labelOps;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/listbox.c new/newt-0.52.9/listbox.c
--- old/newt-0.52.7/listbox.c 2007-06-08 12:59:14.000000000 +0200
+++ new/newt-0.52.9/listbox.c 2008-03-21 13:17:45.000000000 +0100
@@ -133,6 +133,7 @@
co->ops = &listboxOps;
co->takesFocus = 1;
co->callback = NULL;
+ co->destroyCallback = NULL;
updateWidth(co, li, 5);
@@ -528,16 +529,7 @@
else
SLsmg_set_color(NEWT_COLORSET_LISTBOX);
- SLsmg_write_nstring(NULL, li->curWidth);
- newtGotorc(co->top + i + li->bdyAdjust, co->left + li->bdxAdjust);
- if (wstrlen(item->text, -1) > li->curWidth) {
- char *tmp;
- tmp = strdup(item->text);
- trim_string(tmp, li->curWidth);
- SLsmg_write_string(tmp);
- free(tmp);
- } else
- SLsmg_write_string(item->text);
+ SLsmg_write_nstring(item->text, li->curWidth);
if (li->flags & NEWT_FLAG_MULTIPLE) {
newtGotorc(co->top + i + li->bdyAdjust, co->left + li->bdxAdjust);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/Makefile.in new/newt-0.52.9/Makefile.in
--- old/newt-0.52.7/Makefile.in 2007-03-02 13:00:51.000000000 +0100
+++ new/newt-0.52.9/Makefile.in 2008-03-21 13:17:45.000000000 +0100
@@ -8,8 +8,7 @@
SHLIBFLAGS= -Wl,--version-script,newt.0.52.ver
VERSION = @VERSION@
-CVSTAG = r$(subst .,-,$(VERSION))
-CVSROOT = $(shell cat CVS/Root)
+TAG = r$(subst .,-,$(VERSION))
SONAME = @SONAME@
PYTHONVERS = @PYTHONVERS@
@@ -132,15 +131,14 @@
install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
done
-configure: configure.ac newt.spec
- autoconf
+Makefile: newt.spec
echo "You need to rerun ./configure before continuing"
- exit 1
+ @exit 1
-create-archive: configure
- @rm -rf /tmp/newt-$(VERSION) /tmp/newt
- @cd /tmp; cvs -d $(CVSROOT) export -r$(CVSTAG) newt; mv newt newt-$(VERSION)
- @cd /tmp/newt-$(VERSION); ./autogen.sh
+create-archive: Makefile
+ @rm -rf /tmp/newt-$(VERSION)
+ @git archive --prefix=newt-$(VERSION)/ $(TAG) | tar x -C /tmp
+ @cd /tmp/newt-$(VERSION) && ./autogen.sh && rm -rf autom4te.cache
@cd /tmp; tar czSpf newt-$(VERSION).tar.gz newt-$(VERSION)
@rm -rf /tmp/newt-$(VERSION)
@cp /tmp/newt-$(VERSION).tar.gz .
@@ -148,8 +146,8 @@
@echo " "
@echo "The final archive is ./newt-$(VERSION).tar.gz."
-tag-archive:
- @cvs tag $(CVSTAG)
+tag-archive: Makefile
+ @git tag $(TAG)
archive: tag-archive create-archive
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/newt.0.52.ver new/newt-0.52.9/newt.0.52.ver
--- old/newt-0.52.7/newt.0.52.ver 2007-02-28 18:35:01.000000000 +0100
+++ new/newt-0.52.9/newt.0.52.ver 2008-03-21 13:17:45.000000000 +0100
@@ -141,3 +141,9 @@
newtSetColor;
newtPopWindowNoRefresh;
} NEWT_0.52;
+
+NEWT_0.52.9 {
+ global:
+ newtComponentAddDestroyCallback;
+ newtComponentDestroy;
+} NEWT_0.52.6;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/newt.c new/newt-0.52.9/newt.c
--- old/newt-0.52.7/newt.c 2007-05-15 12:38:09.000000000 +0200
+++ new/newt-0.52.9/newt.c 2008-03-21 13:17:45.000000000 +0100
@@ -37,9 +37,9 @@
static char ** currentHelpline = NULL;
static int cursorRow, cursorCol;
-static int needResize = 0;
static int cursorOn = 1;
static int trashScreen = 0;
+extern int needResize;
static const char * defaultHelpLine =
" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
@@ -214,7 +214,7 @@
int c;
while ((c = SLang_getkey()) == '\xC') { /* if Ctrl-L redraw whole screen */
- SLsmg_touch_lines (0, SLtt_Screen_Rows - 1);
+ SLsmg_touch_lines(0, SLtt_Screen_Rows);
SLsmg_refresh();
}
return c;
@@ -264,10 +264,11 @@
* @param redraw - boolean - should we redraw the screen?
*/
void newtResizeScreen(int redraw) {
+ /* we can't redraw from scratch, just redisplay SLang screen */
SLtt_get_screen_size();
- SLsmg_reinit_smg();
+ /* SLsmg_reinit_smg(); */
if (redraw) {
- SLsmg_touch_lines (0, SLtt_Screen_Rows - 1);
+ SLsmg_touch_lines(0, SLtt_Screen_Rows);
newtRefresh();
}
}
@@ -285,11 +286,14 @@
if ((lang = getenv("LC_CTYPE")) == NULL)
if ((lang = getenv("LANG")) == NULL)
lang = "";
+ /* slang doesn't support multibyte encodings except UTF-8,
+ avoid character corruption by redrawing the screen */
if (strstr (lang, ".euc") != NULL)
trashScreen = 1;
(void) strlen(ident);
+ SLutf8_enable(-1);
SLtt_get_terminfo();
SLtt_get_screen_size();
@@ -306,10 +310,6 @@
newtCursorOff();
initKeymap();
- /*memset(&sa, 0, sizeof(sa));
- sa.sa_handler = handleSigwinch;
- sigaction(SIGWINCH, &sa, NULL);*/
-
SLsignal_intr(SIGWINCH, handleSigwinch);
SLang_getkey_intr_hook = getkeyInterruptHook;
@@ -879,15 +879,7 @@
* @param int - number of usecs to wait for.
*/
void newtDelay(unsigned int usecs) {
- fd_set set;
- struct timeval tv;
-
- FD_ZERO(&set);
-
- tv.tv_sec = usecs / 1000000;
- tv.tv_usec = usecs % 1000000;
-
- select(0, &set, &set, &set, &tv);
+ usleep(usecs);
}
struct eventResult newtDefaultEventHandler(newtComponent c,
@@ -1017,6 +1009,6 @@
void newtTrashScreen(void) {
if (trashScreen)
- SLsmg_touch_lines (0, SLtt_Screen_Rows - 1);
+ SLsmg_touch_lines(0, SLtt_Screen_Rows);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/newt.h new/newt-0.52.9/newt.h
--- old/newt-0.52.7/newt.h 2007-02-28 18:35:01.000000000 +0100
+++ new/newt-0.52.9/newt.h 2008-03-21 13:17:45.000000000 +0100
@@ -255,10 +255,20 @@
void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);
void newtComponentTakesFocus(newtComponent co, int val);
+/* This callback is called when a component is destroyed. */
+void newtComponentAddDestroyCallback(newtComponent co,
+ newtCallback f, void * data);
+
/* this also destroys all of the components (including other forms) on the
form */
void newtFormDestroy(newtComponent form);
+/* NB: You SHOULD NOT call this for components which have been added
+ * to a form (ie. almost all components). They are destroyed along
+ * with the form when you call newtFormDestroy.
+ */
+void newtComponentDestroy(newtComponent co);
+
/* Key codes */
#define NEWT_KEY_TAB '\t'
@@ -359,7 +369,7 @@
struct newtWinEntry {
char * text;
- const char ** value; /* may be initialized to set default */
+ char ** value; /* may be initialized to set default */
int flags;
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/newt_pr.h new/newt-0.52.9/newt_pr.h
--- old/newt-0.52.7/newt_pr.h 2006-09-15 15:38:21.000000000 +0200
+++ new/newt-0.52.9/newt_pr.h 2008-03-21 13:17:45.000000000 +0100
@@ -40,6 +40,9 @@
newtCallback callback;
void * callbackData;
+ newtCallback destroyCallback;
+ void * destroyCallbackData;
+
void * data;
} ;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/newt.spec new/newt-0.52.9/newt.spec
--- old/newt-0.52.7/newt.spec 2007-06-15 14:53:12.000000000 +0200
+++ new/newt-0.52.9/newt.spec 2008-03-21 13:17:45.000000000 +0100
@@ -1,15 +1,13 @@
-Summary: A development library for text mode user interfaces
+%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+Summary: A library for text mode user interfaces
Name: newt
-Version: 0.52.7
+Version: 0.52.9
Release: 1%{?dist}
-License: LGPL
+License: LGPLv2
Group: System Environment/Libraries
-# The source for this package was pulled from upstream's vcs. Use the
-# following commands to generate the tarball:
-# cvs -d :pserver:anonymous@elvis.redhat.com:/usr/local/CVS co -r r0-52-7 newt
-# cd newt; ./autogen.sh; ./configure; make create-archive
-Source: newt-%{version}.tar.gz
-BuildRequires: python, python-devel, slang-devel
+URL: https://fedorahosted.org/newt/
+Source: https://fedorahosted.org/releases/n/e/newt/newt-%{version}.tar.gz
+BuildRequires: popt-devel python-devel slang-devel
Provides: snack = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -47,6 +45,15 @@
The newt-static package contains the static version of the newt library.
Install it if you need to link statically with libnewt.
+%package python
+Summary: Python bindings for newt
+Group: Development/Libraries
+Requires: newt = %{version}-%{release}
+
+%description python
+The newt-python package contains the Python bindings for the newt library
+providing a python API for creating text mode ionterfaces.
+
%prep
%setup -q
@@ -75,19 +82,58 @@
%doc COPYING
%{_bindir}/whiptail
%{_libdir}/libnewt.so.*
-%{_libdir}/python?.?/site-packages/*
%{_mandir}/man1/whiptail.1*
%files devel
%defattr (-,root,root)
-%doc tutorial.sgml peanuts.py popcorn.py
+%doc tutorial.sgml
%{_includedir}/newt.h
%{_libdir}/libnewt.so
%files static
+%defattr(-,root,root)
%{_libdir}/libnewt.a
+%files python
+%defattr(-,root,root)
+%doc peanuts.py popcorn.py
+%{python_sitearch}/*.so
+%{python_sitearch}/*.py*
+
%changelog
+* Fri Mar 21 2008 Miroslav Lichvar - 0.52.9-1
+- handle component destruction (patch by Richard W.M. Jones)
+- fix newtWinEntry definition
+- don't use uninitialized values in newtWinMenu
+- remove workarounds for old bug in SLsmg_write_nstring
+- improve SIGWINCH handling in form
+- don't abort from whiptail gauge on SIGWINCH
+- redisplay also last line
+- update Polish translation
+- update URL and Source tag
+
+* Tue Feb 19 2008 Fedora Release Engineering - 0.52.8-2
+- Autorebuild for GCC 4.3
+
+* Wed Jan 23 2008 Miroslav Lichvar - 0.52.8-1
+- enable slang utf8 mode (#425992)
+- support --disable-nls option (patch by Natanael Copa)
+- redraw screen when using entry in euc encodings
+
+* Mon Aug 27 2007 Miroslav Lichvar - 0.52.7-4
+- fix segfault in whiptail when no entry is selected in radiolist
+- buildrequire popt-devel
+
+* Wed Aug 22 2007 Miroslav Lichvar - 0.52.7-3
+- rebuild
+
+* Wed Aug 08 2007 Miroslav Lichvar - 0.52.7-2
+- add back support for list of Entries in EntryWindow prompts in snack
+ (#248878)
+- update license tag
+- split python module to -python subpackage (patch by Yanko Kaneti)
+- fix summary
+
* Fri Jun 15 2007 Miroslav Lichvar - 0.52.7-1
- add support to snack for multiple selection and border in listbox
and cursorAtEnd in entry (patch by Shawn Starr)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/nls.h new/newt-0.52.9/nls.h
--- old/newt-0.52.7/nls.h 2006-08-25 15:11:37.000000000 +0200
+++ new/newt-0.52.9/nls.h 2008-03-21 13:17:45.000000000 +0100
@@ -6,8 +6,14 @@
# include
+#ifdef ENABLE_NLS
# include
# define _(Text) gettext (Text)
+#else
+# define _(Text) (Text)
+# define dgettext(Package, String) (String)
+#endif
+
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/po/newt.pot new/newt-0.52.9/po/newt.pot
--- old/newt-0.52.7/po/newt.pot 2007-06-15 15:01:58.000000000 +0200
+++ new/newt-0.52.9/po/newt.pot 2008-03-21 13:17:45.000000000 +0100
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-06-15 15:01+0200\n"
+"POT-Creation-Date: 2006-09-14 16:03+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -16,18 +16,18 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../dialogboxes.c:49
+#: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493
msgid "Ok"
msgstr ""
-#: ../dialogboxes.c:50
+#: ../dialogboxes.c:51
msgid "Cancel"
msgstr ""
-#: ../dialogboxes.c:51
+#: ../dialogboxes.c:498
msgid "Yes"
msgstr ""
-#: ../dialogboxes.c:52
+#: ../dialogboxes.c:500
msgid "No"
msgstr ""
Files old/newt-0.52.7/po/pl.mo and new/newt-0.52.9/po/pl.mo differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/po/pl.po new/newt-0.52.9/po/pl.po
--- old/newt-0.52.7/po/pl.po 2006-09-19 14:15:37.000000000 +0200
+++ new/newt-0.52.9/po/pl.po 2008-03-21 13:17:45.000000000 +0100
@@ -1,23 +1,22 @@
-# Polish translations for newt
-# Copyright (C) 2003 Free Software Foundation
-# This file is distributed under the same license as the newt package.
-# Alastair McKinstry , 2003.
+# translation of pl.po to Polish
+# Bartosz Fenski , 2004.
+# Piotr Drąg , 2008.
#
msgid ""
msgstr ""
-"Project-Id-Version: newt 0.51.4\n"
+"Project-Id-Version: pl\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-09-14 16:03+0200\n"
-"PO-Revision-Date: 2004-01-09 10:40+0100\n"
-"Last-Translator: Bartosz Fenski \n"
-"Language-Team: Polish \n"
+"PO-Revision-Date: 2008-02-19 23:14+0200\n"
+"Last-Translator: Piotr Drąg \n"
+"Language-Team: Polish \n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493
msgid "Ok"
-msgstr "Ok"
+msgstr "OK"
#: ../dialogboxes.c:51
msgid "Cancel"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/scale.c new/newt-0.52.9/scale.c
--- old/newt-0.52.7/scale.c 2006-10-12 16:18:38.000000000 +0200
+++ new/newt-0.52.9/scale.c 2008-03-21 13:17:45.000000000 +0100
@@ -28,6 +28,7 @@
co = malloc(sizeof(*co));
sc = malloc(sizeof(struct scale));
co->data = sc;
+ co->destroyCallback = NULL;
co->ops = &scaleOps;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/scrollbar.c new/newt-0.52.9/scrollbar.c
--- old/newt-0.52.7/scrollbar.c 2006-09-15 15:23:58.000000000 +0200
+++ new/newt-0.52.9/scrollbar.c 2008-03-21 13:17:45.000000000 +0100
@@ -46,6 +46,7 @@
co = malloc(sizeof(*co));
sb = malloc(sizeof(*sb));
co->data = sb;
+ co->destroyCallback = NULL;
if (height >= 2) {
sb->arrows = 1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/snackmodule.c new/newt-0.52.9/snackmodule.c
--- old/newt-0.52.7/snackmodule.c 2007-06-13 19:17:53.000000000 +0200
+++ new/newt-0.52.9/snackmodule.c 2008-03-21 13:17:45.000000000 +0100
@@ -1274,9 +1274,11 @@
void init_snack(void) {
PyObject * d, * m;
+#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+#endif
m = Py_InitModule("_snack", snackModuleMethods);
d = PyModule_GetDict(m);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/snack.py new/newt-0.52.9/snack.py
--- old/newt-0.52.7/snack.py 2007-06-13 19:17:53.000000000 +0200
+++ new/newt-0.52.9/snack.py 2008-03-21 13:17:45.000000000 +0100
@@ -826,7 +826,8 @@
for n in prompts:
if (type(n) == types.TupleType):
(n, e) = n
- e = Entry(entryWidth, e)
+ if (type(e) in types.StringTypes):
+ e = Entry(entryWidth, e)
else:
e = Entry(entryWidth)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/test.c new/newt-0.52.9/test.c
--- old/newt-0.52.7/test.c 2007-05-21 15:26:56.000000000 +0200
+++ new/newt-0.52.9/test.c 2008-03-21 13:17:45.000000000 +0100
@@ -138,14 +138,9 @@
}
} while (es.reason != NEWT_EXIT_COMPONENT || es.u.co == b2);
- scaleVal = strdup(scaleVal);
- enr2 = strdup(enr2);
- enr3 = strdup(enr3);
-
+ numsel = 0;
selectedList = newtListboxGetSelection(lb, &numsel);
- newtFormDestroy(f);
-
newtPopWindow();
newtPopWindow();
newtFinished();
@@ -154,11 +149,14 @@
printf("got string 2: %s\n", enr2);
printf("got string 3: %s\n", enr3);
+ newtFormDestroy(f);
+
printf("\nSelected listbox items (%d):\n", numsel);
if(selectedList) {
for(i = 0; i < numsel; i++)
- printf("#%d\n", (int) selectedList[i]);
+ printf("#%d\n", (int)(long) selectedList[i]);
}
+ free(selectedList);
return 0;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/testgrid.c new/newt-0.52.9/testgrid.c
--- old/newt-0.52.7/testgrid.c 2006-08-25 14:15:24.000000000 +0200
+++ new/newt-0.52.9/testgrid.c 2008-03-21 13:17:45.000000000 +0100
@@ -10,9 +10,9 @@
newtComponent answer, f, t;
newtGrid grid, subgrid;
char * flowedText;
- int textWidth, textHeight, rc;
+ int textWidth, textHeight, rc, i;
char * menuContents[] = { "One", "Two", "Three", "Four", "Five", NULL };
- const char * entries[10];
+ char * entries[10];
struct newtWinEntry autoEntries[] = {
{ "An entry", entries + 0, 0 },
{ "Another entry", entries + 1, 0 },
@@ -97,6 +97,8 @@
"newtWinEntries() call. It lets you get a lot of input "
"quite easily.", 50, 5, 5, 20, autoEntries, "Ok",
"Cancel", NULL);
+ for (i = 0; i < sizeof (autoEntries) / sizeof (struct newtWinEntry) && autoEntries[i].value; i++)
+ free(*(autoEntries[i].value));
newtFinished();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/testtree.c new/newt-0.52.9/testtree.c
--- old/newt-0.52.7/testtree.c 2007-04-12 19:03:57.000000000 +0200
+++ new/newt-0.52.9/testtree.c 2008-03-21 13:17:45.000000000 +0100
@@ -115,7 +115,7 @@
else
printf("Current selection (all) (%d):\n", numselected);
for (i = 0; i < numselected; i++) {
- j = (int) *ptr++;
+ j = (long) *ptr++;
printf("%d\n", j);
}
free(result);
@@ -127,7 +127,7 @@
else
printf("Current selection (b) (%d):\n",numselected);
for (i = 0; i < numselected; i++) {
- j = (int) *ptr++;
+ j = (long) *ptr++;
printf("%d\n", j);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/textbox.c new/newt-0.52.9/textbox.c
--- old/newt-0.52.7/textbox.c 2007-04-12 19:03:57.000000000 +0200
+++ new/newt-0.52.9/textbox.c 2008-03-21 13:17:45.000000000 +0100
@@ -105,6 +105,7 @@
co->left = left;
co->takesFocus = 0;
co->width = width;
+ co->destroyCallback = NULL;
tb->doWrap = flags & NEWT_FLAG_WRAP;
tb->numLines = 0;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/whiptail.c new/newt-0.52.9/whiptail.c
--- old/newt-0.52.7/whiptail.c 2007-01-31 14:48:15.000000000 +0100
+++ new/newt-0.52.9/whiptail.c 2008-03-21 13:17:45.000000000 +0100
@@ -70,10 +70,6 @@
fprintf (stdout, _("whiptail (newt): %s\n"), VERSION);
}
-static void handleSighup(int signum) {
- exit(DLG_ERROR);
-}
-
#if 0
/* FIXME Copied from newt.c
* Place somewhere better -- dialogboxes? -- amck
@@ -328,7 +324,6 @@
char * text;
const char * nextArg;
char * end;
- struct sigaction sa;
int height;
int width;
int fd = -1;
@@ -390,9 +385,11 @@
{ 0, 0, 0, 0, 0 }
};
+#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+#endif
optCon = poptGetContext("whiptail", argc, argv, optionsTable, 0);
@@ -500,10 +497,6 @@
if (open("/dev/tty", O_RDWR) != 0) perror("open /dev/tty");
}
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = handleSighup;
- sigaction(SIGWINCH, &sa, NULL);
-
newtInit();
newtCls();
@@ -569,7 +562,8 @@
case MODE_RADIOLIST:
rc = checkList(text, height, width, optCon, 1, flags, &selections);
if (rc == DLG_OKAY) {
- fprintf(output, "%s", selections[0]);
+ if (selections[0])
+ fprintf(output, "%s", selections[0]);
free(selections);
}
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/whiptcl.c new/newt-0.52.9/whiptcl.c
--- old/newt-0.52.7/whiptcl.c 2006-08-25 15:11:37.000000000 +0200
+++ new/newt-0.52.9/whiptcl.c 2008-03-21 13:17:45.000000000 +0100
@@ -91,9 +91,11 @@
{ 0, 0, 0, 0, 0 }
};
+#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+#endif
optCon = poptGetContext("whiptcl", argc, argv, optionsTable, 0);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.7/windows.c new/newt-0.52.9/windows.c
--- old/newt-0.52.7/windows.c 2006-08-25 14:15:24.000000000 +0200
+++ new/newt-0.52.9/windows.c 2008-03-21 13:17:45.000000000 +0100
@@ -153,7 +153,7 @@
listbox = newtListbox(-1, -1, maxListHeight,
(needScroll ? NEWT_FLAG_SCROLL : 0) | NEWT_FLAG_RETURNEXIT);
for (i = 0; items[i]; i++) {
- newtListboxAddEntry(listbox, items[i], (void *) i);
+ newtListboxAddEntry(listbox, items[i], (void *)(long) i);
}
newtListboxSetCurrent(listbox, *listItem);
@@ -187,7 +187,8 @@
*listItem = ((long) newtListboxGetCurrent(listbox));
- for (rc = 0; result != buttons[rc] && rc < numButtons; rc++);
+ for (rc = 0; rc < numButtons && result != buttons[rc]; rc++)
+ ;
if (rc == numButtons)
rc = 0; /* F12 or return-on-exit (which are the same for us) */
else
@@ -242,7 +243,7 @@
newtGridSetField(subgrid, 1, i, NEWT_GRID_COMPONENT,
newtEntry(-1, -1, items[i].value ?
*items[i].value : NULL, dataWidth,
- items[i].value, items[i].flags),
+ (const char **)items[i].value, items[i].flags),
1, 0, 0, 0, 0, 0);
}
++++++ newt-rpmlintrc ++++++
--- newt/newt-rpmlintrc 2007-12-17 16:58:04.000000000 +0100
+++ newt/newt-rpmlintrc 2008-04-07 17:25:33.000000000 +0200
@@ -1 +1,4 @@
-addFilter("python-naming-policy-not-applied .*/python2.5/site-packages/snack.py")
+# newt-devel just needs the lib package
+addFilter("no-dependency-on newt")
+# newt-devel should require python-devel
+addFilter("useless-explicit-requires python")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org