Skip to content

Commit 9cfb72a

Browse files
authored
Merge branch 'main' into claude_test_tools_wrappers
2 parents 6dbd9ac + 6a69091 commit 9cfb72a

File tree

6 files changed

+20
-744
lines changed

6 files changed

+20
-744
lines changed

README

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,9 @@ They all have a --usage option
2020

2121
convert_csv_to_txt: Converts a csv file to a plain text file
2222
create_filesystem: creates the designated filesystem type on the designated devices
23-
execute_via_pbench: Runs a program via the pbench wrappers
2423
general_setup: Wrappers source this file to process the common options.
2524
grab_disks: List the disks on the system that are not in use.
2625
lvm_create: Creates an lvm
2726
lvm_delete: Deletes an lvm
28-
pbench_copy_data: Takes the results from a pbench user run and saves the data. By default we move the data.
29-
pull_data: Process the csv data for the tests.
30-
set_pbench_variables
31-
umount_filesystems: unmounts a series of filesystems.
3227
detect_os: Determines the currently running OS
3328
detect_numa: Allows fetching NUMA information on a system

execute_via_pbench

Lines changed: 0 additions & 200 deletions
This file was deleted.

package_tool

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ usage()
1010
echo " --usage: This usage message."
1111
echo " --pip_packages: comma separated list of pip modules to install"
1212
echo " --python_exec: path to python interpreter to install pip modules for (default \"python3\"), will require installation of relevant packages to install pip"
13+
echo " --update_cache: Update package cache before install/updating packages, 1 (default) updates cache, 0 skips cache update"
14+
echo " --python_exec: path to python intrepreter to install pip modules for (default \"python3\"), will require installation of relevant packages to install pip"
1315
exit 1
1416
}
1517

@@ -27,10 +29,19 @@ remove_packages=""
2729
wrapper_config=""
2830
pip_packages=""
2931
python_exec="python3"
32+
update_cache=1
33+
cache_cmd=""
3034

3135
base_dir=$(dirname $(realpath $0))
3236
running_os=$($base_dir/detect_os)
3337

38+
update_system_cache() {
39+
if [[ "$update_cache" -eq 1 ]]; then
40+
$install_cmd $cache_cmd
41+
fi
42+
update_cache=0 # Prevent multiple cache updates
43+
}
44+
3445
# Install System packages
3546
# Args:
3647
# - Comma separated list of packages, can also be space separated and work
@@ -41,7 +52,7 @@ install_system_pkgs() {
4152
if [[ -z "$package_list" ]]; then
4253
return 0 # Nothing to do
4354
fi
44-
55+
update_system_cache
4556
for package in $package_list; do
4657
$install_cmd install -y $package
4758
if [ $? -ne 0 ]; then
@@ -116,6 +127,7 @@ install_pip_pkgs() {
116127
ARGUMENT_LIST=(
117128
"is_installed"
118129
"no_packages"
130+
"update_cache"
119131
"packages"
120132
"remove_packages"
121133
"wrapper_config"
@@ -179,6 +191,10 @@ while [[ $# -gt 0 ]]; do
179191
wrapper_config=$2
180192
shift 2
181193
;;
194+
--update_cache)
195+
update_cache=$2
196+
shift 2
197+
;;
182198
-h)
183199
usage $0
184200
;;
@@ -196,16 +212,19 @@ install_cmd=""
196212
case "$running_os" in
197213
"ubuntu")
198214
install_cmd="/bin/apt"
215+
cache_cmd="update"
199216
;;
200217
"sles")
201218
install_cmd="/usr/bin/zypper"
219+
cache_cmd="refresh"
202220
;;
203221
*)
204222
if [[ -f "/bin/dnf" ]]; then
205223
install_cmd="/bin/dnf"
206224
elif [[ -f "/bin/yum" ]]; then
207225
install_cmd="/bin/yum"
208226
fi
227+
cache_cmd="makecache"
209228
;;
210229
esac
211230

0 commit comments

Comments
 (0)