Skip to content
Snippets Groups Projects
Commit cdc7a73f authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

run_cmd for now

parent b4bfa063
No related branches found
No related tags found
No related merge requests found
......@@ -132,9 +132,9 @@ aur_install(){
oblog -t "Installing package ${named}"
if test -e ${named}-*.pkg.tar.xz &>/dev/null; then
run_cmd pacman -r "$NEWROOT" -U ${named}-*.pkg.tar.xz --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to install packages $named" "clean_install"
pacman -r "$NEWROOT" -U ${named}-*.pkg.tar.xz --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to install packages $named" "clean_install"
elif test -e ${named}-*.pkg.tar.zst &>/dev/null; then
run_cmd pacman -r "$NEWROOT" -U ${named}-*.pkg.tar.zst --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to install packages $named" "clean_install"
pacman -r "$NEWROOT" -U ${named}-*.pkg.tar.zst --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to install packages $named" "clean_install"
fi
oblog -t "Copy all ${named}-*.pkg.tar.{xz,zst} to $CACHE_DIR"
......
......@@ -99,9 +99,9 @@ config_mirrorlist(){
config_pac_sync(){
oblog -t "Synchronize database..."
if [[ ! -d "${NEWROOT}"/var/lib/pacman/sync ]]; then
run_cmd pacman -r "${NEWROOT}" -Syy --dbpath "$NEWROOT/var/lib/pacman" --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf"
pacman -r "${NEWROOT}" -Syy --dbpath "$NEWROOT/var/lib/pacman" --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf"
else
run_cmd pacman -r "${NEWROOT}" -Sy --dbpath "$NEWROOT/var/lib/pacman" --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf"
pacman -r "${NEWROOT}" -Sy --dbpath "$NEWROOT/var/lib/pacman" --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf"
fi
}
......
......@@ -54,7 +54,7 @@ install_package(){
# if $NEWROOT/usr/bin/bash doesn't exist means that is the first pass
# into the function install_system; so install base package first
if ! [[ -x "$NEWROOT/usr/bin/bash" ]]; then
run_cmd pacman -r "$NEWROOT" -S $(grep -h -v ^# $GENERAL_DIR/$CONFIG_DIR/package_list/base) --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to install base system" "clean_install"
pacman -r "$NEWROOT" -S $(grep -h -v ^# $GENERAL_DIR/$CONFIG_DIR/package_list/base) --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to install base system" "clean_install"
fi
installed=($(pacman -r "$NEWROOT" -Qsq --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf"))
......@@ -72,7 +72,7 @@ install_package(){
if [[ -n "${result_base[@]}" ]]; then
oblog -w "Install missing base packages"
run_cmd pacman -S ${result_base[@]} -r "$NEWROOT" --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" 2>/dev/null || die " Failed to install packages" "clean_install"
pacman -S ${result_base[@]} -r "$NEWROOT" --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" 2>/dev/null || die " Failed to install packages" "clean_install"
result_base=()
else
oblog "Nothing to do for base system"
......@@ -116,7 +116,7 @@ install_package(){
if [[ -n ${pacman_list[@]} ]]; then
oblog -w "Install missing packages coming from repo define in pacman.conf"
run_cmd pacman -r "$NEWROOT" -S ${pacman_list[@]} --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to install packages with pacman" "clean_install"
pacman -r "$NEWROOT" -S ${pacman_list[@]} --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to install packages with pacman" "clean_install"
fi
if [[ -n ${aur_list[@]} ]]; then
......@@ -138,7 +138,7 @@ install_package(){
sync_data(){
oblog -t "Synchronize database"
run_cmd pacman -Sy --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" || die " Impossible to synchronize database" "clean_install"
pacman -Sy --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" || die " Impossible to synchronize database" "clean_install"
oblog -t "Copying database on $NEWROOT/var/lib/pacman/sync/"
mkdir -p -m0755 "$NEWROOT/var/lib/pacman/sync/"
......@@ -152,5 +152,5 @@ sync_data(){
update_newroot(){
oblog -t "Check for update..."
run_cmd pacman -r "$NEWROOT" -Syu --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to update the fresh system with pacman" "clean_install"
pacman -r "$NEWROOT" -Syu --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" --cachedir "$CACHE_DIR" --noconfirm --dbpath "$NEWROOT/var/lib/pacman" || die " Failed to update the fresh system with pacman" "clean_install"
}
......@@ -99,7 +99,7 @@ main_update(){
check_database(){
if [[ ! -e "/var/lib/pacman/sync/obcore.db" ]];then
run_cmd pacman -Syy --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" || die "unable to synchronize pacman database" "clean_install"
pacman -Syy --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf" || die "unable to synchronize pacman database" "clean_install"
fi
}
......@@ -116,7 +116,7 @@ hot_fix()
local=$(expac -Q %v glibc --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf")
if vercmp ${remote} ${local} >&/dev/null; then
oblog -t "Updating glibc package"
run_cmd pacman -Sy glibc --noconfirm --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf"
pacman -Sy glibc --noconfirm --config "$GENERAL_DIR/$CONFIG_DIR/pacman.conf"
fi
fi
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment