summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2013-07-08 10:27:57 +0000
committerJeroen Roovers <jer@gentoo.org>2013-07-08 10:27:57 +0000
commitf39b73fdd0fd51e06c893ee5d26c4902f5535b45 (patch)
tree818aa8cb9e6a7aaf77c0976ee9415b43ec50dc04 /sci-calculators
parentppc stable. bug #475834 (diff)
downloadhistorical-f39b73fdd0fd51e06c893ee5d26c4902f5535b45.tar.gz
historical-f39b73fdd0fd51e06c893ee5d26c4902f5535b45.tar.bz2
historical-f39b73fdd0fd51e06c893ee5d26c4902f5535b45.zip
The file is smaller than the patch.
Package-Manager: portage-2.2.0_alpha187/cvs/Linux x86_64 Manifest-Sign-Key: 0xA792A613
Diffstat (limited to 'sci-calculators')
-rw-r--r--sci-calculators/units/ChangeLog8
-rw-r--r--sci-calculators/units/Manifest12
-rwxr-xr-xsci-calculators/units/files/units-2.01_cur84
-rw-r--r--sci-calculators/units/files/units-2.01_cur.patch100
-rw-r--r--sci-calculators/units/units-2.01-r3.ebuild (renamed from sci-calculators/units/units-2.01-r2.ebuild)8
5 files changed, 100 insertions, 112 deletions
diff --git a/sci-calculators/units/ChangeLog b/sci-calculators/units/ChangeLog
index efd9cdc3f47c..316b72abad9c 100644
--- a/sci-calculators/units/ChangeLog
+++ b/sci-calculators/units/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sci-calculators/units
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-calculators/units/ChangeLog,v 1.56 2013/07/06 15:40:41 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-calculators/units/ChangeLog,v 1.57 2013/07/08 10:27:56 jer Exp $
+
+*units-2.01-r3 (08 Jul 2013)
+
+ 08 Jul 2013; Jeroen Roovers <jer@gentoo.org> -units-2.01-r2.ebuild,
+ +units-2.01-r3.ebuild, +files/units-2.01_cur, -files/units-2.01_cur.patch:
+ The file is smaller than the patch.
*units-2.01-r2 (06 Jul 2013)
diff --git a/sci-calculators/units/Manifest b/sci-calculators/units/Manifest
index 54c7ab632c37..0b6f3906c440 100644
--- a/sci-calculators/units/Manifest
+++ b/sci-calculators/units/Manifest
@@ -2,16 +2,16 @@
Hash: SHA256
AUX units-2.01-install.patch 2008 SHA256 7487ec8d4d887cae48e6696361a5777b461eec48f1f2d2100b15fc593a578ab1 SHA512 73dfabad8fdbf24798e51f5104c0a68b28b30c53b162c28facd36cc53f5d68afa269decc04d4055475b17b4e5d932f449d174b41aab9546b5e6f2e32e0410203 WHIRLPOOL a3da2bc69feeb54360284e3d1158d68a2e0c29f784348b0e47c953d676c1398e1dd3d221b9800b4a4c5c32d98320bd2606df66e5fd7698385fb9a7e742e263d2
-AUX units-2.01_cur.patch 2726 SHA256 1c2d399b9b72ff6177b11c04752517eca35af0acc3ecf1be15a04e048e92ddc0 SHA512 f8f361de006991a1694b3654cf2e442c6a4f568123b50b39ebe1c621ba9c171e495b91a1a78cadd94d6727e42820a83f2c04e77b6bed57b0c2ebffc7166ffbb9 WHIRLPOOL 08c92081bd5e75c5218ee35cccc2e7d0c31fe304d17ef6983da88665e6eca495d6fa7b006b167436c6af882f18575089ce103b286f44675deb797b2215a3f933
+AUX units-2.01_cur 2528 SHA256 9293612bef7fb2fca8700dad7b739d860c424ba1020cc8ea351962b22b018505 SHA512 af79e9606b9df8f0cbb657b8ba3175094276330b92d954e82278e83e9d910adf67e89ff751633d582c33bfb7353e4b997eb1a14441bfd2eaf358dcb215d97093 WHIRLPOOL 2e73cbd3b3c5ffcba7191feec1626313a44c0c389889924e39cfe0c4356628dba15d7661b9841f233f69daa801120fba86eafb6383aa2060bd379126b5bd1b35
DIST units-2.01.tar.gz 709368 SHA256 138b12c70bffa0e484fdfe579927412b1ac573e8351c17d8938592f9ba9a88f2 SHA512 ddaa9d8ad84aea963e84379f6d5d6298ec0431c56ba2c805a5fbc3695504279a7ba81609e33bb9d52771ee3ca739570b925d30aa1637dacb5a90d8c8c483fd37 WHIRLPOOL 1c97a5ca7b2e351773eae5850a30680817a5788f8324bd37d2d8632e8a3fcf2a9da7dd59ee0d415bc8617c1e89fcc2a82ac4a51e27f76a1ac8b77321ea035e17
-EBUILD units-2.01-r2.ebuild 797 SHA256 e6c27b7dfac3f00ce7ecd1e20c4c5786f46384889d40b87d393621ab4149c401 SHA512 276f30e5836c621c33ef6a6747c5af8187387b082840c2e461330c62258ed3e1d9d26127d106479a8d462616ff9f5337e81a7bbb3d7627a490235a71b98bd769 WHIRLPOOL d9a5c1e5cba184e535b37b0b5937f345833fba0907acd84adc063d90fd475a69c818af705719063a1dc01e89ea48cc9e858e704734cf72e0dccddcdd6a07e7dc
+EBUILD units-2.01-r3.ebuild 796 SHA256 b4a8366154b3b1e7c6792ce9c0eedc01742b0b1ee26945d0fee3b52f3d7d71d5 SHA512 4088a556dd0f8e6e188430138511591d4a6c9f61f96f7b3dbbff009c0371ea9a6d9a4209378bef6097c88e374db83d5c37ea810fc19a58e45fe97827881dd422 WHIRLPOOL ffd5505c445c858dde78428fc28b6541645af89e434f0cdf245eda925f82b6f4b320eea53babaaed20822ff35f688e82480ebd7736fa68548863460492a54e23
EBUILD units-2.01.ebuild 824 SHA256 a8313ec940a23cb7c071c2a64b7ec6d3f5fb5e1f06dda6e5626dcb914d87c664 SHA512 d12a93bc2233da45de60cc4cf2d68c1423e20d15751aaa18057c721979450c14694ca9b172b57840ddb9437143941c544017ae1452b64909054e47f9dd4d158b WHIRLPOOL e624f4c8b45a51d436bb49a93030cbb8c3d541726f5e7a4650248ad160956d1bdad103172c7725a67b13fc839c54509717eeba9591f010ce683a67cfe4dcd6ca
-MISC ChangeLog 8317 SHA256 f279facaac40604f4b819d15135ce8824bfae538d1c796e09025c97d73e11133 SHA512 370c723d3e6cf38e34a0744f9399e8e1bac2f4725e14d426eaa637413efaf13eee08c1a981e6983c6d30f1479367aff96ab631830dce1bbad40553633a06d09b WHIRLPOOL 1d70991263f6c31b2bab7f8afa421076132eb384f27b0413f630328c9e2fc9d1245cf23a03367fcc2831851c1d48b16bc13d979121dc60d7ec9b7a9e9a3c3778
+MISC ChangeLog 8533 SHA256 1e329a22dfa3163188d2530daa9e2148d0c0c9aa17314438e504591c6ed99295 SHA512 56f92419e3018b5491980a95e6a14446aa5a139686e9cdae9eca36f1500d6bfa713a855b8becc6d73ba2a0f7f67eebdb826aa950dbf8cd0907b660ad4e82b228 WHIRLPOOL b9aef2770e465612fbbf4b1380c85c2f726cb8002d14e44b6b417d6f012370e02b2b1ca6fe3fc78e21e80b53479f5662425eadbd56e2ea854b6d64e3d5417b30
MISC metadata.xml 224 SHA256 d7ffc52704d4bc0180f6f1c448ea4bdd0e3ff3a562384dc944af4a00debc9620 SHA512 6487ad35c6f3d2e4876714919e7bb01fd65f57e7753cbfc318130727dded4fcf8632a06ab9b7a3016fc1ab127434d1d20de2dd0ef2cc63ad162023f2dbf64b1e WHIRLPOOL 879ad2c41f2e1297b677803b2b0478ed2affc91059b198524795e1a128cf8ab6b9fbe78b53bdd3421041f27b419bce387a267e389111125cd55b05e260abc998
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
-iEYEAREIAAYFAlHYOnsACgkQVWmRsqeSphNJwQCcDH7TaBuyf3Wzj2ZeumWMLXd/
-u34An0N25tdxGbYE37lcsEI/EjRNf9ZK
-=dbw1
+iEYEAREIAAYFAlHalC0ACgkQVWmRsqeSphMCagCcC+Fd2wLAdBPesoCOOxRcfG0p
+e64An24PCX7owef/td1t4xVEpFz/mb9o
+=6lzk
-----END PGP SIGNATURE-----
diff --git a/sci-calculators/units/files/units-2.01_cur b/sci-calculators/units/files/units-2.01_cur
new file mode 100755
index 000000000000..7d27921f9ee3
--- /dev/null
+++ b/sci-calculators/units/files/units-2.01_cur
@@ -0,0 +1,84 @@
+#!/usr/bin/python2
+
+import datetime
+import sys
+import urllib
+import xml.etree.ElementTree as ET
+
+outfile = 'currency.units'
+outstr = ''
+
+if len(sys.argv)==2:
+ outfile = sys.argv[1]
+elif len(sys.argv)>2:
+ sys.stderr.write('Usage: {0} [filename]\n\n'.format(sys.argv[0]))
+ sys.stderr.write('Update currency information for \'units\' into the specified\n')
+ sys.stderr.write('filename or the default location, \'{0}\'.\n'.format(outfile))
+ sys.exit(1)
+
+try:
+ currencies = ET.parse(urllib.urlopen('http://rss.timegenie.com/forex.xml')).findall('data')
+except IOError, exc:
+ sys.stderr.write('Error connecting to currency server. {0}\n'.format(exc))
+ sys.exit(1)
+
+# print codes here
+
+outstr += '# ISO Currency Codes\n\n'
+
+maxlen = 0
+
+for currency in currencies:
+ code = currency.find('code').text
+ description = currency.find('description').text.lower().replace(' ','')
+ currency.find('description').text = description
+ outstr += code + ' '*20 + description + '\n'
+ if len(currency.find('description').text) > maxlen:
+ maxlen = len(currency.find('description').text)
+ if currency.find('code').text == 'USD':
+ usdval = currency.find('rate').text[2:]
+ currency.remove
+
+# print rates here
+
+now = datetime.datetime.now()
+outstr += '\n# Currency exchange rates from Time Genie (www.timegenie.com)\n'
+outstr += '\n!message Currency exchange rates from ' + now.strftime('%Y-%m-%d') + '\n\n'
+
+for currency in currencies:
+ if currency.find('code').text == 'EUR':
+ euro = currency.find('rate').text
+ currency.find('rate').text = usdval + ' US$'
+
+ else:
+ currency.find('rate').text += ' euro'
+ outstr += currency.find('description').text.ljust(maxlen+2) + '1|' + currency.find('rate').text + '\n'
+
+# precious metals prices
+
+# Another source for this data might be
+# http://www.xmlcharts.com/cache/precious-metals.xml
+
+outstr += '\n# Precious metals prices from http://services.packetizer.com/spotprices/\n\n'
+
+try:
+ spotprices = ET.parse(urllib.urlopen('http://services.packetizer.com/spotprices/?f=xml'))
+except IOError, exc:
+ sys.stderr.write('Error connecting to spotprices server. {0}\n'.format(exc))
+ sys.exit(1)
+
+metals = ['gold','platinum','silver']
+
+for metal in metals:
+ outstr += '{0} {1} US$/troyounce\n'.format((metal+'price').ljust(15), spotprices.find(metal).text)
+
+try:
+ if outfile == '-':
+ outfile = sys.stdout
+ else:
+ outfile = open(outfile,'w')
+except IOError, exc:
+ sys.stderr.write('Unable to write to output file. {0}\n'.format(exc))
+ sys.exit(1)
+
+outfile.write(outstr)
diff --git a/sci-calculators/units/files/units-2.01_cur.patch b/sci-calculators/units/files/units-2.01_cur.patch
deleted file mode 100644
index 03e09f77c9fa..000000000000
--- a/sci-calculators/units/files/units-2.01_cur.patch
+++ /dev/null
@@ -1,100 +0,0 @@
---- a/units_cur
-+++ b/units_cur
-@@ -1,10 +1,11 @@
--#!/usr/bin/python
-+#!/usr/bin/python2
-
- import urllib
- import datetime
- from xml.dom import minidom
- import sys
- import re
-+import xml.etree.ElementTree as ET
-
- outfile = 'currency.units'
-
-@@ -26,51 +27,54 @@
- sys.exit(1)
-
- try:
-- data = urllib.urlopen('http://rss.timegenie.com/forex.txt').readlines()
-+ data = ET.parse(urllib.urlopen('http://rss.timegenie.com/forex.xml')).findall('data')
- except IOError, exc:
- sys.stderr.write('Error connecting to currency server. {0}\n'.format(exc))
- sys.exit(1)
-
--if not re.match(r"[A-Z]{3}\|[A-Za-z ]*\|[0-9.]*",data[0]):
-- sys.stderr.write('Something wrong with timegenie reply\n')
-- sys.exit(1)
--
--splitdata = [x.split('|') for x in data]
--
--codes = [x[0] for x in splitdata]
--names = [x[1].lower().replace(' ','') for x in splitdata]
--values = ['1|' + x[2].rstrip('\n') for x in splitdata]
--
-+# <forex>
-+# <data>
-+# <code>AED</code>
-+# <description>United Arab Emirates Dirham</description>
-+# <rate>4.8013</rate>
-+# </data>
-+# </forex>
-
- # print codes here
-
- output.write('# ISO Currency Codes\n\n')
-
--for x in zip(codes, names):
-- output.write(('{0}' + ' '*20 + '{1}\n').format(*x))
--
--usd = codes.index('USD')
--euro = codes.index('EUR')
--usdval = values[usd][2:] # Trim off leading 1|
--
--values = [x+' euro' for x in values]
--
--values[euro] = usdval + ' US$'
--
--del names[usd]
--del values[usd]
--
--# print values here
-+for datum in data:
-+ code = datum.find('code').text
-+ description = datum.find('description').text.lower().replace(' ','')
-+ datum.find('description').text = description
-+ output.write(code + ' '*20 + description + '\n')
-+
-+# print rates here
-+
-+for datum in data:
-+ if datum.find('code').text == 'USD':
-+ usdval = datum.find('rate').text[2:]
-+ data.remove(datum)
-
- now = datetime.datetime.now()
- output.write('\n# Currency exchange rates from Time Genie (www.timegenie.com)\n')
- output.write('\n!message Currency exchange rates from ' + now.strftime('%Y-%m-%d') + '\n\n')
-+maxlen = 0
-
--maxlen = max(map(len,names))
--names = [x.ljust(maxlen+2) for x in names]
--for x in zip(names, values):
-- output.write('{0}{1}\n'.format(*x))
-+for datum in data:
-+ if len(datum.find('description').text) > maxlen:
-+ maxlen = len(datum.find('description').text)
-+
-+ if datum.find('code').text == 'EUR':
-+ euro = datum.find('rate').text
-+ datum.find('rate').text = usdval + ' US$'
-+
-+ else:
-+ datum.find('rate').text += ' euro'
-+ output.write(datum.find('description').text.ljust(maxlen+2) + '1|' + datum.find('rate').text + '\n')
-
-+# precious metals prices
-
- output.write('\n# Precious metals prices from http://services.packetizer.com/spotprices/\n\n')
-
diff --git a/sci-calculators/units/units-2.01-r2.ebuild b/sci-calculators/units/units-2.01-r3.ebuild
index 74de3f9c120d..706afc556e24 100644
--- a/sci-calculators/units/units-2.01-r2.ebuild
+++ b/sci-calculators/units/units-2.01-r3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-calculators/units/units-2.01-r2.ebuild,v 1.1 2013/07/06 15:40:41 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-calculators/units/units-2.01-r3.ebuild,v 1.1 2013/07/08 10:27:56 jer Exp $
EAPI=5
inherit autotools eutils
@@ -29,9 +29,7 @@ RDEPEND="
DOCS=( ChangeLog NEWS README )
src_prepare() {
- epatch \
- "${FILESDIR}"/${P}-install.patch \
- "${FILESDIR}"/${P}_cur.patch
-
+ epatch "${FILESDIR}"/${P}-install.patch
+ cp "${FILESDIR}"/${P}_cur ${PN}_cur
eautoreconf
}