Advertisement
MWTab

PKGBUILD update for weather archlinux aur

Jan 26th, 2020
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.41 KB | None | 0 0
  1. diff --git a/PKGBUILD b/PKGBUILD
  2. index 53a64f3..9b61619 100644
  3. --- a/PKGBUILD
  4. +++ b/PKGBUILD
  5. @@ -3,19 +3,23 @@
  6.  # Contributor: Abhishek Dasgupta <abhidg@gmail.com>
  7.  
  8.  pkgname=weather
  9. -pkgver=2.1
  10. +pkgver=2.3
  11.  pkgrel=1
  12.  pkgdesc="CLI tool which shows weather forecasts from METAR data"
  13.  arch=('any')
  14.  url="http://fungi.yuggoth.org/weather/"
  15. -depends=('python2')
  16. +depends=('python')
  17.  license=("custom:BSD2")
  18. -source=(http://fungi.yuggoth.org/weather/src/$pkgname-$pkgver.tar.gz)
  19. -md5sums=('51ddb7bc5e9e36d01e615834cc0442dd')
  20. +source=(http://fungi.yuggoth.org/weather/src/$pkgname-$pkgver.tar.gz
  21. +        fix-python-warnings.patch)
  22. +md5sums=('1356e37f74097007b20987742927921b'
  23. +         '853d4ab150d4aea03b9494c4cb62327f')
  24.  
  25.  build() {
  26.    cd "$srcdir/$pkgname-$pkgver"
  27. -  sed -i 's|env python|env python2|' *
  28. +
  29. +  # apply warning patch
  30. +  patch -i ../fix-python-warnings.patch
  31.  
  32.    # set up correlation sets
  33.    sed -i 's| else: default_setpath = ".:~/.weather|&:/usr/share/weather-util|' weather.py
  34. @@ -29,7 +33,7 @@ package() {
  35.    install -Dm644 zctas    "$pkgdir/usr/share/weather-util/zctas"
  36.    install -Dm644 zones    "$pkgdir/usr/share/weather-util/zones"
  37.  
  38. -  _python_path=$(python2 -c "import sys ; print [p for p in sys.path if p.startswith('/usr/lib/python2.')][0]")
  39. +  _python_path=$(python -c "import sys ; print([p for p in sys.path if p.startswith('/usr/lib/python3.')][0])")
  40.    install -Dm755 weather    "$pkgdir/usr/bin/weather-report"
  41.    install -Dm644 weather.py "$pkgdir/$_python_path/weather.py"
  42.  
  43. diff --git a/fix-python-warnings.patch b/fix-python-warnings.patch
  44. new file mode 100644
  45. index 0000000..9541af5
  46. --- /dev/null
  47. +++ b/fix-python-warnings.patch
  48. @@ -0,0 +1,20 @@
  49. +--- weather.py.orig    2020-01-26 13:11:35.460406158 -0800
  50. ++++ weather.py 2020-01-26 13:11:39.390457869 -0800
  51. +@@ -1089,7 +1089,7 @@
  52. +             print(
  53. +                 "   (proximity %s, %.3gkm, %.3gmi)" % ( score, km, mi )
  54. +             )
  55. +-        elif searchtype is "coordinates":
  56. ++        elif searchtype == "coordinates":
  57. +             print( "   (%.3gkm, %.3gmi)" % (km, mi) )
  58. +         if zone[0]:
  59. +             print(
  60. +@@ -1105,7 +1105,7 @@
  61. +             print(
  62. +                 "   (proximity %s, %.3gkm, %.3gmi)" % ( score, km, mi )
  63. +             )
  64. +-        elif searchtype is "coordinates" and zone[0]:
  65. ++        elif searchtype == "coordinates" and zone[0]:
  66. +             print( "   (%.3gkm, %.3gmi)" % (km, mi) )
  67. +     if cache_search:
  68. +         now = time.time()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement