Hello community, here is the log from the commit of package scdoc for openSUSE:Factory checked in at 2020-06-16 13:46:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/scdoc (Old) and /work/SRC/openSUSE:Factory/.scdoc.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "scdoc" Tue Jun 16 13:46:08 2020 rev:13 rq:814844 version:1.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/scdoc/scdoc.changes 2020-02-18 10:39:07.648788060 +0100 +++ /work/SRC/openSUSE:Factory/.scdoc.new.3606/scdoc.changes 2020-06-16 13:46:47.714307242 +0200 @@ -1,0 +2,10 @@ +Tue Jun 16 08:23:04 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 1.11.0: + * Section needs to be explicitly defined + * Allow subsection in preamble + * Add basic working tests for line breaks parsing + * Fix parsing of line breaks without newline + * Fix parsing of line breaks followed by underlined text + +------------------------------------------------------------------- Old: ---- 1.10.1.tar.gz New: ---- 1.11.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ scdoc.spec ++++++ --- /var/tmp/diff_new_pack.KsSZ9F/_old 2020-06-16 13:46:51.438337192 +0200 +++ /var/tmp/diff_new_pack.KsSZ9F/_new 2020-06-16 13:46:51.442337224 +0200 @@ -1,7 +1,7 @@ # # spec file for package scdoc # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: scdoc -Version: 1.10.1 +Version: 1.11.0 Release: 0 Summary: A man page generator written in C99 License: MIT ++++++ 1.10.1.tar.gz -> 1.11.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scdoc-1.10.1/Makefile new/scdoc-1.11.0/Makefile --- old/scdoc-1.10.1/Makefile 2020-02-14 22:38:03.000000000 +0100 +++ new/scdoc-1.11.0/Makefile 2020-06-14 17:21:58.000000000 +0200 @@ -1,4 +1,4 @@ -VERSION=1.10.1 +VERSION=1.11.0 CFLAGS+=-g -DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter LDFLAGS+=-static INCLUDE+=-Iinclude diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scdoc-1.10.1/src/main.c new/scdoc-1.11.0/src/main.c --- old/scdoc-1.10.1/src/main.c 2020-02-14 22:38:03.000000000 +0100 +++ new/scdoc-1.11.0/src/main.c 2020-06-14 17:21:58.000000000 +0200 @@ -16,31 +16,35 @@ char *strstr(const char *haystack, const char *needle); char *strerror(int errnum); -static int parse_section(struct parser *p) { +static struct str *parse_section(struct parser *p) { struct str *section = str_create(); uint32_t ch; + char *subsection; while ((ch = parser_getch(p)) != UTF8_INVALID) { - if (ch < 0x80 && isdigit(ch)) { + if (ch < 0x80 && isalnum(ch)) { int ret = str_append_ch(section, ch); assert(ret != -1); } else if (ch == ')') { - if (!section->str) { + if (section->len == 0) { + break; + } + int sec = strtol(section->str, &subsection, 10); + if (section->str == subsection) { + parser_fatal(p, "Expected section digit"); break; } - int sec = strtol(section->str, NULL, 10); if (sec < 0 || sec > 9) { parser_fatal(p, "Expected section between 0 and 9"); break; } - str_free(section); - return sec; + return section; } else { - parser_fatal(p, "Expected digit or )"); + parser_fatal(p, "Expected alphanumerical character or )"); break; } }; parser_fatal(p, "Expected manual section"); - return -1; + return NULL; } static struct str *parse_extra(struct parser *p) { @@ -69,7 +73,7 @@ struct str *name = str_create(); int ex = 0; struct str *extras[2] = { NULL }; - int section = -1; + struct str *section = NULL; uint32_t ch; time_t date_time; char date[256]; @@ -122,13 +126,12 @@ if (name->len == 0) { parser_fatal(p, "Expected preamble"); } - if (section == -1) { + if (section == NULL) { parser_fatal(p, "Expected manual section"); } - char sec[2] = { '0' + section, 0 }; char *ex2 = extras[0] != NULL ? extras[0]->str : NULL; char *ex3 = extras[1] != NULL ? extras[1]->str : NULL; - fprintf(p->output, ".TH \"%s\" \"%s\" \"%s\"", name->str, sec, date); + fprintf(p->output, ".TH \"%s\" \"%s\" \"%s\"", name->str, section->str, date); /* ex2 and ex3 are already double-quoted */ if (ex2) { fprintf(p->output, " %s", ex2); @@ -138,7 +141,7 @@ } fprintf(p->output, "\n"); break; - } else if (section == -1) { + } else if (section == NULL) { parser_fatal(p, "Name characters must be A-Z, a-z, 0-9, `-`, `_`, or `.`"); } } @@ -173,19 +176,19 @@ p->flags ^= fmt; } -static void parse_linebreak(struct parser *p) { +static bool parse_linebreak(struct parser *p) { uint32_t plus = parser_getch(p); if (plus != '+') { fprintf(p->output, "+"); parser_pushch(p, plus); - return; + return false; } uint32_t lf = parser_getch(p); if (lf != '\n') { fprintf(p->output, "+"); + parser_pushch(p, lf); parser_pushch(p, plus); - parser_pushch(p, '\n'); - return; + return false; } uint32_t ch = parser_getch(p); if (ch == '\n') { @@ -194,6 +197,7 @@ } parser_pushch(p, ch); fprintf(p->output, "\n.br\n"); + return true; } static void parse_text(struct parser *p) { @@ -227,7 +231,9 @@ parser_pushch(p, next); break; case '+': - parse_linebreak(p); + if (parse_linebreak(p)) { + last = '\n'; + } break; case '\n': utf8_fputch(p->output, ch); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scdoc-1.10.1/test/line-breaks new/scdoc-1.11.0/test/line-breaks --- old/scdoc-1.10.1/test/line-breaks 1970-01-01 01:00:00.000000000 +0100 +++ new/scdoc-1.11.0/test/line-breaks 2020-06-14 17:21:58.000000000 +0200 @@ -0,0 +1,46 @@ +#!/bin/sh +. test/lib.sh + +begin "Handles line break" +scdoc <<EOF | grep '^\.br$' >/dev/null +test(8) + +hello++ +world +EOF +end 0 + +begin "Disallows empty line after line break" +scdoc <<EOF >/dev/null +test(8) + +hello++ + +world +EOF +end 1 + +begin "Leave single +" +scdoc <<EOF | grep 'hello+world' >/dev/null +test(8) + +hello+world +EOF +end 0 + +begin "Leave double + without newline" +scdoc <<EOF | grep 'hello++world' >/dev/null +test(8) + +hello++world +EOF +end 0 + +begin "Handles underlined text following line break" +scdoc <<EOF | grep '\\fIworld\\fR' >/dev/null +test(8) + +hello++ +_world_ +EOF +end 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scdoc-1.10.1/test/preamble new/scdoc-1.11.0/test/preamble --- old/scdoc-1.10.1/test/preamble 2020-02-14 22:38:03.000000000 +0100 +++ new/scdoc-1.11.0/test/preamble 2020-06-14 17:21:58.000000000 +0200 @@ -13,30 +13,54 @@ EOF end 1 +begin "Expects a section within the parentheses" +scdoc <<EOF >/dev/null +test() +EOF +end 1 + begin "Expects name to alphanumeric" scdoc <<EOF >/dev/null !!!!(8) EOF end 1 -begin "Expects section to be a number" +begin "Expects section to start with a number" scdoc <<EOF >/dev/null test(hello) EOF end 1 -begin "Expects section to legit" +begin "Expects section to be legit" scdoc <<EOF >/dev/null test(100) EOF end 1 +begin "Expects section to be legit with subsection" +scdoc <<EOF >/dev/null +test(100hello) +EOF +end 1 + +begin "Expects section not to contain a space" +scdoc <<EOF >/dev/null +test(8 hello) +EOF +end 1 + begin "Accepts a valid preamble" scdoc <<EOF >/dev/null test(8) EOF end 0 +begin "Accepts a valid preamble with subsection" +scdoc <<EOF >/dev/null +test(8hello) +EOF +end 0 + # Make sure SOURCE_DATE_EPOCH is not set for the next tests unset SOURCE_DATE_EPOCH ++++++ scdoc-1.6.1-makefile.patch ++++++ --- /var/tmp/diff_new_pack.KsSZ9F/_old 2020-06-16 13:46:51.542338028 +0200 +++ /var/tmp/diff_new_pack.KsSZ9F/_new 2020-06-16 13:46:51.542338028 +0200 @@ -1,8 +1,8 @@ -diff -urEbw scdoc-1.10.1/Makefile scdoc-1.10.1.new/Makefile ---- scdoc-1.10.1/Makefile 2020-02-14 22:38:03.000000000 +0100 -+++ scdoc-1.10.1.new/Makefile 2020-02-17 11:06:51.216722039 +0100 +diff -urEbw scdoc-1.11.0/Makefile scdoc-1.11.0.new/Makefile +--- scdoc-1.11.0/Makefile 2020-06-14 17:21:58.000000000 +0200 ++++ scdoc-1.11.0.new/Makefile 2020-06-16 10:24:07.293848736 +0200 @@ -1,6 +1,5 @@ - VERSION=1.10.1 + VERSION=1.11.0 CFLAGS+=-g -DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter -LDFLAGS+=-static INCLUDE+=-Iinclude
