Skip to content

Commit

Permalink
Fix whitespace in scripts
Browse files Browse the repository at this point in the history
* unify indentation size
* don't mix tabs and spaces
* remove trailing whitespace
  • Loading branch information
a1346054 committed Aug 28, 2021
1 parent ff50406 commit 3d311f7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions tools/create-deb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ DOCDIR=$FSDIR/usr/share/doc/xaos
mkdir -p "$DOCDIR"
cp "$MAINDIR/COPYING" "$MAINDIR/NEWS" "$DOCDIR"
for i in CREDITS README; do
pandoc "$MAINDIR/$i.md" | lynx -stdin -dump -nolist > "$DOCDIR/$i"
done
pandoc "$MAINDIR/$i.md" | lynx -stdin -dump -nolist > "$DOCDIR/$i"
done
gzip -n "$DOCDIR/NEWS"

echo "Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Expand Down
2 changes: 1 addition & 1 deletion tools/dep-deb-versions
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export ARCH=`dpkg --print-architecture`
| awk '{print $1}' | cut -d: -f1 ; done) | sort | uniq | xargs dpkg -l | grep :$ARCH \
| sed s/:$ARCH// | sed s/+dfsg// | awk '{if (nonfirst==1) printf ", ";
nonfirst=1; mp=index($3,"-"); ver=substr($3,1,mp-1); verpp=index(ver ".",".");
ver2=substr(ver,verpp+1); ver2pp=index(ver2 ".","."); ver3=substr(ver,1,verpp+ver2pp-1); printf $2 " (>= " ver3 ")"}'
ver2=substr(ver,verpp+1); ver2pp=index(ver2 ".","."); ver3=substr(ver,1,verpp+ver2pp-1); printf $2 " (>= " ver3 ")"}'
4 changes: 2 additions & 2 deletions tools/deploy-mac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cp examples/*/* bin/XaoS.app/Contents/Resources/examples/
cp -R catalogs bin/XaoS.app/Contents/Resources/
cp -R tutorial bin/XaoS.app/Contents/Resources/
if [ -z "$1" ]; then
$MACDEPLOYQT bin/XaoS.app -dmg
$MACDEPLOYQT bin/XaoS.app -dmg
else
$MACDEPLOYQT bin/XaoS.app -dmg -codesign="$1"
$MACDEPLOYQT bin/XaoS.app -dmg -codesign="$1"
fi
74 changes: 37 additions & 37 deletions tools/xaf2cat
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ if [ $# != 1 ]; then
echo "xaf2cat converts .xaf to .cat file format and reconstructs .xaf"
echo "Usage: xaf2cat [ filename.xaf | -h ]"
exit 1
fi
fi

if [ "$1" = "-h" ]; then
echo "This tool helps you create language independent .xaf files."
echo "The texts from the .xaf file will be copied into all .cat files."
echo "All texts in the .xaf file will be pointered to the .cat files."
echo "You have to write your own descriptions for the .xaf tutorial file"
echo "into the .cat files for each language."
echo ""
echo "The usage of this tool is quite straightforward, but unfortunately"
echo "it has a serious bug: it cannot handle multiline texts correctly."
echo "Keep this bug in mind or write a better script which will solve"
echo "this problem."
exit 1
fi
echo "This tool helps you create language independent .xaf files."
echo "The texts from the .xaf file will be copied into all .cat files."
echo "All texts in the .xaf file will be pointered to the .cat files."
echo "You have to write your own descriptions for the .xaf tutorial file"
echo "into the .cat files for each language."
echo ""
echo "The usage of this tool is quite straightforward, but unfortunately"
echo "it has a serious bug: it cannot handle multiline texts correctly."
echo "Keep this bug in mind or write a better script which will solve"
echo "this problem."
exit 1
fi

test -r "$1" || {
echo "$1 is missing"
Expand All @@ -36,48 +36,48 @@ echo "
cat "$1" | grep "text " | sed s/"(text "/""/g | sed s/"\")"/"\""/g | \
sed s/" \"$"/"\""/g | awk '{x++; print ENVIRON["BASENAME"] x " " $0}' \
>> "$OUTPUTFILE"

cat "$OUTPUTFILE"
printf '%s' "^- This is the output. Do you want to append it to ../catalogs/*.cat? [Y/n] "
read -r A
if [ "$A" != "n" ]; then
for i in ../catalogs/*.cat; do
cat "$OUTPUTFILE" >> "$i"
printf '%s' "$i, "
done
echo "done."
for i in ../catalogs/*.cat; do
cat "$OUTPUTFILE" >> "$i"
printf '%s' "$i, "
done
echo "done."
fi

printf '%s' "Shall I create 'message' commands instead of 'text's in $1? [Y/n] "
read -r A
if [ "$A" != "n" ]; then
cat "$1" | sed s/"(text "/"(message "/g | \
sed s/" \"$"/"\""/g | awk '
{
if (index($0,"(message ")==1)
cat "$1" | sed s/"(text "/"(message "/g | \
sed s/" \"$"/"\""/g | awk '
{
if (index($0,"(message ")==1)
{
x++
l=length($0)
print "(message ~" ENVIRON["BASENAME"] x "~)"
}
else print $0
}' | sed s/"~"/"\""/g \
> "$1.work"
cat "$1.work"
printf '%s' "^- This is the new $1 file. Do you want to save it? [Y/n] "
read -r A
if [ "$A" != "n" ]; then
cp -- "$1.work" "$1"
echo "Done."
fi
else print $0
}' | sed s/"~"/"\""/g \
> "$1.work"

cat "$1.work"
printf '%s' "^- This is the new $1 file. Do you want to save it? [Y/n] "
read -r A
if [ "$A" != "n" ]; then
cp -- "$1.work" "$1"
echo "Done."
fi
fi

printf '%s' "Cleanup? [Y/n] "
read -r A
if [ "$A" != "n" ]; then
rm -f "$1.work" "$1.orig" "$OUTPUTFILE"
echo "Cleanup done."
fi
rm -f "$1.work" "$1.orig" "$OUTPUTFILE"
echo "Cleanup done."
fi

echo "Exiting."

0 comments on commit 3d311f7

Please sign in to comment.