#!/bin/sh
config='/etc/pacman-testing.conf'
packages=""
# make sure the script is being run as root
if [[ $(id -u) != 0 ]]; then
echo "error: you must be root to run this script"
exit 1
fi
# Sync pacman with testing repos
pacman -Sy --config $config
# make sure packages exist
echo "checking package name(s)..."
for i in $@; do
pacman -Qi $i > /dev/null
[[ "$?" = "1" ]] && echo "skipping..." && continue
packages=$packages" $i"
done
if [[ $packages = "" ]]; then
echo "error: no existing packages received, resyncing repos and exiting..."
exit 1
fi
# upgrade packages
pacman -S --config $config $packages
exit 0
config='/etc/pacman-testing.conf'
packages=""
# make sure the script is being run as root
if [[ $(id -u) != 0 ]]; then
echo "error: you must be root to run this script"
exit 1
fi
# Sync pacman with testing repos
pacman -Sy --config $config
# make sure packages exist
echo "checking package name(s)..."
for i in $@; do
pacman -Qi $i > /dev/null
[[ "$?" = "1" ]] && echo "skipping..." && continue
packages=$packages" $i"
done
if [[ $packages = "" ]]; then
echo "error: no existing packages received, resyncing repos and exiting..."
exit 1
fi
# upgrade packages
pacman -S --config $config $packages
exit 0
No comments:
Post a Comment