mirror of
https://git.ludikovsky.name/git/fugitive.git
synced 2024-07-07 14:35:29 +02:00
removed mktemp call options because of a compatibility issue with BSD mktemp util
This commit is contained in:
parent
c044292f9e
commit
925225d96e
2
build.sh
2
build.sh
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
include_file() {
|
include_file() {
|
||||||
f=`echo -n $2 | sed 's/\//\\\\\//g'`
|
f=`echo -n $2 | sed 's/\//\\\\\//g'`
|
||||||
tmp=`mktemp --suffix "-fugitive"`
|
tmp=`mktemp`
|
||||||
cat "$2" | gzip | base64 > "$tmp"
|
cat "$2" | gzip | base64 > "$tmp"
|
||||||
cat "$1" | sed "/#INCLUDE:$f#/ {
|
cat "$1" | sed "/#INCLUDE:$f#/ {
|
||||||
r $tmp
|
r $tmp
|
||||||
|
|
32
html-gen.sh
32
html-gen.sh
|
@ -16,8 +16,8 @@ if [ "$tpl_change" -gt 0 ]; then
|
||||||
modified_files=`git log --name-status --pretty="format:" | \
|
modified_files=`git log --name-status --pretty="format:" | \
|
||||||
grep -E '^A' | cut -f2 | sort | uniq`
|
grep -E '^A' | cut -f2 | sort | uniq`
|
||||||
deleted_files=
|
deleted_files=
|
||||||
tmpart=`mktemp --suffix "-fugitive"`
|
tmpart=`mktemp`
|
||||||
tmpmod=`mktemp --suffix "-fugitive"`
|
tmpmod=`mktemp`
|
||||||
ls "$articles_dir"/* > "$tmpart"
|
ls "$articles_dir"/* > "$tmpart"
|
||||||
echo "$modified_files" | tr " " "\n" > "$tmpmod"
|
echo "$modified_files" | tr " " "\n" > "$tmpmod"
|
||||||
modified_files=`comm -12 --nocheck-order "$tmpmod" "$tmpart"`
|
modified_files=`comm -12 --nocheck-order "$tmpmod" "$tmpart"`
|
||||||
|
@ -25,9 +25,9 @@ if [ "$tpl_change" -gt 0 ]; then
|
||||||
echo "[fugitive] Templates changed, regenerating everything..."
|
echo "[fugitive] Templates changed, regenerating everything..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
generated_files=`mktemp --suffix "-fugitive"`
|
generated_files=`mktemp`
|
||||||
|
|
||||||
articles_sorted=`mktemp --suffix "-fugitive"`
|
articles_sorted=`mktemp`
|
||||||
for f in "$articles_dir"/*; do
|
for f in "$articles_dir"/*; do
|
||||||
ts=`git log --format="%at" -- "$f" | tail -1`
|
ts=`git log --format="%at" -- "$f" | tail -1`
|
||||||
if [ "$ts" != "" ]; then
|
if [ "$ts" != "" ]; then
|
||||||
|
@ -39,7 +39,7 @@ if [ "`head -1 $articles_sorted`" = "" ]; then
|
||||||
echo "[fugitive] WARNING: there's no article, errors may occur." >&2
|
echo "[fugitive] WARNING: there's no article, errors may occur." >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
articles_sorted_with_delete=`mktemp --suffix "-fugitive"`
|
articles_sorted_with_delete=`mktemp`
|
||||||
for f in "$articles_dir"/* $deleted_files; do
|
for f in "$articles_dir"/* $deleted_files; do
|
||||||
ts=`git log --format="%at" -- "$f" | tail -1`
|
ts=`git log --format="%at" -- "$f" | tail -1`
|
||||||
if [ "$ts" != "" ]; then
|
if [ "$ts" != "" ]; then
|
||||||
|
@ -47,7 +47,7 @@ for f in "$articles_dir"/* $deleted_files; do
|
||||||
fi
|
fi
|
||||||
done | sort -nr | cut -d' ' -f2 > "$articles_sorted_with_delete"
|
done | sort -nr | cut -d' ' -f2 > "$articles_sorted_with_delete"
|
||||||
|
|
||||||
commits=`mktemp --suffix "-fugitive"`
|
commits=`mktemp`
|
||||||
git log --oneline | cut -d' ' -f1 > "$commits"
|
git log --oneline | cut -d' ' -f1 > "$commits"
|
||||||
|
|
||||||
get_article_info() {
|
get_article_info() {
|
||||||
|
@ -83,7 +83,7 @@ get_article_title() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
get_article_content() {
|
get_article_content() {
|
||||||
tmp=`mktemp --suffix "-fugitive"`
|
tmp=`mktemp`
|
||||||
tail -n+2 "$articles_dir/$1" > "$tmp"
|
tail -n+2 "$articles_dir/$1" > "$tmp"
|
||||||
echo "$tmp"
|
echo "$tmp"
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ get_commit_info() {
|
||||||
git show --quiet --format="$1" "$2"
|
git show --quiet --format="$1" "$2"
|
||||||
}
|
}
|
||||||
get_commit_body() {
|
get_commit_body() {
|
||||||
tmp=`mktemp --suffix "-fugitive"`
|
tmp=`mktemp`
|
||||||
git show --quiet --format="%b" "$1" > "$tmp"
|
git show --quiet --format="%b" "$1" > "$tmp"
|
||||||
if [ "`cat \"$tmp\" | sed \"/^$/d\" | wc -l`" != "0" ]; then
|
if [ "`cat \"$tmp\" | sed \"/^$/d\" | wc -l`" != "0" ]; then
|
||||||
echo "$tmp"
|
echo "$tmp"
|
||||||
|
@ -137,8 +137,8 @@ replace_file() {
|
||||||
}
|
}
|
||||||
|
|
||||||
replace_includes() {
|
replace_includes() {
|
||||||
buf=`mktemp --suffix "-fugitive"`
|
buf=`mktemp`
|
||||||
buf2=`mktemp --suffix "-fugitive"`
|
buf2=`mktemp`
|
||||||
cat > "$buf"
|
cat > "$buf"
|
||||||
includes=`cat "$buf" | \
|
includes=`cat "$buf" | \
|
||||||
sed "s/<?fugitive\s\+include:.\+\s*?>/\n\0\n/g" | \
|
sed "s/<?fugitive\s\+include:.\+\s*?>/\n\0\n/g" | \
|
||||||
|
@ -250,9 +250,9 @@ replace_empty_article_info() {
|
||||||
}
|
}
|
||||||
|
|
||||||
replace_foreach () {
|
replace_foreach () {
|
||||||
foreach_body=`mktemp --suffix "-fugitive"`
|
foreach_body=`mktemp`
|
||||||
tmpfile=`mktemp --suffix "-fugitive"`
|
tmpfile=`mktemp`
|
||||||
temp=`mktemp --suffix "-fugitive"`
|
temp=`mktemp`
|
||||||
fe="foreach:$1"
|
fe="foreach:$1"
|
||||||
cat > "$temp"
|
cat > "$temp"
|
||||||
cat "$temp" | \
|
cat "$temp" | \
|
||||||
|
@ -276,7 +276,7 @@ replace_foreach () {
|
||||||
|
|
||||||
generate_article() {
|
generate_article() {
|
||||||
if [ "$preproc" != "" ]; then
|
if [ "$preproc" != "" ]; then
|
||||||
preproc_bak=`mktemp --suffix "-fugitive" -d "$articles_dir"`
|
preproc_bak=`mktemp -d "$articles_dir"`
|
||||||
mv "$1" "$preproc_bak"
|
mv "$1" "$preproc_bak"
|
||||||
($preproc) < "$preproc_bak" > "$1"
|
($preproc) < "$preproc_bak" > "$1"
|
||||||
fi
|
fi
|
||||||
|
@ -364,9 +364,9 @@ if [ $modification -gt 0 ]; then
|
||||||
sed "/^\s*$/d" > "$public_dir/archives.html"
|
sed "/^\s*$/d" > "$public_dir/archives.html"
|
||||||
echo "done."
|
echo "done."
|
||||||
echo -n "[fugitive] Generating $public_dir/feed.xml... "
|
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"
|
head -5 "$articles_sorted" > "$last_5_articles"
|
||||||
last_5_commits=`mktemp --suffix "-fugitive"`
|
last_5_commits=`mktemp`
|
||||||
head -5 "$commits" > "$last_5_commits"
|
head -5 "$commits" > "$last_5_commits"
|
||||||
cat "$templates_dir/feed.xml" | \
|
cat "$templates_dir/feed.xml" | \
|
||||||
replace_includes | \
|
replace_includes | \
|
||||||
|
|
|
@ -23,10 +23,10 @@ modified_files=`git log $range --name-status --pretty="format:" | \
|
||||||
deleted_files=`git log $range --name-status --pretty="format:" | \
|
deleted_files=`git log $range --name-status --pretty="format:" | \
|
||||||
grep -E '^D' | cut -f2 | sort | uniq`
|
grep -E '^D' | cut -f2 | sort | uniq`
|
||||||
|
|
||||||
tmpart=`mktemp --suffix "-fugitive"`
|
tmpart=`mktemp`
|
||||||
tmpadd=`mktemp --suffix "-fugitive"`
|
tmpadd=`mktemp`
|
||||||
tmpmod=`mktemp --suffix "-fugitive"`
|
tmpmod=`mktemp`
|
||||||
tmpdel=`mktemp --suffix "-fugitive"`
|
tmpdel=`mktemp`
|
||||||
ls "$articles_dir"/* > "$tmpart"
|
ls "$articles_dir"/* > "$tmpart"
|
||||||
echo "$added_files" | tr " " "\n" > "$tmpadd"
|
echo "$added_files" | tr " " "\n" > "$tmpadd"
|
||||||
echo "$modified_files" | tr " " "\n" > "$tmpmod"
|
echo "$modified_files" | tr " " "\n" > "$tmpmod"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
articles_dir=`git config --get fugitive.articles-dir`
|
articles_dir=`git config --get fugitive.articles-dir`
|
||||||
|
|
||||||
article_exists=`mktemp --suffix "-fugitive"`
|
article_exists=`mktemp`
|
||||||
for f in "$articles_dir"/*; do
|
for f in "$articles_dir"/*; do
|
||||||
ts=`git log --format="%at" -- "$f" | tail -1`
|
ts=`git log --format="%at" -- "$f" | tail -1`
|
||||||
if [ "$ts" != "" ]; then
|
if [ "$ts" != "" ]; then
|
||||||
|
|
Loading…
Reference in a new issue