diff --git a/.gitignore b/.gitignore index 017b085..b3cb273 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ units-1.88.tar.gz +/units-2.00.tar.gz diff --git a/sources b/sources index e86a38c..05995d8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9b2ee6e7e0e9c62741944cf33fc8a656 units-1.88.tar.gz +6d0518d493f9bab5aa318a3c7d0801b2 units-2.00.tar.gz diff --git a/units-1.88-coverity.patch b/units-1.88-coverity.patch deleted file mode 100644 index cc46992..0000000 --- a/units-1.88-coverity.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 149121fe597e9d3ee818d6d1d0facf9175d6674d Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Tue, 15 Nov 2011 19:24:00 +0100 -Subject: [PATCH 1/2] units - fix defects found by Coverity - ---- - units.c | 18 +++++++++++------- - 1 files changed, 11 insertions(+), 7 deletions(-) - -diff --git a/units.c b/units.c -index cdda76a..c4230c9 100644 ---- a/units.c -+++ b/units.c -@@ -383,7 +383,7 @@ readunits(char *file, FILE *errfile, - struct prefixlist *pfxptr; - struct unitlist *uptr; - FILE *unitfile; -- char *line, *lineptr, *unitdef, *unitname, *permfile; -+ char *line = 0, *lineptr, *unitdef, *unitname, *permfile; - int len, linenum, linebufsize, goterr; - unsigned hashval, pval; - int locunitcount, locprefixcount, locfunccount; -@@ -399,12 +399,13 @@ readunits(char *file, FILE *errfile, - - growbuffer(&line,&linebufsize); - -- permfile = dupstr(file); /* This is a permanent copy to -- reference in the database. -- It is never freed. */ - unitfile = fopen(file, "rt"); - if (!unitfile) - return E_FILE; -+ -+ permfile = dupstr(file); /* This is a permanent copy to -+ reference in the database. -+ It is never freed. */ - while (!feof(unitfile)) { - if (!fgetslong(&line, &linebufsize, unitfile, &linenum)) - break; -@@ -471,8 +472,10 @@ readunits(char *file, FILE *errfile, - } - readerr = readunits(includefile, errfile, unitcount, prefixcount, - funccount, depth+1); -- if (readerr == E_MEMORY) -+ if (readerr == E_MEMORY) { -+ fclose(unitfile); - return readerr; -+ } - if (readerr == E_FILE) { - if (errfile) - fprintf(errfile, "%s: unable to open included file '%s' at line %d of file '%s\n", progname, includefile, linenum, file); -@@ -1381,7 +1384,7 @@ subunitroot(int n,char *in[], char *out[]) - char **ptr,**current; - int count; - -- for(current = in;*current && *current==NULLUNIT;current++); -+ for(current = in;*current==NULLUNIT;current++) - count = 0; - for(ptr=in;*ptr;ptr++){ - if (*ptr==NULLUNIT) continue; -@@ -2618,7 +2621,7 @@ Typing 'search text' will show units whose names contain 'text'.\n\n", - int - main(int argc, char **argv) - { -- struct unittype have, want; -+ static struct unittype have, want; - char *havestr=0, *wantstr=0; - struct func *funcval; - int havestrsize=0; /* Only used if READLINE is undefined */ --- -1.7.1 - - -From 30ede89a0147189cd815afc58b1d82545b881bcd Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Wed, 16 Nov 2011 13:37:09 +0100 -Subject: [PATCH 2/2] units - use an annotation to suppress a false positive of Coverity - ---- - units.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/units.c b/units.c -index c4230c9..28555a4 100644 ---- a/units.c -+++ b/units.c -@@ -403,6 +403,7 @@ readunits(char *file, FILE *errfile, - if (!unitfile) - return E_FILE; - -+ /* coverity[alloc_fn] */ - permfile = dupstr(file); /* This is a permanent copy to - reference in the database. - It is never freed. */ --- -1.7.1 - diff --git a/units-1.88-man-typo.patch b/units-1.88-man-typo.patch deleted file mode 100644 index 1e49b16..0000000 --- a/units-1.88-man-typo.patch +++ /dev/null @@ -1,16 +0,0 @@ - units.man | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/units.man b/units.man -index 6199904..e202da4 100644 ---- a/units.man -+++ b/units.man -@@ -446,7 +446,7 @@ The temperature differences are done using units starting with - Think of `tempF(x)' not as a function but as a notation which - indicates that `x' should have units of `tempF' attached to - it. See \fINonlinear units\fR. The first conversion shows that if it's 45 --degrees Fahrehneit outside it's 7.2 degrees Celsius. The second -+degrees Fahrenheit outside it's 7.2 degrees Celsius. The second - conversions indicates that a change of 45 degrees Fahrenheit corresponds - to a change of 25 degrees Celsius. - .PP diff --git a/units-1.88.tar.gz.sig b/units-1.88.tar.gz.sig deleted file mode 100644 index 2a1898b..0000000 Binary files a/units-1.88.tar.gz.sig and /dev/null differ diff --git a/units-2.00-make-install.patch b/units-2.00-make-install.patch new file mode 100644 index 0000000..658ebc8 --- /dev/null +++ b/units-2.00-make-install.patch @@ -0,0 +1,43 @@ +From adfae89daffafd4f1a07dcc2a6f4689cf07c2b54 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Mon, 2 Jul 2012 11:16:13 +0200 +Subject: [PATCH] Makefile.in: do not ignore $(DESTDIR) when installing data + +--- + Makefile.in | 13 +++++++------ + 1 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 60b8966..111f4e7 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -84,10 +84,10 @@ units_cur_inst: units_cur + sed -e "s:outfile = 'currency.units':outfile='@UDAT@currency.units':" units_cur > units_cur_inst + + install-support: definitions.units currency.units units_cur_inst +- $(srcdir)/mkinstalldirs @UDAT@ $(DESTDIR)$(bindir) +- $(INSTALL_DATA) $(srcdir)/definitions.units @UDAT@definitions.units +- $(INSTALL_DATA) $(srcdir)/currency.units @UDAT@currency.units +- $(INSTALL_DATA) $(srcdir)/locale.map @UDAT@locale.map ++ $(srcdir)/mkinstalldirs $(DESTDIR)@UDAT@ $(DESTDIR)$(bindir) ++ $(INSTALL_DATA) $(srcdir)/definitions.units $(DESTDIR)@UDAT@definitions.units ++ $(INSTALL_DATA) $(srcdir)/currency.units $(DESTDIR)@UDAT@currency.units ++ $(INSTALL_DATA) $(srcdir)/locale.map $(DESTDIR)@UDAT@locale.map + $(INSTALL_PROGRAM) units_cur_inst $(DESTDIR)$(bindir)/`echo units_cur|sed '$(transform)'` + + install: units@EXEEXT@ install-doc install-support +@@ -138,8 +138,9 @@ Makefile: Makefile.in config.status + uninstall: + -rm -f $(DESTDIR)$(bindir)/`echo units@EXEEXT@|sed '$(transform)'` \ + $(DESTDIR)$(mandir)/man1/`echo units|sed '$(transform)'`.1 \ +- $(DESTDIR)$(infodir)/units.info @UDAT@definitions.units \ +- @UDAT@currency.units \ ++ $(DESTDIR)$(infodir)/units.info \ ++ $(DESTDIR)@UDAT@definitions.units \ ++ $(DESTDIR)@UDAT@currency.units \ + @if test -f $(DESTDIR)$(infodir)/dir; then \ + echo You may need to remove units.info from $(DESTDIR)$(infodir)/dir; \ + else true; fi +-- +1.7.1 + diff --git a/units-2.00.tar.gz.sig b/units-2.00.tar.gz.sig new file mode 100644 index 0000000..2fdcbfe Binary files /dev/null and b/units-2.00.tar.gz.sig differ diff --git a/units.spec b/units.spec index d17ae75..1d25d06 100644 --- a/units.spec +++ b/units.spec @@ -1,7 +1,7 @@ Summary: A utility for converting amounts from one unit to another Name: units -Version: 1.88 -Release: 6%{?dist} +Version: 2.00 +Release: 1%{?dist} Source: ftp://ftp.gnu.org/gnu/units/%{name}-%{version}.tar.gz URL: http://www.gnu.org/software/units/units.html License: GPLv3+ @@ -12,8 +12,7 @@ Requires(preun): /sbin/install-info BuildRequires: bison BuildRequires: ncurses-devel BuildRequires: readline-devel -Patch1: units-1.88-man-typo.patch -Patch2: units-1.88-coverity.patch +Patch0: units-2.00-make-install.patch %description Units converts an amount from one unit to another, or tells you what @@ -23,8 +22,7 @@ well as conversions such as Fahrenheit to Celsius. %prep %setup -q -%patch1 -p1 -%patch2 -p1 +%patch0 -p1 %build %configure @@ -54,11 +52,15 @@ fi %defattr(-,root,root,-) %doc ChangeLog COPYING NEWS README %{_bindir}/* -%{_datadir}/units.dat +%{_datadir}/units %{_infodir}/* %{_mandir}/man1/* %changelog +* Mon Jun 02 2012 Kamil Dudka - 2.00-1 +- new upstream release, dropped applied patches +- patch Makefile.in to respect $(DESTDIR) + * Sat Jan 14 2012 Fedora Release Engineering - 1.88-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild