Merge remote-tracking branch 'upstream/master'

This commit is contained in:
creme 2020-03-06 15:51:25 +01:00
commit 2b99bf98e3
Signed by: creme
GPG Key ID: C147C3B7FBDF08D0
2 changed files with 22 additions and 19 deletions

11
burrow
View File

@ -1,6 +1,6 @@
#!/bin/sh
version="v1.7.8"
version="v1.7.9"
configsystem="/etc/burrow/config"
if [ -n "$XDG_CONFIG_HOME" ]; then
configfiles="${XDG_CONFIG_HOME}/burrow/config"
@ -84,7 +84,7 @@ check_coreutils () {
stat -c %Y "$1"
}
date_func () {
date -d "$1" +"%a, %d %b %Y %T %z"
date -d "$1" +"%a, %d %b %Y %T %z" 2>/dev/null
}
else
# BSD environment
@ -93,7 +93,7 @@ check_coreutils () {
}
date_func () {
# $1 will be in YYYYMMDD format
printf "%s" "$1" | awk 'BEGIN {n = split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec",month)} { y=substr($0, 0, 4); m=substr($0,5,2); gsub ("^0*", "", m); d=substr($0,7,2); print d, month[m], y, "00:00:00 +0000"}'
printf "%s" "$1" | awk 'BEGIN {n = split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec",month)} { y=substr($0, 0, 4); m=substr($0,5,2); gsub ("^0*", "", m); d=substr($0,7,2); print d, month[m], y, "00:00:00 +0000"}' 2>/dev/null
}
fi
}
@ -539,11 +539,13 @@ make_rss () {
fi
date="$(printf "%s" "$filename" | sed 's|^\./||' | awk 'BEGIN { FS="-" } { print $1; }')"
title="$(printf "%s" "$filename" | awk 'BEGIN { FS="-" } { $1=""; print $0; }' | sed "s|/gophermap||" | sed 's/^\ //' | sed 's|/$||' | awk '{for(i=1;i<=NF;i++){ $i=toupper(substr($i,1,1)) substr($i,2) }}1')"
dateval=$(date_func "$date")
if [ -n "$dateval" ]; then
{
printf "<item>\\n"
printf " <title>%s</title>\\n" "$title"
printf " <link>gopher://%s/%s%s%s/%s</link>\\n" "$config_gopher_server" "$item_type" "$config_gopher_root" "$config_dir_phlog" "$filename"
printf " <pubdate>%s</pubdate>\\n" "$(date_func "$date")"
printf " <pubdate>%s</pubdate>\\n" "$dateval"
printf " <description><![CDATA[<pre>\\n"
if [ "$item_type" -eq 1 ]
then
@ -554,6 +556,7 @@ make_rss () {
printf "</pre>]]></description>\\n"
printf "</item>\\n"
} >> "${config_dir_gopher}${config_file_rss}"
fi
done
pop_d
printf "</channel>\\n" >> "${config_dir_gopher}${config_file_rss}"

View File

@ -1,4 +1,4 @@
.TH BURROW 1 "05 Feb 2019" "version 1.7.8"
.TH BURROW 1 "06 Mar 2020" "version 1.7.9"
.SH NAME
burrow \- a helper for building and managing a gopher hole
.SH SYNOPSIS