diff options
Diffstat (limited to 'update-cleansystem')
-rwxr-xr-x | update-cleansystem | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/update-cleansystem b/update-cleansystem index 53d21d9..6bec742 100755 --- a/update-cleansystem +++ b/update-cleansystem @@ -23,6 +23,9 @@ set -e # You should have received a copy of the GNU General Public License # along with Parabola. If not, see <http://www.gnu.org/licenses/>. +set -e + +# libretools.conf gives us libremessages source /etc/libretools.conf cleansystem=/etc/libretools.d/cleansystem @@ -43,9 +46,13 @@ if [ "$1" == '-h' ]; then exit 0 fi +if [ ! -w "$cleansystem" ]; then + error 'This script must be run as root' + exit 1 +fi + # Maintain a clean database in the system db_dir="${DB:-/var/lib/libretools/clean}" - [ ! -d "${db_dir}" ] && mkdir -p "${db_dir}" # We sync first because updating info gets printed to stdout too @@ -53,8 +60,9 @@ pacman -b "${db_dir}" --config /etc/pacman.conf -Sy 2>/dev/null pacman -b "${db_dir}" \ --config /etc/pacman.conf \ -Sp --print-format "%n" \ - base base-devel sudo ${@} | sort > /etc/libretools.d/cleansystem + base base-devel sudo $@ | sort > "$cleansystem" +# Ensures everything's installed pacman -Sy --needed --noconfirm base base-devel sudo $@ exit $? |