From 7681a52889415179b104adb0aebac6f9742faa84 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Thu, 4 Aug 2011 12:36:08 -0500
Subject: pacman: Add SyncFirst to pacman.conf on upgrade, remove larch from
 pacman.conf on upgrade

---
 abs/core/pacman/PKGBUILD       |  2 +-
 abs/core/pacman/pacman.install | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/abs/core/pacman/PKGBUILD b/abs/core/pacman/PKGBUILD
index e25f7a7..80dabe4 100644
--- a/abs/core/pacman/PKGBUILD
+++ b/abs/core/pacman/PKGBUILD
@@ -3,7 +3,7 @@
 
 pkgname=pacman
 pkgver=3.5.3
-pkgrel=4
+pkgrel=5
 pkgdesc="A library-based package manager with dependency support"
 arch=('i686' 'x86_64')
 url="http://www.archlinux.org/pacman/"
diff --git a/abs/core/pacman/pacman.install b/abs/core/pacman/pacman.install
index a3066bc..c066733 100644
--- a/abs/core/pacman/pacman.install
+++ b/abs/core/pacman/pacman.install
@@ -9,6 +9,7 @@ post_upgrade() {
     if [ "$(vercmp $2 3.5.0)" -lt 0 ]; then
         _warnupgrade
     fi
+    _updateconf
     echo ">>>"
     echo ">>> ATTENTION! ATTENTION! ATTENTION!"
     echo ">>> /etc/pacman.conf has changed. If you have customized your"
@@ -18,6 +19,21 @@ post_upgrade() {
     echo ">>>"
 }
 
+_updateconf() {
+    pacconf="/etc/pacman.conf"
+    #add SyncFirst
+    grep -q SyncFirst $pacconf
+    if [ $? -eq 1 ]
+    then
+        sed -i '/\[options\]/  a\SyncFirst = pacman ' $pacconf
+    fi
+    #remove larch
+    sed -i '/larch/d' $pacconf
+
+}
+    
+
+
 _warnupgrade() {
     echo ">>>"
     echo ">>> The pacman database format has changed as of pacman 3.5.0."
-- 
cgit v0.12