Skip to content

Commit f08d571

Browse files
committed
[update] : Added debug mode
1 parent 6e8bb0a commit f08d571

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,9 @@ make_packages_repo() {
667667
if [[ "${include_extra}" = true ]]; then
668668
_pkglist_args+=" -e"
669669
fi
670+
if [[ "${debug}" = true ]]; then
671+
_pkglist_args+=" -d"
672+
fi
670673
local _pkglist=($("${tools_dir}/pkglist.sh" ${_pkglist_args}))
671674

672675
# Create a list of packages to be finally installed as packages.list directly under the working directory.
@@ -689,6 +692,9 @@ make_packages_aur() {
689692
if [[ "${include_extra}" = true ]]; then
690693
_pkglist_args+=" -e"
691694
fi
695+
if [[ "${debug}" = true ]]; then
696+
_pkglist_args+=" -d"
697+
fi
692698
local _pkglist_aur=($("${tools_dir}/pkglist.sh" ${_pkglist_args}))
693699

694700
# Create a list of packages to be finally installed as packages.list directly under the working directory.

tools/pkglist.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ aur=false
1111
pkgdir_name="packages"
1212
extra=false
1313
line=false
14+
debug=false
1415

1516
arch=""
1617
channel_dir=""
@@ -31,6 +32,7 @@ _help() {
3132
echo " -a | --arch [arch] Specify the architecture"
3233
echo " -b | --boot-splash Enable boot splash"
3334
echo " -c | --channel [dir] Specify the channel directory"
35+
echo " -d | --debug Enable debug message"
3436
echo " -e | --extra Include extra packages"
3537
echo " -k | --kernel [kernel] Specify the kernel"
3638
echo " -l | --locale [locale] Specify the locale"
@@ -55,22 +57,24 @@ msg_info() {
5557
}
5658

5759
msg_debug() {
58-
"${script_path}/tools/msg.sh" -s "5" -a "pkglist.sh" -l "Debug" -r "magenta" error "${1}"
60+
if [[ "${debug}" = true ]]; then
61+
"${script_path}/tools/msg.sh" -s "5" -a "pkglist.sh" -l "Debug" -r "magenta" error "${1}"
62+
fi
5963
}
6064

6165

6266
# Parse options
6367
ARGUMENT="${@}"
64-
opt_short="a:bc:ek:l:h"
65-
opt_long="arch:,boot-splash,channel:,extra,kernel:,locale:,aur,help,line"
68+
opt_short="a:bc:dek:l:h"
69+
opt_long="arch:,boot-splash,channel:,debug,extra,kernel:,locale:,aur,help,line"
6670
OPT=$(getopt -o ${opt_short} -l ${opt_long} -- ${ARGUMENT})
6771
[[ ${?} != 0 ]] && exit 1
6872

6973
eval set -- "${OPT}"
7074
unset OPT opt_short opt_long
7175

7276
while true; do
73-
case ${1} in
77+
case "${1}" in
7478
-a | --arch)
7579
arch="${2}"
7680
shift 2
@@ -83,6 +87,10 @@ while true; do
8387
channel_dir="${2}"
8488
shift 2
8589
;;
90+
-d | --debug)
91+
debug=true
92+
shift 1
93+
;;
8694
-e | --extra)
8795
extra=true
8896
shift 1

0 commit comments

Comments
 (0)