Age | Commit message (Collapse) | Author |
|
The config is loaded for each child program. These could override these
variables if the user specifies the same name.
|
|
Theres no need to specify. POSIX defines it should support at least LINE_MAX
(2048 typically).
OpenIndiana xargs doesn't conform to POSIX. It doesn't use the largest constraint but
errors out.
From POSIX:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html
"Values of size up to at least {LINE_MAX} bytes shall be supported, provided
that the constraints specified in the DESCRIPTION are met. It shall not be
considered an error if a value larger than that supported by the implementation
or exceeding the constraints specified in the DESCRIPTION is given; xargs shall
use the largest value it supports within the constraints."
|
|
Noticed while testing TMPDIR=/noaccess sort on Illumos/OpenIndiana, which gives
a warning to stderr. For sort temporary directories might be used for large
output.
|
|
|
|
|
|
Remove the parallel xargs example because it is now the default.
|
|
Some of the options, like -P are as of writing (2023) non-POSIX:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html. However
many systems support this useful extension for many years now.
Some historic context:
The xargs -0 option was added on 1996-06-11, about a year after the NetBSD
import (over 27 years ago at the time of writing):
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/xargs/xargs.c?rev=1.2&content-type=text/x-cvsweb-markup
On OpenBSD the xargs -P option was added on 2003-12-06 by syncing the FreeBSD
code:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/xargs/xargs.c?rev=1.14&content-type=text/x-cvsweb-markup
Looking at the imported git history log of GNU findutils (which has xargs), the
very first commit already had the -0 and -P option on Sun Feb 4 20:35:16 1996
+0000.
Tested on many systems, old and new, some notable:
- OpenBSD 7.4
- Void Linux
- FreeBSD 12
- NetBSD 9.3
- HaikuOS (uses GNU tools).
- Slackware 11
- OpenBSD 3.8
- NetBSD 5.1
Some shells:
- oksh
- bash
- dash
- zsh
During testing there are some incompatibilities found in parsing the fields so
the arguments are passed as one argument which is split later on by the child
program.
|
|
Tested on NetBSD 5.1:
- mktemp -p doesn't exist there yet.
- mktemp without any arguments/template doesnt work
- mktemp -d without any arguments/template doesnt work
|
|
Tested on NetBSD 5.1: evaluating directories as config files could allow
garbage, so disallow it.
Devices / fifo, etc are still allowed.
|
|
|
|
- Add a die() helper function to cleanup and exit.
- NOTE that with an empty sfeedtmpdir the case rm -rf "" is fine.
- Respect $TMPDIR for creating temporary files like many UNIX tools do.
- Fix: when creating "${sfeedtmpdir}/ok" fails for some reason cleanup the
whole temporary directory as well.
- Fix: when the feeds() function is not defined exit with status code 1 (this
was incorrectly status code 0).
Reproduce: sfeed_update /dev/null; echo $?
|
|
In zsh the variables $path and $status are special.
https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-path
https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-status
(No promises I will keep up with this insanity in the future though)
|
|
This was a typo: "url:" should be "url".
|
|
no reason for them not to be `static` and this also silences
-Wmissing-prototypes warning
(note: most of this patch was done by a sed(1) command.)
|
|
|
|
|
|
|
|
Reported by commodorian, thanks!
|
|
This is documented in the sfeedrc.5 also where it is more suitable.
|
|
|
|
Such as sfeed_atom.1 or sfeed_twtxt.1
|
|
Reported by Allan Wind, thanks!
|
|
|
|
Asked via e-mail. This confused a person which converted an OPML file which
yielded an sfeedrc with duplicate names or multiple "unnamed" entries.
This caused sfeed_update to fail, because it tried to merge files with the same
name and causing a race-condition because the temporary file with the same name
was already moved.
|
|
I don't mind either behaviour, but it has been suggested by a few people.
For example the mutt mail client also has this behaviour.
|
|
|
|
This is useful for sites that block clients that don't have a User-Agent header
set.
|
|
Prompted by a question from a user. Specificly mention reddit.com now blocks
clients which don't set the User-Agent header. It is specificly mentioned
because there is a reddit feed in the example sfeedrc.
|
|
These file contain examples and more details and may be overlooked/forgotten.
|
|
This might make it easier to set filters or ordering by pattern matching on a
group of feeds by the feed URL. For example youtube or reddit feeds.
Another way which was already possible is prefixing names with for example:
"reddit somename" or "yt somename".
|
|
Reduce using some of the unneeded sys/* headers too. This makes it slightly
more portable or easier to port also.
|
|
See also:
https://www.rssboard.org/rss-0-9-0
|
|
When gmtime_r is called to get the current time show the same error message as
sfeed_mbox does.
|
|
|
|
|
|
|
|
Found with clang -Wreserved-macro-identifier
See also:
https://wiki.sei.cmu.edu/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier
|
|
Separate the common pattern to get the time to compare new items in format
tools to the new util function: getcomparetime().
Some changes and notes:
- Change it so it is OK to set this value to 0 or negative (in the future).
- sfeed_curses: truncating newmaxsecs to an int would limit the value too much.
- Just use strtotime() and parse the value to time_t. This is a signed long
(32-bit, until 2038) or signed long long (64-bit) on most platforms.
- sfeed_curses gets the comparison time on reload aswell and it needs errno =
0, because it uses die(). time() is not guaranteed to set an errno if it fails.
- Rename environment variable to $SFEED_NEW_AGE.
|
|
|
|
By introducing the new environment variable $SFEED_NEW_MAX_SECS in all
sfeed_* utilities marking feeds as new based on comparing their age, it
is now possible to override this age limit.
This allows, for example, to be notified about new feeds within the last
hour with
SFEED_NEW_MAX_SECS=3600 sfeed_plain ~/.sfeed/feeds/*
while creating a beautiful web report for last week's news by
SFEED_NEW_MAX_SECS=604800 sfeed_html ~/.sfeed/feeds/*
|
|
|
|
This matches the behaviour of setting errno for malloc/calloc on the following
systems too:
glibc, musl libc, OpenBSD libc.
It is also more portable for (older) systems.
|
|
A numeric entity could be 5 bytes, so use a round number of 8 bytes.
|
|
This would skip checking the end of the string of checking a NUL byte, because
the iteration was done before checking it.
It would proceed into the data that comes after. Note that sfeed itself can't
generate such malformed data itself.
Example input:
0 title link content\ html
Would incorrect print "contenthtml" as the content.
|
|
|
|
This outputs the TSV data to JSON.
It uses a subset of JSON Feed 1.1:
https://www.jsonfeed.org/version/1.1/
|
|
A numeric entity could be 5 bytes, so use a round number of 8 bytes.
No other change intended and no performance difference noticed.
|
|
Technically for sfeed_atom this violates the RFC standard. There must be an
author in the feed or for an item. However sfeed is not the author, it is a
generator. All readers will read these feeds anyway.
https://www.rfc-editor.org/rfc/rfc4287#section-4.1.1
"atom:feed elements MUST contain one or more atom:author elements, unless all of
the atom:feed element's child atom:entry elements contain at least one
atom:author element." *shrug*
|
|
Save a few bytes in the output by removing it.
https://www.rfc-editor.org/rfc/rfc4287
3.1.1. The "type" Attribute
The title is an atomTextConstruct.
|
|
|