Hello community,
here is the log from the commit of package ghc-http-download for
openSUSE:Factory checked in at 2019-12-27 13:54:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-download (Old)
and /work/SRC/openSUSE:Factory/.ghc-http-download.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-http-download"
Fri Dec 27 13:54:16 2019 rev:3 rq:759424 version:0.1.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http-download/ghc-http-download.changes
2019-10-18 14:37:19.911630224 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-http-download.new.6675/ghc-http-download.changes
2019-12-27 13:54:21.160686837 +0100
@@ -1,0 +2,11 @@
+Mon Dec 23 11:12:02 UTC 2019 - [email protected]
+
+- Update http-download to version 0.1.0.1.
+ Upstream does not provide a change log file.
+
+-------------------------------------------------------------------
+Fri Nov 8 16:13:59 UTC 2019 - Peter Simons <[email protected]>
+
+- Drop obsolete group attributes.
+
+-------------------------------------------------------------------
Old:
----
http-download-0.1.0.0.tar.gz
http-download.cabal
New:
----
http-download-0.1.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-http-download.spec ++++++
--- /var/tmp/diff_new_pack.Auumaa/_old 2019-12-27 13:54:22.668687565 +0100
+++ /var/tmp/diff_new_pack.Auumaa/_new 2019-12-27 13:54:22.672687567 +0100
@@ -19,14 +19,12 @@
%global pkg_name http-download
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.1.0.0
+Version: 0.1.0.1
Release: 0
Summary: Verified downloads with retries
License: BSD-3-Clause
-Group: Development/Libraries/Haskell
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/4.cabal#/%{pkg_name}.cabal
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-base64-bytestring-devel
BuildRequires: ghc-bytestring-devel
@@ -53,11 +51,10 @@
%endif
%description
-Verified downloads with retries.
+Higher level HTTP download APIs include verification of content and retries.
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
@@ -68,7 +65,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
echo > Setup.hs 'import Distribution.Simple'
echo >>Setup.hs 'main = defaultMain'
++++++ http-download-0.1.0.0.tar.gz -> http-download-0.1.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-download-0.1.0.0/http-download.cabal
new/http-download-0.1.0.1/http-download.cabal
--- old/http-download-0.1.0.0/http-download.cabal 2019-06-08
23:40:43.000000000 +0200
+++ new/http-download-0.1.0.1/http-download.cabal 2019-12-23
09:30:07.000000000 +0100
@@ -1,17 +1,18 @@
cabal-version: 1.12
--- This file has been generated from package.yaml by hpack version 0.31.1.
+-- This file has been generated from package.yaml by hpack version 0.31.2.
--
-- see: https://github.com/sol/hpack
--
--- hash: b6a9c41e4facbc95bcb9ee81b15c8c682b88f638fa8df0382f9e4e54b6ab1629
+-- hash: 8b4f895c68c59d6ced8926b73292a062ce3b3f53859ca9b40d11c85f39e2fbf2
name: http-download
-version: 0.1.0.0
+version: 0.1.0.1
synopsis: Verified downloads with retries
+description: Higher level HTTP download APIs include verification of
content and retries
category: Development
-homepage: https://github.com/commercialhaskell/stack#readme
-bug-reports: https://github.com/commercialhaskell/stack/issues
+homepage: https://github.com/commercialhaskell/http-download#readme
+bug-reports: https://github.com/commercialhaskell/http-download/issues
author: Michael Snoyman
maintainer: [email protected]
copyright: 2018-2019 FP Complete
@@ -21,7 +22,7 @@
source-repository head
type: git
- location: https://github.com/commercialhaskell/stack
+ location: https://github.com/commercialhaskell/http-download
library
exposed-modules:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/http-download-0.1.0.0/src/Network/HTTP/Download/Verified.hs
new/http-download-0.1.0.1/src/Network/HTTP/Download/Verified.hs
--- old/http-download-0.1.0.0/src/Network/HTTP/Download/Verified.hs
2019-04-18 20:16:33.000000000 +0200
+++ new/http-download-0.1.0.1/src/Network/HTTP/Download/Verified.hs
2019-12-23 09:29:02.000000000 +0100
@@ -20,7 +20,7 @@
import qualified Data.List as List
import qualified Data.ByteString.Base64 as B64
-import Conduit (withSinkFile)
+import Conduit (sinkHandle)
import qualified Data.Conduit.Binary as CB
import qualified Data.Conduit.List as CL
@@ -45,7 +45,8 @@
import qualified RIO.ByteString as ByteString
import qualified RIO.Text as Text
import System.Directory
-import qualified System.FilePath as FP ((<.>))
+import qualified System.FilePath as FP
+import System.IO (openTempFileWithDefaultPermissions)
-- | A request together with some checks to perform.
data DownloadRequest = DownloadRequest
@@ -249,16 +250,17 @@
whenM' (liftIO getShouldDownload) $ do
logDebug $ "Downloading " <> display (decodeUtf8With lenientDecode
(path req))
liftIO $ createDirectoryIfMissing True dir
- recoveringHttp drRetryPolicy $
- withSinkFile fptmp $ httpSink req . go
- liftIO $ renameFile fptmp fp
+ withTempFileWithDefaultPermissions dir (FP.takeFileName fp) $ \fptmp
htmp -> do
+ recoveringHttp drRetryPolicy $
+ httpSink req $ go (sinkHandle htmp)
+ hClose htmp
+ liftIO $ renameFile fptmp fp
where
whenM' mp m = do
p <- mp
if p then m >> return True else return False
fp = toFilePath destpath
- fptmp = fp FP.<.> "tmp"
dir = toFilePath $ parent destpath
getShouldDownload = do
@@ -322,3 +324,21 @@
*> maybe (pure ()) (assertLengthSink drRequest) drLengthCheck
*> ZipSink sink
*> ZipSink (progressSink mcontentLength))
+
+
+
+-- | Like 'UnliftIO.Temporary.withTempFile', but the file is created with
+-- default file permissions, instead of read/write access only for the owner.
+withTempFileWithDefaultPermissions
+ :: MonadUnliftIO m
+ => FilePath -- ^ Temp dir to create the file in.
+ -> String -- ^ File name template. See 'openTempFile'.
+ -> (FilePath -> Handle -> m a) -- ^ Callback that can use the
file.
+ -> m a
+withTempFileWithDefaultPermissions tmpDir template action =
+ bracket
+ (liftIO (openTempFileWithDefaultPermissions tmpDir template))
+ (\(name, handle') -> liftIO (hClose handle' >> ignoringIOErrors
(removeFile name)))
+ (uncurry action)
+ where
+ ignoringIOErrors = void. tryIO