[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] Change format of packages.txt/binary.packages to be machine readable


On Tue, Apr 21, 2009 at 1:39 PM, Cody A.W. Somerville <cody.somerville@canonical.com> wrote:

 For most binary image types, live helper produces a packages.txt (in the image) and binary.packages (outside of the image) that is just the output of "dpkg -l" ran within the target. Unfortunately, the output from "dpkg -l" isn't the easiest to machine parse which is why I've created a patch to have the output of "dpkg-query -W" which format, by default, is "${Package}\t${Version}\n".

I've updated the patch to remove some descriptive text that was being added to file and also name the copy outside of the image binary.manifest instead of binary.packages (the latter change less important, just my personal preference since it seems *.manifest seems to be the standard naming convention for live filesystem package manifests).


Cody A.W. Somerville
Software Systems Release Engineer
Foundations Team
Custom Engineering Solutions Group
Canonical OEM Services
Phone: +1-781-850-2087
Cell: +1-506-471-8402
Email: cody.somerville@canonical.com
From 2851d8a48f07d5a96514ee86d95635596f73bb1e Mon Sep 17 00:00:00 2001
From: Cody A.W. Somerville <cody.somerville@canonical.com>
Date: Tue, 21 Apr 2009 13:30:38 -0300
Subject: [PATCH] Change format of packages.txt/binary.packages to be machine readable using dpkg-query -W instead of dpkg -l.

 helpers/lh_binary_manifest |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/helpers/lh_binary_manifest b/helpers/lh_binary_manifest
index 981699a..48868f1 100755
--- a/helpers/lh_binary_manifest
+++ b/helpers/lh_binary_manifest
@@ -56,15 +56,8 @@ case "${LH_INITRAMFS}" in
 # Add packages.list
-cat > binary/${INITFS}/packages.txt << EOF
-This file contains the list of all packages installed in this live system.
-Chroot chroot "dpkg -l" >> binary/${INITFS}/packages.txt
-cp binary/${INITFS}/packages.txt binary.packages
+Chroot chroot "dpkg-query -W" >> binary/${INITFS}/packages.txt
+cp binary/${INITFS}/packages.txt binary.manifest
 # Creating stage file
 Create_stagefile .stage/binary_manifest

Reply to: