главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
path: root/bb.sh
diff options
context:
space:
mode:
authorsubtleq <sam.lanzo@gmail.com>2013-06-06 18:01:22 -0600
committersubtleq <sam.lanzo@gmail.com>2013-06-06 18:01:22 -0600
commit4ea22be4126a2511e4fa92231b912bfa3e460533 (patch)
tree36464a6045c611dbfb34c825f7f2b4b0dacba4c4 /bb.sh
parenta628d074fc706102ebba975448dee262b324ebbf (diff)
Fix For "BSD 'date' does not have the -R option"
modified date calls on lines 514, 515, 531, and 628 to use +"%a, %d %b %Y %H:%M:%S %z" in place of -R for compatibility with BSD systems. This commit has not been tested, but should work.
Diffstat (limited to 'bb.sh')
-rwxr-xr-xbb.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/bb.sh b/bb.sh
index 1b3ef15..be623c2 100755
--- a/bb.sh
+++ b/bb.sh
@@ -511,8 +511,8 @@ make_rss() {
echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">' >> "$rssfile"
echo '<channel><title>'$global_title'</title><link>'$global_url'</link>' >> "$rssfile"
echo '<description>'$global_description'</description><language>en</language>' >> "$rssfile"
- echo '<lastBuildDate>'$(date -R)'</lastBuildDate>' >> "$rssfile"
- echo '<pubDate>'$(date -R)'</pubDate>' >> "$rssfile"
+ echo '<lastBuildDate>'$(date +"%a, %d %b %Y %H:%M:%S %z")'</lastBuildDate>' >> "$rssfile"
+ echo '<pubDate>'$(date +"%a, %d %b %Y %H:%M:%S %z")'</pubDate>' >> "$rssfile"
echo '<atom:link href="'$global_url/$blog_feed'" rel="self" type="application/rss+xml" />' >> "$rssfile"
n=0
@@ -528,7 +528,7 @@ make_rss() {
echo "]]></description><link>$global_url/$i</link>" >> "$rssfile"
echo "<guid>$global_url/$i</guid>" >> "$rssfile"
echo "<dc:creator>$global_author</dc:creator>" >> "$rssfile"
- echo '<pubDate>'$(date -r "$i" -R)'</pubDate></item>' >> "$rssfile"
+ echo '<pubDate>'$(date -r "$i" +"%a, %d %b %Y %H:%M:%S %z")'</pubDate></item>' >> "$rssfile"
n=$(( $n + 1 ))
done
@@ -625,7 +625,7 @@ rebuild_all_entries() {
awk '/<!-- text begin -->/, /<!-- text end -->/{if (!/<!-- text begin -->/ && !/<!-- text end -->/) print}' "$i" >> "$contentfile"
# Original post timestamp
- timestamp="$(date -R -r $i)"
+ timestamp="$(date -r $i +"%a, %d %b %Y %H:%M:%S %z" )"
create_html_page "$contentfile" "$i.rebuilt" no "$title" "$timestamp"
# keep the original timestamp!