r41331 - in /trunk/libmath-calc-units-perl: Changes META.yml Units.pm debian/README.source debian/changelog debian/control debian/copyright debian/examples debian/libmath-calc-units-perl.examples debian/rules script/ucalc
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Wed Aug 5 01:53:08 UTC 2009
Author: jawnsy-guest
Date: Wed Aug 5 01:53:02 2009
New Revision: 41331
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=41331
Log:
* New upstream release
+ Add a warning for incorrect usage of "-c"
* Standards-Version 3.8.2 (no changes)
* Added myself to Copyright and Uploaders
* Updated to perl (>= 5.6.0-16) in B-D-I (Perl Policy)
* Add a README.source
* Move examples -> libmath-calc-units-perl.examples
Added:
trunk/libmath-calc-units-perl/debian/README.source
trunk/libmath-calc-units-perl/debian/libmath-calc-units-perl.examples
- copied unchanged from r41330, trunk/libmath-calc-units-perl/debian/examples
Removed:
trunk/libmath-calc-units-perl/debian/examples
Modified:
trunk/libmath-calc-units-perl/Changes
trunk/libmath-calc-units-perl/META.yml
trunk/libmath-calc-units-perl/Units.pm
trunk/libmath-calc-units-perl/debian/changelog
trunk/libmath-calc-units-perl/debian/control
trunk/libmath-calc-units-perl/debian/copyright
trunk/libmath-calc-units-perl/debian/rules
trunk/libmath-calc-units-perl/script/ucalc
Modified: trunk/libmath-calc-units-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/Changes?rev=41331&op=diff
==============================================================================
--- trunk/libmath-calc-units-perl/Changes (original)
+++ trunk/libmath-calc-units-perl/Changes Wed Aug 5 01:53:02 2009
@@ -1,7 +1,28 @@
Revision history for Perl extension Math::Calc::Units.
-1.00 Fri Aug 10 12:36:10 2001
- - original version; created by h2xs 1.19
+1.07 Tue Aug 4 2009
+ - Add a warning when -c used incorrectly
+
+1.06 Tue Oct 25 17:29:00 2005
+ - silly release to bump up kwalitee score
+
+1.05 Tue Oct 25 17:29:00 2005
+ - implemented distances
+ - cleaned up a few uses of uninitialized stuff
+
+1.04
+ - Implemented -a flag (aka abbreviate=>1 option) to spit out
+ abbreviated units
+
+1.03
+ - Fixed 0.89 gigabytes getting described as gigabits
+
+1.02 Mon Oct 22 20:01:27 2001
+ - added timestamps
+ - added dates
+ - added constructor syntax for timestamps & dates
+ - fixed endless recursion bug
+ - added years (ugh... inexact unit)
1.01 Fri Sep 4
- added unit breakdowns (2 hour 46 minute)
@@ -10,22 +31,5 @@
- added major unit preference ordering
- added out-of-range preference estimation
-1.02 Mon Oct 22 20:01:27 2001
- - added timestamps
- - added dates
- - added constructor syntax for timestamps & dates
- - fixed endless recursion bug
- - added years (ugh... inexact unit)
-
-1.03
- - Fixed 0.89 gigabytes getting described as gigabits
-
-1.04
- - Implemented -a flag (aka abbreviate=>1 option) to spit out abbreviated units
-
-1.05 Tue Oct 25 17:29:00 2005
- - implemented distances
- - cleaned up a few uses of uninitialized stuff
-
-1.06 Tue Oct 25 17:29:00 2005
- - silly release to bump up kwalitee score
+1.00 Fri Aug 10 12:36:10 2001
+ - original version; created by h2xs 1.19
Modified: trunk/libmath-calc-units-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/META.yml?rev=41331&op=diff
==============================================================================
--- trunk/libmath-calc-units-perl/META.yml (original)
+++ trunk/libmath-calc-units-perl/META.yml Wed Aug 5 01:53:02 2009
@@ -1,13 +1,20 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Math-Calc-Units
-version: 1.06
-version_from: Units.pm
-installdirs: site
-requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
-license: perl
-recommends:
- Time::Local: 0
+--- #YAML:1.0
+name: Math-Calc-Units
+version: 1.07
+abstract: ~
+author: []
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires: {}
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.50
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: trunk/libmath-calc-units-perl/Units.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/Units.pm?rev=41331&op=diff
==============================================================================
--- trunk/libmath-calc-units-perl/Units.pm (original)
+++ trunk/libmath-calc-units-perl/Units.pm Wed Aug 5 01:53:02 2009
@@ -7,7 +7,7 @@
use base 'Exporter';
use vars qw($VERSION @EXPORT_OK);
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.07';
@EXPORT_OK = qw(calc readable convert equal exact);
}
use strict;
@@ -33,7 +33,7 @@
return map { render($_, \%options) } choose_juicy_ones($v, \%options);
}
-# convert : string x string -> string
+# convert : string x string [ x boolean ] -> string
sub convert ($$;$) {
my ($expr, $units, $exact) = @_;
my $v = compute($expr);
Added: trunk/libmath-calc-units-perl/debian/README.source
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/debian/README.source?rev=41331&op=file
==============================================================================
--- trunk/libmath-calc-units-perl/debian/README.source (added)
+++ trunk/libmath-calc-units-perl/debian/README.source Wed Aug 5 01:53:02 2009
@@ -1,0 +1,5 @@
+This package uses quilt to manage all modifications to the upstream
+source. Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+See /usr/share/doc/quilt/README.source for a detailed explanation.
Modified: trunk/libmath-calc-units-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/debian/changelog?rev=41331&op=diff
==============================================================================
--- trunk/libmath-calc-units-perl/debian/changelog (original)
+++ trunk/libmath-calc-units-perl/debian/changelog Wed Aug 5 01:53:02 2009
@@ -1,4 +1,13 @@
-libmath-calc-units-perl (1.06-2) UNRELEASED; urgency=low
+libmath-calc-units-perl (1.07-1) UNRELEASED; urgency=low
+
+ [ Jonathan Yu ]
+ * New upstream release
+ + Add a warning for incorrect usage of "-c"
+ * Standards-Version 3.8.2 (no changes)
+ * Added myself to Copyright and Uploaders
+ * Updated to perl (>= 5.6.0-16) in B-D-I (Perl Policy)
+ * Add a README.source
+ * Move examples -> libmath-calc-units-perl.examples
[ gregor herrmann ]
* debian/control: finish incomplete long description, thanks to Rhonda for
@@ -7,7 +16,7 @@
[ Nathan Handler ]
* debian/watch: Update to ignore development releases.
- -- gregor herrmann <gregoa at debian.org> Fri, 20 Mar 2009 15:18:53 +0100
+ -- Jonathan Yu <frequency at cpan.org> Tue, 04 Aug 2009 17:45:39 -0400
libmath-calc-units-perl (1.06-1) unstable; urgency=low
Modified: trunk/libmath-calc-units-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/debian/control?rev=41331&op=diff
==============================================================================
--- trunk/libmath-calc-units-perl/debian/control (original)
+++ trunk/libmath-calc-units-perl/debian/control Wed Aug 5 01:53:02 2009
@@ -1,11 +1,11 @@
Source: libmath-calc-units-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7), quilt
-Build-Depends-Indep: perl (>= 5.6.0-12), libtest-pod-perl
+Build-Depends: debhelper (>= 7.0.8), quilt (>= 0.46-7)
+Build-Depends-Indep: perl (>= 5.6.0-16), libtest-pod-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Ryan Niebur <ryanryan52 at gmail.com>
-Standards-Version: 3.8.0
+Uploaders: Ryan Niebur <ryanryan52 at gmail.com>, Jonathan Yu <frequency at cpan.org>
+Standards-Version: 3.8.2
Homepage: http://search.cpan.org/dist/Math-Calc-Units/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libmath-calc-units-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libmath-calc-units-perl/
@@ -13,21 +13,12 @@
Package: libmath-calc-units-perl
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends}
-Description: human-readable unit-aware calculator
- Math::Calc::Units is a simple calculator that keeps track of units. It
- currently handles combinations of byte sizes and duration only, although
- adding any other multiplicative types is easy. Any unknown type is treated as
- a unique user type (with some effort to map English plurals to their singular
- forms).
+Description: Human-readable unit-aware calculator
+ Math::Calc::Units is a simple calculator that keeps track of units. It only
+ handles combinations of byte sizes and duration only, though adding any other
+ multiplicative types is easy. Any unknown type is treated as a unique user
+ type (with some effort to map English plurals to their singular forms).
.
- The primary intended use is via the ucalc script that prints out all of the
- "readable" variants of a value. For example, "3 bytes" will only produce "3
- byte", but "3 byte / sec" produces the original along with "180 byte /
- minute", "10.55 kilobyte / hour", etc.
- .
- The Math::Calc::Units interface only provides for string-based computations,
- which could result in a large loss of precision for some applications. If you
- need the exact result, you may pass in an extra parameter 'exact' to calc or
- convert, causing them to return a 2-element list containing the numerical
- result and a string describing the units of that result; in scalar context,
- they just return the numeric value.
+ The included 'ucalc' program prints out all of the "readable" variants of a
+ value. For example, "3 bytes" will only produce "3 byte", but "3 byte/sec"
+ produces the original along with "180 byte/minute", etc.
Modified: trunk/libmath-calc-units-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/debian/copyright?rev=41331&op=diff
==============================================================================
--- trunk/libmath-calc-units-perl/debian/copyright (original)
+++ trunk/libmath-calc-units-perl/debian/copyright Wed Aug 5 01:53:02 2009
@@ -15,7 +15,8 @@
License: Artistic | GPL-1+
Files: debian/*
-Copyright: 2009, Ryan Niebur <ryanryan52 at gmail.com>
+Copyright: 2009, Jonathan Yu <frequency at cpan.org>
+ 2009, Ryan Niebur <ryanryan52 at gmail.com>
License: Artistic | GPL-1+
License: Artistic
Modified: trunk/libmath-calc-units-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/debian/rules?rev=41331&op=diff
==============================================================================
--- trunk/libmath-calc-units-perl/debian/rules (original)
+++ trunk/libmath-calc-units-perl/debian/rules Wed Aug 5 01:53:02 2009
@@ -1,26 +1,4 @@
#!/usr/bin/make -f
-include /usr/share/quilt/quilt.make
-
-build: build-stamp
-build-stamp: $(QUILT_STAMPFN)
- dh build
- touch $@
-
-clean: unpatch
- [ ! -f Makefile ] || touch Makefile
- dh $@
-
-install: install-stamp
-install-stamp: build-stamp
- dh install
- touch $@
-
-binary-arch:
-
-binary-indep: install
- dh $@
-
-binary: binary-arch binary-indep
-
-.PHONY: binary binary-arch binary-indep install clean build
+%:
+ dh --with quilt $@
Modified: trunk/libmath-calc-units-perl/script/ucalc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-calc-units-perl/script/ucalc?rev=41331&op=diff
==============================================================================
--- trunk/libmath-calc-units-perl/script/ucalc (original)
+++ trunk/libmath-calc-units-perl/script/ucalc Wed Aug 5 01:53:02 2009
@@ -1,43 +1,48 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
use Getopt::Long;
+use File::Basename qw(basename);
use Math::Calc::Units qw(convert readable calc);
+
+use strict;
+use warnings;
sub usage {
my ($msg, $bad) = @_;
my $out = $bad ? *STDERR : *STDOUT;
+ my $CMD = basename($0);
if ($msg) {
- print $out "$0: $msg\n";
+ print $out "$CMD: $msg\n";
}
print $out <<"END";
usage:
Calculate the given expression, and guess human-readable units for the result:
- $0 [-v] [-a] <expr>
+ $CMD [-v] [-a] <expr>
Convert the given expression to the requested units:
- $0 -c <expr> <unit>
- $0 --convert <expr> <unit>
+ $CMD -c <expr> <unit>
+ $CMD --convert <expr> <unit>
Examples:
How long does it take to download 10MB over a 384 kilobit/sec connection?
- $0 "10MB / 384Kbps"
+ $CMD "10MB / 384Kbps"
What is the expected I/O rate for 8KB reads on a disk that reads at 20MB/sec
and has an average seek time of 15ms?
- $0 "8KB / (8KB/(20MB/sec) + 15ms)"
+ $CMD "8KB / (8KB/(20MB/sec) + 15ms)"
Or if you prefer to calculate that by figuring out the number of seconds
per byte and inverting:
- $0 "((1sec/20MB) + 15ms/8KB) ** -1"
+ $CMD "((1sec/20MB) + 15ms/8KB) ** -1"
How many gigabytes can you transfer in a week at 2MB/sec?
- $0 -c "2MB/sec" "GB/week"
+ $CMD -c "2MB/sec" "GB/week"
How many angels fit on the heads of 17 pins (with some assumptions)?
(This demonstrates that unknown units are allowed, with plurals.)
- $0 "42 angels/pinhead * 17 pinheads"
+ $CMD "42 angels/pinhead * 17 pinheads"
END
exit($bad ? 1 : 0);
@@ -57,7 +62,11 @@
if ($action eq 'convert') {
usage("not enough args", 1) if (@ARGV < 2);
usage("too many args", 1) if (@ARGV > 2);
- print convert($ARGV[0], $ARGV[1]), "\n";
+ my ($expr, $units) = @ARGV;
+ if ($units =~ /^\s*\d+/) {
+ warn("WARNING: Destination units in conversion should probably not have a value\n");
+ }
+ print convert($expr, $units), "\n";
} elsif ($action eq 'readable') {
usage("", 0) if @ARGV == 0;
usage("too many ARGV", 1) if (@ARGV > 1);
More information about the Pkg-perl-cvs-commits
mailing list