From 192c94747bbf7ba909d6a0c7b965e6f614ddb182 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel@debian.org>
Date: Sun, 8 Feb 2009 10:35:25 +0100
Subject: Take win32-loader from the target distribution by using the chroot.

---
 helpers/lh_binary_win32-loader | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/helpers/lh_binary_win32-loader b/helpers/lh_binary_win32-loader
index c9f8910..feedaef 100755
--- a/helpers/lh_binary_win32-loader
+++ b/helpers/lh_binary_win32-loader
@@ -37,18 +37,32 @@ Check_lockfile .lock
 # Creating lock file
 Create_lockfile .lock
 
-# Copying win32-loader
-if [ "${LH_WIN32_LOADER}" = "enabled" ]
+if [ "${LH_WIN32_LOADER}" = "enabled" ] && [ "${LH_DISTRIBUTION}" != "etch" ]
 then
 	case "${LH_ARCHITECTURE}" in
 		amd64|i386)
-			if Find_files /usr/lib/win32-loader/*
-			then
-				cp /usr/lib/win32-loader/* binary
-			else
-				Echo_warning "win32-loader inclusion is enabled but not found, ignoring."
-			fi
-		;;
+			# Checking depends
+			Check_package chroot/usr/lib/win32-loader/win32-loader.exe win32-loader
+
+			# Restoring cache
+			Restore_cache cache/packages_binary
+
+			# Installing depends
+			Install_package
+
+			# Copying win32-loader
+			cp chroot/usr/lib/win32-loader/* binary
+
+			# Saving cache
+			Save_cache cache/packages_binary
+
+			# Removing depends
+			Remove_package
+			;;
+
+		*)
+			Echo_warning "win32-loader inclusion is enabled but not compatible with your architecture, ignoring."
+			;;
 	esac
 fi
 
-- 
cgit v1.0