[arch-commits] Commit in haskell-hackage-db/trunk (2 files)

Felix Yan felixonmars at archlinux.org
Sun May 16 09:10:40 UTC 2021


    Date: Sunday, May 16, 2021 @ 09:10:39
  Author: felixonmars
Revision: 935711

upgpkg: haskell-hackage-db 2.1.1-2: add a patch to fix serious bug in arch-hs

Added:
  haskell-hackage-db/trunk/fix-parsing-of-preferred-version-ranges.patch
Modified:
  haskell-hackage-db/trunk/PKGBUILD

-----------------------------------------------+
 PKGBUILD                                      |   14 ++++-
 fix-parsing-of-preferred-version-ranges.patch |   63 ++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-05-16 09:10:26 UTC (rev 935710)
+++ PKGBUILD	2021-05-16 09:10:39 UTC (rev 935711)
@@ -3,7 +3,7 @@
 _hkgname=hackage-db
 pkgname=haskell-hackage-db
 pkgver=2.1.1
-pkgrel=1
+pkgrel=2
 pkgdesc="Access cabal-install's Hackage database via Data.Map"
 url="https://github.com/peti/hackage-db#readme"
 license=("BSD")
@@ -10,9 +10,17 @@
 arch=('x86_64')
 depends=('ghc-libs' 'haskell-aeson' 'haskell-tar' 'haskell-utf8-string')
 makedepends=('ghc')
-source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz")
-sha512sums=('fada91ffbad436148bfe14c7b44fd2a8682fac6d4ccedd3a86ae49767f1604e723e42b0d712f0edae2797e19c15a80ab6fb4d6e9902ee4125af02b38f3bdbe32')
+source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz"
+        fix-parsing-of-preferred-version-ranges.patch)
+sha512sums=('fada91ffbad436148bfe14c7b44fd2a8682fac6d4ccedd3a86ae49767f1604e723e42b0d712f0edae2797e19c15a80ab6fb4d6e9902ee4125af02b38f3bdbe32'
+            '3987e08584360fe8d28ada30e5424df8406e4783c05787bf6bebac8fc572ef7ddebc959b3877471c6482d8dc2de24b2628410521ce8a0926c0d765d84b785b15')
 
+prepare() {
+  cd $_hkgname-$pkgver
+  # https://github.com/peti/hackage-db/pull/13
+  patch -p1 -i ../fix-parsing-of-preferred-version-ranges.patch
+}
+
 build() {
   cd $_hkgname-$pkgver    
 

Added: fix-parsing-of-preferred-version-ranges.patch
===================================================================
--- fix-parsing-of-preferred-version-ranges.patch	                        (rev 0)
+++ fix-parsing-of-preferred-version-ranges.patch	2021-05-16 09:10:39 UTC (rev 935711)
@@ -0,0 +1,63 @@
+From 4c2efcda723aa7afd8d687a39e704000791e924b Mon Sep 17 00:00:00 2001
+From: Kevin Quick <kquick at galois.com>
+Date: Tue, 11 May 2021 23:49:15 -0700
+Subject: [PATCH 1/2] Fix parsing of preferred version ranges.
+
+The preferred version range starts with the name of the current
+package; this name must be removed to allow a valid parse as a
+VersionRange.
+
+Prior to this change:
+$ cabal run show-package-versions containers
+show-package-versions: HackageDBPackageName (PackageName "containers") (InvalidRepresentationOfType "preferred version range" "containers <0.5.8.1 || >0.5.8.1 && <0.5.9.1 || >0.5.9.1")
+
+After this change:
+$ cabal run show-package-versions containers
+containers: 0.1.0.0 0.1.0.1 0.2.0.0 0.2.0.1 0.3.0.0 0.4.0.0 0.4.1.0 0.4.2.0 0.4.2.1 0.5.0.0 0.5.1.0 0.5.2.0 0.5.2.1 0.5.3.0 0.5.3.1 0.5.4.0 0.5.5.0 0.5.5.1 0.5.6.0 0.5.6.1 0.5.6.2 0.5.6.3 0.5.7.0 0.5.7.1 0.5.8.2 0.5.9.2 0.5.10.1 0.5.10.2 0.5.11.0 0.6.0.1 0.6.1.1 0.6.2.1 0.6.3.1 0.6.4.1
+---
+ src/Distribution/Hackage/DB/Parsed.hs | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/Distribution/Hackage/DB/Parsed.hs b/src/Distribution/Hackage/DB/Parsed.hs
+index a73863d..8056228 100644
+--- a/src/Distribution/Hackage/DB/Parsed.hs
++++ b/src/Distribution/Hackage/DB/Parsed.hs
+@@ -55,7 +55,14 @@ parsePackageData pn (U.PackageData pv vs') =
+       Map.filterWithKey (\v _ -> v `withinRange` vr) vs'
+   where
+     vr | BSS.null pv = anyVersion
+-       | otherwise = parseText "preferred version range" (toString pv)
++       | otherwise = parseText "preferred version range"
++                     (toString $
++                      -- pv is something like: "containers <0.5.8.1 || >0.5.8.1".
++                      -- The first word should match pn and should be removed to
++                      -- allow parseText to parse the VersionRange; this is
++                      -- simply done by dropping the first word (non-space chars)
++                      BSS.dropWhile (/= toEnum 32) $  -- 32 = ASCII space
++                      pv)
+ 
+ parseVersionData :: PackageName -> Version -> U.VersionData -> VersionData
+ parseVersionData pn v (U.VersionData cf m) =
+
+From a5dd906dee5075950294f53c3bcc9a2fa675fed1 Mon Sep 17 00:00:00 2001
+From: Kevin Quick <kquick at galois.com>
+Date: Wed, 12 May 2021 08:28:23 -0700
+Subject: [PATCH 2/2] Change required by hlint.
+
+---
+ src/Distribution/Hackage/DB/Parsed.hs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Distribution/Hackage/DB/Parsed.hs b/src/Distribution/Hackage/DB/Parsed.hs
+index 8056228..19768ae 100644
+--- a/src/Distribution/Hackage/DB/Parsed.hs
++++ b/src/Distribution/Hackage/DB/Parsed.hs
+@@ -61,7 +61,7 @@ parsePackageData pn (U.PackageData pv vs') =
+                       -- The first word should match pn and should be removed to
+                       -- allow parseText to parse the VersionRange; this is
+                       -- simply done by dropping the first word (non-space chars)
+-                      BSS.dropWhile (/= toEnum 32) $  -- 32 = ASCII space
++                      BSS.dropWhile (/= toEnum 32)   -- 32 = ASCII space
+                       pv)
+ 
+ parseVersionData :: PackageName -> Version -> U.VersionData -> VersionData



More information about the arch-commits mailing list