mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
create-mk(spec|debian).sh: Code beautication
Beautify code and fix backtick and backslash escaping of package scripts Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
1a27f6ecf5
commit
2a88f1ceca
2 changed files with 19 additions and 12 deletions
|
|
@ -1,10 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export LANG=POSIX
|
|
||||||
dir=`dirname $0`
|
|
||||||
inifile="$1"
|
|
||||||
. $dir/ini-tools.sh
|
|
||||||
|
|
||||||
cfg_section()
|
cfg_section()
|
||||||
{
|
{
|
||||||
ini_section "$inifile" $@
|
ini_section "$inifile" $@
|
||||||
|
|
@ -15,6 +10,15 @@ cfg_value()
|
||||||
ini_value "$inifile" $@
|
ini_value "$inifile" $@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# -- here we go
|
||||||
|
|
||||||
|
echo "== running $0" "$@" >&2
|
||||||
|
|
||||||
|
export LANG=POSIX
|
||||||
|
dir=`dirname $0`
|
||||||
|
inifile="$1"
|
||||||
|
. $dir/ini-tools.sh
|
||||||
|
|
||||||
cat << EOT
|
cat << EOT
|
||||||
format_depends()
|
format_depends()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export LANG=POSIX
|
|
||||||
dir=`dirname $0`
|
|
||||||
inifile="$1"
|
|
||||||
. $dir/ini-tools.sh
|
|
||||||
|
|
||||||
cfg_section()
|
cfg_section()
|
||||||
{
|
{
|
||||||
ini_section "$inifile" $@
|
ini_section "$inifile" $@
|
||||||
|
|
@ -17,7 +12,7 @@ cfg_value()
|
||||||
|
|
||||||
cfg_escape()
|
cfg_escape()
|
||||||
{
|
{
|
||||||
sed 's/\$/\\$/g'
|
sed 's/\\/\\\\/g; s/\$/\\$/g; s/`/\\`/g'
|
||||||
}
|
}
|
||||||
|
|
||||||
_cat()
|
_cat()
|
||||||
|
|
@ -30,6 +25,15 @@ subpackages()
|
||||||
echo $SUBPACKAGES
|
echo $SUBPACKAGES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# -- here we go
|
||||||
|
|
||||||
|
echo "== running $0" "$@" >&2
|
||||||
|
|
||||||
|
export LANG=POSIX
|
||||||
|
dir=`dirname $0`
|
||||||
|
inifile="$1"
|
||||||
|
. $dir/ini-tools.sh
|
||||||
|
|
||||||
LICENSE=`cfg_value global.license`
|
LICENSE=`cfg_value global.license`
|
||||||
[ "$LICENSE" ] || LICENSE="janware GmbH proprietary license"
|
[ "$LICENSE" ] || LICENSE="janware GmbH proprietary license"
|
||||||
SUBPACKAGES=`cfg_value global.subpackages`
|
SUBPACKAGES=`cfg_value global.subpackages`
|
||||||
|
|
@ -134,4 +138,3 @@ fi
|
||||||
_cat << EOT
|
_cat << EOT
|
||||||
|echo '%defattr (-, root, root)'
|
|echo '%defattr (-, root, root)'
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue