mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
bin, make, scripts: Re-add files necessary for packaging jw-build
Re-add all files necessary to package jw-build itself, i.e. sucessfully run make pkg-rebuild-reinstall. This adds 1892 lines of code. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
bc883deed4
commit
82eb80979d
11 changed files with 1881 additions and 0 deletions
56
scripts/ini-tools.sh
Normal file
56
scripts/ini-tools.sh
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
ini_section()
|
||||
{
|
||||
local inifile="$1"
|
||||
local sec="$2"
|
||||
cat "$inifile" |
|
||||
cut -d\# -f1 |
|
||||
tr -s '\n' '\n' |
|
||||
sed -n "/^ *\[$sec\]/,/^ *\[/ p" |
|
||||
grep -v '^ *\[' |
|
||||
sed '/^ *$/ d'
|
||||
}
|
||||
|
||||
ini_value()
|
||||
{
|
||||
local inifile="$1"
|
||||
local path="$2"
|
||||
local sec=`echo "$path" | sed 's/\.[^.]\+$//'`
|
||||
local key=`echo "$path" | sed 's/.*\.//'`
|
||||
|
||||
# echo "path=>$path<"
|
||||
# echo "sec=>$sec<"
|
||||
# echo "key=>$key<"
|
||||
|
||||
if [ "$key" = "$path" ]; then
|
||||
ini_section "$inifile" "$path"
|
||||
return 0
|
||||
fi
|
||||
|
||||
ini_section "$inifile" "$sec" | sed "
|
||||
/^ *$key *=/ !d
|
||||
s/^ *$key *= *//
|
||||
s/ *$//
|
||||
/^ *$/ d
|
||||
"
|
||||
}
|
||||
|
||||
ini_has_section()
|
||||
{
|
||||
local inifile="$1"
|
||||
local sec="$2"
|
||||
grep -q "^ *\[$sec\]" $inifile || return 1
|
||||
}
|
||||
|
||||
ini_has_value()
|
||||
{
|
||||
ini_value $@ | grep -q .
|
||||
}
|
||||
|
||||
ini_escape()
|
||||
{
|
||||
cat | sed '
|
||||
s/\$/\\$/g
|
||||
s/`/\\\`/g
|
||||
'
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue