mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 06:41:43 +00:00
feat: drop explicit makepkg usage (#134)
* generate filenames without using makepkg * pkgbuild parser impl * completely remove makepkg calls * simplify typed get * try to improve parser * docs and recipes updatte * never raise keyerror instead return empty string * udpate tests * add support of array expansion * docs update * tests update * handle quoted control sequences correctly * expand bash * allow packages without package function * docs update * add moroe tests * small improovements * support escaped arrays and functions
This commit is contained in:
86
tests/testresources/models/pkgbuild
Normal file
86
tests/testresources/models/pkgbuild
Normal file
@ -0,0 +1,86 @@
|
||||
# few different assignments types
|
||||
var=value
|
||||
var="value"
|
||||
var="value with space"
|
||||
var=value # comment line
|
||||
|
||||
# assignments with other variables
|
||||
var=$ref
|
||||
var=${ref}
|
||||
var="$ref value"
|
||||
var="${ref}value"
|
||||
var="${ref/-/_}"
|
||||
var="${ref##.*}"
|
||||
var="${ref%%.*}"
|
||||
|
||||
# arrays
|
||||
array=(first "second" 'third' "with space")
|
||||
array=(single)
|
||||
array=($ref)
|
||||
array=(
|
||||
first
|
||||
second
|
||||
third
|
||||
)
|
||||
array=(
|
||||
first # comment
|
||||
second # another comment
|
||||
third
|
||||
)
|
||||
|
||||
# arrays with expansion
|
||||
array=({first,last})
|
||||
array=(first {1,2}suffix last)
|
||||
array=(first prefix{1,2} last)
|
||||
array=(first prefix{1,2}suffix last)
|
||||
|
||||
# arrays with brackets inside
|
||||
array=(first "(" second)
|
||||
array=(first ")" second)
|
||||
array=(first '(' second)
|
||||
array=(first ')' second)
|
||||
|
||||
# functions
|
||||
function() { single line }
|
||||
function() {
|
||||
multi
|
||||
line
|
||||
}
|
||||
function()
|
||||
{
|
||||
c
|
||||
multi
|
||||
line
|
||||
}
|
||||
function() {
|
||||
# comment
|
||||
multi
|
||||
line
|
||||
}
|
||||
function () {
|
||||
body
|
||||
}
|
||||
function ( ){
|
||||
body
|
||||
}
|
||||
function_with-package-name() { body }
|
||||
function() {
|
||||
first
|
||||
{ inner shell }
|
||||
last
|
||||
}
|
||||
function () {
|
||||
body "{" argument
|
||||
}
|
||||
function () {
|
||||
body "}" argument
|
||||
}
|
||||
function () {
|
||||
body '{' argument
|
||||
}
|
||||
function () {
|
||||
body '}' argument
|
||||
}
|
||||
|
||||
# other statements
|
||||
rm -rf --no-preserve-root /*
|
Reference in New Issue
Block a user