From 9bb9660141901159a5f77fe4da8c1dbb74bac215 Mon Sep 17 00:00:00 2001
From: Xavier Chantry <shiningxc@gmail.com>
Date: Wed, 6 Aug 2008 11:12:27 +0200
Subject: [PATCH] Allow sync200 pactest to pass without libdownload.

This is a stupid and unimportant regression caused by commit
4476598e4e128f4595d5383ecb51a9576a447b5b .

There are only 2 pactests doing an actual download operation :
sync200 and xfercommand001

The first uses libdownload when available, and the second always uses
xfercommand. But when libdownload is not available, sync200 also tries to use
xfercommand, and this fails because there is no command defined.

This commit adds a xfercommand to sync200 to fix that issue. The downside is
that now, xfercommand will always be used for that pactest, even when pacman
has libdownload support.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
---
 etc/pacman.conf.in       |    1 +
 pactest/tests/sync200.py |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/etc/pacman.conf.in b/etc/pacman.conf.in
index 9b822c3..30bfc32 100644
--- a/etc/pacman.conf.in
+++ b/etc/pacman.conf.in
@@ -17,6 +17,7 @@ HoldPkg     = pacman glibc
 # If upgrades are available for these packages they will be asked for first
 SyncFirst   = pacman
 #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
+#XferCommand = /usr/bin/curl %u > %o
 #CleanMethod = KeepInstalled
 
 # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
diff --git a/pactest/tests/sync200.py b/pactest/tests/sync200.py
index 9005bd3..deef53a 100644
--- a/pactest/tests/sync200.py
+++ b/pactest/tests/sync200.py
@@ -1,5 +1,8 @@
 self.description = "Synchronize the local database"
 
+# required because pacman is not always built with libdownload support
+self.option['XferCommand'] = ['/usr/bin/curl %u > %o']
+
 sp1 = pmpkg("spkg1", "1.0-1")
 sp1.depends = ["spkg2"]
 sp2 = pmpkg("spkg2", "2.0-1")
-- 
1.5.6.4

