Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/PKGBUILD b/PKGBUILD
- index 53a64f3..9b61619 100644
- --- a/PKGBUILD
- +++ b/PKGBUILD
- @@ -3,19 +3,23 @@
- # Contributor: Abhishek Dasgupta <abhidg@gmail.com>
- pkgname=weather
- -pkgver=2.1
- +pkgver=2.3
- pkgrel=1
- pkgdesc="CLI tool which shows weather forecasts from METAR data"
- arch=('any')
- url="http://fungi.yuggoth.org/weather/"
- -depends=('python2')
- +depends=('python')
- license=("custom:BSD2")
- -source=(http://fungi.yuggoth.org/weather/src/$pkgname-$pkgver.tar.gz)
- -md5sums=('51ddb7bc5e9e36d01e615834cc0442dd')
- +source=(http://fungi.yuggoth.org/weather/src/$pkgname-$pkgver.tar.gz
- + fix-python-warnings.patch)
- +md5sums=('1356e37f74097007b20987742927921b'
- + '853d4ab150d4aea03b9494c4cb62327f')
- build() {
- cd "$srcdir/$pkgname-$pkgver"
- - sed -i 's|env python|env python2|' *
- +
- + # apply warning patch
- + patch -i ../fix-python-warnings.patch
- # set up correlation sets
- sed -i 's| else: default_setpath = ".:~/.weather|&:/usr/share/weather-util|' weather.py
- @@ -29,7 +33,7 @@ package() {
- install -Dm644 zctas "$pkgdir/usr/share/weather-util/zctas"
- install -Dm644 zones "$pkgdir/usr/share/weather-util/zones"
- - _python_path=$(python2 -c "import sys ; print [p for p in sys.path if p.startswith('/usr/lib/python2.')][0]")
- + _python_path=$(python -c "import sys ; print([p for p in sys.path if p.startswith('/usr/lib/python3.')][0])")
- install -Dm755 weather "$pkgdir/usr/bin/weather-report"
- install -Dm644 weather.py "$pkgdir/$_python_path/weather.py"
- diff --git a/fix-python-warnings.patch b/fix-python-warnings.patch
- new file mode 100644
- index 0000000..9541af5
- --- /dev/null
- +++ b/fix-python-warnings.patch
- @@ -0,0 +1,20 @@
- +--- weather.py.orig 2020-01-26 13:11:35.460406158 -0800
- ++++ weather.py 2020-01-26 13:11:39.390457869 -0800
- +@@ -1089,7 +1089,7 @@
- + print(
- + " (proximity %s, %.3gkm, %.3gmi)" % ( score, km, mi )
- + )
- +- elif searchtype is "coordinates":
- ++ elif searchtype == "coordinates":
- + print( " (%.3gkm, %.3gmi)" % (km, mi) )
- + if zone[0]:
- + print(
- +@@ -1105,7 +1105,7 @@
- + print(
- + " (proximity %s, %.3gkm, %.3gmi)" % ( score, km, mi )
- + )
- +- elif searchtype is "coordinates" and zone[0]:
- ++ elif searchtype == "coordinates" and zone[0]:
- + print( " (%.3gkm, %.3gmi)" % (km, mi) )
- + if cache_search:
- + now = time.time()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement