debian/0000755000000000000000000000000012143757754007205 5ustar debian/patches/0000755000000000000000000000000012143757711010625 5ustar debian/patches/addFormatForPrintf.patch0000644000000000000000000000023412143755331015374 0ustar --- a/src/unites.y +++ b/src/unites.y @@ -695,7 +695,7 @@ printf("%s\\,",buf); } } else { - printf(buf); + printf("%s",buf); } } debian/patches/debian-changes-3.5-20000644000000000000000000001145311661725327014050 0ustar Description: Upstream changes introduced in version 3.5-2 This patch has been created by dpkg-source during the package build. Here's the last changelog entry, hopefully it gives details on why those changes were made: . units-filter (3.5-2) unstable; urgency=low . * fixed typos in the manpage, thanks to A. Costa's patch. Closes: #649228 . The person named in the Author field signed this changelog entry. Author: Georges Khaznadar Bug-Debian: http://bugs.debian.org/649228 --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: http://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- units-filter-3.5.orig/manpage.xml +++ units-filter-3.5/manpage.xml @@ -122,16 +122,16 @@ standard SI unit, followed by the physic - Like Significative. + Like Significant. - Takes in account the number of significative digits. For -example 1.0 m contains 2 significative digits, while 0.00100 contains -3 significative digits. It is possible to enforce the number of -significative digits by using a special syntax : if units-filter + Takes in account the number of significant digits. For +example 1.0 m contains 2 significant digits, while 0.00100 contains +3 significant digits. It is possible to enforce the number of +significant digits by using a special syntax : if units-filter parses the input "1.0m#6", it interprets it as a value with exactly 6 -significative digits, like "1.00000 m". The number following the # -sign is the forced number of significative digits. The number of -significative digits appears just before the last zero in the output +significant digits, like "1.00000 m". The number following the # +sign is the forced number of significant digits. The number of +significant digits appears just before the last zero in the output of the command (this zero is a placeholder for future extensions). @@ -145,7 +145,7 @@ physical unit in the International Syste simplification with usual units. For example, a newton will be represented by the unit N in place of m.kg.s^-2. The value is expressed as a floating number with one digit before the decimal point, and as many digits in the mantissa as -necessary to fit the desired number of significative digits (see an example +necessary to fit the desired number of significant digits (see an example below). It is possible to enforce the output unit : just add a colon and the desired unit at the end of the input. If this unit is homogeneous with the former one, it will be used to format the output. @@ -167,19 +167,19 @@ in LaTeX language. EXAMPLES - Establishing the SI value and units exponents of a quantity in the mksa system: + Establish the SI value and unit exponent of a quantity in the mksa system: ~$ echo 1.5e3 nN.m.s^-1 | units-filter 1.5e-6 2 1 -3 0 0 0 0 which means : 1.5e-6 (SI unit) m^2.kg.s^-3 -Comparing to different physical quantities: +Compare different physical quantities: ~$ e1=$(echo "1.2e-3 V" | units-filter) ~$ e2=$(echo "1200e3 nWb/s"| units-filter) ~$ if [ "$e1" = "$e2" ]; then echo ok; else echo ko; fi ok - ... which emphasizes that webers by unit time are the same than volts. + ... which emphasizes that webers by unit time are the same as volts. -Playing with the number of significative digits: +Playing with the number of significant digits: ~$ echo "0.00100m" | src/units-filter -s 0.001 1 0 0 0 0 0 0 3 0 ~$ echo "0.00100m #2" | src/units-filter -s @@ -203,7 +203,7 @@ in LaTeX language. KNOWN BUGS -Few units out of the mksa system are sucessfuly parsed. +Few units out of the mksa system are successfully parsed. debian/patches/series0000644000000000000000000000012412143757615012042 0ustar debian-changes-3.5-2 addFormatForPrintf.patch Makefile.patch fix_mpq_mpz-mess.patch debian/patches/fix_mpq_mpz-mess.patch0000644000000000000000000000102712143757711015144 0ustar --- a/src/unites.y +++ b/src/unites.y @@ -626,7 +626,7 @@ free(codedunit); } -mpq_class round_mpc(const mpq_class & x); +mpz_class round_mpc(const mpq_class & x); void printValue(optiontype option, yystype result, int s){ char val[128],exp[128], *i, *j, *indexE; @@ -701,7 +701,7 @@ double trunc(double x); -mpq_class round_mpc(const mpq_class & x){ +mpz_class round_mpc(const mpq_class & x){ /** * computes a rounded multiprecision integer from the input data * this may be valid only for positive inputs. debian/patches/Makefile.patch0000644000000000000000000000034412143756161013362 0ustar --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,7 @@ CC = gcc CXX = g++ #CXXFLAGS= -g -O1 -CXXFLAGS= -g +CXXFLAGS+= -g RECODE_SUPPORT = $(shell if grep -q Debian /etc/issue; then echo -DRECODE_SUPPORT=1; else echo; fi) debian/control0000644000000000000000000000205212143756640010600 0ustar # -*- coding: utf-8 -*- Source: units-filter Section: science Priority: optional Maintainer: Georges Khaznadar Build-Depends: debhelper (>> 9), flex, bison, librecode-dev, hardening-wrapper, docbook-xsl, xsltproc, libgmp3-dev Standards-Version: 3.9.4 Package: units-filter Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: wims Description: Parser for expressions concerning physical values Units-filter is a basic standalone filter written in C language, flex and bison. It inputs strings like "1.5e3 nN.m.s^-1" (it could be the time growth ratio of a torque) and outputs the value in standard SI unit, followed by the physical dimension of this value. . example :~/src$ echo 1.5e3 nN.m.s^-1 | units-filter 1.5e-06   2   1  -3   0   0   0   0    0    0 . 2 -3 which means : 1.5e-06 (SI unit) m .kg.s . This parser can be embedded in educational test systems, in order to analyze a student's answer to a problem of physics or chemistry. debian/compat0000644000000000000000000000000212143753607010374 0ustar 9 debian/copyright0000644000000000000000000000102211250735145011117 0ustar This package was debianized by Georges Khaznadar on Tue, 30 Apr 2002 19:41:41 +0200. It was downloaded from ftp://boltz.univ-littoral.fr/pub/units-filter Upstream Author: Georges Khaznadar Copyright: This software is copyright (c) 2000-02 by Georges Khaznadar You are free to distribute this software under the terms of the GNU General Public License. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL file. debian/source/0000755000000000000000000000000011604102040010452 5ustar debian/source/format0000644000000000000000000000001411604102040011660 0ustar 3.0 (quilt) debian/docs0000644000000000000000000000002011250735145010034 0ustar README LISEZMOI debian/changelog0000644000000000000000000002307012143756714011054 0ustar units-filter (3.5-3) unstable; urgency=low * Modified my DEBEMAIL * fixed a conversion not allowed by the last version of gcc. Closes:#707460 * updated Standards-Version and compat level * fixed the Suggests: field in control file * introduced hardening-wrapper in the rules and build-dependencies * fixed src/unites.y: added a format string for printf * fixed src/Makefile to take in account fortifying options in CXXFLAGS -- Georges Khaznadar Sun, 12 May 2013 19:52:37 +0200 units-filter (3.5-2) unstable; urgency=low * fixed typos in the manpage, thanks to A. Costa's patch. Closes: #649228 -- Georges Khaznadar Sat, 19 Nov 2011 14:00:30 +0100 units-filter (3.5-1) unstable; urgency=low * fixed a bug which appeared with data containing too much digits. * added unitary tests for this feature -- Georges Khaznadar Sat, 27 Aug 2011 20:46:11 +0200 units-filter (3.4-1) unstable; urgency=low * fixed a bug about significative digit guessing when the option -s is active and no explicite number of significatif digits is entered. * added unitary tests for this feature -- Georges Khaznadar Thu, 25 Aug 2011 15:38:18 +0200 units-filter (3.3-3) unstable; urgency=low * added missing ";" in unites.y, thanks to Bernadette RIOU's bugreport -- Georges Khaznadar Thu, 18 Aug 2011 18:31:36 +0200 units-filter (3.3-2) unstable; urgency=low * modified src/Makefile, thanks to Ilya Barygin's patch. Closes: #632567 * simplified the file debian/rules. * switched to source format 3.0 (quilt). -- Georges Khaznadar Sun, 03 Jul 2011 21:30:09 +0200 units-filter (3.3-1) unstable; urgency=low * introduced the type "decimal" which differs from "double" to get rid of the false digitalization for non-integers. Removed any use of functions which are based on the type "double". This should definitely close the bugs related to significative digits. * updated Standards-Version: 3.9.1 -> 3.9.2 -- Georges Khaznadar Fri, 24 Jun 2011 18:04:54 +0200 units-filter (3.2-1) unstable; urgency=low * added as a possibilty to replace the symbol "e" or "E" by "*10^" in float representation of input numbers. -- Georges Khaznadar Wed, 02 Mar 2011 21:54:58 +0100 units-filter (3.1-2) unstable; urgency=low * modified the Makefile, now the invokation of flex can be used even with older versions of flex. * upgraded Standards-Version to 3.9.1 -- Georges Khaznadar Sun, 15 Aug 2010 20:19:50 +0200 units-filter (3.1-1) unstable; urgency=low * fixed a bug about the output with negative numbers * fixed a bug about the output with zero numbers -- Georges Khaznadar Thu, 10 Dec 2009 18:48:32 +0100 units-filter (3.0-3) unstable; urgency=low * updated lintian and fixed the warning about standards-version -- Georges Khaznadar Thu, 29 Oct 2009 14:11:08 +0100 units-filter (3.0-2) unstable; urgency=low * fixed a bug which was not detected by the test suite: the written output for numbers lesser than 1 was false. Integrated one new test in the suite. * modified the routine used to round the numbers. As many examples made by teachers use integer data, and divisions by 2, rounding numbers whose mantissa should be 0.5 is not unfrequent. Unfortunately computations with floats (for example with the interpreter of Wims) often yelds unprecise results. This may cause troublesome behaviors, when a mantissa which should be 0.5 is actually 0.4999999999999998 or so. Therefore, the routine used to round numbers adds the fraction 1000000001/2000000000 before making a trucation. -- Georges Khaznadar Sun, 06 Sep 2009 16:30:16 +0200 units-filter (3.0-1) unstable; urgency=low * introduced multiprecision calculus, in order to avoid errors when doing truncations (for exemple when specifying the number of significant digits) * recoded sources from latin1 to utf8 -- Georges Khaznadar Mon, 31 Aug 2009 11:31:43 +0200 units-filter (2.9-7) unstable; urgency=low * added a dependency on docbook-xsl, thanks to José L. Redrejo Rodríguez * replaced some spaces by unbreakable spaces in debian/control to get rid of a lintian warning about redundancy of the zeros. -- Georges Khaznadar Tue, 30 Jun 2009 11:40:29 +0200 units-filter (2.9-6) unstable; urgency=low * updated the compat level, fixed a typo in the file debian/control, rewritten the manpage with docbook (xml) -- Georges Khaznadar Sun, 28 Jun 2009 22:59:33 +0200 units-filter (2.9-5) unstable; urgency=low * modified unites.y and Makefile so it is possible to suppress the support for UTF8. * added the profiles of the functions trunc and round to avoid a warning from gcc and have these functione properly managed. -- Georges Khaznadar Sun, 15 Jun 2008 23:49:41 +0200 units-filter (2.9-4) unstable; urgency=low * fixed a segfault bug when the environment variable LC_ALL was not set. -- Georges Khaznadar Sun, 16 Dec 2007 20:18:00 +0100 units-filter (2.9-3) unstable; urgency=low * fixed the definition of eV : it is now a unit of energy (=1.6e-19 J) * modified the routine to simplify the output of floating numbers. * now the default behavior with the option -o is to display the unit given in the input (if it exists). * modified the test suite accordingly. -- Georges Khaznadar Sun, 16 Dec 2007 19:43:27 +0100 units-filter (2.9-2) unstable; urgency=low * fixed a nasty bug which made a segfault when some units were used -- Georges Khaznadar Fri, 14 Dec 2007 11:24:07 +0100 units-filter (2.9-1) unstable; urgency=low * Modified the package to make it non-native, as it can be used outside Debian. * Added some code to take in account the necessary recoding of some units for non-ASCII environments, like UTF-8 -- Georges Khaznadar Wed, 05 Dec 2007 21:54:55 +0100 units-filter (2.8) unstable; urgency=low * removed the option --strip from the Makefile. Closes: 438234 -- Georges Khaznadar Fri, 24 Aug 2007 17:17:34 +0200 units-filter (2.7) unstable; urgency=low * modified the behavior with the option -o: when then output string contains e+00, the substring e+00 is erased. -- Georges Khaznadar Sun, 27 May 2007 17:03:57 +0200 units-filter (2.6-1) unstable; urgency=low * added a new feature, to consider physical quantities with a given rate of relative precision: syntax ~percent, to mean a physical quantity plus or minus percent % tolerance. The syntax +-percent% is also allowed, which adds some rentrance. * added a new option switch, -l, to have an output in LaTeX language. -- Georges Khaznadar Tue, 17 Oct 2006 19:41:28 +0200 units-filter (2.5-1) unstable; urgency=low * repackaged as a non-native package Closes: #230993 -- Georges Khaznadar Sun, 25 Jun 2006 12:59:02 +0200 units-filter (2.5) unstable; urgency=low * allowed some spaces in the representation of real numbers. * fixed some issues with strncat in unites.y * added a syntax for wanted units in the output string * fixed a bug with non-SI units at a negative power * fixed a bug with the unit h -- Georges Khaznadar Thu, 15 Jun 2006 09:30:26 +0200 units-filter (2.4) unstable; urgency=low * recompiled with the new version of flex, see http://www.debian.org/security/2006/dsa-1020) -- Georges Khaznadar Sun, 2 Apr 2006 16:49:55 +0200 units-filter (2.3) unstable; urgency=low * fixed the canonical output when some significative number of digits is expected: an automatic rounding is made. -- Georges Khaznadar Sun, 5 Dec 2004 23:49:26 +0100 units-filter (2.2) unstable; urgency=low * added the possibility to pass an option via the environment as suggested by Gang XIAO. -- Georges Khaznadar Mon, 29 Nov 2004 00:42:30 +0100 units-filter (2.1) unstable; urgency=low * added an option to output a simple canonical expression with basic units of the International System. * added support for usual units as N, J, W, etc. * fixed a bug about numbers beginning with a '+' or '-' sign. -- Georges Khaznadar Sun, 21 Nov 2004 16:58:42 +0100 units-filter (2.0) unstable; urgency=low * added a syntax to express significative numbers : suffix "#n" -- Georges Khaznadar Sat, 20 Nov 2004 22:36:53 +0100 units-filter (1.0-3) unstable; urgency=low * removed hard dependance on libc6 without release number Closes: #215949 -- Georges Khaznadar Sun, 25 Jan 2004 19:23:07 +0100 units-filter (1.0-2) unstable; urgency=low * fixed a bug in debian/control : non-ascii character "Mu" is no more used. -- Georges Khaznadar Sun, 21 Sep 2003 01:54:38 +0200 units-filter (1.0-1) unstable; urgency=low * strcpy,strcat => strncpy, strncat : buffers should be secure. * added "a" (are) unity (1 are = 100 m^2). -- Georges Khaznadar Tue, 23 Jul 2002 19:30:05 +0200 units-filter (0.9.7-1) unstable; urgency=low * Initial Release. -- Georges Khaznadar Tue, 30 Apr 2002 19:41:41 +0200 debian/rules0000755000000000000000000000073012143754330010250 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_HARDENING=1 %: dh $@