Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package csvprintf for openSUSE:Factory checked in at 2026-03-08 17:27:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/csvprintf (Old) and /work/SRC/openSUSE:Factory/.csvprintf.new.8177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "csvprintf" Sun Mar 8 17:27:09 2026 rev:13 rq:1337505 version:1.3.4 Changes: -------- --- /work/SRC/openSUSE:Factory/csvprintf/csvprintf.changes 2025-09-30 17:42:56.178637594 +0200 +++ /work/SRC/openSUSE:Factory/.csvprintf.new.8177/csvprintf.changes 2026-03-08 17:27:39.344705694 +0100 @@ -1,0 +2,6 @@ +Sun Mar 1 15:59:49 UTC 2026 - Archie Cobbs <[email protected]> + +- Update to release 1.3.4 + - Add support for column name format accessors (#6) + +------------------------------------------------------------------- Old: ---- csvprintf-1.3.3.obscpio New: ---- csvprintf-1.3.4.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ csvprintf.spec ++++++ --- /var/tmp/diff_new_pack.qls50z/_old 2026-03-08 17:27:39.864727052 +0100 +++ /var/tmp/diff_new_pack.qls50z/_new 2026-03-08 17:27:39.868727217 +0100 @@ -1,7 +1,7 @@ # # spec file for package csvprintf # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 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: csvprintf -Version: 1.3.3 +Version: 1.3.4 Release: 0 Summary: Simple CSV file parser for the UNIX command line License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.qls50z/_old 2026-03-08 17:27:39.900728531 +0100 +++ /var/tmp/diff_new_pack.qls50z/_new 2026-03-08 17:27:39.904728695 +0100 @@ -2,8 +2,8 @@ <service mode="localonly" name="obs_scm"> <param name="scm">git</param> <param name="url">https://github.com/archiecobbs/csvprintf</param> - <param name="versionformat">1.3.3</param> - <param name="revision">1.3.3</param> + <param name="versionformat">1.3.4</param> + <param name="revision">1.3.4</param> <param name="filename">csvprintf</param> </service> <service mode="buildtime" name="tar"/> ++++++ csvprintf-1.3.3.obscpio -> csvprintf-1.3.4.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/CHANGES new/csvprintf-1.3.4/CHANGES --- old/csvprintf-1.3.3/CHANGES 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/CHANGES 2026-03-01 16:52:42.000000000 +0100 @@ -1,3 +1,7 @@ +Version 1.3.4 released March 1, 2026 + + - Add support for column name format accessors (#6) + Version 1.3.3 released September 22, 2025 - Fixed bug where \t separator was being skipped as whitespace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/configure.ac new/csvprintf-1.3.4/configure.ac --- old/csvprintf-1.3.3/configure.ac 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/configure.ac 2026-03-01 16:52:42.000000000 +0100 @@ -16,7 +16,7 @@ # under the License. # -AC_INIT([csvprintf - Simple CSV file parser for the UNIX command line],[1.3.3],[https://github.com/archiecobbs/csvprintf],[csvprintf]) +AC_INIT([csvprintf - Simple CSV file parser for the UNIX command line],[1.3.4],[https://github.com/archiecobbs/csvprintf],[csvprintf]) AC_CONFIG_AUX_DIR(scripts) AM_INIT_AUTOMAKE dnl AM_MAINTAINER_MODE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/csvprintf.1.in new/csvprintf-1.3.4/csvprintf.1.in --- old/csvprintf-1.3.3/csvprintf.1.in 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/csvprintf.1.in 2026-03-01 16:52:42.000000000 +0100 @@ -66,26 +66,30 @@ command line utility: you supply a .Xr printf 1 format string on the command line, and each row of the CSV file is split into arguments and formatted accordingly. -.Pp -The format specifiers in the format string contain numeric or symbolic column accessors to specify which CSV column to format. +.Sh Normal Mode +In the first form shown above, the format specifiers in the format string specify which which CSV column to format. +The column accessor within each format specifier takes one of three forms: numeric, symbolic, or column name. .Pp A numeric column accessor is a sequence of decimal digits followed by the .Pa $ character (the same accessor format supported by .Xr printf 1 ) . So for example, -.Pa \(dq%3$d\(dq -would format the third CSV column as a decimal value. -In addition, the +.Pa \(dq%3$-10d\(dq +would format the third CSV column as a decimal value, left justified, in a 10 column wide field. +Columns are numbered starting at one; +the .Pa \(dq%0$d\(dq specifier will print the number of columns in the record. .Pp When the +.Fl i +or .Fl n flag is given, the first row is assumed to contain column names and is not output. -This allows symbolic, instead of numeric, column accessors to be used. -A symbolic column accessor is the column name enclosed in curly braces. +This flag also enables support for symbolic and column name column accessors. .Pp +A symbolic column accessor uses the column's name, as specified in the first row, enclosed in curly braces. For example, if the first row is .Pa FirstName,Lastname,IdNum then the format string @@ -93,8 +97,17 @@ would be equivalent to the format string .Pa \(dq%3$04d: %2$s, %1$s\(dq . .Pp -Specifying a column name that does not appear in the first row generates an error, +Specifying a column name that does not appear in exactly one column in the first row generates an error, so the use of symbolic column accessors adds an extra consistency check. +.Pp +A column name column accessor just outputs the name of the column; the row's value in that column is ignored. +This permits column names in the output even when they are not known ahead of time. +A column name column accessor is specified by putting the column's numeric index in square brackets. +For example, the following format string would output the first three columns in each row, labeled by their names, on three lines: +.Pp +.Pa \(dq%[1]s: %1$s\(rsn%[2]s: %2$s\(rsn%[3]s: %3$s\(rsn\(dq . +.Pp +If the specified column index is zero or greater than the number of columns in the first row, an error occurs. .Sh XML Mode With .Fl x , @@ -115,6 +128,13 @@ .Fl i , the sub-elements use the column names read from the first row (with illegal characters replaced by underscores). .Pp +Specifying +.Fl X +is equivalent to specifying both +.Fl x +and +.Fl i . +.Pp In XML mode, a character encoding must be assumed; see .Fl e . .Pp @@ -139,7 +159,10 @@ with .Fl i , each row is written as an object, using column names for fields. -An error occurs if two columns have the same name. +An error occurs if two columns to be output have the same name. +Use the +.Fl c +flag to whitelist the set of fields that are output. .Pp In JSON mode, a character encoding must be assumed; see .Fl e . @@ -235,6 +258,13 @@ If any .Ar colname doesn't exist, an error occurs. +.Pp +Use of this flag requires the +.Fl i , +.Fl n , +or +.Fl X +flag. .It Fl e Specify input character encoding for XML or JSON mode. .Pp @@ -274,7 +304,7 @@ .It Fl n Assume the first CSV record contains column names and omit from the output. .Pp -In normal mode, enable symbolic column accessors. +In normal mode, enable symbolic and column name accessors. .It Fl p Specify a common prefix (UTF-8 encoding) to use with all column names in the output. .Pp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/main.c new/csvprintf-1.3.4/main.c --- old/csvprintf-1.3.3/main.c 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/main.c 2026-03-01 16:52:42.000000000 +0100 @@ -503,7 +503,7 @@ case MODE_NORMAL: { char ncolbuf[32]; - char empty[] = { '\0' }; + char empty_string[] = { '\0' }; pid_t pid; pid_t result; int status; @@ -523,8 +523,14 @@ err(1, "strdup"); argv[1] = format; snprintf(ncolbuf, sizeof(ncolbuf), "%lu", (unsigned long)row.num); - for (i = 0; i < nargs; i++) - argv[2 + i] = args[i] == 0 ? ncolbuf : args[i] <= row.num ? row.fields[args[i] - 1] : empty; + for (i = 0; i < nargs; i++) { + const int arg = args[i]; + argv[2 + i] = + arg < 0 ? column_names.fields[~arg] : // column name + arg == 0 ? ncolbuf : // number of columns in row + arg <= row.num ? row.fields[arg - 1] : // column value + empty_string; // column index out of range + } argv[2 + nargs] = NULL; execvp(PRINTF_PROGRAM, argv); err(1, "execvp"); @@ -1048,6 +1054,9 @@ memset(row->fields + row->num, 0, (row->alloc - row->num) * sizeof(*row->fields)); } +// Parse format string, permitting "{Column Name}" and "[3]" accessors if "column_names" is not NULL. +// Build an array of column indicies, one for each %x format specifier, and return the length of that array. +// Negative indicies are used for column name accessors like "[3]". static int parsefmt(char *fmt, const struct row *column_names, unsigned int **argsp) { @@ -1192,14 +1201,28 @@ errx(1, "unknown column name \"%.*s\" in symbolic column accessor in %s starting at \"%.20s...\"", namelen, colname, desc, fspec); } - args[(*nargs)++] = argnum; + } else if (*s == '[') { + if (column_names == NULL) + errx(1, "column name accessors require \"-i\" flag in %s starting at \"%.20s...\"", desc, fspec); + s++; + while (isdigit((unsigned char)*s)) + s++; + if (s == start || *s++ != ']') + errx(1, "missing required column accessor in %s starting at \"%.20s...\"", desc, fspec); + sscanf(start + 1, "%u", &argnum); + if (argnum < 1 || argnum > column_names->num) { + errx(1, "invalid column name accessor index %d not in the range %d..%d in %s starting at \"%.20s...\"", + argnum, 1, (int)column_names->num, desc, fspec); + } + argnum = -argnum; } else { while (isdigit((unsigned char)*s)) s++; if (s == start || *s++ != '$') errx(1, "missing required column accessor in %s starting at \"%.20s...\"", desc, fspec); - sscanf(start, "%u", &args[(*nargs)++]); + sscanf(start, "%u", &argnum); } + args[(*nargs)++] = argnum; memmove(start, s, strlen(s) + 1); return start; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/run2.sh new/csvprintf-1.3.4/tests/run2.sh --- old/csvprintf-1.3.3/tests/run2.sh 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/run2.sh 2026-03-01 16:52:42.000000000 +0100 @@ -74,7 +74,7 @@ echo -en "${STDOUT}" > "${TMP_STDOUT_EXPECTED}" echo -en "${STDERR}" > "${TMP_STDERR_EXPECTED}" set +e - echo -en "${STDIN}" | ../csvprintf ${FLAGS} >"${TMP_STDOUT_ACTUAL}" 2>"${TMP_STDERR_ACTUAL}" + echo -en "${STDIN}" | ../csvprintf "${FLAGS[@]}" >"${TMP_STDOUT_ACTUAL}" 2>"${TMP_STDERR_ACTUAL}" ACTUAL_EXITVAL="$?" set -e @@ -103,7 +103,7 @@ else echo "******************************************************" echo "test: ${TESTFILE} FAILED with:" - echo " FLAGS='${FLAGS}'" + echo " FLAGS='${FLAGS[*]}'" echo " STDIN='${STDIN}'" echo "******************************************************" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-bash-omit1.tst new/csvprintf-1.3.4/tests/test-bash-omit1.tst --- old/csvprintf-1.3.3/tests/test-bash-omit1.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-bash-omit1.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-bi' +FLAGS=( -bi ) STDIN='aaa,PATH,ccc\n"a1","b1","c1"\n"a2","b2","c2"\n' STDOUT=$'aaa=\'a1\'; ccc=\'c1\';\naaa=\'a2\'; ccc=\'c2\';\n' STDERR='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-bash-prefix1.tst new/csvprintf-1.3.4/tests/test-bash-prefix1.tst --- old/csvprintf-1.3.3/tests/test-bash-prefix1.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-bash-prefix1.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-bi -p FOO_' +FLAGS=( -bi -p FOO_ ) STDIN='aaa,PATH,ccc\n"a1","b1","c1"\n"a2","b2","c2"\n' STDOUT=$'FOO_aaa=\'a1\'; FOO_PATH=\'b1\'; FOO_ccc=\'c1\';\nFOO_aaa=\'a2\'; FOO_PATH=\'b2\'; FOO_ccc=\'c2\';\n' STDERR='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-bash-prefix2.tst new/csvprintf-1.3.4/tests/test-bash-prefix2.tst --- old/csvprintf-1.3.3/tests/test-bash-prefix2.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-bash-prefix2.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-bi -p PA' +FLAGS=( -bi -p PA ) STDIN='aaa,TH,ccc\n"a1","b1","c1"\n"a2","b2","c2"\n' STDOUT=$'PAaaa=\'a1\'; PAccc=\'c1\';\nPAaaa=\'a2\'; PAccc=\'c2\';\n' STDERR='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-bash-quote.tst new/csvprintf-1.3.4/tests/test-bash-quote.tst --- old/csvprintf-1.3.3/tests/test-bash-quote.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-bash-quote.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-bi -p PA_' +FLAGS=( -bi -p PA_ ) STDIN=$'aaa,bbb,ccc\n\'aa\'xx\',"bb""yy",cc`zz\\ww\n' STDOUT=$'PA_aaa=$\'\\\'aa\\\'xx\\\'\'; PA_bbb=\'bb"yy\'; PA_ccc=\'cc`zz\\ww\';\n' STDERR='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-cflag-extra-cols.tst new/csvprintf-1.3.4/tests/test-cflag-extra-cols.tst --- old/csvprintf-1.3.3/tests/test-cflag-extra-cols.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-cflag-extra-cols.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-ib -p ROW_ -c aaa' +FLAGS=( -ib -p ROW_ -c aaa ) STDIN='"aaa","bbb"\n"a1","b1","c1"\n"a2","b2","c2"\n' STDOUT=$'ROW_aaa=\'a1\';\nROW_aaa=\'a2\';\n' STDERR='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-cflag-not-found.tst new/csvprintf-1.3.4/tests/test-cflag-not-found.tst --- old/csvprintf-1.3.3/tests/test-cflag-not-found.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-cflag-not-found.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-X -c bbb -c zzz' +FLAGS=( -X -c bbb -c zzz ) STDIN='aaa,bbb,ccc\n"a1","b1","c1"\n"a2","b2","c2"\n' STDOUT='!IGNORE!' STDERR='csvprintf: column "zzz" not found\n' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-cflag-xml.tst new/csvprintf-1.3.4/tests/test-cflag-xml.tst --- old/csvprintf-1.3.3/tests/test-cflag-xml.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-cflag-xml.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-X -c bbb' +FLAGS=( -X -c bbb ) STDIN='aaa,bbb,ccc\n"a1","b1","c1"\n"a2","b2","c2"\n' STDOUT='<?xml version="1.0" encoding="UTF-8"?>\n<csv>\n <row>\n <bbb>b1</bbb>\n </row>\n <row>\n <bbb>b2</bbb>\n </row>\n</csv>\n' STDERR='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-column-names-1.tst new/csvprintf-1.3.4/tests/test-column-names-1.tst --- old/csvprintf-1.3.3/tests/test-column-names-1.tst 1970-01-01 01:00:00.000000000 +0100 +++ new/csvprintf-1.3.4/tests/test-column-names-1.tst 2026-03-01 16:52:42.000000000 +0100 @@ -0,0 +1,5 @@ +FLAGS=( -n '%[1]s:%1$s\n' ) +STDIN='"aaa","bbb"\n"a1","b1","b2"\n' +STDOUT=$'aaa:a1\n' +STDERR='' +EXITVAL='0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-duplicate-col.tst new/csvprintf-1.3.4/tests/test-duplicate-col.tst --- old/csvprintf-1.3.3/tests/test-duplicate-col.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-duplicate-col.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-bi -p ROW_ -c aa' +FLAGS=( -bi -p ROW_ -c aa ) STDIN='"aa","bb","bb","",""\n"foo","bar","","",""\n' STDOUT=$'ROW_aa=\'foo\';\n' STDERR='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-json-skip1.tst new/csvprintf-1.3.4/tests/test-json-skip1.tst --- old/csvprintf-1.3.3/tests/test-json-skip1.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-json-skip1.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-jn' +FLAGS=( -jn ) STDIN='aaa,bbb\n"a1","b1"\n"a2","b2"\n' STDOUT='\x1e["a1","b1"]\n\x1e["a2","b2"]\n' STDERR='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/csvprintf-1.3.3/tests/test-tab-noskip.tst new/csvprintf-1.3.4/tests/test-tab-noskip.tst --- old/csvprintf-1.3.3/tests/test-tab-noskip.tst 2025-09-22 17:05:27.000000000 +0200 +++ new/csvprintf-1.3.4/tests/test-tab-noskip.tst 2026-03-01 16:52:42.000000000 +0100 @@ -1,4 +1,4 @@ -FLAGS='-nj -s \t' +FLAGS=( -nj -s '\t' ) STDIN='aaa\tbbb\tccc\n\t\t\n' STDOUT='\x1e["","",""]\n' STDERR='' ++++++ csvprintf.obsinfo ++++++ --- /var/tmp/diff_new_pack.qls50z/_old 2026-03-08 17:27:40.108737075 +0100 +++ /var/tmp/diff_new_pack.qls50z/_new 2026-03-08 17:27:40.128737896 +0100 @@ -1,5 +1,5 @@ name: csvprintf -version: 1.3.3 -mtime: 1758553527 -commit: e4d020da85ec02f895811beb7a5859af3fb8b2b2 +version: 1.3.4 +mtime: 1772380362 +commit: edbe73df5becf886eda45ad45866ca8d7433505e
