Skip to content

Conversation

@craigcomstock
Copy link
Contributor

On FreeBSD where package versions can have commas such as joe-4.6,1 this was causing errors with the use of packagesmatching() function.

   error: Line from package inventory 'joe,4.6,1,amd64,pkg' did not yield correct number of elements.

Used CsvWriterField to quote the field in case it includes " , \r \n. See CsvWriterField() at https://github.com/NorthernTechHQ/libntech/blob/master/libutils/csv_writer.c#L73

Had to add a workaround to convert CRLF written by csv_writer to expected LF in resulting inventory_list.

Ticket: CFE-4341
Changelog: title

Co-authored-by: Lars Erik Wik lars.erik.wik@northern.tech
(cherry picked from commit 27fdfb5)

…n needed

On FreeBSD where package versions can have commas such as joe-4.6,1 this was causing errors with the use of packagesmatching() function.

```
   error: Line from package inventory 'joe,4.6,1,amd64,pkg' did not yield correct number of elements.
```

Used CsvWriterField to quote the field in case it includes " , \r \n. See CsvWriterField() at https://github.com/NorthernTechHQ/libntech/blob/master/libutils/csv_writer.c#L73

Had to add a workaround to convert CRLF written by csv_writer to expected LF in resulting inventory_list.

Ticket: CFE-4341
Changelog: title

Co-authored-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 27fdfb5)
@cf-bottom
Copy link

Thank you for submitting a PR! Maybe @larsewi can review this?

@craigcomstock craigcomstock merged commit f3485ba into 3.21.x Mar 21, 2024
@craigcomstock craigcomstock deleted the CFE-4341/3.21 branch March 21, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants