[nano] new upstream release - 2.3.2

Kamil Dudka kdudka at fedoraproject.org
Thu May 29 08:14:15 UTC 2014


commit 1ff25d28edfbfe3e2ef8b400347efad1b718cb32
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Thu May 29 09:23:07 2014 +0200

    new upstream release - 2.3.2

 .gitignore                                         |    7 +--
 ...s-result-and-avoid-calling-stat-on-a-NULL.patch |   33 +++++-----
 ...se-futimens-if-available-instead-of-utime.patch |   67 ++++++--------------
 ...nt-the-poslog-P-option-in-nano.1-man-page.patch |   26 --------
 nano-2.3.2-warnings.patch                          |   52 ---------------
 nano-2.3.3-warnings.patch                          |   24 +++++++
 nano.spec                                          |   14 ++--
 sources                                            |    2 +-
 8 files changed, 71 insertions(+), 154 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 17e4159..3a95680 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,2 @@
-nano-2.2.5.tar.gz
-/nano-2.2.6.tar.gz
-/nano-2.3.0.tar.gz
-/nano-2.3.1.tar.gz
-/nano-2.3.2.tar.gz
+/nano-2.*.*.tar.gz
+/nano-2.*.*/
diff --git a/0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch b/0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch
index af6c52f..70242c8 100644
--- a/0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch
+++ b/0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch
@@ -1,19 +1,19 @@
 From fc87b0a32c130a2b3ab37e614d4a1c6c8e5d70e7 Mon Sep 17 00:00:00 2001
 From: Kamil Dudka <kdudka at redhat.com>
 Date: Thu, 19 Aug 2010 13:58:12 +0200
-Subject: [PATCH 1/2] check stat's result and avoid calling stat on a NULL pointer
+Subject: [PATCH 2/3] check stat's result and avoid calling stat on a NULL pointer
 
 ---
- src/files.c |   33 +++++++++++++++++++++++++--------
- 1 files changed, 25 insertions(+), 8 deletions(-)
+ src/files.c | 36 +++++++++++++++++++++++++-----------
+ 1 file changed, 25 insertions(+), 11 deletions(-)
 
 diff --git a/src/files.c b/src/files.c
 index f6efbf1..99cc1b8 100644
 --- a/src/files.c
 +++ b/src/files.c
-@@ -306,6 +306,24 @@ int do_lockfile(const char *filename)
- #endif /* NANO_TINY */
- 
+@@ -300,6 +300,24 @@ int do_lockfile(const char *filename)
+ }
+ #endif /* !NANO_TINY */
  
 +#ifndef NANO_TINY
 +/* If *pstat is NULL, perform a stat call with the given file name.  On success,
@@ -36,7 +36,7 @@ index f6efbf1..99cc1b8 100644
  /* If it's not "", filename is a file to open.  We make a new buffer, if
   * necessary, and then open and read the file, if applicable. */
  void open_buffer(const char *filename, bool undoable)
-@@ -351,11 +369,7 @@ void open_buffer(const char *filename, bool undoable)
+@@ -345,11 +363,7 @@ void open_buffer(const char *filename, bool undoable)
      if (rc > 0) {
  	read_file(f, rc, filename, undoable, new_buffer);
  #ifndef NANO_TINY
@@ -49,23 +49,26 @@ index f6efbf1..99cc1b8 100644
  #endif
      }
  
-@@ -1741,8 +1755,8 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
-      * specified it interactively), stat and save the value
-      * or else we will chase null pointers when we do
-      * modtime checks, preserve file times, etc. during backup */
--    if (openfile->current_stat == NULL && !tmp && realexists)
+@@ -1737,10 +1751,8 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
+      * specified it interactively), stat and save the value now,
+      * or else we will chase null pointers when we do modtime checks,
+      * preserve file times, and so on, during backup. */
+-    if (openfile->current_stat == NULL && !tmp && realexists) {
+-	openfile->current_stat = (struct stat *)nmalloc(sizeof(struct stat));
 -	stat(realname, openfile->current_stat);
+-    }
 +    if (!tmp && realexists)
 +	stat_if_needed(realname, &openfile->current_stat);
  
      /* We backup only if the backup toggle is set, the file isn't
       * temporary, and the file already exists.  Furthermore, if we
-@@ -2134,7 +2148,10 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
+@@ -2133,8 +2145,10 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
  	if (openfile->current_stat == NULL)
  	    openfile->current_stat =
  		(struct stat *)nmalloc(sizeof(struct stat));
--	stat(realname, openfile->current_stat);
-+	if (stat(realname, openfile->current_stat)) {
+-	if (!openfile->mark_set)
+-	    stat(realname, openfile->current_stat);
++	if (!openfile->mark_set && 0 != stat(realname, openfile->current_stat)) {
 +	    free(openfile->current_stat);
 +	    openfile->current_stat = NULL;
 +	}
diff --git a/0002-use-futimens-if-available-instead-of-utime.patch b/0002-use-futimens-if-available-instead-of-utime.patch
index 3347d18..478848e 100644
--- a/0002-use-futimens-if-available-instead-of-utime.patch
+++ b/0002-use-futimens-if-available-instead-of-utime.patch
@@ -1,20 +1,20 @@
 From 23510b930ea31f7de8005e2f0ff6cab7062b4e26 Mon Sep 17 00:00:00 2001
 From: Kamil Dudka <kdudka at redhat.com>
 Date: Thu, 19 Aug 2010 15:23:06 +0200
-Subject: [PATCH 2/2] use futimens() if available, instead of utime()
+Subject: [PATCH 3/3] use futimens() if available, instead of utime()
 
 ---
  config.h.in  |    3 +++
  configure    |    2 +-
  configure.ac |    2 +-
- src/files.c  |   48 +++++++++++++++++++++++++++++++++++-------------
- 4 files changed, 40 insertions(+), 15 deletions(-)
+ src/files.c  |   26 +++++++++++++++++++++++++-
+ 4 files changed, 30 insertions(+), 3 deletions(-)
 
 diff --git a/config.h.in b/config.h.in
 index 52e13f1..cb17b29 100644
 --- a/config.h.in
 +++ b/config.h.in
-@@ -64,6 +64,9 @@
+@@ -66,6 +66,9 @@
  /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
  #undef HAVE_DOPRNT
  
@@ -28,12 +28,12 @@ diff --git a/configure b/configure
 index 02733c7..1805e53 100755
 --- a/configure
 +++ b/configure
-@@ -7362,7 +7362,7 @@ fi
+@@ -7577,7 +7577,7 @@ fi
  
  
  
--for ac_func in getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf
-+for ac_func in futimens getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf
+-for ac_func in getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen snprintf vsnprintf
++for ac_func in futimens getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen snprintf vsnprintf
  do :
    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
  ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -41,20 +41,20 @@ diff --git a/configure.ac b/configure.ac
 index 66f8ee3..f4975d3 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -414,7 +414,7 @@ fi])
+@@ -419,7 +419,7 @@ int main(void)
  
  dnl Checks for functions.
  
--AC_CHECK_FUNCS(getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf)
-+AC_CHECK_FUNCS(futimens getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf)
+-AC_CHECK_FUNCS(getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen snprintf vsnprintf)
++AC_CHECK_FUNCS(futimens getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen snprintf vsnprintf)
  
- if test x$enable_utf8 != xno; then
+ if test "x$enable_utf8" != xno; then
      AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace nl_langinfo mblen mbstowcs mbtowc wctomb wcwidth)
 diff --git a/src/files.c b/src/files.c
 index 99cc1b8..9a1bdcc 100644
 --- a/src/files.c
 +++ b/src/files.c
-@@ -1665,6 +1665,29 @@ int copy_file(FILE *inn, FILE *out)
+@@ -1662,6 +1662,29 @@ int copy_file(FILE *inn, FILE *out)
      return retval;
  }
  
@@ -84,45 +84,16 @@ index 99cc1b8..9a1bdcc 100644
  /* Write a file out to disk.  If f_open isn't NULL, we assume that it is
   * a stream associated with the file, and we don't try to open it
   * ourselves.  If tmp is TRUE, we set the umask to disallow anyone else
-@@ -1904,6 +1927,18 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
- 	fprintf(stderr, "Backing up %s to %s\n", realname, backupname);
- #endif
- 
-+	/* Set backup's file metadata. */
-+	if (utime_wrap(backup_fd, backupname, &filetime) == -1
-+		&& !ISSET(INSECURE_BACKUP)) {
-+	    statusbar(_("Error writing backup file %s: %s"), backupname,
-+			strerror(errno));
-+	    /* If we can't write to the backup, DONT go on, since
-+	       whatever caused the backup file to fail (e.g. disk
-+	       full may well cause the real file write to fail, which
-+	       means we could lose both the backup and the original! */
-+	    goto cleanup_and_exit;
-+	}
-+
- 	/* Copy the file. */
- 	copy_status = copy_file(f, backup_file);
- 
-@@ -1914,19 +1949,6 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
- 	    goto cleanup_and_exit;
+@@ -1912,7 +1935,8 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
  	}
  
--	/* And set its metadata. */
+ 	/* And set its metadata. */
 -	if (utime(backupname, &filetime) == -1 && !ISSET(INSECURE_BACKUP)) {
--	    if (prompt_failed_backupwrite(backupname))
--		goto skip_backup;
--	    statusbar(_("Error writing backup file %s: %s"), backupname,
--			strerror(errno));
--	    /* If we can't write to the backup, DONT go on, since
--	       whatever caused the backup file to fail (e.g. disk
--	       full may well cause the real file write to fail, which
--	       means we could lose both the backup and the original! */
--	    goto cleanup_and_exit;
--	}
--
- 	free(backupname);
-     }
- 
++	if (utime_wrap(backup_fd, backupname, &filetime) == -1
++		&& !ISSET(INSECURE_BACKUP)) {
+ 	    if (prompt_failed_backupwrite(backupname))
+ 		goto skip_backup;
+ 	    statusbar(_("Error writing backup file %s: %s"), backupname,
 -- 
 1.7.4
 
diff --git a/nano-2.3.3-warnings.patch b/nano-2.3.3-warnings.patch
new file mode 100644
index 0000000..ae4197a
--- /dev/null
+++ b/nano-2.3.3-warnings.patch
@@ -0,0 +1,24 @@
+From 8d618f769b1e66a26e7b790e4e94b2c3dca68d31 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka at redhat.com>
+Date: Tue, 26 Mar 2013 16:20:27 +0100
+Subject: [PATCH 1/3] fix compile-time warnings in nano-2.3.3
+
+---
+ po/Makefile.in.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/po/Makefile.in.in b/po/Makefile.in.in
+index ada8bb4..f7b2a95 100644
+--- a/po/Makefile.in.in
++++ b/po/Makefile.in.in
+@@ -20,6 +20,7 @@ VPATH = @srcdir@
+ 
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
++datarootdir = @datarootdir@
+ datadir = @datadir@
+ localedir = $(datadir)/locale
+ gettextsrcdir = $(datadir)/gettext/po
+-- 
+1.7.1
+
diff --git a/nano.spec b/nano.spec
index 167a0c9..390ef80 100644
--- a/nano.spec
+++ b/nano.spec
@@ -1,13 +1,13 @@
 Summary:         A small text editor
 Name:            nano
-Version:         2.3.2
-Release:         4%{?dist}
+Version:         2.3.3
+Release:         1%{?dist}
 License:         GPLv3+
 Group:           Applications/Editors
 URL:             http://www.nano-editor.org
 Source:          http://www.nano-editor.org/dist/v2.3/%{name}-%{version}.tar.gz
 Source2:         nanorc
-Patch0:          nano-2.3.2-warnings.patch
+Patch0:          nano-2.3.3-warnings.patch
 
 # http://lists.gnu.org/archive/html/nano-devel/2010-08/msg00004.html
 Patch1:          0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch
@@ -15,9 +15,6 @@ Patch1:          0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch
 # http://lists.gnu.org/archive/html/nano-devel/2010-08/msg00005.html
 Patch2:          0002-use-futimens-if-available-instead-of-utime.patch
 
-# http://thread.gmane.org/gmane.editors.nano.devel/3081
-Patch3:          0003-Document-the-poslog-P-option-in-nano.1-man-page.patch
-
 BuildRoot:       %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:   autoconf
 BuildRequires:   file-devel
@@ -25,6 +22,7 @@ BuildRequires:   gettext-devel
 BuildRequires:   groff
 BuildRequires:   ncurses-devel
 BuildRequires:   sed
+BuildRequires:   texinfo
 Conflicts:       filesystem < 3
 Requires(post):  /sbin/install-info
 Requires(preun): /sbin/install-info
@@ -37,7 +35,6 @@ GNU nano is a small and friendly text editor.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
 
 for f in doc/man/fr/{nano.1,nanorc.5,rnano.1} ; do
   iconv -f iso-8859-1 -t utf-8 -o $f.tmp $f && mv $f.tmp $f
@@ -93,6 +90,9 @@ exit 0
 %{_datadir}/nano
 
 %changelog
+* Thu May 29 2014 Kamil Dudka <kdudka at redhat.com> - 2.3.3-1
+- new upstream release
+
 * Fri Aug 09 2013 Kamil Dudka <kdudka at redhat.com> - 2.3.2-4
 - document the --poslog (-P) option in nano.1 man page
 
diff --git a/sources b/sources
index a066d1c..3afbe91 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6451aeae836471cadea8567c44a46c99  nano-2.3.2.tar.gz
+229ecb771c962117bdf97f75622204c9  nano-2.3.3.tar.gz


More information about the scm-commits mailing list