From 84dbccf8bea8d6bf7ac4258ab9fe54ce55650730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 30 Oct 2016 11:32:06 +0100 Subject: Add list of installed packages on archlinux --- utils/arch | 46 ++++++++++++++++++++++++++++++++++++++++++++++ utils/inst | 4 ++-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 utils/arch (limited to 'utils') diff --git a/utils/arch b/utils/arch new file mode 100644 index 0000000..5293d0e --- /dev/null +++ b/utils/arch @@ -0,0 +1,46 @@ +# Archlinux system installation and compare +# vim: ft=sh + +# Installs pacaur +# This expect base and base-devel to be installed +arch_pacaur() { + set -e + # Make sure that we have wget + sudo pacman -S wget + # Download pacaur tar + wget https://aur.archlinux.org/cgit/aur.git/snapshot/pacaur.tar.gz + # Download cower (pacaur dependency) + wget https://aur.archlinux.org/cgit/aur.git/snapshot/cower.tar.gz + + tar -xzf cower.tar.gz + cd cower + makepkg -cis + cd .. + rm -rf cower cower.tar.gz + tar -xzf pacaur.tar.gz + cd pacaur + makepkg -cis + cd .. + rm -rf pacaur pacaur.tar.gz + + unset -e +} + +archlinux_inst() { + # Check if we are on archlinux + if ! [ -e /etc/arch-release ]; then + echo Archlinux not detected! >&2 + return + fi + # Now check for pacaur and optionally install + if ! pacaur --version 2>&1 >/dev/null; then + arch_pacaur + fi + + TFILE1=$(mktemp myconfigs-pacaur1-XXXXX) + grep -E '^[^# ]+$' archlinux.pkgs | sort > "$TFILE1" + TFILE2=$(mktemp myconfigs-pacaur2-XXXXX) + pacaur -Qqet | sort > "$TFILE2" + diff --suppress-common-lines -ay "$TFILE1" "$TFILE2" + rm "$TFILE1" "$TFILE2" +} diff --git a/utils/inst b/utils/inst index 46cae0c..9c15496 100644 --- a/utils/inst +++ b/utils/inst @@ -23,7 +23,7 @@ dodiff() { vimdiff "$1" "$OUT" } -diff() { +checkdiff() { # Iterate trough source directory but ignore any git repositories # Note that it's design decision to not iterate trough target directory. if [ -d "$1" ]; then @@ -82,7 +82,7 @@ doinst() { inst() { if [ -e "$2" ]; then # If output exists, execute diff instead - diff $1 $2 + checkdiff $1 $2 return fi doinst $1 $2 -- cgit v1.2.3