---
 build/Makefile               |    7 +++++++
 build/util/write-built-using |    8 ++++++++
 debian/changelog             |    2 ++
 debian/control               |    1 +
 debian/rules                 |    3 +++
 5 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100755 build/util/write-built-using

diff --git a/build/Makefile b/build/Makefile
index e2c5da0..6ee9089 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -350,12 +350,19 @@ endif
                        usedblocks=`echo $$newblocks - $$oldblocks | bc`; \
                        usedcount=`echo $$newcount - $$oldcount | bc`; \
                        version=`dpkg-deb --info $$udeb | grep '^ *Version:' | 
sed 's/^ *//' | awk '{print $$2}'` ; \
+                       source=`dpkg-deb --info $$udeb | grep '^ *Source:' | 
sed 's/^ *//' | awk '{print $$2}'` ; \
+                       if [ -z "$$source" ]; then \
+                               source=`dpkg-deb --info $$udeb | grep '^ 
*Package:' | sed 's/^ *//' | awk '{print $$2}'` ; \
+                       fi ; \
                        echo " $$usedsize B - $$usedblocks blocks - $$usedcount 
files from $$pkg (version $$version)" >>$(TEMP)/diskusage.txt;\
+                       echo "$$source (= $$version)" 
>>$(TEMP)/built-using.txt;\
                        oldsize=$$newsize ; \
                        oldblocks=$$newblocks ; \
                        oldcount=$$newcount ; \
                fi; \
        done
+       sort -u < $(TEMP)/built-using.txt > $(TEMP)/built-using.txt.new && \
+               mv $(TEMP)/built-using.txt.new $(TEMP)/built-using.txt
        sort -n < $(TEMP)/diskusage.txt > $(TEMP)/diskusage.txt.new && \
                mv $(TEMP)/diskusage.txt.new $(TEMP)/diskusage.txt
        grep-dctrl -nsPackage,Version,Architecture '' 
$(TREE)/var/lib/dpkg/status | \
diff --git a/build/util/write-built-using b/build/util/write-built-using
new file mode 100755
index 0000000..97beb13
--- /dev/null
+++ b/build/util/write-built-using
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+echo -n "initrd:Built-Using=" >> debian/debian-installer.substvars
+cat build/tmp/*/built-using.txt \
+    | sort -u \
+    | tr "\n" "," \
+    | sed 's/,/, /g;s/, $//g' >> debian/debian-installer.substvars
+echo >> debian/debian-installer.substvars
diff --git a/debian/changelog b/debian/changelog
index cb9c975..b9fd9d0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -91,6 +91,8 @@ debian-installer (2011xxxx) UNRELEASED; urgency=low
   [ Otavio Salvador ]
   * Update Linux kernel to 3.0.0-1
   * Use upload suite as origin to udebs
+  * Output information of all used udebs into the debian-installer
+    binary package for usage by the archive tool
 
  -- Robert Millan <r...@debian.org>  Fri, 15 Jul 2011 23:34:48 +0200
 
diff --git a/debian/control b/debian/control
index f8e9bbd..9aef650 100644
--- a/debian/control
+++ b/debian/control
@@ -161,6 +161,7 @@ Build-Depends:
 
 Package: debian-installer
 Architecture: any
+Built-Using: ${initrd:Built-Using}
 Description: Debian installer
  This package currently only contains some documentation for the Debian
  installer. We welcome suggestions about what else to put in it.
diff --git a/debian/rules b/debian/rules
index a659a5e..9cf4ef0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -66,6 +66,9 @@ binary-arch: install
                -X internals.xml -X partman-doc.sgml
        dh_compress
        dh_fixperms
+
+       ./build/util/write-built-using
+
        dh_gencontrol
        dh_md5sums
        dh_builddeb
-- 
1.7.5.4


-- 
To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1312051150-13754-2-git-send-email-ota...@ossystems.com.br

Reply via email to