Skip to content

Commit

Permalink
build type feature added
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Aug 28, 2024
1 parent d586f5b commit d27b29b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
Empty file modified po/tr.po
100644 → 100755
Empty file.
33 changes: 22 additions & 11 deletions src/data/ympbuild.vala
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,28 @@ public class ympbuild {
get_ympbuild_value ("name"),
function));
if (ympbuild_has_function (function)) {
string cmd = "cd %s\n %s\n set +e ; source %s/ympbuild ; export ACTION=%s ; set -e ; %s".printf (
ympbuild_buildpath,
ympbuild_header,
ympbuild_srcpath,
function,
function
);
if (get_bool ("quiet")) {
return run_args_silent ( {"bash", "-c", cmd});
}else {
return run_args ( {"bash", "-c", cmd});
string[] build_types = get_ympbuild_array("buildtypes");
if (build_types.length == 0){
build_types = {"main"};
}
foreach(string buildtype in build_types){
string cmd = "cd %s\n %s\n set +e ; source %s/ympbuild ; export ACTION=%s BUILDTYPE=%s; set -e ; %s".printf (
ympbuild_buildpath,
ympbuild_header,
ympbuild_srcpath,
function,
buildtype,
function
);
int status = 0;
if (get_bool ("quiet")) {
status = run_args_silent ( {"bash", "-ec", cmd});
}else {
status = run_args ( {"bash", "-ec", cmd});
}
if(status != 0){
return status;
}
}
}else {
warning (_ ("ympbuild function not exists: %s").printf (function));
Expand Down
11 changes: 10 additions & 1 deletion src/shcode/ympbuild_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export FORCE_UNSAFE_CONFIGURE=1
export PYTHONDONTWRITEBYTECODE=1
export SHELL="/bin/bash"
export EDITOR="/bin/false"
export CONFIG_SHELL=/bin/bash
export PAGER="/bin/cat"
export CONFIG_SHELL="/bin/bash"

declare -r TARGET="@BUILD_TARGET@"
declare -r DISTRO="@DISTRO@"
Expand Down Expand Up @@ -133,6 +134,14 @@ function target(){
}
readonly -f target

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

function use(){
if ! echo ${uses[@]} ${uses_extra[@]} ${arch[@]} all extra | grep "$1" >/dev/null; then
echo "Use flag \"$1\" is unknown!"
Expand Down

0 comments on commit d27b29b

Please sign in to comment.