From b37cf6bd9c65ba753f3163f63a97247e43f2b447 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Sat, 11 Jan 2014 17:19:07 +0100 Subject: [PATCH] Added custom pacman_disowned function. --- zsh_functions | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/zsh_functions b/zsh_functions index 114595e..63dd076 100644 --- a/zsh_functions +++ b/zsh_functions @@ -40,3 +40,27 @@ change_dir(){ unalias cd fi } + +#from arch wiki +pacman_disowned(){ + tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$ + db=$tmp/db + fs=$tmp/fs + + mkdir "$tmp" + trap 'rm -rf "$tmp"' EXIT + + pacman -Qlq | sort -u > "$db" + #I added: + #/etc/ssl/certs + #/usr/lib/python + #/usr/share/mime + find /bin /etc /sbin /usr \ + ! -name lost+found\ + ! -path "/etc/ssl/certs/*"\ + ! -path "/usr/lib/python*"\ + ! -path "/usr/share/mime/*"\ + \( -type d -printf '%p/\n' -o -print \) | sort > "$fs" + + comm -23 "$fs" "$db" +}