openSUSE Commits
Threads by month
- ----- 2024 -----
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
May 2018
- 1 participants
- 1987 discussions
Hello community,
here is the log from the commit of package gstreamer-plugins-libav for openSUSE:Factory checked in at 2018-05-30 12:22:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gstreamer-plugins-libav (Old)
and /work/SRC/openSUSE:Factory/.gstreamer-plugins-libav.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gstreamer-plugins-libav"
Wed May 30 12:22:25 2018 rev:12 rq:611163 version:1.14.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/gstreamer-plugins-libav/gstreamer-plugins-libav.changes 2018-05-11 09:16:41.729949099 +0200
+++ /work/SRC/openSUSE:Factory/.gstreamer-plugins-libav.new/gstreamer-plugins-libav.changes 2018-05-30 12:28:38.435455871 +0200
@@ -1,0 +2,78 @@
+Sun May 20 09:46:16 UTC 2018 - bjorn.lie(a)gmail.com
+
+- Update to version 1.14.1:
+ + GstPad: Fix race condition causing the same probe to be called
+ multiple times
+ + Fix occasional deadlocks on windows when outputting debug
+ logging
+ + Fix debug levels being applied in the wrong order
+ + GIR annotation fixes for bindings
+ + audiomixer, audioaggregator: fix some negotiation issues
+ + gst-play-1.0: fix leaving stdin in non-blocking mode after exit
+ + flvmux: wait for caps on all input pads before writing header
+ even if source is live
+ + flvmux: don't wake up the muxer unless there is data, fixes
+ busy looping if there's no input data
+ + flvmux: fix major leak of input buffers
+ + rtspsrc, rtsp-server: revert to RTSP RFC handling of
+ sendonly/recvonly attributes
+ + rtpvrawpay: fix payloading with very large mtu sizes where
+ everything fits into a single RTP packet
+ + v4l2: Fix hard-coded enabled v4l2 probe on Linux/ARM
+ + v4l2: Disable DMABuf for emulated formats when using libv4l2
+ + v4l2: Always set colorimetry in S_FMT
+ + asfdemux: Set stream-format field for H264 streams and handle
+ H.264 in bytestream format
+ + x265enc: Fix tagging of keyframes on output buffers
+ + ladspa: Fix critical during plugin load on Windows
+ + decklink: Fix COM initialisation on Windows
+ + h264parse: fix re-use across pipeline stop/restart
+ + mpegtsmux: fix force-keyframe event handling and PCR/PMT
+ changes that would confuse some players with generated HLS
+ streams
+ + adaptivedemux: Support period change in live playlist
+ + rfbsrc: Fix support for applevncserver and support NULL pool in
+ decide_allocation
+ + jpegparse: Fix APP1 marker segment parsing
+ + h265parse: Make caps writable before modifying them, fixes
+ criticals
+ + fakevideosink: request an extra buffer if enable-last-sample is
+ enabled
+ + wasapisrc: Don't provide a clock based on WASAPI's clock
+ + wasapi: Only use audioclient3 when low-latency, as it might
+ otherwise glitch with slow CPUs or VMs
+ + wasapi: Don't derive device period from latency time, should
+ make it more robust against glitches
+ + audiolatency: Fix wave detection in buffers and avoid bogus pts
+ values while starting
+ + msdk: fix plugin load on implementations with only HW support
+ + msdk: dec: set framerate to the driver only if provided, not in
+ 0/1 case
+ + msdk: Don't set extended coding options for JPEG encode
+ + rtponviftimestamp: fix state change function init/reset causing
+ races/crashes on shutdown
+ + decklink: fix initialization failure in windows binary
+ + ladspa: Fix critical warnings during plugin load on Windows and
+ fix dependencies in meson build
+ + gl: fix cross-compilation error with viv-fb
+ + qmlglsink: make work with eglfs_kms
+ + rtspclientsink: Don't deadlock in preroll on early close
+ + rtspclientsink: Fix client ports for the RTCP backchannel
+ + rtsp-server: Fix session timeout when streaming data to client
+ over TCP
+ + vaapiencode: h264: find best profile in those available, fixing
+ negotiation errors
+ + vaapi: remove custom GstGL context handling, use GstGL instead.
+ Fixes GL Context sharing with WebkitGtk on wayland
+ + gst-editing-services: various fixes
+ + gst-python: bump pygobject req to 3.8;
+ fix GstPad.set_query_function(); dist autogen.sh and
+ configure.ac in tarball
+ + g-i: pick up GstVideo-1.0.gir from local build directory in
+ GstGL build
+ + g-i: update constant values for bindings
+ + avoid duplicate symbols in plugins across modules in static
+ builds
+ + ... and many, many more!
+
+-------------------------------------------------------------------
@@ -19,0 +98,43 @@
+
+-------------------------------------------------------------------
+Mon Apr 16 21:51:42 UTC 2018 - bjorn.lie(a)gmail.com
+
+- Update to version 1.14.0:
+ + Highlights:
+ - WebRTC support: real-time audio/video streaming to and from
+ web browsers;
+ - Experimental support for the next-gen royalty-free AV1 video
+ codec;
+ - Video4Linux: encoding support, stable element names and
+ faster device probing;
+ - Support for the Secure Reliable Transport (SRT) video
+ streaming protocol;
+ - RTP Forward Error Correction (FEC) support (ULPFEC);
+ - RTSP 2.0 support in rtspsrc and gst-rtsp-server;
+ - ONVIF audio backchannel support in gst-rtsp-server and
+ rtspsrc;
+ - playbin3 gapless playback and pre-buffering support;
+ - Tee, our stream splitter/duplication element, now does
+ allocation query aggregation which is important for efficient
+ data handling and zero-copy;
+ - QuickTime muxer has a new prefill recording mode that allows
+ file import in Adobe Premiere and FinalCut Pro while the file
+ is still being written;
+ - rtpjitterbuffer fast-start mode and timestamp offset
+ adjustment smoothing;
+ - souphttpsrc connection sharing, which allows for connection
+ reuse, cookie sharing, etc;
+ - nvdec: new plugin for hardware-accelerated video decoding
+ using the NVIDIA NVDEC API;
+ - Adaptive DASH trick play support;
+ - ipcpipeline: new plugin that allows splitting a pipeline
+ across multiple processes;
+ - Major gobject-introspection annotation improvements for large
+ parts of the library API;
+ - GStreamer C# bindings have been revived and seen many updates
+ and fixes;
+ - The externally maintained GStreamer Rust bindings had many
+ usability improvements and cover most of the API now.
+ Coinciding with the 1.14 release, a new release with the 1.14
+ API additions is happening.
+ + Updated translations.
Old:
----
gst-libav-1.12.5.tar.xz
New:
----
gst-libav-1.14.1.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gstreamer-plugins-libav.spec ++++++
--- /var/tmp/diff_new_pack.eJLx4j/_old 2018-05-30 12:28:39.099432105 +0200
+++ /var/tmp/diff_new_pack.eJLx4j/_new 2018-05-30 12:28:39.103431961 +0200
@@ -18,7 +18,7 @@
%define gst_branch 1.0
Name: gstreamer-plugins-libav
-Version: 1.12.5
+Version: 1.14.1
Release: 0
Summary: A ffmpeg/libav plugin for GStreamer
License: GPL-2.0-or-later
++++++ gst-libav-1.12.5.tar.xz -> gst-libav-1.14.1.tar.xz ++++++
/work/SRC/openSUSE:Factory/gstreamer-plugins-libav/gst-libav-1.12.5.tar.xz /work/SRC/openSUSE:Factory/.gstreamer-plugins-libav.new/gst-libav-1.14.1.tar.xz differ: char 27, line 1
1
0
Hello community,
here is the log from the commit of package gstreamer-editing-services for openSUSE:Factory checked in at 2018-05-30 12:22:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gstreamer-editing-services (Old)
and /work/SRC/openSUSE:Factory/.gstreamer-editing-services.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gstreamer-editing-services"
Wed May 30 12:22:31 2018 rev:24 rq:611167 version:1.14.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/gstreamer-editing-services/gstreamer-editing-services.changes 2018-04-03 12:12:16.031023541 +0200
+++ /work/SRC/openSUSE:Factory/.gstreamer-editing-services.new/gstreamer-editing-services.changes 2018-05-30 12:28:35.299568046 +0200
@@ -1,0 +2,121 @@
+Sun May 20 09:56:17 UTC 2018 - bjorn.lie(a)gmail.com
+
+- Update to version 1.14.1:
+ + GstPad: Fix race condition causing the same probe to be called
+ multiple times
+ + Fix occasional deadlocks on windows when outputting debug
+ logging
+ + Fix debug levels being applied in the wrong order
+ + GIR annotation fixes for bindings
+ + audiomixer, audioaggregator: fix some negotiation issues
+ + gst-play-1.0: fix leaving stdin in non-blocking mode after exit
+ + flvmux: wait for caps on all input pads before writing header
+ even if source is live
+ + flvmux: don't wake up the muxer unless there is data, fixes
+ busy looping if there's no input data
+ + flvmux: fix major leak of input buffers
+ + rtspsrc, rtsp-server: revert to RTSP RFC handling of
+ sendonly/recvonly attributes
+ + rtpvrawpay: fix payloading with very large mtu sizes where
+ everything fits into a single RTP packet
+ + v4l2: Fix hard-coded enabled v4l2 probe on Linux/ARM
+ + v4l2: Disable DMABuf for emulated formats when using libv4l2
+ + v4l2: Always set colorimetry in S_FMT
+ + asfdemux: Set stream-format field for H264 streams and handle
+ H.264 in bytestream format
+ + x265enc: Fix tagging of keyframes on output buffers
+ + ladspa: Fix critical during plugin load on Windows
+ + decklink: Fix COM initialisation on Windows
+ + h264parse: fix re-use across pipeline stop/restart
+ + mpegtsmux: fix force-keyframe event handling and PCR/PMT
+ changes that would confuse some players with generated HLS
+ streams
+ + adaptivedemux: Support period change in live playlist
+ + rfbsrc: Fix support for applevncserver and support NULL pool in
+ decide_allocation
+ + jpegparse: Fix APP1 marker segment parsing
+ + h265parse: Make caps writable before modifying them, fixes
+ criticals
+ + fakevideosink: request an extra buffer if enable-last-sample is
+ enabled
+ + wasapisrc: Don't provide a clock based on WASAPI's clock
+ + wasapi: Only use audioclient3 when low-latency, as it might
+ otherwise glitch with slow CPUs or VMs
+ + wasapi: Don't derive device period from latency time, should
+ make it more robust against glitches
+ + audiolatency: Fix wave detection in buffers and avoid bogus pts
+ values while starting
+ + msdk: fix plugin load on implementations with only HW support
+ + msdk: dec: set framerate to the driver only if provided, not in
+ 0/1 case
+ + msdk: Don't set extended coding options for JPEG encode
+ + rtponviftimestamp: fix state change function init/reset causing
+ races/crashes on shutdown
+ + decklink: fix initialization failure in windows binary
+ + ladspa: Fix critical warnings during plugin load on Windows and
+ fix dependencies in meson build
+ + gl: fix cross-compilation error with viv-fb
+ + qmlglsink: make work with eglfs_kms
+ + rtspclientsink: Don't deadlock in preroll on early close
+ + rtspclientsink: Fix client ports for the RTCP backchannel
+ + rtsp-server: Fix session timeout when streaming data to client
+ over TCP
+ + vaapiencode: h264: find best profile in those available, fixing
+ negotiation errors
+ + vaapi: remove custom GstGL context handling, use GstGL instead.
+ Fixes GL Context sharing with WebkitGtk on wayland
+ + gst-editing-services: various fixes
+ + gst-python: bump pygobject req to 3.8;
+ fix GstPad.set_query_function(); dist autogen.sh and
+ configure.ac in tarball
+ + g-i: pick up GstVideo-1.0.gir from local build directory in
+ GstGL build
+ + g-i: update constant values for bindings
+ + avoid duplicate symbols in plugins across modules in static
+ builds
+ + ... and many, many more!
+
+-------------------------------------------------------------------
+Tue Apr 17 13:12:10 UTC 2018 - bjorn.lie(a)gmail.com
+
+- Update to version 1.14.0:
+ + Highlights:
+ - WebRTC support: real-time audio/video streaming to and from
+ web browsers;
+ - Experimental support for the next-gen royalty-free AV1 video
+ codec
+ - Video4Linux: encoding support, stable element names and
+ faster device probing;
+ - Support for the Secure Reliable Transport (SRT) video
+ streaming protocol;
+ - RTP Forward Error Correction (FEC) support (ULPFEC);
+ - RTSP 2.0 support in rtspsrc and gst-rtsp-server;
+ - ONVIF audio backchannel support in gst-rtsp-server and
+ rtspsrc;
+ - playbin3 gapless playback and pre-buffering support;
+ - Tee, our stream splitter/duplication element, now does
+ allocation query aggregation which is important for efficient
+ data handling and zero-copy;
+ - QuickTime muxer has a new prefill recording mode that allows
+ file import in Adobe Premiere and FinalCut Pro while the file
+ is still being written;
+ - rtpjitterbuffer fast-start mode and timestamp offset
+ adjustment smoothing;
+ - souphttpsrc connection sharing, which allows for connection
+ reuse, cookie sharing, etc;
+ - nvdec: new plugin for hardware-accelerated video decoding
+ using the NVIDIA NVDEC API;
+ - Adaptive DASH trick play support;
+ - ipcpipeline: new plugin that allows splitting a pipeline
+ across multiple processes;
+ - Major gobject-introspection annotation improvements for large
+ parts of the library API;
+ - GStreamer C# bindings have been revived and seen many updates
+ and fixes;
+ - The externally maintained GStreamer Rust bindings had many
+ usability improvements and cover most of the API now.
+ Coinciding with the 1.14 release, a new release with the 1.14
+ API additions is happening.
+ + Updated translations.
+
+-------------------------------------------------------------------
Old:
----
gstreamer-editing-services-1.12.5.tar.xz
New:
----
gstreamer-editing-services-1.14.1.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gstreamer-editing-services.spec ++++++
--- /var/tmp/diff_new_pack.wH6INi/_old 2018-05-30 12:28:35.827549169 +0200
+++ /var/tmp/diff_new_pack.wH6INi/_new 2018-05-30 12:28:35.831549026 +0200
@@ -18,7 +18,7 @@
Name: gstreamer-editing-services
-Version: 1.12.5
+Version: 1.14.1
Release: 0
Summary: GStreamer Editing Services
License: GPL-3.0-or-later AND LGPL-2.1-or-later
@@ -32,11 +32,11 @@
BuildRequires: pkgconfig(gio-2.0) >= 2.16
BuildRequires: pkgconfig(glib-2.0) >= 2.40.0
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 0.9.6
-BuildRequires: pkgconfig(gst-validate-1.0) >= 1.12.0
-BuildRequires: pkgconfig(gstreamer-1.0) >= 1.12.0
+BuildRequires: pkgconfig(gst-validate-1.0) >= %{version}
+BuildRequires: pkgconfig(gstreamer-1.0) >= %{version}
BuildRequires: pkgconfig(gstreamer-controller-1.0)
-BuildRequires: pkgconfig(gstreamer-pbutils-1.0) >= 1.12.0
-BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) >= 1.12.0
+BuildRequires: pkgconfig(gstreamer-pbutils-1.0) >= %{version}
+BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) >= %{version}
BuildRequires: pkgconfig(gstreamer-video-1.0)
BuildRequires: pkgconfig(gtk+-3.0) >= 2.91.3
BuildRequires: pkgconfig(gtk+-x11-3.0) >= 2.91.3
@@ -125,8 +125,7 @@
%{_mandir}/man1/ges-launch-1.0.1%{ext_man}
%{_bindir}/ges-launch-1.0
%{_datadir}/bash-completion/completions/ges-launch-1.0
-%dir %{_datadir}/gstreamer-1.0/validate-scenario
-%{_datadir}/gstreamer-1.0/validate-scenario/ges-edit-clip-while-paused.scenario
+%{_datadir}/gstreamer-1.0/validate/scenarios/ges-edit-clip-while-paused.scenario
%{_libdir}/gst-validate-launcher/python/launcher/apps/geslaunch.py
%dir %{python_sitearch}/gstreamer-editing-services
%{python_sitearch}/gstreamer-editing-services/GES.*
++++++ gstreamer-editing-services-1.12.5.tar.xz -> gstreamer-editing-services-1.14.1.tar.xz ++++++
++++ 21743 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package gpxsee for openSUSE:Factory checked in at 2018-05-30 12:23:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gpxsee (Old)
and /work/SRC/openSUSE:Factory/.gpxsee.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gpxsee"
Wed May 30 12:23:52 2018 rev:29 rq:612938 version:5.13
Changes:
--------
--- /work/SRC/openSUSE:Factory/gpxsee/gpxsee.changes 2018-05-16 11:42:10.391033219 +0200
+++ /work/SRC/openSUSE:Factory/.gpxsee.new/gpxsee.changes 2018-05-30 12:28:28.847798441 +0200
@@ -1,0 +2,16 @@
+Tue May 29 22:09:25 CEST 2018 - tumic(a)cbox.cz
+
+- Update to version 5.13
+ * Fixed broken automatic loading of OziExplorer maps (introduced
+ in 5.12)
+ * Added support for Krovak projections (EPSG:1041 and EPSG:9819)
+
+-------------------------------------------------------------------
+Fri May 25 18:30:22 CEST 2018 - tumic(a)cbox.cz
+
+- Update to version 5.12
+ * Added support for Garmin JNX maps.
+ * Added support for GPX Garmin route extension.
+ * Several performance improvements.
+
+-------------------------------------------------------------------
Old:
----
GPXSee-5.11.tar.gz
New:
----
GPXSee-5.13.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gpxsee.spec ++++++
--- /var/tmp/diff_new_pack.zxoEq5/_old 2018-05-30 12:28:29.563772899 +0200
+++ /var/tmp/diff_new_pack.zxoEq5/_new 2018-05-30 12:28:29.567772756 +0200
@@ -19,7 +19,7 @@
# See also http://en.opensuse.org/openSUSE:Specfile_guidelines
Name: gpxsee
-Version: 5.11
+Version: 5.13
Release: 1
Summary: GPS log files visualizing and analyzing tool
License: GPL-3.0
++++++ GPXSee-5.11.tar.gz -> GPXSee-5.13.tar.gz ++++++
++++ 6119 lines of diff (skipped)
++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.zxoEq5/_old 2018-05-30 12:28:29.871761910 +0200
+++ /var/tmp/diff_new_pack.zxoEq5/_new 2018-05-30 12:28:29.871761910 +0200
@@ -1,5 +1,5 @@
pkgname=gpxsee
-pkgver=5.11
+pkgver=5.13
pkgrel=1
pkgdesc='GPS log files visualizing and analyzing tool'
arch=('i686' 'x86_64')
++++++ debian.changelog ++++++
--- /var/tmp/diff_new_pack.zxoEq5/_old 2018-05-30 12:28:29.899760911 +0200
+++ /var/tmp/diff_new_pack.zxoEq5/_new 2018-05-30 12:28:29.899760911 +0200
@@ -1,3 +1,19 @@
+gpxsee (5.13) stable; urgency=low
+
+ * Fixed broken automatic loading of OziExplorer maps (introduced
+ in 5.12)
+ * Added support for Krovak projections (EPSG:1041 and EPSG:9819)
+
+ -- Martin Tuma <tumic(a)cbox.cz> Tue, 29 May 2018 22:13:28 +0200
+
+gpxsee (5.12) stable; urgency=low
+
+ * Added support for Garmin JNX maps.
+ * Added support for GPX Garmin route extension.
+ * Several performance improvements.
+
+ -- Martin Tuma <tumic(a)cbox.cz> Fri, 25 May 2018 18:34:34 +0200
+
gpxsee (5.11) stable; urgency=low
* Added support for EPSG:9606 and 9607 datum transformations.
++++++ gpxsee.dsc ++++++
--- /var/tmp/diff_new_pack.zxoEq5/_old 2018-05-30 12:28:29.967758486 +0200
+++ /var/tmp/diff_new_pack.zxoEq5/_new 2018-05-30 12:28:29.967758486 +0200
@@ -1,9 +1,9 @@
Format: 1.0
Source: gpxsee
-Version: 5.11
+Version: 5.13
Binary: gpxsee
Maintainer: Martin Tuma <tumic(a)cbox.cz>
Architecture: any
Build-Depends: debhelper (>= 9), qtbase5-dev, qtbase5-dev-tools, qt5-qmake, qttools5-dev-tools, libqt5opengl5-dev
Files:
- 00000000000000000000000000000000 0 GPXSee-5.11.tar.gz
+ 00000000000000000000000000000000 0 GPXSee-5.13.tar.gz
1
0
Hello community,
here is the log from the commit of package ghc-zlib for openSUSE:Factory checked in at 2018-05-30 12:16:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-zlib (Old)
and /work/SRC/openSUSE:Factory/.ghc-zlib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-zlib"
Wed May 30 12:16:15 2018 rev:13 rq:607960 version:0.6.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-zlib/ghc-zlib.changes 2017-09-15 22:28:42.441474337 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-zlib.new/ghc-zlib.changes 2018-05-30 12:28:01.988751775 +0200
@@ -1,0 +2,8 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update zlib to version 0.6.2.
+ * New cabal flag 'pkg-config' for discovering 'zlib` via pkg-config(1) (#16)
+ * Use CApiFFI where available for cross-compile friendliness (#14)
+ * Change the window bits range from 8..15 to 9..15 (#11)
+
+-------------------------------------------------------------------
Old:
----
zlib-0.6.1.2.tar.gz
New:
----
zlib-0.6.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-zlib.spec ++++++
--- /var/tmp/diff_new_pack.910Pnz/_old 2018-05-30 12:28:02.748724932 +0200
+++ /var/tmp/diff_new_pack.910Pnz/_new 2018-05-30 12:28:02.752724789 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-zlib
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name zlib
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.6.1.2
+Version: 0.6.2
Release: 0
Summary: Compression and decompression in the gzip and zlib formats
License: BSD-2-Clause
@@ -78,7 +78,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
%doc changelog examples
++++++ zlib-0.6.1.2.tar.gz -> zlib-0.6.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/Codec/Compression/Zlib/Stream.hsc new/zlib-0.6.2/Codec/Compression/Zlib/Stream.hsc
--- old/zlib-0.6.1.2/Codec/Compression/Zlib/Stream.hsc 2016-10-23 20:13:38.000000000 +0200
+++ new/zlib-0.6.2/Codec/Compression/Zlib/Stream.hsc 2018-03-08 16:13:31.000000000 +0100
@@ -2,6 +2,9 @@
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE DeriveGeneric #-}
#endif
+#if __GLASGOW_HASKELL__ >= 706
+{-# LANGUAGE CApiFFI #-}
+#endif
-----------------------------------------------------------------------------
-- |
-- Copyright : (c) 2006-2015 Duncan Coutts
@@ -709,8 +712,8 @@
-- usage.
--
-- The compression window size is the value of the the window bits raised to
--- the power 2. The window bits must be in the range @8..15@ which corresponds
--- to compression window sizes of 256b to 32Kb. The default is 15 which is also
+-- the power 2. The window bits must be in the range @9..15@ which corresponds
+-- to compression window sizes of 512b to 32Kb. The default is 15 which is also
-- the maximum size.
--
-- The total amount of memory used depends on the window bits and the
@@ -737,19 +740,19 @@
defaultWindowBits :: WindowBits
defaultWindowBits = WindowBits 15
--- | A specific compression window size, specified in bits in the range @8..15@
+-- | A specific compression window size, specified in bits in the range @9..15@
--
windowBits :: Int -> WindowBits
windowBits n
- | n >= 8 && n <= 15 = WindowBits n
- | otherwise = error "WindowBits must be in the range 8..15"
+ | n >= 9 && n <= 15 = WindowBits n
+ | otherwise = error "WindowBits must be in the range 9..15"
fromWindowBits :: Format -> WindowBits-> CInt
fromWindowBits format bits = (formatModifier format) (checkWindowBits bits)
where checkWindowBits DefaultWindowBits = 15
checkWindowBits (WindowBits n)
- | n >= 8 && n <= 15 = fromIntegral n
- | otherwise = error "WindowBits must be in the range 8..15"
+ | n >= 9 && n <= 15 = fromIntegral n
+ | otherwise = error "WindowBits must be in the range 9..15"
formatModifier Zlib = id
formatModifier GZip = (+16)
formatModifier GZipOrZlib = (+32)
@@ -1008,6 +1011,10 @@
--
-- So we define c_inflateInit2 and c_deflateInit2 here as wrappers around
-- their _ counterparts and pass the extra args.
+--
+-- As of GHC 7.6, we can import macros directly using the CApiFFI extension.
+-- This avoids the need for the hsc2hs #{const_str} construct, which means
+-- hsc2hs can run in cross-compilation mode.
##ifdef NON_BLOCKING_FFI
##define SAFTY safe
@@ -1015,6 +1022,14 @@
##define SAFTY unsafe
##endif
+#if __GLASGOW_HASKELL__ >= 706
+foreign import capi unsafe "zlib.h inflateInit2"
+ c_inflateInit2 :: StreamState -> CInt -> IO CInt
+
+foreign import capi unsafe "zlib.h deflateInit2"
+ c_deflateInit2 :: StreamState
+ -> CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt
+#else
foreign import ccall unsafe "zlib.h inflateInit2_"
c_inflateInit2_ :: StreamState -> CInt -> Ptr CChar -> CInt -> IO CInt
@@ -1023,15 +1038,6 @@
withCAString #{const_str ZLIB_VERSION} $ \versionStr ->
c_inflateInit2_ z n versionStr (#{const sizeof(z_stream)} :: CInt)
-foreign import ccall SAFTY "zlib.h inflate"
- c_inflate :: StreamState -> CInt -> IO CInt
-
-foreign import ccall unsafe "zlib.h &inflateEnd"
- c_inflateEnd :: FinalizerPtr StreamState
-
-foreign import ccall unsafe "zlib.h inflateReset"
- c_inflateReset :: StreamState -> IO CInt
-
foreign import ccall unsafe "zlib.h deflateInit2_"
c_deflateInit2_ :: StreamState
-> CInt -> CInt -> CInt -> CInt -> CInt
@@ -1043,6 +1049,16 @@
c_deflateInit2 z a b c d e =
withCAString #{const_str ZLIB_VERSION} $ \versionStr ->
c_deflateInit2_ z a b c d e versionStr (#{const sizeof(z_stream)} :: CInt)
+#endif
+
+foreign import ccall SAFTY "zlib.h inflate"
+ c_inflate :: StreamState -> CInt -> IO CInt
+
+foreign import ccall unsafe "zlib.h &inflateEnd"
+ c_inflateEnd :: FinalizerPtr StreamState
+
+foreign import ccall unsafe "zlib.h inflateReset"
+ c_inflateReset :: StreamState -> IO CInt
foreign import ccall unsafe "zlib.h deflateSetDictionary"
c_deflateSetDictionary :: StreamState
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/changelog new/zlib-0.6.2/changelog
--- old/zlib-0.6.1.2/changelog 2016-10-23 20:13:38.000000000 +0200
+++ new/zlib-0.6.2/changelog 2018-03-08 16:13:31.000000000 +0100
@@ -1,3 +1,9 @@
+0.6.2 Herbert Valerio Riedel <hvr(a)gnu.org> March 2018
+
+ * New cabal flag 'pkg-config' for discovering 'zlib` via pkg-config(1) (#16)
+ * Use CApiFFI where available for cross-compile friendliness (#14)
+ * Change the window bits range from 8..15 to 9..15 (#11)
+
0.6.1.2 Herbert Valerio Riedel <hvr(a)gnu.org> October 2016
* Fix a segfault when reading the stream multithreaded, #7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/test/Test/Codec/Compression/Zlib/Stream.hs new/zlib-0.6.2/test/Test/Codec/Compression/Zlib/Stream.hs
--- old/zlib-0.6.1.2/test/Test/Codec/Compression/Zlib/Stream.hs 2016-10-23 20:13:38.000000000 +0200
+++ new/zlib-0.6.2/test/Test/Codec/Compression/Zlib/Stream.hs 2018-03-08 16:13:31.000000000 +0100
@@ -24,7 +24,7 @@
instance Arbitrary WindowBits where
- arbitrary = elements $ defaultWindowBits:map windowBits [8..15]
+ arbitrary = elements $ defaultWindowBits:map windowBits [9..15]
instance Arbitrary MemoryLevel where
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/test/Test.hs new/zlib-0.6.2/test/Test.hs
--- old/zlib-0.6.1.2/test/Test.hs 2016-10-23 20:13:38.000000000 +0200
+++ new/zlib-0.6.2/test/Test.hs 2018-03-08 16:13:31.000000000 +0100
@@ -61,10 +61,7 @@
-> Property
prop_decompress_after_compress w cp dp =
(w /= zlibFormat || decompressWindowBits dp >= compressWindowBits cp) &&
- -- Zlib decompression has been observed to fail with both compress and decompress
- -- window bits = 8. This seems to be contrary to the docs and to a quick reading
- -- of the zlib source code.
- (decompressWindowBits dp > compressWindowBits cp || decompressWindowBits dp > WindowBits 8) &&
+ (decompressWindowBits dp > compressWindowBits cp) &&
decompressBufferSize dp > 0 && compressBufferSize cp > 0 ==>
liftM2 (==) (decompress w dp . compress w cp) id
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.1.2/zlib.cabal new/zlib-0.6.2/zlib.cabal
--- old/zlib-0.6.1.2/zlib.cabal 2016-10-23 20:13:38.000000000 +0200
+++ new/zlib-0.6.2/zlib.cabal 2018-03-08 16:13:31.000000000 +0100
@@ -1,5 +1,5 @@
name: zlib
-version: 0.6.1.2
+version: 0.6.2
copyright: (c) 2006-2016 Duncan Coutts
license: BSD3
license-file: LICENSE
@@ -20,7 +20,7 @@
provides access to the full zlib feature set.
build-type: Simple
cabal-version: >= 1.10
-tested-with: GHC ==7.0.4, GHC ==7.2.2, GHC ==7.4.2, GHC ==7.6.3, GHC ==7.8.4, GHC ==7.10.3, GHC ==8.0.1, GHC==8.0.2, GHC ==8.1.*
+tested-with: GHC ==7.0.4, GHC ==7.2.2, GHC ==7.4.2, GHC ==7.6.3, GHC ==7.8.4, GHC ==7.10.3, GHC ==8.0.1, GHC==8.0.2, GHC ==8.2.2, GHC ==8.4.1
extra-source-files: changelog
-- zlib C sources (for Windows)
@@ -45,6 +45,11 @@
prevents other Haskell threads running. Enabling this flag
avoids this unfairness, but with greater overall cost.
+flag pkg-config
+ default: False
+ manual: True
+ description: Use @pkg-config(1)@ to locate foreign @zlib@ library.
+
library
exposed-modules: Codec.Compression.GZip,
Codec.Compression.Zlib,
@@ -60,6 +65,8 @@
DeriveDataTypeable
if impl(ghc >= 7.2)
other-extensions: DeriveGeneric
+ if impl(ghc >= 7.6)
+ other-extensions: CApiFFI
build-depends: base >= 4 && < 5,
bytestring >= 0.9 && < 0.12
if impl(ghc >= 7.2 && < 7.6)
@@ -68,18 +75,23 @@
ghc-options: -Wall -fwarn-tabs
if flag(non-blocking-ffi)
cpp-options: -DNON_BLOCKING_FFI
- if !os(windows)
- -- Normally we use the the standard system zlib:
- extra-libraries: z
+ if flag(pkg-config)
+ -- NB: pkg-config is available on windows as well when using msys2
+ pkgconfig-depends: zlib
else
- -- However for the benefit of users of Windows (which does not have zlib
- -- by default) we bundle a complete copy of the C sources of zlib-1.2.8
- c-sources: cbits/adler32.c cbits/compress.c cbits/crc32.c
+ -- don't use pkg-config
+ if !os(windows)
+ -- Normally we use the the standard system zlib.
+ extra-libraries: z
+ else
+ -- However for the benefit of users of Windows (which does not have zlib
+ -- by default) we bundle a complete copy of the C sources of zlib-1.2.8
+ c-sources: cbits/adler32.c cbits/compress.c cbits/crc32.c
cbits/deflate.c cbits/infback.c
cbits/inffast.c cbits/inflate.c cbits/inftrees.c
cbits/trees.c cbits/uncompr.c cbits/zutil.c
- include-dirs: cbits
- install-includes: zlib.h zconf.h
+ include-dirs: cbits
+ install-includes: zlib.h zconf.h
test-suite tests
type: exitcode-stdio-1.0
1
0
Hello community,
here is the log from the commit of package ghc-yaml for openSUSE:Factory checked in at 2018-05-30 12:16:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-yaml (Old)
and /work/SRC/openSUSE:Factory/.ghc-yaml.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-yaml"
Wed May 30 12:16:07 2018 rev:27 rq:607958 version:0.8.30
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-yaml/ghc-yaml.changes 2017-09-15 22:27:45.485497850 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-yaml.new/ghc-yaml.changes 2018-05-30 12:28:00.172815882 +0200
@@ -1,0 +2,17 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update yaml to version 0.8.30.
+ * Removed `AppSettings` mentioned in `loadYamlSettings` error message.
+ * Deprecated `decodeFile` [#129](https://github.com/snoyberg/yaml/issues/129)
+ * Turn off executables by default [#103](https://github.com/snoyberg/yaml/issues/103)
+ * Add `Data.Yaml.TH.yamlQQ`
+ * Support conduit 1.3
+ * Add `Semigroup` instance [#123](https://github.com/snoyberg/yaml/pull/123)
+ * Use `throwM` instead of `monadThrow`
+ * Drop aeson-qq dep (incompatible with Stackage Nightly)
+ * Tweaks to the executable `yaml2json` [#119](https://github.com/snoyberg/yaml/pull/119):
+ - Add command-line option `-h` and `--help` to show help message
+ - Error messages are now written to `stderr` instead of `stdout`
+ * New encodePretty option `setConfDropNull` to drop null values from objects [#116](https://github.com/snoyberg/yaml/issues/116)
+
+-------------------------------------------------------------------
Old:
----
yaml-0.8.23.3.tar.gz
New:
----
yaml-0.8.30.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-yaml.spec ++++++
--- /var/tmp/diff_new_pack.7InOm0/_old 2018-05-30 12:28:00.920789482 +0200
+++ /var/tmp/diff_new_pack.7InOm0/_new 2018-05-30 12:28:00.924789341 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-yaml
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,14 +19,13 @@
%global pkg_name yaml
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.8.23.3
+Version: 0.8.30
Release: 0
Summary: Support for parsing and rendering YAML documents
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}-%{ve…
-BuildRequires: chrpath
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-aeson-devel
BuildRequires: ghc-attoparsec-devel
@@ -46,7 +45,6 @@
BuildRequires: ghc-vector-devel
%if %{with tests}
BuildRequires: ghc-HUnit-devel
-BuildRequires: ghc-aeson-qq-devel
BuildRequires: ghc-base-compat-devel
BuildRequires: ghc-hspec-devel
BuildRequires: ghc-mockery-devel
@@ -54,7 +52,8 @@
%endif
%description
-Support for parsing and rendering YAML documents.
+README and API documentation are available at
+<https://www.stackage.org/package/yaml>.
%package devel
Summary: Haskell %{pkg_name} library development files
@@ -75,7 +74,6 @@
%install
%ghc_lib_install
-%ghc_fix_rpath %{pkg_name}-%{version}
%check
%cabal_test
@@ -87,11 +85,9 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
-%{_bindir}/json2yaml
-%{_bindir}/yaml2json
+%license LICENSE
%files devel -f %{name}-devel.files
-%doc ChangeLog.md README.md examples
+%doc ChangeLog.md README.md
%changelog
++++++ yaml-0.8.23.3.tar.gz -> yaml-0.8.30.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/ChangeLog.md new/yaml-0.8.30/ChangeLog.md
--- old/yaml-0.8.23.3/ChangeLog.md 2017-07-14 09:17:46.000000000 +0200
+++ new/yaml-0.8.30/ChangeLog.md 2018-05-04 07:36:29.000000000 +0200
@@ -1,3 +1,42 @@
+## 0.8.30
+
+* Removed `AppSettings` mentioned in `loadYamlSettings` error message.
+
+## 0.8.29
+
+* Deprecated `decodeFile` [#129](https://github.com/snoyberg/yaml/issues/129)
+* Turn off executables by default [#103](https://github.com/snoyberg/yaml/issues/103)
+
+## 0.8.28
+
+* Add `Data.Yaml.TH.yamlQQ`
+
+## 0.8.27
+
+* Support conduit 1.3
+
+## 0.8.26
+
+* Add `Semigroup` instance [#123](https://github.com/snoyberg/yaml/pull/123)
+
+## 0.8.25.2
+
+* Use `throwM` instead of `monadThrow`
+
+## 0.8.25.1
+
+* Drop aeson-qq dep (incompatible with Stackage Nightly)
+
+## 0.8.25
+
+* Tweaks to the executable `yaml2json` [#119](https://github.com/snoyberg/yaml/pull/119):
+ - Add command-line option `-h` and `--help` to show help message
+ - Error messages are now written to `stderr` instead of `stdout`
+
+## 0.8.24
+
+* New encodePretty option `setConfDropNull` to drop null values from objects [#116](https://github.com/snoyberg/yaml/issues/116)
+
## 0.8.23.3
* Avoid over-escaping `*` [#113](https://github.com/snoyberg/yaml/issues/113)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Data/Yaml/Builder.hs new/yaml-0.8.30/Data/Yaml/Builder.hs
--- old/yaml-0.8.23.3/Data/Yaml/Builder.hs 2017-06-16 05:46:12.000000000 +0200
+++ new/yaml-0.8.30/Data/Yaml/Builder.hs 2018-01-15 18:30:34.000000000 +0100
@@ -21,7 +21,6 @@
import Prelude hiding (null)
import Control.Arrow (second)
-import Control.Monad.Trans.Resource (runResourceT)
#if MIN_VERSION_aeson(1,0,0)
import Data.Aeson.Text (encodeToTextBuilder)
#else
@@ -107,11 +106,11 @@
toEvents (YamlBuilder front) =
EventStreamStart : EventDocumentStart : front [EventDocumentEnd, EventStreamEnd]
-toSource :: (Monad m, ToYaml a) => a -> Source m Event
+toSource :: (Monad m, ToYaml a) => a -> ConduitM i Event m ()
toSource = mapM_ yield . toEvents . toYaml
toByteString :: ToYaml a => a -> ByteString
-toByteString yb = unsafePerformIO $ runResourceT $ toSource yb $$ encode
+toByteString yb = unsafePerformIO $ runConduitRes $ toSource yb .| encode
writeYamlFile :: ToYaml a => FilePath -> a -> IO ()
-writeYamlFile fp yb = runResourceT $ toSource yb $$ encodeFile fp
+writeYamlFile fp yb = runConduitRes $ toSource yb .| encodeFile fp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Data/Yaml/Config.hs new/yaml-0.8.30/Data/Yaml/Config.hs
--- old/yaml-0.8.23.3/Data/Yaml/Config.hs 2016-06-21 18:51:20.000000000 +0200
+++ new/yaml-0.8.30/Data/Yaml/Config.hs 2018-05-04 07:36:29.000000000 +0200
@@ -195,7 +195,7 @@
RequireCustomEnv env -> return $ applyEnvValue True env value'
case fromJSON value of
- Error s -> error $ "Could not convert to AppSettings: " ++ s
+ Error s -> error $ "Could not convert to expected type: " ++ s
Success settings -> return settings
-- | Same as @loadYamlSettings@, but get the list of runtime config files from
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Data/Yaml/Include.hs new/yaml-0.8.30/Data/Yaml/Include.hs
--- old/yaml-0.8.23.3/Data/Yaml/Include.hs 2017-01-25 12:17:27.000000000 +0100
+++ new/yaml-0.8.30/Data/Yaml/Include.hs 2018-01-15 18:30:34.000000000 +0100
@@ -27,19 +27,19 @@
eventsFromFile
:: MonadResource m
=> FilePath
- -> Producer m Event
+ -> ConduitM i Event m ()
eventsFromFile = go []
where
- go :: MonadResource m => [FilePath] -> FilePath -> Producer m Event
+ go :: MonadResource m => [FilePath] -> FilePath -> ConduitM i Event m ()
go seen fp = do
cfp <- liftIO $ handleNotFound $ canonicalizePath fp
when (cfp `elem` seen) $ do
liftIO $ throwIO CyclicIncludes
- Y.decodeFile cfp $= do
+ Y.decodeFile cfp .| do
awaitForever $ \event -> case event of
EventScalar f (UriTag "!include") _ _ -> do
let includeFile = takeDirectory cfp </> unpack (decodeUtf8 f)
- go (cfp : seen) includeFile $= CL.filter (`notElem` irrelevantEvents)
+ go (cfp : seen) includeFile .| CL.filter (`notElem` irrelevantEvents)
_ -> yield event
irrelevantEvents = [EventStreamStart, EventDocumentStart, EventDocumentEnd, EventStreamEnd]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Data/Yaml/Internal.hs new/yaml-0.8.30/Data/Yaml/Internal.hs
--- old/yaml-0.8.23.3/Data/Yaml/Internal.hs 2017-07-14 09:17:05.000000000 +0200
+++ new/yaml-0.8.30/Data/Yaml/Internal.hs 2018-01-15 18:30:34.000000000 +0100
@@ -27,7 +27,7 @@
import qualified Data.Attoparsec.Text as Atto
import Data.ByteString (ByteString)
import Data.Char (toUpper)
-import qualified Data.Conduit as C
+import Data.Conduit ((.|), ConduitM, runConduit)
import qualified Data.Conduit.List as CL
import qualified Data.HashMap.Strict as M
import qualified Data.HashSet as HashSet
@@ -125,12 +125,12 @@
type Parse = StateT (Map.Map String Value) (ResourceT IO)
-requireEvent :: Event -> C.Sink Event Parse ()
+requireEvent :: Event -> ConduitM Event o Parse ()
requireEvent e = do
f <- CL.head
unless (f == Just e) $ liftIO $ throwIO $ UnexpectedEvent f $ Just e
-parse :: C.Sink Event Parse Value
+parse :: ConduitM Event o Parse Value
parse = do
streamStart <- CL.head
case streamStart of
@@ -152,7 +152,7 @@
_ -> liftIO $ throwIO $ UnexpectedEvent streamStart Nothing
parseScalar :: ByteString -> Anchor -> Style -> Tag
- -> C.Sink Event Parse Text
+ -> ConduitM Event o Parse Text
parseScalar v a style tag = do
let res = decodeUtf8With lenientDecode v
case a of
@@ -178,7 +178,7 @@
textToScientific :: Text -> Either String Scientific
textToScientific = Atto.parseOnly (Atto.scientific <* Atto.endOfInput)
-parseO :: C.Sink Event Parse Value
+parseO :: ConduitM Event o Parse Value
parseO = do
me <- CL.head
case me of
@@ -194,7 +194,7 @@
parseS :: Y.Anchor
-> ([Value] -> [Value])
- -> C.Sink Event Parse Value
+ -> ConduitM Event o Parse Value
parseS a front = do
me <- CL.peek
case me of
@@ -212,7 +212,7 @@
parseM :: Y.Anchor
-> M.HashMap Text Value
- -> C.Sink Event Parse Value
+ -> ConduitM Event o Parse Value
parseM a front = do
me <- CL.peek
case me of
@@ -249,13 +249,13 @@
merge' al _ = al
decodeHelper :: FromJSON a
- => C.Source Parse Y.Event
+ => ConduitM () Y.Event Parse ()
-> IO (Either ParseException (Either String a))
decodeHelper src = do
-- This used to be tryAny, but the fact is that catching async
-- exceptions is fine here. We'll rethrow them immediately in the
-- otherwise clause.
- x <- try $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
+ x <- try $ runResourceT $ flip evalStateT Map.empty $ runConduit $ src .| parse
case x of
Left e
| Just pe <- fromException e -> return $ Left pe
@@ -264,10 +264,10 @@
Right y -> return $ Right $ parseEither parseJSON y
decodeHelper_ :: FromJSON a
- => C.Source Parse Event
+ => ConduitM () Event Parse ()
-> IO (Either ParseException a)
decodeHelper_ src = do
- x <- try $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
+ x <- try $ runResourceT $ flip evalStateT Map.empty $ runConduit $ src .| parse
return $ case x of
Left e
| Just pe <- fromException e -> Left pe
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Data/Yaml/Parser.hs new/yaml-0.8.30/Data/Yaml/Parser.hs
--- old/yaml-0.8.23.3/Data/Yaml/Parser.hs 2017-06-16 05:46:12.000000000 +0200
+++ new/yaml-0.8.30/Data/Yaml/Parser.hs 2018-01-15 18:30:34.000000000 +0100
@@ -9,7 +9,7 @@
import Control.Exception (Exception)
import Control.Monad (MonadPlus (..), liftM, ap)
import Control.Monad.Trans.Class (lift)
-import Control.Monad.Trans.Resource (MonadThrow, monadThrow, runResourceT)
+import Control.Monad.Trans.Resource (MonadThrow, throwM)
import Control.Monad.Trans.Writer.Strict (tell, WriterT)
import Data.ByteString (ByteString)
import Data.Conduit
@@ -18,6 +18,9 @@
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (Monoid (..))
#endif
+#if !MIN_VERSION_base(4,11,0)
+import Data.Semigroup (Semigroup(..))
+#endif
import Data.Text (Text, pack, unpack)
import Data.Text.Encoding (decodeUtf8)
import Data.Text.Read (signed, decimal)
@@ -36,9 +39,13 @@
instance Alternative YamlParser where
empty = fail "empty"
(<|>) = mplus
+instance Semigroup (YamlParser a) where
+ (<>) = mplus
instance Monoid (YamlParser a) where
mempty = fail "mempty"
- mappend = mplus
+#if !MIN_VERSION_base(4,11,0)
+ mappend = (<>)
+#endif
instance Monad YamlParser where
return = pure
YamlParser f >>= g = YamlParser $ \am ->
@@ -124,7 +131,7 @@
parseRawDoc :: (FromYaml a, MonadThrow m) => RawDoc -> m a
parseRawDoc (RawDoc val am) =
case unYamlParser (fromYaml val) am of
- Left t -> monadThrow $ FromYamlException t
+ Left t -> throwM $ FromYamlException t
Right x -> return x
(.:) :: FromYaml a => [(Text, YamlValue)] -> Text -> YamlParser a
@@ -140,11 +147,11 @@
deriving (Show, Typeable)
instance Exception YamlParseException
-sinkValue :: MonadThrow m => Consumer Event (WriterT AnchorMap m) YamlValue
+sinkValue :: MonadThrow m => ConduitM Event o (WriterT AnchorMap m) YamlValue
sinkValue =
start
where
- start = await >>= maybe (monadThrow UnexpectedEndOfEvents) go
+ start = await >>= maybe (throwM UnexpectedEndOfEvents) go
tell' Nothing val = return val
tell' (Just name) val = do
@@ -164,12 +171,12 @@
let val = Mapping pairs mname
tell' mname val
- go e = monadThrow $ UnexpectedEvent e
+ go e = throwM $ UnexpectedEvent e
goS front = do
me <- await
case me of
- Nothing -> monadThrow UnexpectedEndOfEvents
+ Nothing -> throwM UnexpectedEndOfEvents
Just EventSequenceEnd -> return $ front []
Just e -> do
val <- go e
@@ -178,17 +185,17 @@
goM front = do
mk <- await
case mk of
- Nothing -> monadThrow UnexpectedEndOfEvents
+ Nothing -> throwM UnexpectedEndOfEvents
Just EventMappingEnd -> return $ front []
Just (EventScalar a b c d) -> do
_ <- tell' d $ Scalar a b c d
let k = decodeUtf8 a
v <- start
goM (front . ((k, v):))
- Just e -> monadThrow $ UnexpectedEvent e
+ Just e -> throwM $ UnexpectedEvent e
-sinkRawDoc :: MonadThrow m => Consumer Event m RawDoc
+sinkRawDoc :: MonadThrow m => ConduitM Event o m RawDoc
sinkRawDoc = uncurry RawDoc <$> runWriterC sinkValue
readYamlFile :: FromYaml a => FilePath -> IO a
-readYamlFile fp = runResourceT (decodeFile fp $$ sinkRawDoc) >>= parseRawDoc
+readYamlFile fp = runConduitRes (decodeFile fp .| sinkRawDoc) >>= parseRawDoc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Data/Yaml/Pretty.hs new/yaml-0.8.30/Data/Yaml/Pretty.hs
--- old/yaml-0.8.23.3/Data/Yaml/Pretty.hs 2016-02-15 10:15:08.000000000 +0100
+++ new/yaml-0.8.30/Data/Yaml/Pretty.hs 2017-10-31 18:05:16.000000000 +0100
@@ -1,12 +1,14 @@
{-# LANGUAGE CPP #-}
-- | Prettier YAML encoding.
--
--- Since 0.8.13
+-- @since 0.8.13
module Data.Yaml.Pretty
( encodePretty
, Config
, getConfCompare
, setConfCompare
+ , getConfDropNull
+ , setConfDropNull
, defConfig
) where
@@ -29,30 +31,47 @@
import Data.Yaml.Builder
-- |
--- Since 0.8.13
+-- @since 0.8.13
data Config = Config
{ confCompare :: Text -> Text -> Ordering -- ^ Function used to sort keys in objects
+ , confDropNull :: Bool
}
--- | The default configuration: do not sort objects.
+-- | The default configuration: do not sort objects or drop keys
--
--- Since 0.8.13
+-- @since 0.8.13
defConfig :: Config
-defConfig = Config mempty
+defConfig = Config mempty False
-- |
--- Since 0.8.13
+-- @since 0.8.13
getConfCompare :: Config -> Text -> Text -> Ordering
getConfCompare = confCompare
--- |
--- Since 0.8.13
+-- | Sets ordering for object keys
+--
+-- @since 0.8.13
setConfCompare :: (Text -> Text -> Ordering) -> Config -> Config
setConfCompare cmp c = c { confCompare = cmp }
+-- |
+-- @since 0.8.24
+getConfDropNull :: Config -> Bool
+getConfDropNull = confDropNull
+
+-- | Drop entries with `Null` value from objects, if set to `True`
+--
+-- @since 0.8.24
+setConfDropNull :: Bool -> Config -> Config
+setConfDropNull m c = c { confDropNull = m }
+
pretty :: Config -> Value -> YamlBuilder
pretty cfg = go
- where go (Object o) = mapping (sortBy (confCompare cfg `on` fst) $ HM.toList $ HM.map go o)
+ where go (Object o) = let sort = sortBy (confCompare cfg `on` fst)
+ select
+ | confDropNull cfg = HM.filter (/= Null)
+ | otherwise = id
+ in mapping (sort $ HM.toList $ HM.map go $ select o)
go (Array a) = array (go <$> V.toList a)
go Null = null
go (String s) = string s
@@ -61,6 +80,6 @@
-- | Configurable 'encode'.
--
--- Since 0.8.13
+-- @since 0.8.13
encodePretty :: ToJSON a => Config -> a -> ByteString
encodePretty cfg = toByteString . pretty cfg . toJSON
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Data/Yaml/TH.hs new/yaml-0.8.30/Data/Yaml/TH.hs
--- old/yaml-0.8.23.3/Data/Yaml/TH.hs 2016-10-16 04:44:01.000000000 +0200
+++ new/yaml-0.8.30/Data/Yaml/TH.hs 2018-01-16 19:14:25.000000000 +0100
@@ -1,10 +1,13 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE TemplateHaskell #-}
module Data.Yaml.TH
( -- * Decoding
- decodeFile
+ yamlQQ
+#if MIN_VERSION_template_haskell(2,9,0)
+ , decodeFile
+#endif
-- * Re-exports from "Data.Yaml"
, Value (..)
, Parser
@@ -19,11 +22,16 @@
, FromJSON (..)
) where
-import Data.Yaml hiding (decodeFile)
-import Language.Haskell.TH
-import Language.Haskell.TH.Syntax
+import Data.Text.Encoding
+import qualified Data.Text as T
+import Language.Haskell.TH
+import Language.Haskell.TH.Syntax
+import Language.Haskell.TH.Quote
--- | Decode a @yaml@ file at compile time. Only available on GHC version @7.8.1@
+import Data.Yaml hiding (decodeFile)
+
+#if MIN_VERSION_template_haskell(2,9,0)
+-- | Decode a YAML file at compile time. Only available on GHC version @7.8.1@
-- or higher.
--
-- @since 0.8.19.0
@@ -42,3 +50,37 @@
runIO (decodeFileEither path) >>= \case
Left err -> fail (prettyPrintParseException err)
Right x -> fmap TExp (lift (x :: a))
+#endif
+
+decodeValue :: String -> Either String Value
+decodeValue = decodeEither . encodeUtf8 . T.pack
+
+yamlExp :: String -> Q Exp
+yamlExp input = case decodeValue input of
+ Left err -> fail err
+ Right a -> lift a
+
+-- | A @QuasiQuoter@ for YAML.
+--
+-- @since 0.8.28.0
+--
+-- ==== __Examples__
+--
+-- @
+-- {-\# LANGUAGE QuasiQuotes \#-}
+-- import Data.Yaml.TH
+--
+-- value :: Value
+-- value = [yamlQQ|
+-- name: John Doe
+-- age: 23
+-- |]
+-- @
+yamlQQ :: QuasiQuoter
+yamlQQ = QuasiQuoter {
+ quoteExp = yamlExp
+, quotePat = notDefined "quotePat"
+, quoteType = notDefined "quoteType"
+, quoteDec = notDefined "quoteDec"
+} where
+ notDefined name _ = fail (name ++ " is not defined for yamlQQ")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Data/Yaml.hs new/yaml-0.8.30/Data/Yaml.hs
--- old/yaml-0.8.23.3/Data/Yaml.hs 2017-07-14 09:16:50.000000000 +0200
+++ new/yaml-0.8.30/Data/Yaml.hs 2018-03-19 13:08:47.000000000 +0100
@@ -71,7 +71,6 @@
import Control.Applicative((<$>))
#endif
import Control.Exception
-import Control.Monad.Trans.Resource (runResourceT)
import Data.Aeson
( Value (..), ToJSON (..), FromJSON (..), object
, (.=) , (.:) , (.:?) , (.!=)
@@ -85,7 +84,7 @@
#endif
import Data.Aeson.Types (Pair, parseMaybe, parseEither, Parser)
import Data.ByteString (ByteString)
-import qualified Data.Conduit as C
+import Data.Conduit ((.|), runConduitRes)
import qualified Data.Conduit.List as CL
import qualified Data.HashMap.Strict as M
import qualified Data.HashSet as HashSet
@@ -101,14 +100,14 @@
import qualified Text.Libyaml as Y
encode :: ToJSON a => a -> ByteString
-encode obj = unsafePerformIO $
- runResourceT $ CL.sourceList (objToEvents $ toJSON obj)
- C.$$ Y.encode
+encode obj = unsafePerformIO $ runConduitRes
+ $ CL.sourceList (objToEvents $ toJSON obj)
+ .| Y.encode
encodeFile :: ToJSON a => FilePath -> a -> IO ()
-encodeFile fp obj = runResourceT
- $ CL.sourceList (objToEvents $ toJSON obj)
- C.$$ Y.encodeFile fp
+encodeFile fp obj = runConduitRes
+ $ CL.sourceList (objToEvents $ toJSON obj)
+ .| Y.encodeFile fp
objToEvents :: Value -> [Y.Event]
objToEvents o = (:) EventStreamStart
@@ -166,6 +165,7 @@
=> FilePath
-> IO (Maybe a)
decodeFile fp = decodeHelper (Y.decodeFile fp) >>= either throwIO (return . either (const Nothing) id)
+{-# DEPRECATED decodeFile "Please use decodeFileEither, which does not confused type-directed and runtime exceptions." #-}
-- | A version of 'decodeFile' which should not throw runtime exceptions.
--
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/Text/Libyaml.hs new/yaml-0.8.30/Text/Libyaml.hs
--- old/yaml-0.8.23.3/Text/Libyaml.hs 2017-06-16 05:46:12.000000000 +0200
+++ new/yaml-0.8.30/Text/Libyaml.hs 2018-01-15 18:30:34.000000000 +0100
@@ -479,7 +479,7 @@
deriving (Show, Typeable)
instance Exception ToEventRawException
-decode :: MonadResource m => B.ByteString -> Producer m Event
+decode :: MonadResource m => B.ByteString -> ConduitM i Event m ()
decode bs | B8.null bs = return ()
decode bs =
bracketP alloc cleanup (runParser . fst)
@@ -521,7 +521,7 @@
then withCString openMode $ \openMode' -> c_fdopen fd openMode'
else return nullPtr
-decodeFile :: MonadResource m => FilePath -> Producer m Event
+decodeFile :: MonadResource m => FilePath -> ConduitM i Event m ()
decodeFile file =
bracketP alloc cleanup (runParser . fst)
where
@@ -549,7 +549,7 @@
c_yaml_parser_delete ptr
free ptr
-runParser :: MonadResource m => Parser -> Producer m Event
+runParser :: MonadResource m => Parser -> ConduitM i Event m ()
runParser parser = do
e <- liftIO $ parserParseOne' parser
case e of
@@ -573,7 +573,7 @@
return $ Left $ YamlParseException problem context problemMark
else Right <$> getEvent er
-encode :: MonadResource m => Consumer Event m ByteString
+encode :: MonadResource m => ConduitM Event o m ByteString
encode =
runEmitter alloc close
where
@@ -590,7 +590,7 @@
encodeFile :: MonadResource m
=> FilePath
- -> Consumer Event m ()
+ -> ConduitM Event o m ()
encodeFile filePath =
bracketP getFile c_fclose $ \file -> runEmitter (alloc file) (\u _ -> return u)
where
@@ -605,7 +605,7 @@
runEmitter :: MonadResource m
=> (Emitter -> IO a) -- ^ alloc
-> (() -> a -> IO b) -- ^ close
- -> Consumer Event m b
+ -> ConduitM Event o m b
runEmitter allocI closeI =
bracketP alloc cleanup go
where
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/exe/json2yaml.hs new/yaml-0.8.30/exe/json2yaml.hs
--- old/yaml-0.8.23.3/exe/json2yaml.hs 2016-02-15 10:15:08.000000000 +0100
+++ new/yaml-0.8.30/exe/json2yaml.hs 2018-01-15 18:30:34.000000000 +0100
@@ -1,4 +1,3 @@
-import Control.Monad (when)
import qualified Data.Aeson as J
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L
@@ -9,8 +8,9 @@
main :: IO ()
main = do
args <- getArgs
- when (length args > 2) $ error "Usage: json2yaml [in] [out]"
- let (input:output:_) = args ++ repeat "-"
+ (input, output) <- case args ++ replicate (2 - length args) "-" of
+ [i, o] -> return (i, o)
+ _ -> fail "Usage: json2yaml [in] [out]"
mval <- fmap J.decode $
case input of
"-" -> L.getContents
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/exe/yaml2json.hs new/yaml-0.8.30/exe/yaml2json.hs
--- old/yaml-0.8.23.3/exe/yaml2json.hs 2016-02-15 10:15:08.000000000 +0100
+++ new/yaml-0.8.30/exe/yaml2json.hs 2017-11-13 08:06:07.000000000 +0100
@@ -5,16 +5,17 @@
import Data.ByteString.Lazy (putStr)
import System.Environment (getArgs)
import System.Exit
+import System.IO (stderr, hPutStrLn)
import Data.Yaml (decodeFileEither, decodeEither')
helpMessage :: IO ()
-helpMessage = putStrLn "yaml2json FILE\n use - as FILE to indicate stdin" >> exitFailure
+helpMessage = putStrLn "Usage: yaml2json FILE\n\nuse '-' as FILE to indicate stdin" >> exitFailure
showJSON :: Show a => Either a Value -> IO b
showJSON ejson =
case ejson of
- Left err -> print err >> exitFailure
+ Left err -> hPutStrLn stderr (show err) >> exitFailure
Right res -> putStr (encode (res :: Value)) >> exitSuccess
main :: IO ()
@@ -22,7 +23,9 @@
args <- getArgs
case args of
-- strict getContents will read in all of stdin at once
+ (["-h"]) -> helpMessage
+ (["--help"]) -> helpMessage
(["-"]) -> getContents >>= showJSON . decodeEither'
([f]) -> decodeFileEither f >>= showJSON
_ -> helpMessage
-
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/libyaml/yaml.h new/yaml-0.8.30/libyaml/yaml.h
--- old/yaml-0.8.23.3/libyaml/yaml.h 2017-06-30 06:02:56.000000000 +0200
+++ new/yaml-0.8.30/libyaml/yaml.h 2017-10-31 18:05:16.000000000 +0100
@@ -1091,7 +1091,7 @@
yaml_error_type_t error;
/** Error description. */
const char *problem;
- /** The byte about which the problem occured. */
+ /** The byte about which the problem occurred. */
size_t problem_offset;
/** The problematic value (@c -1 is none). */
int problem_value;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/test/Data/Yaml/IncludeSpec.hs new/yaml-0.8.30/test/Data/Yaml/IncludeSpec.hs
--- old/yaml-0.8.23.3/test/Data/Yaml/IncludeSpec.hs 2017-01-25 12:17:27.000000000 +0100
+++ new/yaml-0.8.30/test/Data/Yaml/IncludeSpec.hs 2017-12-29 07:47:09.000000000 +0100
@@ -1,10 +1,9 @@
-{-# LANGUAGE QuasiQuotes #-}
+{-# LANGUAGE OverloadedStrings #-}
module Data.Yaml.IncludeSpec (main, spec) where
import Test.Hspec
import Data.List (isPrefixOf)
import Data.Aeson
-import Data.Aeson.QQ
import Data.Yaml (ParseException(InvalidYaml))
import Data.Yaml.Include
import Text.Libyaml (YamlException(YamlException))
@@ -12,28 +11,33 @@
main :: IO ()
main = hspec spec
+asInt :: Int -> Int
+asInt = id
+
spec :: Spec
spec = do
describe "decodeFile" $ do
it "supports includes" $ do
- decodeFile "test/resources/foo.yaml" `shouldReturn` Just [aesonQQ|
- {
- foo: 23,
- bar: {one: 1, two: 2},
- baz: 42
- }
- |]
+ decodeFile "test/resources/foo.yaml" `shouldReturn` Just (object
+ [ "foo" .= asInt 23
+ , "bar" .= object
+ [ "one" .= asInt 1
+ , "two" .= asInt 2
+ ]
+ , "baz" .= asInt 42
+ ])
it "supports recursive includes" $ do
- decodeFile "test/resources/baz.yaml" `shouldReturn` Just [aesonQQ|
- {
- foo: {
- foo: 23,
- bar: {one: 1, two: 2},
- baz: 42
- }
- }
- |]
+ decodeFile "test/resources/baz.yaml" `shouldReturn` Just (object
+ [ "foo" .= object
+ [ "foo" .= asInt 23
+ , "bar" .= object
+ [ "one" .= asInt 1
+ , "two" .= asInt 2
+ ]
+ , "baz" .= asInt 42
+ ]
+ ])
it "aborts on cyclic includes" $ do
(decodeFile "test/resources/loop/foo.yaml" :: IO (Maybe Value)) `shouldThrow` anyException
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/test/Data/Yaml/THSpec.hs new/yaml-0.8.30/test/Data/Yaml/THSpec.hs
--- old/yaml-0.8.23.3/test/Data/Yaml/THSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/yaml-0.8.30/test/Data/Yaml/THSpec.hs 2018-01-16 19:14:25.000000000 +0100
@@ -0,0 +1,17 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE QuasiQuotes #-}
+module Data.Yaml.THSpec (spec) where
+
+import Test.Hspec
+import Data.Aeson
+
+import Data.Yaml.TH
+
+spec :: Spec
+spec = do
+ describe "yamlQQ" $ do
+ it "parses yaml" $ do
+ [yamlQQ|
+ name: John Doe
+ age: 23
+ |] `shouldBe` object ["name" .= String "John Doe", "age" .= Number 23]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/test/Data/YamlSpec.hs new/yaml-0.8.30/test/Data/YamlSpec.hs
--- old/yaml-0.8.23.3/test/Data/YamlSpec.hs 2017-07-14 09:16:04.000000000 +0200
+++ new/yaml-0.8.30/test/Data/YamlSpec.hs 2018-01-16 19:14:25.000000000 +0100
@@ -11,8 +11,7 @@
import Test.HUnit hiding (Test, path)
-import qualified Data.Conduit as C
-import qualified Control.Monad.Trans.Resource as C
+import Data.Conduit (runConduitRes, (.|), ConduitM)
import qualified Data.Conduit.List as CL
import Control.Monad
@@ -172,7 +171,7 @@
, "foo\nbar\nbaz\n"
]
-counter :: Monad m => (Y.Event -> Bool) -> C.Sink Y.Event m Int
+counter :: Monad m => (Y.Event -> Bool) -> ConduitM Y.Event o m Int
counter pred' =
CL.fold (\cnt e -> (if pred' e then 1 else 0) + cnt) 0
@@ -181,7 +180,7 @@
-> Int
-> Assertion
caseHelper yamlString pred' expRes = do
- res <- C.runResourceT $ Y.decode (B8.pack yamlString) C.$$ counter pred'
+ res <- runConduitRes $ Y.decode (B8.pack yamlString) .| counter pred'
res @?= expRes
caseCountScalarsWithAnchor :: Assertion
@@ -218,7 +217,7 @@
caseCountScalars :: Assertion
caseCountScalars = do
- res <- C.runResourceT $ Y.decode yamlBS C.$$ CL.fold adder accum
+ res <- runConduitRes $ Y.decode yamlBS .| CL.fold adder accum
res @?= (7, 1, 2)
where
yamlString = "foo:\n baz: [bin1, bin2, bin3]\nbaz: bazval"
@@ -231,7 +230,7 @@
caseLargestString :: Assertion
caseLargestString = do
- res <- C.runResourceT $ Y.decodeFile filePath C.$$ CL.fold adder accum
+ res <- runConduitRes $ Y.decodeFile filePath .| CL.fold adder accum
res @?= (length expected, expected)
where
expected = "this one is just a little bit bigger than the others"
@@ -251,9 +250,9 @@
caseEncodeDecode :: Assertion
caseEncodeDecode = do
- eList <- C.runResourceT $ Y.decode yamlBS C.$$ CL.consume
- bs <- C.runResourceT $ CL.sourceList eList C.$$ Y.encode
- eList2 <- C.runResourceT $ Y.decode bs C.$$ CL.consume
+ eList <- runConduitRes $ Y.decode yamlBS .| CL.consume
+ bs <- runConduitRes $ CL.sourceList eList .| Y.encode
+ eList2 <- runConduitRes $ Y.decode bs .| CL.consume
map MyEvent eList @=? map MyEvent eList2
where
yamlString = "foo: bar\nbaz:\n - bin1\n - bin2\n"
@@ -261,17 +260,17 @@
caseEncodeDecodeFile :: Assertion
caseEncodeDecodeFile = withFile "" $ \tmpPath -> do
- eList <- C.runResourceT $ Y.decodeFile filePath C.$$ CL.consume
- C.runResourceT $ CL.sourceList eList C.$$ Y.encodeFile tmpPath
- eList2 <- C.runResourceT $ Y.decodeFile filePath C.$$ CL.consume
+ eList <- runConduitRes $ Y.decodeFile filePath .| CL.consume
+ runConduitRes $ CL.sourceList eList .| Y.encodeFile tmpPath
+ eList2 <- runConduitRes $ Y.decodeFile filePath .| CL.consume
map MyEvent eList @=? map MyEvent eList2
where
filePath = "test/largest-string.yaml"
caseInterleave :: Assertion
caseInterleave = withFile "" $ \tmpPath -> withFile "" $ \tmpPath2 -> do
- () <- C.runResourceT $ Y.decodeFile filePath C.$$ Y.encodeFile tmpPath
- () <- C.runResourceT $ Y.decodeFile tmpPath C.$$ Y.encodeFile tmpPath2
+ () <- runConduitRes $ Y.decodeFile filePath .| Y.encodeFile tmpPath
+ () <- runConduitRes $ Y.decodeFile tmpPath .| Y.encodeFile tmpPath2
f1 <- readFile tmpPath
f2 <- readFile tmpPath2
f1 @=? f2
@@ -280,7 +279,7 @@
caseDecodeInvalidDocument :: Assertion
caseDecodeInvalidDocument = do
- x <- try $ C.runResourceT $ Y.decode yamlBS C.$$ CL.sinkNull
+ x <- try $ runConduitRes $ Y.decode yamlBS .| CL.sinkNull
case x of
Left (_ :: SomeException) -> return ()
Right y -> do
@@ -338,12 +337,12 @@
out1 <- D.decodeFile "accenté/bar.yaml"
out1 @?= Just mySample
- createDirectoryIfMissing True "test/resources/accenté/"
-
- readFile "test/resources/accent/foo.yaml" >>=
- writeFile "test/resources/accenté/foo.yaml"
- out2 <- D.decodeFile "test/resources/accenté/foo.yaml"
- out2 @?= Just mySample
+ c <- readFile "test/resources/accent/foo.yaml"
+ inTempDirectory $ do
+ createDirectoryIfMissing True "test/resources/unicode/accenté/"
+ writeFile "test/resources/unicode/accenté/foo.yaml" c
+ out2 <- D.decodeFile "test/resources/unicode/accenté/foo.yaml"
+ out2 @?= Just mySample
caseEncodeDecodeStrings :: Assertion
caseEncodeDecodeStrings = do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yaml-0.8.23.3/yaml.cabal new/yaml-0.8.30/yaml.cabal
--- old/yaml-0.8.23.3/yaml.cabal 2017-07-14 09:17:49.000000000 +0200
+++ new/yaml-0.8.30/yaml.cabal 2018-05-04 07:36:29.000000000 +0200
@@ -1,11 +1,11 @@
name: yaml
-version: 0.8.23.3
+version: 0.8.30
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael(a)snoyman.com>, Anton Ageev <antage(a)gmail.com>,Kirill Simonov
maintainer: Michael Snoyman <michael(a)snoyman.com>
synopsis: Support for parsing and rendering YAML documents.
-description: Please see the README.md file.
+description: README and API documentation are available at <https://www.stackage.org/package/yaml>
category: Web
stability: stable
cabal-version: >= 1.8
@@ -30,7 +30,7 @@
flag no-exe
description: don't install the yaml2json or json2yaml executables
- default: False
+ default: True
flag no-examples
description: don't build the examples
@@ -45,12 +45,13 @@
default: False
library
+ other-extensions: LambdaCase
build-depends: base >= 4 && < 5
, transformers >= 0.1
, bytestring >= 0.9.1.4
- , conduit >= 1.1.0 && < 1.3
- , resourcet >= 0.3 && < 1.2
- , aeson >= 0.7
+ , conduit >= 1.2.8 && < 1.4
+ , resourcet >= 0.3 && < 1.3
+ , aeson >= 0.11
, containers
, unordered-containers
, vector
@@ -60,6 +61,7 @@
, filepath
, directory
, semigroups
+ , template-haskell
exposed-modules: Text.Libyaml
Data.Yaml
Data.Yaml.Aeson
@@ -68,9 +70,7 @@
Data.Yaml.Include
Data.Yaml.Parser
Data.Yaml.Pretty
- if impl(ghc >= 7.8.1)
- build-depends: template-haskell >= 2.8.0.0
- exposed-modules: Data.Yaml.TH
+ Data.Yaml.TH
other-modules:
Data.Yaml.Internal
ghc-options: -Wall
@@ -126,6 +126,7 @@
main-is: Spec.hs
other-modules: Data.YamlSpec
Data.Yaml.IncludeSpec
+ Data.Yaml.THSpec
cpp-options: -DTEST
build-depends: hspec >= 1.3
, HUnit
@@ -140,7 +141,6 @@
, directory
, vector
, resourcet
- , aeson-qq
, mockery
, base-compat
, temporary
1
0
Hello community,
here is the log from the commit of package ghc-zip-archive for openSUSE:Factory checked in at 2018-05-30 12:16:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-zip-archive (Old)
and /work/SRC/openSUSE:Factory/.ghc-zip-archive.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-zip-archive"
Wed May 30 12:16:11 2018 rev:10 rq:607959 version:0.3.2.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-zip-archive/ghc-zip-archive.changes 2017-07-06 00:03:58.709405162 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-zip-archive.new/ghc-zip-archive.changes 2018-05-30 12:28:01.104782987 +0200
@@ -1,0 +2,20 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update zip-archive to version 0.3.2.4.
+ * Use createSymbolicLink instead of createFileLink in tests. This allows
+ us to lower the directory lower bound (#40).
+
+ * Fixes for handling of symbolic links (#39, Tommaso Piazza).
+
+ * Fixes for symbolic link tests, and additional tests.
+
+ * Add ZipOption to preserve symbolic links (#37, Tommaso Piazza).
+ Add OptPreserveSymbolicLinks constructor to ZipOption. If this option
+ is set, symbolic links will be preserved. Symbolic links are not
+ supported on Windows.
+
+ * Require binary >= 0.6 (#36).
+
+ * Improve exit handling in zip-archive program.
+
+-------------------------------------------------------------------
Old:
----
zip-archive-0.3.1.1.tar.gz
New:
----
zip-archive-0.3.2.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-zip-archive.spec ++++++
--- /var/tmp/diff_new_pack.mslXzy/_old 2018-05-30 12:28:01.808758131 +0200
+++ /var/tmp/diff_new_pack.mslXzy/_new 2018-05-30 12:28:01.808758131 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-zip-archive
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,12 +19,12 @@
%global pkg_name zip-archive
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.3.1.1
+Version: 0.3.2.4
Release: 0
Summary: Library for creating and modifying zip archives
License: BSD-3-Clause
-Group: Development/Languages/Other
-Url: https://hackage.haskell.org/package/%{pkg_name}
+Group: Development/Libraries/Haskell
+URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-array-devel
@@ -42,7 +42,7 @@
BuildRequires: ghc-time-devel
BuildRequires: ghc-unix-devel
BuildRequires: ghc-zlib-devel
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: unzip
%if %{with tests}
BuildRequires: ghc-HUnit-devel
BuildRequires: ghc-process-devel
@@ -55,7 +55,7 @@
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Libraries/Other
+Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
@@ -83,11 +83,9 @@
%ghc_pkg_recache
%files -f %{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
-%defattr(-,root,root,-)
%doc README.markdown changelog
%changelog
++++++ zip-archive-0.3.1.1.tar.gz -> zip-archive-0.3.2.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zip-archive-0.3.1.1/Main.hs new/zip-archive-0.3.2.4/Main.hs
--- old/zip-archive-0.3.1.1/Main.hs 2017-06-04 13:08:55.000000000 +0200
+++ new/zip-archive-0.3.2.4/Main.hs 2018-01-22 21:11:33.000000000 +0100
@@ -44,6 +44,14 @@
, Option ['h'] ["help"] (NoArg Help) "help"
]
+quit :: Bool -> String -> IO a
+quit failure msg = do
+ hPutStr stderr msg
+ _ <- exitWith $ if failure
+ then ExitFailure 1
+ else ExitSuccess
+ return undefined
+
main :: IO ()
main = do
argv <- getArgs
@@ -53,9 +61,10 @@
(o, _, _) | Version `elem` o -> do
putStrLn ("version " ++ showVersion version)
exitWith ExitSuccess
- (o, _, _) | Help `elem` o -> error $ usageInfo header options
+ (o, _, _) | Help `elem` o -> quit False $ usageInfo header options
(o, (a:as), []) -> return (o, a:as)
- (_, _, errs) -> error $ concat errs ++ "\n" ++ usageInfo header options
+ (_, [], []) -> quit True $ usageInfo header options
+ (_, _, errs) -> quit True $ concat errs ++ "\n" ++ usageInfo header options
let verbosity = if Quiet `elem` opts then [] else [OptVerbose]
let debug = Debug `elem` opts
let cmd = case filter (`notElem` [Quiet, Help, Version, Debug]) opts of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zip-archive-0.3.1.1/Setup.hs new/zip-archive-0.3.2.4/Setup.hs
--- old/zip-archive-0.3.1.1/Setup.hs 2017-06-04 13:52:37.000000000 +0200
+++ new/zip-archive-0.3.2.4/Setup.hs 2018-02-12 19:12:13.000000000 +0100
@@ -1,2 +1,8 @@
import Distribution.Simple
-main = defaultMain
+import Distribution.Simple.Program
+
+main :: IO ()
+main = defaultMainWithHooks simpleUserHooks
+ { hookedPrograms = [ simpleProgram "unzip"
+ ]
+ }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zip-archive-0.3.1.1/changelog new/zip-archive-0.3.2.4/changelog
--- old/zip-archive-0.3.1.1/changelog 2017-06-19 10:39:30.000000000 +0200
+++ new/zip-archive-0.3.2.4/changelog 2018-02-21 23:27:59.000000000 +0100
@@ -1,3 +1,33 @@
+zip-archive 0.3.2.4
+
+ * Make build-tools stanza conditional on non-windows. Closes #44.
+
+zip-archive 0.3.2.3
+
+ * Use custom-setup stanza and specify build-tools. Closes #41.
+
+zip-archive 0.3.2.2
+
+ * Use createSymbolicLink instead of createFileLink in tests. This allows
+ us to lower the directory lower bound (#40).
+
+zip-archive 0.3.2.1
+
+ * Fixes for handling of symbolic links (#39, Tommaso Piazza).
+
+ * Fixes for symbolic link tests, and additional tests.
+
+zip-archive 0.3.2
+
+ * Add ZipOption to preserve symbolic links (#37, Tommaso Piazza).
+ Add OptPreserveSymbolicLinks constructor to ZipOption. If this option
+ is set, symbolic links will be preserved. Symbolic links are not
+ supported on Windows.
+
+ * Require binary >= 0.6 (#36).
+
+ * Improve exit handling in zip-archive program.
+
zip-archive 0.3.1.1
* readEntry: Read file as a strict ByteString. This avoids
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zip-archive-0.3.1.1/src/Codec/Archive/Zip.hs new/zip-archive-0.3.2.4/src/Codec/Archive/Zip.hs
--- old/zip-archive-0.3.1.1/src/Codec/Archive/Zip.hs 2017-06-19 10:31:55.000000000 +0200
+++ new/zip-archive-0.3.2.4/src/Codec/Archive/Zip.hs 2018-01-22 21:12:49.000000000 +0100
@@ -48,10 +48,18 @@
, findEntryByPath
, fromEntry
, toEntry
+#ifndef _WINDOWS
+ , isEntrySymbolicLink
+ , symbolicLinkEntryTarget
+ , entryCMode
+#endif
-- * IO functions for working with zip archives
, readEntry
, writeEntry
+#ifndef _WINDOWS
+ , writeSymbolicLinkEntry
+#endif
, addFilesToArchive
, extractFilesFromArchive
@@ -65,8 +73,9 @@
import Data.Binary
import Data.Binary.Get
import Data.Binary.Put
-import Data.List ( nub, find, intercalate )
+import Data.List ( nub, find, intercalate, partition)
import Data.Data (Data)
+import Data.Maybe (fromJust)
import Data.Typeable (Typeable)
import Text.Printf
import System.FilePath
@@ -81,12 +90,14 @@
import Control.Applicative
#endif
#ifndef _WINDOWS
-import System.Posix.Files ( setFileTimes, setFileMode, fileMode, getFileStatus )
+import System.Posix.Files ( setFileTimes, setFileMode, fileMode, getSymbolicLinkStatus, symbolicLinkMode, readSymbolicLink, isSymbolicLink, unionFileModes, createSymbolicLink )
+import System.Posix.Types ( CMode(..) )
#endif
-- from bytestring
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as B
+import qualified Data.ByteString.Lazy.Char8 as C (pack, unpack)
-- text
import qualified Data.Text.Lazy as TL
@@ -155,6 +166,7 @@
| OptVerbose -- ^ Print information to stderr
| OptDestination FilePath -- ^ Directory in which to extract
| OptLocation FilePath Bool -- ^ Where to place file when adding files and whether to append current path
+ | OptPreserveSymbolicLinks -- ^ Preserve symbolic links as such. This option is ignored on Windows.
deriving (Read, Show, Eq)
data ZipException =
@@ -252,17 +264,34 @@
readEntry :: [ZipOption] -> FilePath -> IO Entry
readEntry opts path = do
isDir <- doesDirectoryExist path
- -- make sure directories end in / and deal with the OptLocation option
+#ifdef _WINDOWS
+ let isSymLink = False
+#else
+ fs <- getSymbolicLinkStatus path
+ let isSymLink = isSymbolicLink fs
+#endif
+ -- make sure directories end in / and deal with the OptLocation option
let path' = let p = path ++ (case reverse path of
('/':_) -> ""
- _ | isDir -> "/"
+ _ | isDir && not isSymLink -> "/"
+ _ | isDir && isSymLink -> ""
| otherwise -> "") in
(case [(l,a) | OptLocation l a <- opts] of
((l,a):_) -> if a then l </> p else l </> takeFileName p
_ -> p)
- contents <- if isDir
- then return B.empty
- else B.fromStrict <$> S.readFile path
+ contents <-
+#ifndef _WINDOWS
+ if isSymLink
+ then do
+ linkTarget <- readSymbolicLink path
+ return $ C.pack linkTarget
+ else
+#endif
+ if isDir
+ then
+ return B.empty
+ else
+ B.fromStrict <$> S.readFile path
#if MIN_VERSION_directory(1,2,0)
modEpochTime <- fmap (floor . utcTimeToPOSIXSeconds)
$ getModificationTime path
@@ -275,7 +304,11 @@
#ifdef _WINDOWS
return $ entry
#else
- do fm <- fmap fileMode $ getFileStatus path
+ do
+ let fm = if isSymLink
+ then unionFileModes symbolicLinkMode (fileMode fs)
+ else fileMode fs
+
let modes = fromIntegral $ shiftL (toInteger fm) 16
return $ entry { eExternalFileAttributes = modes,
eVersionMadeBy = versionMadeBy }
@@ -319,20 +352,62 @@
#ifndef _WINDOWS
let modes = fromIntegral $ shiftR (eExternalFileAttributes entry) 16
when (eVersionMadeBy entry .&. 0xFF00 == 0x0300 &&
- modes /= 0) $ setFileMode path modes
+ modes /= 0) $ setFileMode path modes
#endif
-
-- Note that last modified times are supported only for POSIX, not for
-- Windows.
setFileTimeStamp path (eLastModified entry)
+#ifndef _WINDOWS
+-- | Write an 'Entry' representing a symbolic link to a file.
+-- If the 'Entry' does not represent a symbolic link or
+-- the options do not contain 'OptPreserveSymbolicLinks`, this
+-- function behaves like `writeEntry`.
+writeSymbolicLinkEntry :: [ZipOption] -> Entry -> IO ()
+writeSymbolicLinkEntry opts entry = do
+ if OptPreserveSymbolicLinks `notElem` opts
+ then writeEntry opts entry
+ else do
+ if (isEntrySymbolicLink entry)
+ then do
+ let prefixPath = case [d | OptDestination d <- opts] of
+ (x:_) -> x
+ _ -> ""
+ let targetPath = fromJust . symbolicLinkEntryTarget $ entry
+ let symlinkPath = prefixPath </> eRelativePath entry
+ when (OptVerbose `elem` opts) $ do
+ hPutStrLn stderr $ "linking " ++ symlinkPath ++ " to " ++ targetPath
+ createSymbolicLink targetPath symlinkPath
+ else writeEntry opts entry
+
+
+-- | Get the target of a 'Entry' representing a symbolic link. This might fail
+-- if the 'Entry' does not represent a symbolic link
+symbolicLinkEntryTarget :: Entry -> Maybe FilePath
+symbolicLinkEntryTarget entry | isEntrySymbolicLink entry = Just . C.unpack $ fromEntry entry
+ | otherwise = Nothing
+
+-- | Check if an 'Entry' represents a symbolic link
+isEntrySymbolicLink :: Entry -> Bool
+isEntrySymbolicLink entry = entryCMode entry .&. symbolicLinkMode == symbolicLinkMode
+
+-- | Get the 'eExternalFileAttributes' of an 'Entry' as a 'CMode' a.k.a. 'FileMode'
+entryCMode :: Entry -> CMode
+entryCMode entry = CMode (fromIntegral $ shiftR (eExternalFileAttributes entry) 16)
+#endif
+
-- | Add the specified files to an 'Archive'. If 'OptRecursive' is specified,
--- recursively add files contained in directories. If 'OptVerbose' is specified,
+-- recursively add files contained in directories. if 'OptPreserveSymbolicLinks'
+-- is specified, don't recurse into it. If 'OptVerbose' is specified,
-- print messages to stderr.
addFilesToArchive :: [ZipOption] -> Archive -> [FilePath] -> IO Archive
addFilesToArchive opts archive files = do
filesAndChildren <- if OptRecursive `elem` opts
+#ifdef _WINDOWS
then mapM getDirectoryContentsRecursive files >>= return . nub . concat
+#else
+ then mapM (getDirectoryContentsRecursive' opts) files >>= return . nub . concat
+#endif
else return files
entries <- mapM (readEntry opts) filesAndChildren
return $ foldr addEntryToArchive archive entries
@@ -342,8 +417,17 @@
-- Note that the last-modified time is set correctly only in POSIX,
-- not in Windows.
extractFilesFromArchive :: [ZipOption] -> Archive -> IO ()
-extractFilesFromArchive opts archive =
- mapM_ (writeEntry opts) $ zEntries archive
+extractFilesFromArchive opts archive = do
+ if OptPreserveSymbolicLinks `elem` opts
+ then do
+#ifdef _WINDOWS
+ mapM_ (writeEntry opts) $ zEntries archive
+#else
+ let (symbolicLinkEntries, nonSymbolicLinkEntries) = partition isEntrySymbolicLink $ zEntries archive
+ mapM_ (writeEntry opts) $ nonSymbolicLinkEntries
+ mapM_ (writeSymbolicLinkEntry opts) $ symbolicLinkEntries
+#endif
+ else mapM_ (writeEntry opts) $ zEntries archive
--------------------------------------------------------------------------------
-- Internal functions for reading and writing zip binary format.
@@ -426,18 +510,38 @@
(TOD epochsecs _) = addToClockTime timeSinceEpoch (TOD 0 0)
in epochsecs
+#ifndef _WINDOWS
+getDirectoryContentsRecursive' :: [ZipOption] -> FilePath -> IO [FilePath]
+getDirectoryContentsRecursive' opts path = do
+ if OptPreserveSymbolicLinks `elem` opts
+ then do
+ isDir <- doesDirectoryExist path
+ if isDir
+ then do
+ isSymLink <- fmap isSymbolicLink $ getSymbolicLinkStatus path
+ if isSymLink
+ then return [path]
+ else getDirectoryContentsRecursivelyBy (getDirectoryContentsRecursive' opts) path
+ else return [path]
+ else getDirectoryContentsRecursive path
+#endif
+
getDirectoryContentsRecursive :: FilePath -> IO [FilePath]
getDirectoryContentsRecursive path = do
isDir <- doesDirectoryExist path
if isDir
- then do
+ then getDirectoryContentsRecursivelyBy getDirectoryContentsRecursive path
+ else return [path]
+
+getDirectoryContentsRecursivelyBy :: (FilePath -> IO [FilePath]) -> FilePath -> IO [FilePath]
+getDirectoryContentsRecursivelyBy exploreMethod path = do
contents <- getDirectoryContents path
let contents' = map (path </>) $ filter (`notElem` ["..","."]) contents
- children <- mapM getDirectoryContentsRecursive contents'
+ children <- mapM exploreMethod contents'
if path == "."
then return (concat children)
else return (path : concat children)
- else return [path]
+
setFileTimeStamp :: FilePath -> Integer -> IO ()
setFileTimeStamp file epochtime = do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zip-archive-0.3.1.1/tests/test-zip-archive.hs new/zip-archive-0.3.2.4/tests/test-zip-archive.hs
--- old/zip-archive-0.3.1.1/tests/test-zip-archive.hs 2017-06-19 10:17:27.000000000 +0200
+++ new/zip-archive-0.3.2.4/tests/test-zip-archive.hs 2018-02-12 19:09:05.000000000 +0100
@@ -4,17 +4,21 @@
-- runghc Test.hs
import Codec.Archive.Zip
-import System.Directory
+import Control.Applicative
+import System.Directory hiding (isSymbolicLink)
import Test.HUnit.Base
import Test.HUnit.Text
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy as BL
-import Control.Applicative
import System.Exit
import System.IO.Temp (withTempDirectory)
#ifndef _WINDOWS
+import System.FilePath.Posix
import System.Posix.Files
+import System.Process (rawSystem)
+#else
+import System.FilePath.Windows
#endif
-- define equality for Archives so timestamps aren't distinguished if they
@@ -25,6 +29,23 @@
&& (all id $ zipWith (\x y -> x { eLastModified = eLastModified x `div` 2 } ==
y { eLastModified = eLastModified y `div` 2 }) (zEntries a1) (zEntries a2))
+#ifndef _WINDOWS
+
+createTestDirectoryWithSymlinks :: FilePath -> FilePath -> IO FilePath
+createTestDirectoryWithSymlinks prefixDir baseDir = do
+ let testDir = prefixDir </> baseDir
+ createDirectoryIfMissing True testDir
+ createDirectoryIfMissing True (testDir </> "1")
+ writeFile (testDir </> "1/file.txt") "hello"
+ cwd <- getCurrentDirectory
+ createSymbolicLink (cwd </> testDir </> "1/file.txt") (testDir </> "link_to_file")
+ createSymbolicLink (cwd </> testDir </> "1") (testDir </> "link_to_directory")
+ return testDir
+
+#endif
+
+
+
main :: IO Counts
main = withTempDirectory "." "test-zip-archive." $ \tmpDir -> do
res <- runTestTT $ TestList $ map (\f -> f tmpDir)
@@ -37,6 +58,9 @@
, testExtractFiles
#ifndef _WINDOWS
, testExtractFilesWithPosixAttrs
+ , testArchiveExtractSymlinks
+ , testExtractExternalZipWithSymlinks
+ , testArchiveAndUnzip
#endif
]
exitWith $ case (failures res + errors res) of
@@ -46,8 +70,8 @@
testReadWriteArchive :: FilePath -> Test
testReadWriteArchive tmpDir = TestCase $ do
archive <- addFilesToArchive [OptRecursive] emptyArchive ["LICENSE", "src"]
- BL.writeFile (tmpDir ++ "/test1.zip") $ fromArchive archive
- archive' <- toArchive <$> BL.readFile (tmpDir ++ "/test1.zip")
+ BL.writeFile (tmpDir </> "test1.zip") $ fromArchive archive
+ archive' <- toArchive <$> BL.readFile (tmpDir </> "test1.zip")
assertEqual "for writing and reading test1.zip" archive archive'
assertEqual "for writing and reading test1.zip" archive archive'
@@ -69,9 +93,14 @@
BL.empty (fromEntry f)
testFromToArchive :: FilePath -> Test
-testFromToArchive _tmpDir = TestCase $ do
- archive <- addFilesToArchive [OptRecursive] emptyArchive ["LICENSE", "src"]
- assertEqual "for (toArchive $ fromArchive archive)" archive (toArchive $ fromArchive archive)
+testFromToArchive tmpDir = TestCase $ do
+ archive1 <- addFilesToArchive [OptRecursive] emptyArchive ["LICENSE", "src"]
+ assertEqual "for (toArchive $ fromArchive archive)" archive1 (toArchive $ fromArchive archive1)
+#ifndef _WINDOWS
+ testDir <- createTestDirectoryWithSymlinks tmpDir "test_dir_with_symlinks"
+ archive2 <- addFilesToArchive [OptRecursive, OptPreserveSymbolicLinks] emptyArchive [testDir]
+ assertEqual "for (toArchive $ fromArchive archive)" archive2 (toArchive $ fromArchive archive2)
+#endif
testReadWriteEntry :: FilePath -> Test
testReadWriteEntry tmpDir = TestCase $ do
@@ -79,16 +108,26 @@
setCurrentDirectory tmpDir
writeEntry [] entry
setCurrentDirectory ".."
- entry' <- readEntry [] (tmpDir ++ "/zip-archive.cabal")
+ entry' <- readEntry [] (tmpDir </> "zip-archive.cabal")
let entry'' = entry' { eRelativePath = eRelativePath entry, eLastModified = eLastModified entry }
assertEqual "for readEntry -> writeEntry -> readEntry" entry entry''
testAddFilesOptions :: FilePath -> Test
-testAddFilesOptions _tmpDir = TestCase $ do
+testAddFilesOptions tmpDir = TestCase $ do
archive1 <- addFilesToArchive [OptVerbose] emptyArchive ["LICENSE", "src"]
archive2 <- addFilesToArchive [OptRecursive, OptVerbose] archive1 ["LICENSE", "src"]
assertBool "for recursive and nonrecursive addFilesToArchive"
(length (filesInArchive archive1) < length (filesInArchive archive2))
+#ifndef _WINDOWS
+ testDir <- createTestDirectoryWithSymlinks tmpDir "test_dir_with_symlinks2"
+ archive3 <- addFilesToArchive [OptVerbose, OptRecursive] emptyArchive [testDir]
+ archive4 <- addFilesToArchive [OptVerbose, OptRecursive, OptPreserveSymbolicLinks] emptyArchive [testDir]
+ mapM_ putStrLn $ filesInArchive archive3
+ mapM_ putStrLn $ filesInArchive archive4
+ assertBool "for recursive and recursive by preserving symlinks addFilesToArchive"
+ (length (filesInArchive archive4) < length (filesInArchive archive3))
+#endif
+
testDeleteEntries :: FilePath -> Test
testDeleteEntries _tmpDir = TestCase $ do
@@ -99,33 +138,88 @@
testExtractFiles :: FilePath -> Test
testExtractFiles tmpDir = TestCase $ do
- createDirectory (tmpDir ++ "/dir1")
- createDirectory (tmpDir ++ "/dir1/dir2")
+ createDirectory (tmpDir </> "dir1")
+ createDirectory (tmpDir </> "dir1/dir2")
let hiMsg = BS.pack "hello there"
let helloMsg = BS.pack "Hello there. This file is very long. Longer than 31 characters."
- BS.writeFile (tmpDir ++ "/dir1/hi") hiMsg
- BS.writeFile (tmpDir ++ "/dir1/dir2/hello") helloMsg
- archive <- addFilesToArchive [OptRecursive] emptyArchive [(tmpDir ++ "/dir1")]
- removeDirectoryRecursive (tmpDir ++ "/dir1")
+ BS.writeFile (tmpDir </> "dir1/hi") hiMsg
+ BS.writeFile (tmpDir </> "dir1/dir2/hello") helloMsg
+ archive <- addFilesToArchive [OptRecursive] emptyArchive [(tmpDir </> "dir1")]
+ removeDirectoryRecursive (tmpDir </> "dir1")
extractFilesFromArchive [OptVerbose] archive
- hi <- BS.readFile (tmpDir ++ "/dir1/hi")
- hello <- BS.readFile (tmpDir ++ "/dir1/dir2/hello")
- assertEqual ("contents of " ++ tmpDir ++ "/dir1/hi") hiMsg hi
- assertEqual ("contents of " ++ tmpDir ++ "/dir1/dir2/hello") helloMsg hello
+ hi <- BS.readFile (tmpDir </> "dir1/hi")
+ hello <- BS.readFile (tmpDir </> "dir1/dir2/hello")
+ assertEqual ("contents of " </> tmpDir </> "dir1/hi") hiMsg hi
+ assertEqual ("contents of " </> tmpDir </> "dir1/dir2/hello") helloMsg hello
#ifndef _WINDOWS
+
testExtractFilesWithPosixAttrs :: FilePath -> Test
testExtractFilesWithPosixAttrs tmpDir = TestCase $ do
- createDirectory (tmpDir ++ "/dir3")
+ createDirectory (tmpDir </> "dir3")
let hiMsg = "hello there"
- writeFile (tmpDir ++ "/dir3/hi") hiMsg
+ writeFile (tmpDir </> "dir3/hi") hiMsg
let perms = unionFileModes ownerReadMode $ unionFileModes ownerWriteMode ownerExecuteMode
- setFileMode (tmpDir ++ "/dir3/hi") perms
- archive <- addFilesToArchive [OptRecursive] emptyArchive [(tmpDir ++ "/dir3")]
- removeDirectoryRecursive (tmpDir ++ "/dir3")
+ setFileMode (tmpDir </> "dir3/hi") perms
+ archive <- addFilesToArchive [OptRecursive] emptyArchive [(tmpDir </> "dir3")]
+ removeDirectoryRecursive (tmpDir </> "dir3")
extractFilesFromArchive [OptVerbose] archive
- hi <- readFile (tmpDir ++ "/dir3/hi")
- fm <- fmap fileMode $ getFileStatus (tmpDir ++ "/dir3/hi")
+ hi <- readFile (tmpDir </> "dir3/hi")
+ fm <- fmap fileMode $ getFileStatus (tmpDir </> "dir3/hi")
assertEqual "file modes" perms (intersectFileModes perms fm)
- assertEqual ("contents of " ++ tmpDir ++ "/dir3/hi") hiMsg hi
+ assertEqual ("contents of " </> tmpDir </> "dir3/hi") hiMsg hi
+
+testArchiveExtractSymlinks :: FilePath -> Test
+testArchiveExtractSymlinks tmpDir = TestCase $ do
+ testDir <- createTestDirectoryWithSymlinks tmpDir "test_dir_with_symlinks3"
+ let locationDir = "location_dir"
+ archive <- addFilesToArchive [OptRecursive, OptPreserveSymbolicLinks, OptLocation locationDir True] emptyArchive [testDir]
+ removeDirectoryRecursive testDir
+ let destination = "test_dest"
+ extractFilesFromArchive [OptPreserveSymbolicLinks, OptDestination destination] archive
+ isDirSymlink <- pathIsSymbolicLink (destination </> locationDir </> testDir </> "link_to_directory")
+ isFileSymlink <- pathIsSymbolicLink (destination </> locationDir </> testDir </> "link_to_file")
+ assertBool "Symbolic link to directory is preserved" isDirSymlink
+ assertBool "Symbolic link to file is preserved" isFileSymlink
+ removeDirectoryRecursive destination
+
+testExtractExternalZipWithSymlinks :: FilePath -> Test
+testExtractExternalZipWithSymlinks tmpDir = TestCase $ do
+ archive <- toArchive <$> BL.readFile "tests/zip_with_symlinks.zip"
+ extractFilesFromArchive [OptPreserveSymbolicLinks, OptDestination tmpDir] archive
+ let zipRootDir = "zip_test_dir_with_symlinks"
+ symlinkDir = tmpDir </> zipRootDir </> "symlink_to_dir_1"
+ symlinkFile = tmpDir </> zipRootDir </> "symlink_to_file_1"
+ isDirSymlink <- pathIsSymbolicLink symlinkDir
+ targetDirExists <- doesDirectoryExist symlinkDir
+ isFileSymlink <- pathIsSymbolicLink symlinkFile
+ targetFileExists <- doesFileExist symlinkFile
+ assertBool "Symbolic link to directory is preserved" isDirSymlink
+ assertBool "Target directory exists" targetDirExists
+ assertBool "Symbolic link to file is preserved" isFileSymlink
+ assertBool "Target file exists" targetFileExists
+ removeDirectoryRecursive tmpDir
+
+testArchiveAndUnzip :: FilePath -> Test
+testArchiveAndUnzip tmpDir = TestCase $ do
+ let dir = "test_dir_with_symlinks4"
+ testDir <- createTestDirectoryWithSymlinks tmpDir dir
+ archive <- addFilesToArchive [OptRecursive, OptPreserveSymbolicLinks] emptyArchive [testDir]
+ removeDirectoryRecursive testDir
+ let zipFile = tmpDir </> "testUnzip.zip"
+ BL.writeFile zipFile $ fromArchive archive
+ ec <- rawSystem "unzip" [zipFile]
+ assertBool "unzip succeeds" $ ec == ExitSuccess
+ let symlinkDir = testDir </> "link_to_directory"
+ symlinkFile = testDir </> "link_to_file"
+ isDirSymlink <- pathIsSymbolicLink symlinkDir
+ targetDirExists <- doesDirectoryExist symlinkDir
+ isFileSymlink <- pathIsSymbolicLink symlinkFile
+ targetFileExists <- doesFileExist symlinkFile
+ assertBool "Symbolic link to directory is preserved" isDirSymlink
+ assertBool "Target directory exists" targetDirExists
+ assertBool "Symbolic link to file is preserved" isFileSymlink
+ assertBool "Target file exists" targetFileExists
+ removeDirectoryRecursive tmpDir
+
#endif
Binary files old/zip-archive-0.3.1.1/tests/zip_with_symlinks.zip and new/zip-archive-0.3.2.4/tests/zip_with_symlinks.zip differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zip-archive-0.3.1.1/zip-archive.cabal new/zip-archive-0.3.2.4/zip-archive.cabal
--- old/zip-archive-0.3.1.1/zip-archive.cabal 2017-06-19 09:47:36.000000000 +0200
+++ new/zip-archive-0.3.2.4/zip-archive.cabal 2018-02-21 23:27:40.000000000 +0100
@@ -1,23 +1,24 @@
Name: zip-archive
-Version: 0.3.1.1
+Version: 0.3.2.4
Cabal-Version: >= 1.10
-Build-type: Simple
+Build-type: Custom
Synopsis: Library for creating and modifying zip archives.
Description: The zip-archive library provides functions for creating, modifying,
and extracting files from zip archives.
Category: Codec
-Tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.2
+Tested-with: GHC == 7.8.2, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2
License: BSD3
License-file: LICENSE
Homepage: http://github.com/jgm/zip-archive
Author: John MacFarlane
Maintainer: jgm(a)berkeley.edu
-Extra-Source-Files: changelog,
- README.markdown,
- tests/test4.zip,
- tests/test4/a.txt,
- tests/test4/b.bin,
+Extra-Source-Files: changelog
+ README.markdown
+ tests/test4.zip
+ tests/test4/a.txt
+ tests/test4/b.bin
"tests/test4/c/with spaces.txt"
+ tests/zip_with_symlinks.zip
Source-repository head
type: git
@@ -35,7 +36,7 @@
Build-depends: base >= 3 && < 5, pretty, containers
else
Build-depends: base < 3
- Build-depends: binary >= 0.5, zlib, filepath, bytestring >= 0.10.0,
+ Build-depends: binary >= 0.6, zlib, filepath, bytestring >= 0.10.0,
array, mtl, text >= 0.11, old-time, digest >= 0.0.0.1,
directory, time
Exposed-modules: Codec.Archive.Zip
@@ -46,6 +47,10 @@
cpp-options: -D_WINDOWS
else
Build-depends: unix
+ Build-tools: unzip
+
+custom-setup
+ setup-depends: base, Cabal
Executable zip-archive
if flag(executable)
@@ -65,8 +70,8 @@
Main-Is: test-zip-archive.hs
Hs-Source-Dirs: tests
Build-Depends: base >= 4.2 && < 5,
- directory, bytestring >= 0.9.0, process, time, old-time,
- HUnit, zip-archive, temporary
+ directory >= 1.3, bytestring >= 0.9.0, process, time, old-time,
+ HUnit, zip-archive, temporary, filepath
Default-Language: Haskell98
Ghc-Options: -Wall
if os(windows)
1
0
Hello community,
here is the log from the commit of package ghc-xml for openSUSE:Factory checked in at 2018-05-30 12:21:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-xml (Old)
and /work/SRC/openSUSE:Factory/.ghc-xml.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-xml"
Wed May 30 12:21:40 2018 rev:6 rq:609832 version:1.3.14
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-xml/ghc-xml.changes 2017-09-15 22:26:39.666770060 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-xml.new/ghc-xml.changes 2018-05-30 12:27:59.292846932 +0200
@@ -1,0 +2,5 @@
+Wed May 16 14:36:30 UTC 2018 - psimons(a)suse.com
+
+- Prefer the new %license attribute over %doc.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-xml.spec ++++++
--- /var/tmp/diff_new_pack.faWEGa/_old 2018-05-30 12:27:59.956823506 +0200
+++ /var/tmp/diff_new_pack.faWEGa/_new 2018-05-30 12:27:59.956823506 +0200
@@ -60,7 +60,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
1
0
Hello community,
here is the log from the commit of package ghc-x509-validation for openSUSE:Factory checked in at 2018-05-30 12:16:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-x509-validation (Old)
and /work/SRC/openSUSE:Factory/.ghc-x509-validation.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-x509-validation"
Wed May 30 12:16:02 2018 rev:9 rq:607928 version:1.6.10
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-x509-validation/ghc-x509-validation.changes 2017-08-31 21:01:55.537369905 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-x509-validation.new/ghc-x509-validation.changes 2018-05-30 12:27:58.156886999 +0200
@@ -1,0 +2,6 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update x509-validation to version 1.6.10 revision 1.
+ Upstream does not provide a changelog.
+
+-------------------------------------------------------------------
Old:
----
x509-validation-1.6.8.tar.gz
New:
----
x509-validation-1.6.10.tar.gz
x509-validation.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-x509-validation.spec ++++++
--- /var/tmp/diff_new_pack.hu1RvT/_old 2018-05-30 12:27:58.956858786 +0200
+++ /var/tmp/diff_new_pack.hu1RvT/_new 2018-05-30 12:27:58.960858645 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-x509-validation
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,17 +19,17 @@
%global pkg_name x509-validation
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.6.8
+Version: 1.6.10
Release: 0
Summary: X.509 Certificate and CRL validation
License: BSD-3-Clause
-Group: Development/Languages/Other
-Url: https://hackage.haskell.org/package/%{pkg_name}
+Group: Development/Libraries/Haskell
+URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-asn1-encoding-devel
BuildRequires: ghc-asn1-types-devel
-BuildRequires: ghc-byteable-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
BuildRequires: ghc-cryptonite-devel
@@ -41,7 +41,6 @@
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-x509-devel
BuildRequires: ghc-x509-store-devel
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
BuildRequires: ghc-tasty-devel
BuildRequires: ghc-tasty-hunit-devel
@@ -52,7 +51,7 @@
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Libraries/Other
+Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
@@ -64,6 +63,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
@@ -81,10 +81,8 @@
%ghc_pkg_recache
%files -f %{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
-%defattr(-,root,root,-)
%changelog
++++++ x509-validation-1.6.8.tar.gz -> x509-validation-1.6.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-validation-1.6.8/Data/X509/Validation/Fingerprint.hs new/x509-validation-1.6.10/Data/X509/Validation/Fingerprint.hs
--- old/x509-validation-1.6.8/Data/X509/Validation/Fingerprint.hs 2017-06-26 18:12:09.000000000 +0200
+++ new/x509-validation-1.6.10/Data/X509/Validation/Fingerprint.hs 2018-03-01 22:14:19.000000000 +0100
@@ -5,6 +5,7 @@
-- Stability : experimental
-- Portability : unknown
--
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Data.X509.Validation.Fingerprint
( Fingerprint(..)
, getFingerprint
@@ -13,16 +14,14 @@
import Crypto.Hash
import Data.X509
import Data.ASN1.Types
-import Data.ByteArray (convert)
+import Data.ByteArray (convert, ByteArrayAccess)
import Data.ByteString (ByteString)
-import Data.Byteable
-- | Fingerprint of a certificate
newtype Fingerprint = Fingerprint ByteString
deriving (Show,Eq)
-instance Byteable Fingerprint where
- toBytes (Fingerprint bs) = bs
+instance ByteArrayAccess Fingerprint
-- | Get the fingerprint of the whole signed object
-- using the hashing algorithm specified
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-validation-1.6.8/Data/X509/Validation/Signature.hs new/x509-validation-1.6.10/Data/X509/Validation/Signature.hs
--- old/x509-validation-1.6.8/Data/X509/Validation/Signature.hs 2017-06-26 18:12:09.000000000 +0200
+++ new/x509-validation-1.6.10/Data/X509/Validation/Signature.hs 2017-07-31 22:17:24.000000000 +0200
@@ -18,15 +18,12 @@
import qualified Crypto.PubKey.RSA.PSS as PSS
import qualified Crypto.PubKey.DSA as DSA
import qualified Crypto.PubKey.ECC.Types as ECC
-import qualified Crypto.PubKey.ECC.Prim as ECC
import qualified Crypto.PubKey.ECC.ECDSA as ECDSA
import Crypto.Hash
-import Crypto.Number.Serialize (os2ip)
import Data.ByteString (ByteString)
-import qualified Data.ByteString as B
import Data.X509
-import Data.List (find)
+import Data.X509.EC
import Data.ASN1.Types
import Data.ASN1.Encoding
import Data.ASN1.BinaryEncoding
@@ -126,49 +123,19 @@
verifyECDSA :: HashALG -> PubKeyEC -> Maybe (ByteString -> ByteString -> Bool)
verifyECDSA hashALG key =
- case key of
- PubKeyEC_Named curveName pub -> verifyCurve curveName pub
- PubKeyEC_Prime {} ->
- case find matchPrimeCurve $ enumFrom $ toEnum 0 of
- Nothing -> Nothing
- Just curveName -> verifyCurve curveName (pubkeyEC_pub key)
+ ecPubKeyCurveName key >>= verifyCurve (pubkeyEC_pub key)
where
- matchPrimeCurve c =
- case ECC.getCurveByName c of
- ECC.CurveFP (ECC.CurvePrime p cc) ->
- ECC.ecc_a cc == pubkeyEC_a key &&
- ECC.ecc_b cc == pubkeyEC_b key &&
- ECC.ecc_n cc == pubkeyEC_order key &&
- p == pubkeyEC_prime key
- _ -> False
-
- verifyCurve curveName pub = Just $ \msg sigBS ->
+ verifyCurve pub curveName = Just $ \msg sigBS ->
case decodeASN1' BER sigBS of
Left _ -> False
Right [Start Sequence,IntVal r,IntVal s,End Sequence] ->
- case unserializePoint (ECC.getCurveByName curveName) pub of
- Nothing -> False
- Just pubkey -> (ecdsaVerify hashALG) pubkey (ECDSA.Signature r s) msg
+ let curve = ECC.getCurveByName curveName
+ in case unserializePoint curve pub of
+ Nothing -> False
+ Just p -> let pubkey = ECDSA.PublicKey curve p
+ in (ecdsaVerify hashALG) pubkey (ECDSA.Signature r s) msg
Right _ -> False
- unserializePoint curve (SerializedPoint bs) =
- case B.uncons bs of
- Nothing -> Nothing
- Just (ptFormat, input) ->
- case ptFormat of
- 4 -> if B.length input /= 2 * bytes
- then Nothing
- else
- let (x, y) = B.splitAt bytes input
- p = ECC.Point (os2ip x) (os2ip y)
- in if ECC.isPointValid curve p
- then Just $ ECDSA.PublicKey curve p
- else Nothing
- -- 2 and 3 for compressed format.
- _ -> Nothing
- where bits = ECC.curveSizeBits curve
- bytes = (bits + 7) `div` 8
-
ecdsaVerify HashMD2 = ECDSA.verify MD2
ecdsaVerify HashMD5 = ECDSA.verify MD5
ecdsaVerify HashSHA1 = ECDSA.verify SHA1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-validation-1.6.8/Data/X509/Validation.hs new/x509-validation-1.6.10/Data/X509/Validation.hs
--- old/x509-validation-1.6.8/Data/X509/Validation.hs 2017-06-26 18:12:09.000000000 +0200
+++ new/x509-validation-1.6.10/Data/X509/Validation.hs 2017-07-31 22:17:01.000000000 +0200
@@ -27,6 +27,8 @@
, getFingerprint
-- * Cache
, module Data.X509.Validation.Cache
+ -- * Signature verification
+ , module Data.X509.Validation.Signature
) where
import Control.Applicative
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-validation-1.6.8/Tests/Certificate.hs new/x509-validation-1.6.10/Tests/Certificate.hs
--- old/x509-validation-1.6.8/Tests/Certificate.hs 2017-07-22 08:57:25.000000000 +0200
+++ new/x509-validation-1.6.10/Tests/Certificate.hs 2017-07-31 22:17:24.000000000 +0200
@@ -29,12 +29,11 @@
import Control.Applicative
import Crypto.Hash.Algorithms
-import Crypto.Number.Generate
import Crypto.Number.Serialize
import qualified Crypto.PubKey.DSA as DSA
import qualified Crypto.PubKey.ECC.ECDSA as ECDSA
-import qualified Crypto.PubKey.ECC.Prim as ECC
+import qualified Crypto.PubKey.ECC.Generate as ECC
import qualified Crypto.PubKey.ECC.Types as ECC
import qualified Crypto.PubKey.RSA as RSA
import qualified Crypto.PubKey.RSA.PKCS15 as RSA
@@ -110,12 +109,9 @@
let y = DSA.calculatePublic params x
return (alg, DSA.PublicKey params y, DSA.PrivateKey params x)
generateKeys alg@(AlgEC name _) = do
- d <- generateBetween 1 (n - 1)
- let p = ECC.pointBaseMul curve d
- return (alg, ECDSA.PublicKey curve p, ECDSA.PrivateKey curve d)
- where
- curve = ECC.getCurveByName name
- n = ECC.ecc_n . ECC.common_curve $ curve
+ let curve = ECC.getCurveByName name
+ (pub, priv) <- ECC.generate curve
+ return (alg, pub, priv)
generateRSAKeys :: Alg RSA.PublicKey RSA.PrivateKey
-> Int
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-validation-1.6.8/x509-validation.cabal new/x509-validation-1.6.10/x509-validation.cabal
--- old/x509-validation-1.6.8/x509-validation.cabal 2017-07-22 08:58:06.000000000 +0200
+++ new/x509-validation-1.6.10/x509-validation.cabal 2018-03-01 22:16:09.000000000 +0100
@@ -1,5 +1,5 @@
Name: x509-validation
-version: 1.6.8
+version: 1.6.10
Description: X.509 Certificate and CRL validation
License: BSD3
License-file: LICENSE
@@ -18,12 +18,11 @@
Build-Depends: base >= 3 && < 5
, bytestring
, memory
- , byteable
, mtl
, containers
, hourglass
, data-default-class
- , pem >= 0.1 && < 0.3
+ , pem >= 0.1
, asn1-types >= 0.3 && < 0.4
, asn1-encoding >= 0.9 && < 0.10
, x509 >= 1.6.5
++++++ x509-validation.cabal ++++++
Name: x509-validation
version: 1.6.10
x-revision: 1
Description: X.509 Certificate and CRL validation
License: BSD3
License-file: LICENSE
Copyright: Vincent Hanquez <vincent(a)snarc.org>
Author: Vincent Hanquez <vincent(a)snarc.org>
Maintainer: Vincent Hanquez <vincent(a)snarc.org>
Synopsis: X.509 Certificate and CRL validation
Build-Type: Simple
Category: Data
stability: experimental
Homepage: http://github.com/vincenthz/hs-certificate
Cabal-Version: >= 1.10
Library
Default-Language: Haskell2010
Build-Depends: base >= 3 && < 5
, bytestring
, memory
, mtl
, containers
, hourglass
, data-default-class
, pem >= 0.1
, asn1-types >= 0.3 && < 0.4
, asn1-encoding >= 0.9 && < 0.10
, x509 >= 1.7.2
, x509-store >= 1.6
, cryptonite >= 0.8
Exposed-modules: Data.X509.Validation
Other-modules: Data.X509.Validation.Signature
Data.X509.Validation.Fingerprint
Data.X509.Validation.Cache
Data.X509.Validation.Types
ghc-options: -Wall
Test-Suite test-x509-validation
Default-Language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: Tests
Main-is: Tests.hs
Other-modules: Certificate
Build-Depends: base >= 3 && < 5
, bytestring
, data-default-class
, tasty
, tasty-hunit
, hourglass
, asn1-types
, asn1-encoding
, x509 >= 1.7.1
, x509-store
, x509-validation
, cryptonite
ghc-options: -Wall
source-repository head
type: git
location: git://github.com/vincenthz/hs-certificate
subdir: x509-validation
1
0
Hello community,
here is the log from the commit of package ghc-x509-system for openSUSE:Factory checked in at 2018-05-30 12:16:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-x509-system (Old)
and /work/SRC/openSUSE:Factory/.ghc-x509-system.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-x509-system"
Wed May 30 12:16:00 2018 rev:8 rq:607927 version:1.6.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-x509-system/ghc-x509-system.changes 2017-08-31 21:01:52.405809896 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-x509-system.new/ghc-x509-system.changes 2018-05-30 12:27:57.272918165 +0200
@@ -1,0 +2,6 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update x509-system to version 1.6.6.
+ Upstream does not provide a changelog.
+
+-------------------------------------------------------------------
Old:
----
x509-system-1.6.5.tar.gz
New:
----
x509-system-1.6.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-x509-system.spec ++++++
--- /var/tmp/diff_new_pack.i5lFWT/_old 2018-05-30 12:27:57.968893628 +0200
+++ /var/tmp/diff_new_pack.i5lFWT/_new 2018-05-30 12:27:57.972893488 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-x509-system
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,12 +18,12 @@
%global pkg_name x509-system
Name: ghc-%{pkg_name}
-Version: 1.6.5
+Version: 1.6.6
Release: 0
Summary: Handle per-operating-system X.509 accessors and storage
License: BSD-3-Clause
-Group: Development/Languages/Other
-Url: https://hackage.haskell.org/package/%{pkg_name}
+Group: Development/Libraries/Haskell
+URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-bytestring-devel
@@ -36,14 +36,13 @@
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-x509-devel
BuildRequires: ghc-x509-store-devel
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
System X.509 handling.
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Libraries/Other
+Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
@@ -68,10 +67,8 @@
%ghc_pkg_recache
%files -f %{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
-%defattr(-,root,root,-)
%changelog
++++++ x509-system-1.6.5.tar.gz -> x509-system-1.6.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-system-1.6.5/System/X509/MacOS.hs new/x509-system-1.6.6/System/X509/MacOS.hs
--- old/x509-system-1.6.5/System/X509/MacOS.hs 2015-06-19 22:19:18.000000000 +0200
+++ new/x509-system-1.6.6/System/X509/MacOS.hs 2017-07-31 22:17:24.000000000 +0200
@@ -1,6 +1,6 @@
module System.X509.MacOS
- ( getSystemCertificateStore
- ) where
+ ( getSystemCertificateStore
+ ) where
import Data.PEM (pemParseLBS, PEM(..))
import System.Process
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-system-1.6.5/System/X509.hs new/x509-system-1.6.6/System/X509.hs
--- old/x509-system-1.6.5/System/X509.hs 2014-10-09 06:25:42.000000000 +0200
+++ new/x509-system-1.6.6/System/X509.hs 2017-07-31 22:17:24.000000000 +0200
@@ -7,8 +7,8 @@
-- Portability : good
--
module System.X509
- ( getSystemCertificateStore
- ) where
+ ( getSystemCertificateStore
+ ) where
#if defined(WINDOWS)
import System.X509.Win32
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-system-1.6.5/x509-system.cabal new/x509-system-1.6.6/x509-system.cabal
--- old/x509-system-1.6.5/x509-system.cabal 2017-07-21 19:18:45.000000000 +0200
+++ new/x509-system-1.6.6/x509-system.cabal 2017-07-31 22:24:06.000000000 +0200
@@ -1,5 +1,5 @@
Name: x509-system
-version: 1.6.5
+version: 1.6.6
Description: System X.509 handling
License: BSD3
License-file: LICENSE
1
0
Hello community,
here is the log from the commit of package ghc-x509-store for openSUSE:Factory checked in at 2018-05-30 12:15:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-x509-store (Old)
and /work/SRC/openSUSE:Factory/.ghc-x509-store.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-x509-store"
Wed May 30 12:15:55 2018 rev:7 rq:607926 version:1.6.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-x509-store/ghc-x509-store.changes 2017-08-31 21:01:50.186121767 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-x509-store.new/ghc-x509-store.changes 2018-05-30 12:27:56.516944810 +0200
@@ -1,0 +2,6 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update x509-store to version 1.6.6.
+ Upstream does not provide a changelog.
+
+-------------------------------------------------------------------
Old:
----
x509-store-1.6.3.tar.gz
New:
----
x509-store-1.6.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-x509-store.spec ++++++
--- /var/tmp/diff_new_pack.ZLSLwL/_old 2018-05-30 12:27:57.028926767 +0200
+++ /var/tmp/diff_new_pack.ZLSLwL/_new 2018-05-30 12:27:57.032926626 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-x509-store
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,13 +17,14 @@
%global pkg_name x509-store
+%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.6.3
+Version: 1.6.6
Release: 0
Summary: X.509 collection accessing and storing methods
License: BSD-3-Clause
-Group: Development/Languages/Other
-Url: https://hackage.haskell.org/package/%{pkg_name}
+Group: Development/Libraries/Haskell
+URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-asn1-encoding-devel
@@ -37,7 +38,10 @@
BuildRequires: ghc-pem-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-x509-devel
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%if %{with tests}
+BuildRequires: ghc-tasty-devel
+BuildRequires: ghc-tasty-hunit-devel
+%endif
%description
X.509 collection accessing and storing methods for certificate, crl, exception
@@ -45,7 +49,7 @@
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Libraries/Other
+Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
@@ -63,6 +67,9 @@
%install
%ghc_lib_install
+%check
+%cabal_test
+
%post devel
%ghc_pkg_recache
@@ -70,10 +77,8 @@
%ghc_pkg_recache
%files -f %{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
-%defattr(-,root,root,-)
%changelog
++++++ x509-store-1.6.3.tar.gz -> x509-store-1.6.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-store-1.6.3/Data/X509/CertificateStore.hs new/x509-store-1.6.6/Data/X509/CertificateStore.hs
--- old/x509-store-1.6.3/Data/X509/CertificateStore.hs 2016-10-03 09:36:01.000000000 +0200
+++ new/x509-store-1.6.6/Data/X509/CertificateStore.hs 2018-03-01 10:55:41.000000000 +0100
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
module Data.X509.CertificateStore
( CertificateStore
, makeCertificateStore
@@ -10,7 +11,11 @@
import Data.Char (isDigit, isHexDigit)
import Data.Either (rights)
import Data.List (foldl', isPrefixOf)
-import Data.Monoid
+#if MIN_VERSION_base(4,9,0)
+import Data.Semigroup
+#else
+import Data.Monoid
+#endif
import Data.PEM (pemParseBS, pemContent)
import Data.X509
import qualified Data.Map as M
@@ -26,12 +31,22 @@
data CertificateStore = CertificateStore (M.Map DistinguishedName SignedCertificate)
| CertificateStores [CertificateStore]
+#if MIN_VERSION_base(4,9,0)
+instance Semigroup CertificateStore where
+ (<>) = append
+#endif
+
instance Monoid CertificateStore where
mempty = CertificateStore M.empty
- mappend s1@(CertificateStore _) s2@(CertificateStore _) = CertificateStores [s1,s2]
- mappend (CertificateStores l) s2@(CertificateStore _) = CertificateStores (l ++ [s2])
- mappend s1@(CertificateStore _) (CertificateStores l) = CertificateStores ([s1] ++ l)
- mappend (CertificateStores l1) (CertificateStores l2) = CertificateStores (l1 ++ l2)
+#if !(MIN_VERSION_base(4,11,0))
+ mappend = append
+#endif
+
+append :: CertificateStore -> CertificateStore -> CertificateStore
+append s1@(CertificateStore _) s2@(CertificateStore _) = CertificateStores [s1,s2]
+append (CertificateStores l) s2@(CertificateStore _) = CertificateStores (l ++ [s2])
+append s1@(CertificateStore _) (CertificateStores l) = CertificateStores ([s1] ++ l)
+append (CertificateStores l1) (CertificateStores l2) = CertificateStores (l1 ++ l2)
-- | Create a certificate store out of a list of X509 certificate
makeCertificateStore :: [SignedCertificate] -> CertificateStore
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-store-1.6.3/Data/X509/File.hs new/x509-store-1.6.6/Data/X509/File.hs
--- old/x509-store-1.6.3/Data/X509/File.hs 2015-09-18 11:52:43.000000000 +0200
+++ new/x509-store-1.6.6/Data/X509/File.hs 2017-07-31 22:17:24.000000000 +0200
@@ -28,6 +28,6 @@
where decodePEMs pems =
[ obj | pem <- pems, Right obj <- [X509.decodeSignedObject $ pemContent pem] ]
--- | return all the public key that were successfully read from a file.
+-- | return all the private keys that were successfully read from a file.
readKeyFile :: FilePath -> IO [X509.PrivKey]
readKeyFile path = catMaybes . foldl pemToKey [] <$> readPEMs path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-store-1.6.3/Data/X509/Memory.hs new/x509-store-1.6.6/Data/X509/Memory.hs
--- old/x509-store-1.6.3/Data/X509/Memory.hs 2015-09-18 11:52:18.000000000 +0200
+++ new/x509-store-1.6.6/Data/X509/Memory.hs 2017-07-31 22:17:24.000000000 +0200
@@ -14,12 +14,17 @@
import Data.ASN1.Types
import Data.ASN1.BinaryEncoding
+import Data.ASN1.BitArray
import Data.ASN1.Encoding
+import Data.ASN1.Stream
import Data.Maybe
import qualified Data.X509 as X509
+import Data.X509.EC as X509
import Data.PEM (pemParseBS, pemContent, pemName, PEM)
import qualified Data.ByteString as B
+import Crypto.Number.Serialize (os2ip)
import qualified Crypto.PubKey.DSA as DSA
+import qualified Crypto.PubKey.ECC.ECDSA as ECDSA
import qualified Crypto.PubKey.RSA as RSA
readKeyFileFromMemory :: B.ByteString -> [X509.PrivKey]
@@ -41,11 +46,13 @@
Right asn1 ->
case pemName pem of
"PRIVATE KEY" ->
- tryRSA asn1 : tryDSA asn1 : acc
+ tryRSA asn1 : tryECDSA asn1 : tryDSA asn1 : acc
"RSA PRIVATE KEY" ->
tryRSA asn1 : acc
"DSA PRIVATE KEY" ->
tryDSA asn1 : acc
+ "EC PRIVATE KEY" ->
+ tryECDSA asn1 : acc
_ -> acc
where
tryRSA asn1 = case rsaFromASN1 asn1 of
@@ -54,6 +61,9 @@
tryDSA asn1 = case dsaFromASN1 asn1 of
Left _ -> Nothing
Right (k,_) -> Just $ X509.PrivKeyDSA $ DSA.toPrivateKey k
+ tryECDSA asn1 = case ecdsaFromASN1 [] asn1 of
+ Left _ -> Nothing
+ Right (k,_) -> Just $ X509.PrivKeyEC k
dsaFromASN1 :: [ASN1] -> Either String (DSA.KeyPair, [ASN1])
dsaFromASN1 (Start Sequence : IntVal n : xs)
@@ -63,10 +73,97 @@
IntVal p : IntVal q : IntVal g : IntVal pub : IntVal priv : End Sequence : xs2 ->
let params = DSA.Params { DSA.params_p = p, DSA.params_g = g, DSA.params_q = q }
in Right (DSA.KeyPair params pub priv, xs2)
+ (Start Sequence
+ : OID [1, 2, 840, 10040, 4, 1]
+ : Start Sequence
+ : IntVal p
+ : IntVal q
+ : IntVal g
+ : End Sequence
+ : End Sequence
+ : OctetString bs
+ : End Sequence
+ : xs2) ->
+ let params = DSA.Params { DSA.params_p = p, DSA.params_g = g, DSA.params_q = q }
+ in case decodeASN1' BER bs of
+ Right [IntVal priv] ->
+ let pub = DSA.calculatePublic params priv
+ in Right (DSA.KeyPair params pub priv, xs2)
+ Right _ -> Left "dsaFromASN1: DSA.PrivateKey: unexpected format"
+ Left e -> Left $ "dsaFromASN1: DSA.PrivateKey: " ++ show e
_ ->
Left "dsaFromASN1: DSA.KeyPair: invalid format (version=0)"
dsaFromASN1 _ = Left "dsaFromASN1: DSA.KeyPair: unexpected format"
+ecdsaFromASN1 :: [ASN1] -> [ASN1] -> Either String (X509.PrivKeyEC, [ASN1])
+ecdsaFromASN1 curveOid1 (Start Sequence
+ : IntVal 1
+ : OctetString ds
+ : xs) = do
+ let (curveOid2, ys) = containerWithTag 0 xs
+ privKey <- getPrivKeyEC (os2ip ds) (curveOid2 ++ curveOid1)
+ case containerWithTag 1 ys of
+ (_, End Sequence : zs) -> return (privKey, zs)
+ _ -> Left "ecdsaFromASN1: unexpected EC format"
+ecdsaFromASN1 curveOid1 (Start Sequence
+ : IntVal 0
+ : Start Sequence
+ : OID [1, 2, 840, 10045, 2, 1]
+ : xs) =
+ let strError = Left . ("ecdsaFromASN1: ECDSA.PrivateKey: " ++) . show
+ (curveOid2, ys) = getConstructedEnd 0 xs
+ in case ys of
+ (OctetString bs
+ : zs) -> do
+ let curveOids = curveOid2 ++ curveOid1
+ inner = either strError (ecdsaFromASN1 curveOids) (decodeASN1' BER bs)
+ either Left (\(k, _) -> Right (k, zs)) inner
+ _ -> Left "ecdsaFromASN1: unexpected format"
+ecdsaFromASN1 _ _ =
+ Left "ecdsaFromASN1: unexpected format"
+
+getPrivKeyEC :: ECDSA.PrivateNumber -> [ASN1] -> Either String X509.PrivKeyEC
+getPrivKeyEC _ [] = Left "ecdsaFromASN1: curve is missing"
+getPrivKeyEC d (OID curveOid : _) =
+ case X509.lookupCurveNameByOID curveOid of
+ Just name -> Right X509.PrivKeyEC_Named { X509.privkeyEC_name = name
+ , X509.privkeyEC_priv = d
+ }
+ Nothing -> Left ("ecdsaFromASN1: unknown curve " ++ show curveOid)
+getPrivKeyEC d (Null : xs) = getPrivKeyEC d xs
+getPrivKeyEC d (Start Sequence
+ : IntVal 1
+ : Start Sequence
+ : OID [1, 2, 840, 10045, 1, 1]
+ : IntVal prime
+ : End Sequence
+ : Start Sequence
+ : OctetString a
+ : OctetString b
+ : BitString seed
+ : End Sequence
+ : OctetString generator
+ : IntVal order
+ : IntVal cofactor
+ : End Sequence
+ : _) =
+ Right X509.PrivKeyEC_Prime
+ { X509.privkeyEC_priv = d
+ , X509.privkeyEC_a = os2ip a
+ , X509.privkeyEC_b = os2ip b
+ , X509.privkeyEC_prime = prime
+ , X509.privkeyEC_generator = X509.SerializedPoint generator
+ , X509.privkeyEC_order = order
+ , X509.privkeyEC_cofactor = cofactor
+ , X509.privkeyEC_seed = os2ip $ bitArrayGetData seed
+ }
+getPrivKeyEC _ _ = Left "ecdsaFromASN1: unexpected curve format"
+
+containerWithTag :: ASN1Tag -> [ASN1] -> ([ASN1], [ASN1])
+containerWithTag etag (Start (Container _ atag) : xs)
+ | etag == atag = getConstructedEnd 0 xs
+containerWithTag _ xs = ([], xs)
+
rsaFromASN1 :: [ASN1] -> Either String (RSA.PrivateKey, [ASN1])
rsaFromASN1 (Start Sequence
: IntVal 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-store-1.6.3/Tests/Tests.hs new/x509-store-1.6.6/Tests/Tests.hs
--- old/x509-store-1.6.3/Tests/Tests.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/x509-store-1.6.6/Tests/Tests.hs 2017-07-31 22:17:24.000000000 +0200
@@ -0,0 +1,235 @@
+-- | x509-store test suite.
+module Main (main) where
+
+import qualified Data.ByteString as B
+import Data.String (fromString)
+import Data.X509
+import Data.X509.Memory
+
+import Test.Tasty
+import Test.Tasty.HUnit
+
+{-
+ openssl req -new -x509 -subj /CN=Test -newkey rsa:1024 -nodes -reqexts v3_req \
+ | sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/'
+ sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/' privkey.pem
+ openssl rsa -in privkey.pem | sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/'
+-}
+rsaCertificate, rsaKey1, rsaKey2 :: B.ByteString
+rsaCertificate = fromString $
+ "-----BEGIN CERTIFICATE-----\n" ++
+ "MIIB7DCCAVWgAwIBAgIJAPmzhcKJcLZtMA0GCSqGSIb3DQEBCwUAMA8xDTALBgNV\n" ++
+ "BAMMBFRlc3QwHhcNMTcwMzAyMTgwODU3WhcNMTcwNDAxMTgwODU3WjAPMQ0wCwYD\n" ++
+ "VQQDDARUZXN0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzkysIZyZ1UYFl\n" ++
+ "OFKOhZ+T7Usgove7Z9z9zBSXM7ufXl5NF5QV+u76bDo5ITD81NYiqCLoNGRVC1FY\n" ++
+ "srVmx97AyqQ6Hj2IGfar2JyymTO2Y4E7kYO21hxJSrIJOVnAbGdxHYwiKVFZkP5g\n" ++
+ "PS5FzYqwfMet4gpbPJcvBjfZVo2MIQIDAQABo1AwTjAdBgNVHQ4EFgQUhJgtg9dO\n" ++
+ "jcpA08w0BuXptQw+JVkwHwYDVR0jBBgwFoAUhJgtg9dOjcpA08w0BuXptQw+JVkw\n" ++
+ "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQA2OIHfXV9Ro7208mNaz6Bi\n" ++
+ "QYhW4gGbQA6/5N/BYby5kHLC+veJ9qAXjILn5qW5hsuf4X4Nq7VO3HKQ89Jo2COc\n" ++
+ "6fAvjhCWKqlZFAIBKbcEcg3QZqAdXJ4Q8RLMvG3y/vDzixp1Xuxk0Zbr88D7SX7i\n" ++
+ "Lx+S385X8OT7Wiu6qhM6ig==\n" ++
+ "-----END CERTIFICATE-----\n"
+rsaKey1 = fromString $
+ "-----BEGIN PRIVATE KEY-----\n" ++
+ "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALOTKwhnJnVRgWU4\n" ++
+ "Uo6Fn5PtSyCi97tn3P3MFJczu59eXk0XlBX67vpsOjkhMPzU1iKoIug0ZFULUViy\n" ++
+ "tWbH3sDKpDoePYgZ9qvYnLKZM7ZjgTuRg7bWHElKsgk5WcBsZ3EdjCIpUVmQ/mA9\n" ++
+ "LkXNirB8x63iCls8ly8GN9lWjYwhAgMBAAECgYAxGVkXyBRU2X82rMqt201Bhg0X\n" ++
+ "lFeF7yUWY7lxihyPu56vF3ZO+DhlUjgtLK0XRB50hWJd+Q1Bz4FjbiF5Q8bcm/rz\n" ++
+ "4BzyojpoCHoMnrcPyP+7+LE50MFsySvjQWCJkz0WSoFBsoEVQOvkAkhCEiR4vqoJ\n" ++
+ "UNjZczb2PAvWjlUsvQJBAOyLOm+P4RnrRaV/dMXx3pfNTolJp7KQ0zXghKc4clF5\n" ++
+ "ESMsWHwHRGU++/tW90m/j8ApDvlIrXTmYOyQ4jKCCk8CQQDCWGAzeVa4xL+p2SaO\n" ++
+ "TP5aqRjfEIVf0O3HjB9GklrdwtnDF4JrUUILdUKJ3qxqEetNpSZjzc3H6dDtxvy1\n" ++
+ "yRaPAkEAp+fMexRufK98qJVolnmxv5+Ed/9IgoA67KuKfgibXSnK+GSqCqA99IBY\n" ++
+ "7Xg14KuRpp1+e4UTWz+M3V+asK+OEQJBAKvQW8RGCqAw+M0c+FQnx1q5Ug6q2W77\n" ++
+ "E6wtudy3OPQC9mfemeNspDnjAd9HaCAiFWfAkK79XGbX1GjSWcoQrAsCQQDRoscG\n" ++
+ "Udtf0rxGk4y79YNXPeTReF+0wCdWdDNpAdnhpYCnFE+74LyiY8YRbfe2jP7X2uyn\n" ++
+ "/h1HwfRSKCZ7Epcv\n" ++
+ "-----END PRIVATE KEY-----\n"
+rsaKey2 = fromString $
+ "-----BEGIN RSA PRIVATE KEY-----\n" ++
+ "MIICXgIBAAKBgQCzkysIZyZ1UYFlOFKOhZ+T7Usgove7Z9z9zBSXM7ufXl5NF5QV\n" ++
+ "+u76bDo5ITD81NYiqCLoNGRVC1FYsrVmx97AyqQ6Hj2IGfar2JyymTO2Y4E7kYO2\n" ++
+ "1hxJSrIJOVnAbGdxHYwiKVFZkP5gPS5FzYqwfMet4gpbPJcvBjfZVo2MIQIDAQAB\n" ++
+ "AoGAMRlZF8gUVNl/NqzKrdtNQYYNF5RXhe8lFmO5cYocj7uerxd2Tvg4ZVI4LSyt\n" ++
+ "F0QedIViXfkNQc+BY24heUPG3Jv68+Ac8qI6aAh6DJ63D8j/u/ixOdDBbMkr40Fg\n" ++
+ "iZM9FkqBQbKBFUDr5AJIQhIkeL6qCVDY2XM29jwL1o5VLL0CQQDsizpvj+EZ60Wl\n" ++
+ "f3TF8d6XzU6JSaeykNM14ISnOHJReREjLFh8B0RlPvv7VvdJv4/AKQ75SK105mDs\n" ++
+ "kOIyggpPAkEAwlhgM3lWuMS/qdkmjkz+WqkY3xCFX9Dtx4wfRpJa3cLZwxeCa1FC\n" ++
+ "C3VCid6sahHrTaUmY83Nx+nQ7cb8tckWjwJBAKfnzHsUbnyvfKiVaJZ5sb+fhHf/\n" ++
+ "SIKAOuyrin4Im10pyvhkqgqgPfSAWO14NeCrkaadfnuFE1s/jN1fmrCvjhECQQCr\n" ++
+ "0FvERgqgMPjNHPhUJ8dauVIOqtlu+xOsLbnctzj0AvZn3pnjbKQ54wHfR2ggIhVn\n" ++
+ "wJCu/Vxm19Ro0lnKEKwLAkEA0aLHBlHbX9K8RpOMu/WDVz3k0XhftMAnVnQzaQHZ\n" ++
+ "4aWApxRPu+C8omPGEW33toz+19rsp/4dR8H0UigmexKXLw==\n" ++
+ "-----END RSA PRIVATE KEY-----\n"
+
+{-
+ openssl dsaparam 1024 -out dsaparams
+ openssl req -new -x509 -subj /CN=Test -newkey dsa:dsaparams -nodes -reqexts v3_req \
+ | sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/'
+ sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/' privkey.pem
+ openssl dsa -in privkey.pem | sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/'
+-}
+dsaCertificate, dsaKey1, dsaKey2 :: B.ByteString
+dsaCertificate = fromString $
+ "-----BEGIN CERTIFICATE-----\n" ++
+ "MIICrzCCAmugAwIBAgIJALFEpgowHmcXMAsGCWCGSAFlAwQDAjAPMQ0wCwYDVQQD\n" ++
+ "DARUZXN0MB4XDTE3MDMwMjE4MTA0OFoXDTE3MDQwMTE4MTA0OFowDzENMAsGA1UE\n" ++
+ "AwwEVGVzdDCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQCsH77mdMUYCgpdNnqljOoG\n" ++
+ "OLOkPb+9pIrV/LWoX9TvhyfoVOJli5dEWqcui9eTZZ4LW+2F1//0HpTjW5d+aZk7\n" ++
+ "znkSRg9yihhzYzqGL7GEinFGHIPBL5uKoCW7a2HlJ+OdLBNQ/yeCDpTvt+/agLlA\n" ++
+ "K1CgpBd1NeG7jFmfgmJ+gwIVAOs+Q1CAhIZzqH7Ymgp4X2buU1plAoGALiXg/kXS\n" ++
+ "DSWVzbP6kEKMjkpc0KMmUQCErJgcTZmqe2IddoghCHq44ofbdMyJivk0V3lAfprP\n" ++
+ "l2LMKKnwc0NgWEcPPmR+ZyYXODxOeXlZd1qznDKWdvpciOkMdWOsxF+cbtmGBrxs\n" ++
+ "+Rm86f+95+EsptH/8FeLFMw7L8u/0FNgAyoDgYQAAoGAIBhO3gbkWHsZSic+5rdh\n" ++
+ "HS0z0h/kBqbqY2BHFXchaMAgzMrzD/rTpeZ+mND8tIRzOw73tKckeHrfauBNPstc\n" ++
+ "c2SCFy9lc7eITD/HmoCJFuMLbYxpWlOYL5JU5EQT/1VlH58RprfMp5+HA1tSMZov\n" ++
+ "zf7ck2W7Rt6zH77Io5lt0aujUDBOMB0GA1UdDgQWBBQOlmp9KHZbomx3TbKxBiGL\n" ++
+ "oVUB1zAfBgNVHSMEGDAWgBQOlmp9KHZbomx3TbKxBiGLoVUB1zAMBgNVHRMEBTAD\n" ++
+ "AQH/MAsGCWCGSAFlAwQDAgMxADAuAhUAp/XUpSnDENVgqr2MS1XCXHjI9kACFQDq\n" ++
+ "jV1C0EYgKTRYKjrztFjBEHv3Ig==\n" ++
+ "-----END CERTIFICATE-----\n"
+dsaKey1 = fromString $
+ "-----BEGIN PRIVATE KEY-----\n" ++
+ "MIIBSgIBADCCASsGByqGSM44BAEwggEeAoGBAKwfvuZ0xRgKCl02eqWM6gY4s6Q9\n" ++
+ "v72kitX8tahf1O+HJ+hU4mWLl0Rapy6L15Nlngtb7YXX//QelONbl35pmTvOeRJG\n" ++
+ "D3KKGHNjOoYvsYSKcUYcg8Evm4qgJbtrYeUn450sE1D/J4IOlO+379qAuUArUKCk\n" ++
+ "F3U14buMWZ+CYn6DAhUA6z5DUICEhnOoftiaCnhfZu5TWmUCgYAuJeD+RdINJZXN\n" ++
+ "s/qQQoyOSlzQoyZRAISsmBxNmap7Yh12iCEIerjih9t0zImK+TRXeUB+ms+XYswo\n" ++
+ "qfBzQ2BYRw8+ZH5nJhc4PE55eVl3WrOcMpZ2+lyI6Qx1Y6zEX5xu2YYGvGz5Gbzp\n" ++
+ "/73n4Sym0f/wV4sUzDsvy7/QU2ADKgQWAhQ/q2pbQjljQ7CD3Uc6FA63FS7fYg==\n" ++
+ "-----END PRIVATE KEY-----\n"
+dsaKey2 = fromString $
+ "-----BEGIN DSA PRIVATE KEY-----\n" ++
+ "MIIBugIBAAKBgQCsH77mdMUYCgpdNnqljOoGOLOkPb+9pIrV/LWoX9TvhyfoVOJl\n" ++
+ "i5dEWqcui9eTZZ4LW+2F1//0HpTjW5d+aZk7znkSRg9yihhzYzqGL7GEinFGHIPB\n" ++
+ "L5uKoCW7a2HlJ+OdLBNQ/yeCDpTvt+/agLlAK1CgpBd1NeG7jFmfgmJ+gwIVAOs+\n" ++
+ "Q1CAhIZzqH7Ymgp4X2buU1plAoGALiXg/kXSDSWVzbP6kEKMjkpc0KMmUQCErJgc\n" ++
+ "TZmqe2IddoghCHq44ofbdMyJivk0V3lAfprPl2LMKKnwc0NgWEcPPmR+ZyYXODxO\n" ++
+ "eXlZd1qznDKWdvpciOkMdWOsxF+cbtmGBrxs+Rm86f+95+EsptH/8FeLFMw7L8u/\n" ++
+ "0FNgAyoCgYAgGE7eBuRYexlKJz7mt2EdLTPSH+QGpupjYEcVdyFowCDMyvMP+tOl\n" ++
+ "5n6Y0Py0hHM7Dve0pyR4et9q4E0+y1xzZIIXL2Vzt4hMP8eagIkW4wttjGlaU5gv\n" ++
+ "klTkRBP/VWUfnxGmt8ynn4cDW1Ixmi/N/tyTZbtG3rMfvsijmW3RqwIUP6tqW0I5\n" ++
+ "Y0Owg91HOhQOtxUu32I=\n" ++
+ "-----END DSA PRIVATE KEY-----\n"
+
+{-
+ openssl ecparam -name prime256v1 -out ecparams -param_enc named_curve
+ openssl req -new -x509 -subj /CN=Test -newkey ec:ecparams -nodes -reqexts v3_req \
+ | sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/'
+ sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/' privkey.pem
+ openssl ec -in privkey.pem | sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/'
+-}
+ecCertificateNc, ecKey1Nc, ecKey2Nc :: B.ByteString
+ecCertificateNc = fromString $
+ "-----BEGIN CERTIFICATE-----\n" ++
+ "MIIBZTCCAQugAwIBAgIJAPF7NB8WKn6XMAoGCCqGSM49BAMCMA8xDTALBgNVBAMM\n" ++
+ "BFRlc3QwHhcNMTcwMzAyMTgxMTI1WhcNMTcwNDAxMTgxMTI1WjAPMQ0wCwYDVQQD\n" ++
+ "DARUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETCmVJNQ5HWoFKMpyZFly\n" ++
+ "kILKFuE0ZTu2t8G5jXpQp0g4g8OqyRo/6iSZSs/WAP3e2vcJuyhnDSd8MocSnEfi\n" ++
+ "pqNQME4wHQYDVR0OBBYEFKCemJ7KZ+JfExQxOh/0qhKO3cJwMB8GA1UdIwQYMBaA\n" ++
+ "FKCemJ7KZ+JfExQxOh/0qhKO3cJwMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwID\n" ++
+ "SAAwRQIhALhWJShVXsrupU8ISSBJVGmzRhPcueHsjuydyyfOsxElAiADbsp0SM/9\n" ++
+ "6CQCvqX+V8DAwxT1WiRDzN8ilV6ZIfUI3Q==\n" ++
+ "-----END CERTIFICATE-----\n"
+ecKey1Nc = fromString $
+ "-----BEGIN PRIVATE KEY-----\n" ++
+ "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg1hT2Mdt5IS0Qs9Bb\n" ++
+ "LJ8ZAW3VTDIq1zn8qSYGiLcMVkShRANCAARMKZUk1DkdagUoynJkWXKQgsoW4TRl\n" ++
+ "O7a3wbmNelCnSDiDw6rJGj/qJJlKz9YA/d7a9wm7KGcNJ3wyhxKcR+Km\n" ++
+ "-----END PRIVATE KEY-----\n"
+ecKey2Nc = fromString $
+ "-----BEGIN EC PRIVATE KEY-----\n" ++
+ "MHcCAQEEINYU9jHbeSEtELPQWyyfGQFt1UwyKtc5/KkmBoi3DFZEoAoGCCqGSM49\n" ++
+ "AwEHoUQDQgAETCmVJNQ5HWoFKMpyZFlykILKFuE0ZTu2t8G5jXpQp0g4g8OqyRo/\n" ++
+ "6iSZSs/WAP3e2vcJuyhnDSd8MocSnEfipg==\n" ++
+ "-----END EC PRIVATE KEY-----\n"
+
+{-
+ openssl ecparam -name prime256v1 -out ecparams -param_enc explicit
+ openssl req -new -x509 -subj /CN=Test -newkey ec:ecparams -nodes -reqexts v3_req \
+ | sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/'
+ sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/' privkey.pem
+ openssl ec -in privkey.pem | sed -e 's/^\(.*\)$/ "\1\\n"/' -e '$!s/$/ ++/'
+-}
+ecCertificateEpc, ecKey1Epc, ecKey2Epc :: B.ByteString
+ecCertificateEpc = fromString $
+ "-----BEGIN CERTIFICATE-----\n" ++
+ "MIICWTCCAf+gAwIBAgIJAPF9pxfJTwfaMAoGCCqGSM49BAMCMA8xDTALBgNVBAMM\n" ++
+ "BFRlc3QwHhcNMTcwMzAyMTgxMTUxWhcNMTcwNDAxMTgxMTUxWjAPMQ0wCwYDVQQD\n" ++
+ "DARUZXN0MIIBSzCCAQMGByqGSM49AgEwgfcCAQEwLAYHKoZIzj0BAQIhAP////8A\n" ++
+ "AAABAAAAAAAAAAAAAAAA////////////////MFsEIP////8AAAABAAAAAAAAAAAA\n" ++
+ "AAAA///////////////8BCBaxjXYqjqT57PrvVV2mIa8ZR0GsMxTsPY7zjw+J9Jg\n" ++
+ "SwMVAMSdNgiG5wSTamZ44ROdJreBn36QBEEEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n" ++
+ "6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9QIhAP//\n" ++
+ "//8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABHXlHgRztuAF/Vs5\n" ++
+ "GMB5GEfGpFsSsua+GDB8/zvjT4UBgpnb71HJPFOC0yrYliunXds00VlOs3v+FCVL\n" ++
+ "mU5yW+2jUDBOMB0GA1UdDgQWBBSFV0KwoW1mPah12w3rngU7t1kjETAfBgNVHSME\n" ++
+ "GDAWgBSFV0KwoW1mPah12w3rngU7t1kjETAMBgNVHRMEBTADAQH/MAoGCCqGSM49\n" ++
+ "BAMCA0gAMEUCIDqqWyJEIRo2YSvvrQKJZ3wKQSGeWoPnJvWfXMjgODd5AiEAsXCt\n" ++
+ "LYmBKulTMXATynvrqa/xDi3z2lkwcWQC1AZBZ8M=\n" ++
+ "-----END CERTIFICATE-----\n"
+ecKey1Epc = fromString $
+ "-----BEGIN PRIVATE KEY-----\n" ++
+ "MIIBeQIBADCCAQMGByqGSM49AgEwgfcCAQEwLAYHKoZIzj0BAQIhAP////8AAAAB\n" ++
+ "AAAAAAAAAAAAAAAA////////////////MFsEIP////8AAAABAAAAAAAAAAAAAAAA\n" ++
+ "///////////////8BCBaxjXYqjqT57PrvVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMV\n" ++
+ "AMSdNgiG5wSTamZ44ROdJreBn36QBEEEaxfR8uEsQkf4vOblY6RA8ncDfYEt6zOg\n" ++
+ "9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9QIhAP////8A\n" ++
+ "AAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBBG0wawIBAQQgBnbFaCHgp5Cn\n" ++
+ "stu9ntk7QiEP6j/7FzK6GC4dzsID7/ihRANCAAR15R4Ec7bgBf1bORjAeRhHxqRb\n" ++
+ "ErLmvhgwfP8740+FAYKZ2+9RyTxTgtMq2JYrp13bNNFZTrN7/hQlS5lOclvt\n" ++
+ "-----END PRIVATE KEY-----\n"
+ecKey2Epc = fromString $
+ "-----BEGIN EC PRIVATE KEY-----\n" ++
+ "MIIBaAIBAQQgBnbFaCHgp5Cnstu9ntk7QiEP6j/7FzK6GC4dzsID7/iggfowgfcC\n" ++
+ "AQEwLAYHKoZIzj0BAQIhAP////8AAAABAAAAAAAAAAAAAAAA////////////////\n" ++
+ "MFsEIP////8AAAABAAAAAAAAAAAAAAAA///////////////8BCBaxjXYqjqT57Pr\n" ++
+ "vVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMVAMSdNgiG5wSTamZ44ROdJreBn36QBEEE\n" ++
+ "axfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54W\n" ++
+ "K84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8\n" ++
+ "YyVRAgEBoUQDQgAEdeUeBHO24AX9WzkYwHkYR8akWxKy5r4YMHz/O+NPhQGCmdvv\n" ++
+ "Uck8U4LTKtiWK6dd2zTRWU6ze/4UJUuZTnJb7Q==\n" ++
+ "-----END EC PRIVATE KEY-----\n"
+
+memoryKeyTests :: TestTree
+memoryKeyTests = testGroup "Key"
+ [ keyTest "RSA" rsaKey1 rsaKey2
+ , keyTest "DSA" dsaKey1 dsaKey2
+ , keyTest "EC (named curve)" ecKey1Nc ecKey2Nc
+ , keyTest "EC (explicit prime curve)" ecKey1Epc ecKey2Epc
+ ]
+ where
+ keyTest name outer inner =
+ let kInner = readKeyFileFromMemory inner
+ kOuter = readKeyFileFromMemory outer
+ in testGroup name
+ [ testCase "read outer" $ length kOuter @?= 1
+ , testCase "read inner" $ length kInner @?= 1
+ , testCase "same key" $
+ assertBool "keys differ" (kInner == kOuter)
+ ]
+
+memoryCertificateTests :: TestTree
+memoryCertificateTests = testGroup "Certificate"
+ [ certTest "RSA" rsaCertificate
+ , certTest "DSA" dsaCertificate
+ , certTest "EC (named curve)" ecCertificateNc
+ , certTest "EC (explicit prime curve)" ecCertificateEpc
+ ]
+ where
+ certTest name bytes = testCase name $
+ length (readSignedCertificateFromMemory bytes) @?= 1
+
+ readSignedCertificateFromMemory :: B.ByteString -> [SignedCertificate]
+ readSignedCertificateFromMemory = readSignedObjectFromMemory
+
+-- | Runs the test suite.
+main :: IO ()
+main = defaultMain $ testGroup "x509-store"
+ [ testGroup "Memory"
+ [ memoryKeyTests
+ , memoryCertificateTests
+ ]
+ ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-store-1.6.3/x509-store.cabal new/x509-store-1.6.6/x509-store.cabal
--- old/x509-store-1.6.3/x509-store.cabal 2017-07-21 19:18:36.000000000 +0200
+++ new/x509-store-1.6.6/x509-store.cabal 2018-03-01 14:21:06.000000000 +0100
@@ -1,5 +1,5 @@
Name: x509-store
-version: 1.6.3
+version: 1.6.6
Description: X.509 collection accessing and storing methods for certificate, crl, exception list
License: BSD3
License-file: LICENSE
@@ -25,12 +25,25 @@
, asn1-types >= 0.3 && < 0.4
, asn1-encoding >= 0.9 && < 0.10
, cryptonite
- , x509 >= 1.6
+ , x509 >= 1.7.2
Exposed-modules: Data.X509.CertificateStore
Data.X509.File
Data.X509.Memory
ghc-options: -Wall
+Test-Suite test-x509-store
+ Default-Language: Haskell2010
+ type: exitcode-stdio-1.0
+ hs-source-dirs: Tests
+ Main-is: Tests.hs
+ Build-Depends: base >= 3 && < 5
+ , bytestring
+ , tasty
+ , tasty-hunit
+ , x509
+ , x509-store
+ ghc-options: -Wall
+
source-repository head
type: git
location: git://github.com/vincenthz/hs-certificate
1
0