mirror of https://git.envs.net/envs/burrow.git
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
2b99bf98e3
11
burrow
11
burrow
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
version="v1.7.8"
|
version="v1.7.9"
|
||||||
configsystem="/etc/burrow/config"
|
configsystem="/etc/burrow/config"
|
||||||
if [ -n "$XDG_CONFIG_HOME" ]; then
|
if [ -n "$XDG_CONFIG_HOME" ]; then
|
||||||
configfiles="${XDG_CONFIG_HOME}/burrow/config"
|
configfiles="${XDG_CONFIG_HOME}/burrow/config"
|
||||||
|
@ -84,7 +84,7 @@ check_coreutils () {
|
||||||
stat -c %Y "$1"
|
stat -c %Y "$1"
|
||||||
}
|
}
|
||||||
date_func () {
|
date_func () {
|
||||||
date -d "$1" +"%a, %d %b %Y %T %z"
|
date -d "$1" +"%a, %d %b %Y %T %z" 2>/dev/null
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# BSD environment
|
# BSD environment
|
||||||
|
@ -93,7 +93,7 @@ check_coreutils () {
|
||||||
}
|
}
|
||||||
date_func () {
|
date_func () {
|
||||||
# $1 will be in YYYYMMDD format
|
# $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
|
fi
|
||||||
}
|
}
|
||||||
|
@ -539,11 +539,13 @@ make_rss () {
|
||||||
fi
|
fi
|
||||||
date="$(printf "%s" "$filename" | sed 's|^\./||' | awk 'BEGIN { FS="-" } { print $1; }')"
|
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')"
|
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 "<item>\\n"
|
||||||
printf " <title>%s</title>\\n" "$title"
|
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 " <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"
|
printf " <description><![CDATA[<pre>\\n"
|
||||||
if [ "$item_type" -eq 1 ]
|
if [ "$item_type" -eq 1 ]
|
||||||
then
|
then
|
||||||
|
@ -554,6 +556,7 @@ make_rss () {
|
||||||
printf "</pre>]]></description>\\n"
|
printf "</pre>]]></description>\\n"
|
||||||
printf "</item>\\n"
|
printf "</item>\\n"
|
||||||
} >> "${config_dir_gopher}${config_file_rss}"
|
} >> "${config_dir_gopher}${config_file_rss}"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
pop_d
|
pop_d
|
||||||
printf "</channel>\\n" >> "${config_dir_gopher}${config_file_rss}"
|
printf "</channel>\\n" >> "${config_dir_gopher}${config_file_rss}"
|
||||||
|
|
Loading…
Reference in New Issue