From 6ab22ee007f36d994fd62564a224893fac8249a4 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 02 2019 16:12:04 +0000 Subject: import nano-2.3.1-10.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1172cb1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/nano-2.3.1.tar.gz diff --git a/.nano.metadata b/.nano.metadata new file mode 100644 index 0000000..043be36 --- /dev/null +++ b/.nano.metadata @@ -0,0 +1 @@ +bd1993189f82649b4960b1ccd7142a61f43f2993 SOURCES/nano-2.3.1.tar.gz diff --git a/SOURCES/0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch b/SOURCES/0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch new file mode 100644 index 0000000..739f6f5 --- /dev/null +++ b/SOURCES/0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch @@ -0,0 +1,77 @@ +From fc87b0a32c130a2b3ab37e614d4a1c6c8e5d70e7 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +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 + +--- + src/files.c | 33 +++++++++++++++++++++++++-------- + 1 files changed, 25 insertions(+), 8 deletions(-) + +diff --git a/src/files.c b/src/files.c +index f6efbf1..99cc1b8 100644 +--- a/src/files.c ++++ b/src/files.c +@@ -103,6 +103,24 @@ void initialize_buffer_text(void) + openfile->totsize = 0; + } + ++#ifndef NANO_TINY ++/* If *pstat is NULL, perform a stat call with the given file name. On success, ++ * *pstat points to a newly allocated buffer that contains the stat's result. ++ * On stat's failure, the NULL pointer in *pstat is left intact. */ ++void stat_if_needed(const char *filename, struct stat **pstat) ++{ ++ struct stat *tmp; ++ if (*pstat) ++ return; ++ ++ tmp = (struct stat *)nmalloc(sizeof(struct stat)); ++ if (0 == stat(filename, tmp)) ++ *pstat = tmp; ++ else ++ free(tmp); ++} ++#endif ++ + /* 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) +@@ -148,11 +166,7 @@ void open_buffer(const char *filename, bool undoable) + if (rc > 0) { + read_file(f, rc, filename, undoable, new_buffer); + #ifndef NANO_TINY +- if (openfile->current_stat == NULL) { +- openfile->current_stat = +- (struct stat *)nmalloc(sizeof(struct stat)); +- stat(filename, openfile->current_stat); +- } ++ stat_if_needed(filename, &openfile->current_stat); + #endif + } + +@@ -1532,8 +1546,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) +- 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 +@@ -1924,7 +1938,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)) { ++ free(openfile->current_stat); ++ openfile->current_stat = NULL; ++ } + #endif + + statusbar(P_("Wrote %lu line", "Wrote %lu lines", +-- +1.7.4 + diff --git a/SOURCES/0002-use-futimens-if-available-instead-of-utime.patch b/SOURCES/0002-use-futimens-if-available-instead-of-utime.patch new file mode 100644 index 0000000..c27136d --- /dev/null +++ b/SOURCES/0002-use-futimens-if-available-instead-of-utime.patch @@ -0,0 +1,99 @@ +From 23510b930ea31f7de8005e2f0ff6cab7062b4e26 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Thu, 19 Aug 2010 15:23:06 +0200 +Subject: [PATCH 2/2] use futimens() if available, instead of utime() + +--- + configure.ac | 2 +- + src/files.c | 48 +++++++++++++++++++++++++++++++++++------------- + 2 files changed, 36 insertions(+), 14 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 66f8ee3..f4975d3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -415,7 +415,7 @@ fi]) + + 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) + + 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 +@@ -1455,6 +1455,29 @@ int copy_file(FILE *inn, FILE *out) + return retval; + } + ++#ifdef HAVE_FUTIMENS ++/* set atime/mtime by file descriptor */ ++int utime_wrap(int fd, const char *filename, struct utimbuf *ut) ++{ ++ struct timespec times[2]; ++ (void) filename; ++ ++ times[0].tv_sec = ut->actime; ++ times[1].tv_sec = ut->modtime; ++ times[0].tv_nsec = 0L; ++ times[1].tv_nsec = 0L; ++ ++ return futimens(fd, times); ++} ++#else ++/* set atime/mtime by file name */ ++int utime_wrap(int fd, const char *filename, struct utimbuf *ut) ++{ ++ (void) fd; ++ return utime(filename, ut); ++} ++#endif ++ + /* 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 +@@ -1694,6 +1717,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); + +@@ -1704,19 +1739,6 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type + goto cleanup_and_exit; + } + +- /* 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); + } + +-- +1.7.4 + diff --git a/SOURCES/0003-Document-the-poslog-P-option-in-nano.1-man-page.patch b/SOURCES/0003-Document-the-poslog-P-option-in-nano.1-man-page.patch new file mode 100644 index 0000000..471e347 --- /dev/null +++ b/SOURCES/0003-Document-the-poslog-P-option-in-nano.1-man-page.patch @@ -0,0 +1,26 @@ +From 64452244419d9b77ef62d4971bad5cdaa4dd3dfc Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Tue, 28 May 2013 15:24:19 +0200 +Subject: [PATCH 3/3] Document the --poslog (-P) option in nano.1 man page. + +--- + doc/man/nano.1 | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/doc/man/nano.1 b/doc/man/nano.1 +index 4d4d67a..c4e4782 100644 +--- a/doc/man/nano.1 ++++ b/doc/man/nano.1 +@@ -99,6 +99,9 @@ Disable automatic conversion of files from DOS/Mac format. + .B \-O (\-\-morespace) + Use the blank line below the titlebar as extra editing space. + .TP ++.B \-P (\-\-poslog) ++Log & read location of cursor position. ++.TP + .B \-Q \fIstr\fP (\-\-quotestr=\fIstr\fP) + Set the quoting string for justifying. The default is + "\fI^([\ \\t]*[#:>\\|}])+\fP" if extended regular expression support is +-- +1.7.1 + diff --git a/SOURCES/nano-2.3.0-warnings.patch b/SOURCES/nano-2.3.0-warnings.patch new file mode 100644 index 0000000..5fa5617 --- /dev/null +++ b/SOURCES/nano-2.3.0-warnings.patch @@ -0,0 +1,42 @@ + po/Makefile.in.in | 1 + + src/nano.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + +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 +diff --git a/src/nano.c b/src/nano.c +index 269ab29..5b605bf 100644 +--- a/src/nano.c ++++ b/src/nano.c +@@ -1925,7 +1925,7 @@ precalc_cleanup: + * TRUE. */ + void do_output(char *output, size_t output_len, bool allow_cntrls) + { +- size_t current_len, orig_lenpt, i = 0; ++ size_t current_len, orig_lenpt = 0, i = 0; + char *char_buf = charalloc(mb_cur_max()); + int char_buf_len; + +diff --git a/src/search.c b/src/search.c +index ca93098..3451600 100644 +--- a/src/search.c ++++ b/src/search.c +@@ -138,7 +138,7 @@ int search_init(bool replacing, bool use_answer) + int i = 0; + char *buf; + sc *s; +- void (*func)(void); ++ void (*func)(void) = (void (*)(void))0; + bool meta_key = FALSE, func_key = FALSE; + static char *backupstring = NULL; + /* The search string we'll be using. */ diff --git a/SOURCES/nanorc b/SOURCES/nanorc new file mode 100644 index 0000000..1196518 --- /dev/null +++ b/SOURCES/nanorc @@ -0,0 +1,6 @@ +## This is a system-wide configuration file for the nano editor. +## +## Each user can save his own configuration to ~/.nanorc +## +## See the nanorc(5) man page for details. + diff --git a/SPECS/nano.spec b/SPECS/nano.spec new file mode 100644 index 0000000..c3782e0 --- /dev/null +++ b/SPECS/nano.spec @@ -0,0 +1,260 @@ +Summary: A small text editor +Name: nano +Version: 2.3.1 +Release: 10%{?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.0-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 + +# 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: automake +BuildRequires: gettext-devel +BuildRequires: groff +BuildRequires: ncurses-devel +BuildRequires: sed +Conflicts: filesystem < 3 +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info + +%description +GNU nano is a small and friendly text editor. + +%prep +%setup -q +%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 + touch $f.html +done + +# needed by 0002-use-futimens-if-available-instead-of-utime.patch and bz #926195 +autoreconf -fiv + +%build +%configure +make %{?_smp_mflags} + +%install +make DESTDIR="%{buildroot}" install +#ln -s nano %{buildroot}%{_bindir}/pico +rm -f %{buildroot}%{_infodir}/dir +cp %{SOURCE2} ./nanorc + +# disable line wrapping by default and set hunspell as the default spell-checker +sed -e 's/# set nowrap/set nowrap/' \ + -e 's/^#.*set speller.*$/set speller "hunspell"/' \ + doc/nanorc.sample >> ./nanorc +mkdir -p %{buildroot}%{_sysconfdir} +install -m 644 ./nanorc %{buildroot}%{_sysconfdir}/nanorc + +%find_lang %{name} + +%post +if [ -f %{_infodir}/%{name}.info.gz ]; then + /sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir +fi +exit 0 + +%preun +if [ $1 -eq 0 ]; then + if [ -f %{_infodir}/%{name}.info.gz ]; then + /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir + fi +fi +exit 0 + +%files -f %{name}.lang +%doc AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS TODO +%doc doc/nanorc.sample +%doc doc/faq.html +%{_bindir}/* +%config(noreplace) %{_sysconfdir}/nanorc +%{_mandir}/man*/* +%lang(fr) %{_mandir}/fr/man*/* +%{_infodir}/nano.info* +%{_datadir}/nano + +%changelog +* Fri Jan 24 2014 Daniel Mach - 2.3.1-10 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 2.3.1-9 +- Mass rebuild 2013-12-27 + +* Fri Aug 09 2013 Kamil Dudka - 2.3.1-8 +- document the --poslog (-P) option in nano.1 man page + +* Thu Apr 04 2013 Kamil Dudka - 2.3.1-7 +- run autoreconf in %%prep to support aarch64 with autoconf 2.69+ (#926195) + +* Thu Feb 14 2013 Fedora Release Engineering - 2.3.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Aug 28 2012 Kamil Dudka - 2.3.1-5 +- fix specfile issues reported by the fedora-review script + +* Fri Jul 20 2012 Fedora Release Engineering - 2.3.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jan 25 2012 Harald Hoyer 2.3.1-3 +- install everything in /usr + https://fedoraproject.org/wiki/Features/UsrMove + +* Fri Jan 13 2012 Fedora Release Engineering - 2.3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed May 11 2011 Kamil Dudka - 2.3.1-1 +- new upstream release + +* Thu Mar 03 2011 Kamil Dudka - 2.3.0-1 +- new upstream release (#680736) +- use hunspell as default spell-checker (#681000) +- fix for http://thread.gmane.org/gmane.editors.nano.devel/2911 + +* Tue Feb 08 2011 Fedora Release Engineering - 2.2.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sun Nov 28 2010 Kamil Dudka - 2.2.6-2 +- fix bugs introduced by patches added in 2.2.6-1 (#657875) + +* Mon Nov 22 2010 Kamil Dudka - 2.2.6-1 +- new upstream release (#655978) +- increase code robustness (patches related to CVE-2010-1160, CVE-2010-1161) + +* Sat Aug 07 2010 Kamil Dudka - 2.2.5-1 +- new upstream release (#621857) + +* Thu Apr 15 2010 Kamil Dudka - 2.2.4-1 +- new upstream release +- CVE-2010-1160, CVE-2010-1161 (#582739) + +* Wed Mar 03 2010 Kamil Dudka - 2.2.3-1 +- new upstream release + +* Fri Jan 29 2010 Kamil Dudka - 2.2.2-1 +- new upstream release + +* Sun Dec 27 2009 Kamil Dudka - 2.2.1-1 +- new upstream release + +* Tue Dec 01 2009 Kamil Dudka - 2.2.0-1 +- new upstream release + +* Wed Nov 25 2009 Kamil Dudka - 2.0.9-7 +- sanitize specfile according to Fedora Packaging Guidelines + +* Thu Oct 15 2009 Kamil Dudka - 2.0.9-6 +- use nanorc.sample as base of /etc/nanorc + +* Tue Oct 13 2009 Kamil Dudka - 2.0.9-5 +- fix build failure of the last build + +* Tue Oct 13 2009 Kamil Dudka - 2.0.9-4 +- ship a system-wide configuration file along with the nano package +- disable line wrapping by default (#528359) + +* Mon Sep 21 2009 Kamil Dudka - 2.0.9-3 +- suppress warnings for __attribute__((warn_unused_result)) (#523951) + +* Fri Sep 18 2009 Kamil Dudka - 2.0.9-2 +- install binaries to /bin (#168340) + +* Fri Sep 18 2009 Kamil Dudka - 2.0.9-1 +- new upstream release +- dropped patch no longer needed (possible change in behavior though negligible) +- fixed broken HTML doc in FR locales (#523951) + +* Thu Sep 17 2009 Kamil Dudka - 2.0.6-8 +- do process install-info only without --excludedocs(#515943) + +* Sat Jul 25 2009 Fedora Release Engineering - 2.0.6-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 2.0.6-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Apr 4 2008 Ville Skyttä - 2.0.6-5 +- Mark localized man pages with %%lang, fix French nanorc(5) (#322271). + +* Mon Feb 18 2008 Fedora Release Engineering - 2.0.6-4 +- Autorebuild for GCC 4.3 + +* Fri Dec 07 2007 Jason L Tibbitts III - 2.0.6-3 +- Pass rnano.1 through iconv to silence the final rpmlint complaint + and finish up the merge review. + +* Wed Aug 22 2007 David Woodhouse - 2.0.6-2 +- Update licence +- Fix open(O_CREAT) calls without mode + +* Sun Jun 03 2007 Florian La Roche - 2.0.6-1 +- update to 2.0.6 + +* Mon Feb 05 2007 Florian La Roche - 2.0.3-1 +- update to 2.0.3 +- update spec file syntax, fix scripts rh#220527 + +* Wed Jul 12 2006 Jesse Keating - 1.3.12-1.1 +- rebuild + +* Mon Jul 10 2006 David Woodhouse - 1.3.12-1 +- Update to 1.3.12 + +* Tue May 16 2006 David Woodhouse - 1.3.11-1 +- Update to 1.3.11 +- BuildRequires: groff (#191946) + +* Fri Feb 10 2006 Jesse Keating - 1.3.8-1.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1.3.8-1.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Mon Sep 5 2005 David Woodhouse 1.3.8-1 +- 1.3.8 + +* Wed Mar 2 2005 David Woodhouse 1.3.5-0.20050302 +- Update to post-1.3.5 CVS tree to get UTF-8 support. + +* Wed Aug 04 2004 David Woodhouse 1.2.4-1 +- 1.2.4 + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Apr 02 2004 Florian La Roche +- 1.2.3 + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Mon Aug 11 2003 Bill Nottingham 1.2.1-4 +- build in different environment + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Tue May 6 2003 Bill Nottingham 1.2.1-2 +- description tweaks + +* Mon May 5 2003 Bill Nottingham 1.2.1-1 +- initial build, tweak upstream spec file