Skip to content

Commit 9e69d4f

Browse files
committed
Claude review: Fix issues in package_tool that claude reported when
asked to find bugs.
1 parent bcabe4f commit 9e69d4f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

package_tool

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ usage()
99
echo " --update: Update the system."
1010
echo " --usage: This usage message."
1111
echo " --pip_packages: comma separated list of pip modules to install"
12-
echo " --python_exec: path to python intrepreter to install pip modules for (default \"python3\"), will require installation of relevant packages to install pip"
12+
echo " --python_exec: path to python interpreter to install pip modules for (default \"python3\"), will require installation of relevant packages to install pip"
1313
exit 1
1414
}
1515

@@ -138,7 +138,7 @@ opts=$(getopt \
138138
-- "$@"
139139
)
140140

141-
eval set --$opts
141+
eval set -- "$opts"
142142

143143
while [[ $# -gt 0 ]]; do
144144
case "$1" in
@@ -214,15 +214,15 @@ if [[ $install_cmd == "" ]]; then
214214
fi
215215

216216
if [[ $is_installed != "" ]]; then
217-
$install_cmd list installed | grep -q php-cli.x86_64
217+
$install_cmd list installed | grep -q $is_installed
218218
exit $?
219219
fi
220220

221221
if [[ $remove_packages != "" ]]; then
222222
pkgs_rm=`echo $remove_packages | sed "s/,/ /g"`
223-
$install_cmd remove -y $remove_packages
223+
$install_cmd remove -y $pkg_rm
224224
if [ $? -ne 0 ]; then
225-
exit_out "Failed to remove $packages" 1
225+
exit_out "Failed: Was unable to remove some or all of the package(s) $remoove_packages" 1
226226
fi
227227
fi
228228

0 commit comments

Comments
 (0)