Skip to content
Snippets Groups Projects
Commit 1136c95a authored by Anna Wilcox's avatar Anna Wilcox :fox:
Browse files

Merge branch 'fix-yaml.2018-11-20' into 'master'

system/yaml: Backport emitter fix from v0.2.2-pre1

These patches fix an emitter problem that prevents PyYAML 3.13's test
suite from passing. They should not be necessary when libyaml v0.2.2 is
released.

Patch-Author: James Clarke <jrtc27@jrtc27.com>
See-Also: https://github.com/yaml/pyyaml/issues/184
See-Also: https://github.com/yaml/libyaml/issues/60#issuecomment-311836709

See merge request !111
parents 75c78e33 78d40257
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=yaml
pkgver=0.2.1
pkgrel=0
pkgrel=1
pkgdesc="YAML 1.1 parser and emitter written in C"
url="https://pyyaml.org/wiki/LibYAML"
arch="all"
......@@ -10,7 +10,9 @@ license="MIT"
depends=""
makedepends=""
subpackages="$pkgname-dev"
source="http://pyyaml.org/download/libyaml/yaml-$pkgver.tar.gz"
source="http://pyyaml.org/download/libyaml/yaml-$pkgver.tar.gz
fix-emitter-$pkgver.patch
skip-trailing-doc-term-$pkgver.patch"
build() {
cd "$builddir"
......@@ -35,4 +37,6 @@ package() {
make DESTDIR="$pkgdir" install
}
sha512sums="97ebeea2a2c877b24de2e1ffbf175d07d97d5c8b90e06d21fd057e1114d10b96c04fd92c2ed4e956db751b7ac1686b3fd5778927912ca5bb0d096908a1351235 yaml-0.2.1.tar.gz"
sha512sums="97ebeea2a2c877b24de2e1ffbf175d07d97d5c8b90e06d21fd057e1114d10b96c04fd92c2ed4e956db751b7ac1686b3fd5778927912ca5bb0d096908a1351235 yaml-0.2.1.tar.gz
ad35c3b893cfeb33fab748b39b06ad0c54215941f68d0df591b8e4e4edc3b67f27ea3206321b7621c0e9e6faf749255fd80209da017c77a91d8de68eec54fd2b fix-emitter-0.2.1.patch
715ad72a4a74b19fdf03b8be96b9e5c3801bab5475eeee4c98b109eabcf86e193d5884ad6466b6765ccc2174ebaedade25e43fff711d9522fb8f370bcea5eef4 skip-trailing-doc-term-0.2.1.patch"
Contributor Note: This patch will be part of v0.2.2 which hasn't been
formally released as of 2018-11-20. It should be removed once this
package is version bumped.
From e5ebb70a01cc0fbd9e519050d51d704f58c2a33d Mon Sep 17 00:00:00 2001
From: James Clarke <jrtc27@jrtc27.com>
Date: Thu, 29 Jun 2017 02:26:09 +0100
Subject: [PATCH 2/2] Skip trailing document terminator at the end of the
stream
---
src/emitter.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/emitter.c b/src/emitter.c
index c593a7d..1502590 100644
--- a/src/emitter.c
+++ b/src/emitter.c
@@ -649,14 +649,6 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
else if (event->type == YAML_STREAM_END_EVENT)
{
- if (emitter->open_ended)
- {
- if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
- return 0;
- if (!yaml_emitter_write_indent(emitter))
- return 0;
- }
-
if (!yaml_emitter_flush(emitter))
return 0;
--
2.13.2
Contributor Note: As with fix-emitter-0.2.1.patch, this patch should
not be necessary when v0.2.2 is released.
From 7c2e6f47e1b12ca3dfa9ea2f6c65e9bd8a02e8c8 Mon Sep 17 00:00:00 2001
From: James Clarke <jrtc27@jrtc27.com>
Date: Thu, 29 Jun 2017 02:24:53 +0100
Subject: [PATCH 1/2] Revert "This code is not needed and breaks tests"
This reverts commit 56400d976a1999156b1abfd674c3122843980260.
---
src/emitter.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/emitter.c b/src/emitter.c
index a5b7ff8..c593a7d 100644
--- a/src/emitter.c
+++ b/src/emitter.c
@@ -1946,6 +1946,10 @@ yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter,
emitter->whitespace = 0;
emitter->indention = 0;
+ if (emitter->root_context)
+ {
+ emitter->open_ended = 1;
+ }
return 1;
}
--
2.13.2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment