Skip to content

Commit 688f140

Browse files
committed
[update] : Added --normwork
1 parent c584979 commit 688f140

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

build.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ _usage () {
187187
echo " --noloopmod No check and load kernel module automatically"
188188
echo " --nodepend No check package dependencies before building"
189189
echo " --noiso No build iso image (Use with --tarball)"
190+
echo " --normwork No remove working dir"
190191
echo " --shmkalteriso Use the shell script version of mkalteriso"
191192
echo
192193
echo " Many packages are installed from AUR, so specifying --noaur can cause problems."
@@ -383,7 +384,7 @@ prepare_env() {
383384
[[ ! -d "${work_dir}" ]] && mkdir -p "${work_dir}"
384385

385386
# Check work dir
386-
if [[ -n $(ls -a "${work_dir}" 2> /dev/null | grep -xv ".." | grep -xv ".") ]]; then
387+
if [[ -n $(ls -a "${work_dir}" 2> /dev/null | grep -xv ".." | grep -xv ".") ]] && [[ "${normwork}" = false ]]; then
387388
umount_chroot_advance
388389
msg_info "Deleting the contents of ${work_dir}..."
389390
remove "${work_dir%/}"/*
@@ -393,8 +394,10 @@ prepare_env() {
393394
local _trap_remove_work
394395
_trap_remove_work() {
395396
local status=${?}
396-
echo
397-
"${tools_dir}/clean.sh" -o -w $(realpath "${work_dir}") $([[ "${debug}" = true ]] && echo -n "-d")
397+
if [[ "${normwork}" = false ]]; then
398+
echo
399+
"${tools_dir}/clean.sh" -o -w $(realpath "${work_dir}") $([[ "${debug}" = true ]] && echo -n "-d")
400+
fi
398401
exit ${status}
399402
}
400403
trap '_trap_remove_work' 1 2 3 15
@@ -1038,7 +1041,7 @@ make_iso() {
10381041
# Parse options
10391042
ARGUMENT="${@}"
10401043
OPTS="a:bc:deg:hjk:l:o:p:rt:u:w:x"
1041-
OPTL="arch:,boot-splash,comp-type:,debug,cleaning,cleanup,gpgkey:,help,lang:,japanese,kernel:,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod,tarball,noiso,noaur,nochkver,channellist,config:,noefi,nodebug,nosigcheck"
1044+
OPTL="arch:,boot-splash,comp-type:,debug,cleaning,cleanup,gpgkey:,help,lang:,japanese,kernel:,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod,tarball,noiso,noaur,nochkver,channellist,config:,noefi,nodebug,nosigcheck,normwork"
10421045
if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${DEFAULT_ARGUMENT} ${ARGUMENT}); then
10431046
exit 1
10441047
fi
@@ -1193,6 +1196,10 @@ while :; do
11931196
nosigcheck=true
11941197
shift 1
11951198
;;
1199+
--normwork)
1200+
normwork=true
1201+
shift 1
1202+
;;
11961203
--)
11971204
shift
11981205
break

default.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ noaur=false
247247
# Change the default behavior of "--nosigcheck".
248248
nosigcheck=false
249249

250+
# Do not remove working dir
251+
# Change the default behavior of "--normwork".
252+
normwork=false
253+
250254
#-- Debug options --#
251255

252256
# Set debug mode.

0 commit comments

Comments
 (0)