Permalink
Browse files

fakepac: example of how to find updates without using -Sy

  • Loading branch information...
1 parent f3d5f3e commit a87de0555f1aca205a83c4da6a8f46858b8cd6f3 @falconindy committed May 24, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 fakepac
View
16 fakepac
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+shopt -s extglob
+
+fakedb=/dev/shm/fakepacdb
+realdb=/var/lib/pacman
+
+[[ ! -d $fakedb ]] && { mkdir -p "$fakedb/sync" || exit 1; }
+[[ ! -L $fakedb/local ]] && { ln -s "$realdb/local" "$fakedb" || exit 2; }
+
+case $1 in
+ -Sy|-Syy) exec fakeroot pacman --dbpath "$fakedb" $1 ;;
+ -@(S|U)*) echo "action not allowed" ;;
+ *) exec pacman --dbpath "$fakedb" $1 ;;
+esac
+

0 comments on commit a87de05

Please sign in to comment.