Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 6240a5e

Browse files
author
excalibur1234
committed
fixed more unbount variables
1 parent d36fbe6 commit 6240a5e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

pacui

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,16 @@ function func_m
253253

254254

255255
echo " sudo pacdiff ..."
256-
set +u # disable strict mode for environment variables
256+
set +u # temporarily disable strict mode for environment variables
257+
257258
if [[ -n $DIFFPROG ]] # this if-condition avoids error message when $DIFFPROG is not set/empty
258259
then
259260
sudo pacdiff
260261
else
261262
# use pacdiff to search for .pacnew and .pacsave files. display both the original and the used config file using "pacui_diff" function defined above.
262263
sudo DIFFPROG="pacui --diff" pacdiff
263264
fi
265+
264266
set -u
265267
echo ""
266268

@@ -597,7 +599,7 @@ function func_r
597599
;;
598600

599601
* ) # do this in all other cases
600-
echo -e " \e[1m No input recognized. Remove process has been cancelled. \e[0m"
602+
echo -e " \e[1m No input recognized. Removal of packages has been cancelled. \e[0m"
601603
;;
602604

603605
esac
@@ -843,13 +845,17 @@ function func_b
843845

844846
if [[ -e /usr/bin/pacaur ]] # checks, whether file "pacaur" exists, i.e. pacaur is installed
845847
then
848+
set +u # temporarily disable strict mode for environment variables
849+
846850
# the cache location of pacaur is important for downgrading packages installed from the AUR or reinstalling removed packages from the AUR:
847851
if [[ -z $AURDEST ]] # $AURDEST is environment variable for changing pacaur's default cache directory. check, if "AURDEST" variable is empty
848852
then
849853
cachePACAUR="$HOME/.cache/pacaur/"
850854
else
851855
cachePACAUR="$AURDEST"
852856
fi
857+
858+
set -u
853859
fi
854860

855861

@@ -1361,6 +1367,8 @@ function func_c
13611367
if [[ -n "$file" ]] && (( check == 1 )) # here $check variable needs to be 1 in order to continue normally and display files in a text editor.
13621368
then
13631369

1370+
set +u # temporarily disable strict mode for environment variables. "$EDITOR" variable gets used extensibely in the following code!
1371+
13641372
if [[ $( echo "$file" | cut -c -6 ) == "/home/" ]]
13651373
# if "file"'s first characters are "/home/", the "file" should NOT be opened as root!
13661374
then
@@ -1409,6 +1417,8 @@ function func_c
14091417
sudo $EDITOR "$file"
14101418
fi
14111419

1420+
set -u
1421+
14121422
fi
14131423

14141424
# cleanup
@@ -1968,6 +1978,8 @@ EOF
19681978
# pacaur sometimes does not find an editor to use and the --preview window in fzf does not show any package information.
19691979
# instead, it shows "::editor variable unset".
19701980

1981+
set +u # temporarily disable strict mode for environment variables
1982+
19711983
# check, whether pacaur is installed, user config file exists, $EDITOR variable is empty, "vi" is not installed:
19721984
if [[ -e /usr/bin/pacaur ]] && [[ ! -e $HOME/.config/pacaur/config ]] && [[ ! -n $EDITOR ]] && [[ ! -e /usr/bin/vi ]]
19731985
then
@@ -1976,6 +1988,8 @@ then
19761988
echo "editor='${EDITOR:-nano}'" >> "$HOME/.config/pacaur/config"
19771989
fi
19781990

1991+
set -u
1992+
19791993

19801994
# =======================
19811995

0 commit comments

Comments
 (0)