summaryrefslogtreecommitdiff
path: root/html-gen.sh
diff options
context:
space:
mode:
authorp4bl0 <pablo@rauzy.name>2010-09-04 23:39:06 +0200
committerp4bl0 <pablo@rauzy.name>2010-09-04 23:39:06 +0200
commit925225d96e76087af2e9cce60f389c5dc560a8f5 (patch)
tree9086461b9757e6051fb5c32d6ad142f4726ab10b /html-gen.sh
parentc044292f9e1bc38bb4a03c9c7a18173cd8fdd91d (diff)
removed mktemp call options because of a compatibility issue with BSD mktemp util
Diffstat (limited to 'html-gen.sh')
-rw-r--r--html-gen.sh32
1 files changed, 16 insertions, 16 deletions
diff --git a/html-gen.sh b/html-gen.sh
index fb0f4d9..1029c25 100644
--- a/html-gen.sh
+++ b/html-gen.sh
@@ -16,8 +16,8 @@ if [ "$tpl_change" -gt 0 ]; then
modified_files=`git log --name-status --pretty="format:" | \
grep -E '^A' | cut -f2 | sort | uniq`
deleted_files=
- tmpart=`mktemp --suffix "-fugitive"`
- tmpmod=`mktemp --suffix "-fugitive"`
+ tmpart=`mktemp`
+ tmpmod=`mktemp`
ls "$articles_dir"/* > "$tmpart"
echo "$modified_files" | tr " " "\n" > "$tmpmod"
modified_files=`comm -12 --nocheck-order "$tmpmod" "$tmpart"`
@@ -25,9 +25,9 @@ if [ "$tpl_change" -gt 0 ]; then
echo "[fugitive] Templates changed, regenerating everything..."
fi
-generated_files=`mktemp --suffix "-fugitive"`
+generated_files=`mktemp`
-articles_sorted=`mktemp --suffix "-fugitive"`
+articles_sorted=`mktemp`
for f in "$articles_dir"/*; do
ts=`git log --format="%at" -- "$f" | tail -1`
if [ "$ts" != "" ]; then
@@ -39,7 +39,7 @@ if [ "`head -1 $articles_sorted`" = "" ]; then
echo "[fugitive] WARNING: there's no article, errors may occur." >&2
fi
-articles_sorted_with_delete=`mktemp --suffix "-fugitive"`
+articles_sorted_with_delete=`mktemp`
for f in "$articles_dir"/* $deleted_files; do
ts=`git log --format="%at" -- "$f" | tail -1`
if [ "$ts" != "" ]; then
@@ -47,7 +47,7 @@ for f in "$articles_dir"/* $deleted_files; do
fi
done | sort -nr | cut -d' ' -f2 > "$articles_sorted_with_delete"
-commits=`mktemp --suffix "-fugitive"`
+commits=`mktemp`
git log --oneline | cut -d' ' -f1 > "$commits"
get_article_info() {
@@ -83,7 +83,7 @@ get_article_title() {
fi
}
get_article_content() {
- tmp=`mktemp --suffix "-fugitive"`
+ tmp=`mktemp`
tail -n+2 "$articles_dir/$1" > "$tmp"
echo "$tmp"
}
@@ -92,7 +92,7 @@ get_commit_info() {
git show --quiet --format="$1" "$2"
}
get_commit_body() {
- tmp=`mktemp --suffix "-fugitive"`
+ tmp=`mktemp`
git show --quiet --format="%b" "$1" > "$tmp"
if [ "`cat \"$tmp\" | sed \"/^$/d\" | wc -l`" != "0" ]; then
echo "$tmp"
@@ -137,8 +137,8 @@ replace_file() {
}
replace_includes() {
- buf=`mktemp --suffix "-fugitive"`
- buf2=`mktemp --suffix "-fugitive"`
+ buf=`mktemp`
+ buf2=`mktemp`
cat > "$buf"
includes=`cat "$buf" | \
sed "s/<?fugitive\s\+include:.\+\s*?>/\n\0\n/g" | \
@@ -250,9 +250,9 @@ replace_empty_article_info() {
}
replace_foreach () {
- foreach_body=`mktemp --suffix "-fugitive"`
- tmpfile=`mktemp --suffix "-fugitive"`
- temp=`mktemp --suffix "-fugitive"`
+ foreach_body=`mktemp`
+ tmpfile=`mktemp`
+ temp=`mktemp`
fe="foreach:$1"
cat > "$temp"
cat "$temp" | \
@@ -276,7 +276,7 @@ replace_foreach () {
generate_article() {
if [ "$preproc" != "" ]; then
- preproc_bak=`mktemp --suffix "-fugitive" -d "$articles_dir"`
+ preproc_bak=`mktemp -d "$articles_dir"`
mv "$1" "$preproc_bak"
($preproc) < "$preproc_bak" > "$1"
fi
@@ -364,9 +364,9 @@ if [ $modification -gt 0 ]; then
sed "/^\s*$/d" > "$public_dir/archives.html"
echo "done."
echo -n "[fugitive] Generating $public_dir/feed.xml... "
- last_5_articles=`mktemp --suffix "-fugitive"`
+ last_5_articles=`mktemp`
head -5 "$articles_sorted" > "$last_5_articles"
- last_5_commits=`mktemp --suffix "-fugitive"`
+ last_5_commits=`mktemp`
head -5 "$commits" > "$last_5_commits"
cat "$templates_dir/feed.xml" | \
replace_includes | \