From 939c1b6d0b52bc724f4a9d33c4bc553d52c21e9e Mon Sep 17 00:00:00 2001
From: Matthias Klose <doko@salsa>
Date: Wed, 3 Oct 2007 17:52:32 +0200
Subject: [PATCH] livecd-rootfs (0.37) gutsy; urgency=low

  * Run fdupes on ${ROOT}/usr.

 -- Matthias Klose <doko@ubuntu.com>  Wed, 03 Oct 2007 16:46:14 +0200
---
 debian/changelog | 10 ++++++++--
 debian/control   |  2 +-
 livecd.sh        |  7 +++++++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b83f78ab..34979da9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,15 @@
-livecd-rootfs (0.36) UNRELEASED; urgency=low
+livecd-rootfs (0.37) gutsy; urgency=low
+
+  * Run fdupes on ${ROOT}/usr.
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed, 03 Oct 2007 16:46:14 +0200
+
+livecd-rootfs (0.36) gutsy; urgency=low
 
   * Change the names of ia64 kernels to the right (non-SMP since they're
     merged) ones.
 
- -- LaMont Jones <lamont@ubuntu.com>  Wed, 26 Sep 2007 13:47:15 -0600
+ -- LaMont Jones <lamont@ubuntu.com>  Wed, 26 Sep 2007 13:50:19 -0600
 
 livecd-rootfs (0.35) gutsy; urgency=low
 
diff --git a/debian/control b/debian/control
index db1e6c5b..282ac5a2 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.6.1.0
 
 Package: livecd-rootfs
 Architecture: all
-Depends: debootstrap, rsync, python-minimal | python, procps, squashfs-tools, grep-dctrl
+Depends: debootstrap, rsync, python-minimal | python, procps, squashfs-tools, grep-dctrl, fdupes
 Suggests: partimage
 Description: construction script for the livecd rootfs
  livecd-rootfs provides the script used to create the root filesystem
diff --git a/livecd.sh b/livecd.sh
index c3336c3b..11c77590 100755
--- a/livecd.sh
+++ b/livecd.sh
@@ -381,6 +381,13 @@ deb-src ${SECSRCMIRROR} ${STE}-security ${COMP}
     # And now that we're done messing with debconf, destroy the backup files:
     rm -f ${ROOT}/var/cache/debconf/*-old
 
+    # search for duplicate files, write the summary to stdout, 
+    if which fdupes >/dev/null 2>&1; then
+	echo BEGIN fdupes
+	fdupes --recurse --noempty --sameline --size --quiet ${ROOT}/usr
+	echo END fdupes
+    fi
+
     # Dirty hack to mark langpack stuff as manually installed
     perl -i -nle 'print unless /^Package: language-(pack|support)/ .. /^$/;' \
         ${ROOT}/var/lib/apt/extended_states