Skip to content

Commit

Permalink
ympbuild header functions are read only
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed May 23, 2024
1 parent 18fae36 commit 3af0090
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/shcode/pkgbuild_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@ source+=(PKGBUILD)
sha256sums+=("SKIP")
pkgdir="$installdir"
srcdir="$HOME"

function msg(){
echo "$@"
}
readonly -f msg

function msg2(){
echo "$@"
}
readonly -f msg2

arch-meson(){
command meson setup \
--prefix /usr \
--wrap-mode nodownload \
"$@"

}
readonly -f arch-meson

10 changes: 10 additions & 0 deletions src/shcode/ympbuild_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ function meson(){
function _dump_variables(){
set -o posix ; set
}
readonly -f _dump_variables

function ymp_print_metadata(){
echo "ymp:"
echo " source:"
Expand Down Expand Up @@ -121,13 +123,15 @@ function ymp_print_metadata(){
done
fi
}
readonly -f ymp_print_metadata

function target(){
if [[ "$1" == "@BUILD_TARGET@" ]] ; then
return 0
fi
return 1
}
readonly -f target

function use(){
if ! echo ${uses[@]} ${uses_extra[@]} ${arch[@]} all extra | grep "$1" >/dev/null; then
Expand All @@ -152,15 +156,21 @@ function use(){
fi
done
}
readonly -f use

function use_opt(){
if use "$1" ; then
echo $2
else
echo $3
fi
}
readonly -f use_opt

function eapply(){
for aa in $* ; do
patch -Np1 "$aa"
done
}
readonly -f eapply

5 changes: 4 additions & 1 deletion src/util/build.vala
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ public class builder {
}
if(!isfile(srcpath+"/ympbuild")){
if(isfile(srcpath+"/PKGBUILD")){
writefile(srcpath+"/ympbuild", get_pkgbuild_header().replace("@PKGBUILD@",srcpath+"/PKGBUILD") + "\n# Uses PKGBUILD:" + calculate_md5sum(srcpath+"/PKGBUILD"));
writefile(srcpath+"/ympbuild",
get_pkgbuild_header().replace("@PKGBUILD@",srcpath+"/PKGBUILD")
+ "\n# Uses PKGBUILD:" + calculate_md5sum(srcpath+"/PKGBUILD")
);
}
}
if (!isfile(srcpath + "/ympbuild")) {
Expand Down

0 comments on commit 3af0090

Please sign in to comment.