From d6ba86bf51ee417889ef75231e308eef33abe327 Mon Sep 17 00:00:00 2001 From: "Siegfried-Angel Gevatter Pujals (RainCT)" Date: Sun, 13 Jan 2008 23:22:08 +0100 Subject: [PATCH] Add reverse-build-depends script. --- debian/changelog | 17 +++++++++-------- reverse-build-depends | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 8 deletions(-) create mode 100755 reverse-build-depends diff --git a/debian/changelog b/debian/changelog index 9ac5c4c..abcbac7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,15 +1,16 @@ ubuntu-dev-tools (0.25) UNRELEASED; urgency=low * what-patch: - - Print a list of files that have been modified outside debian/ - - Add -h and -q options - - Add proper exit values + - Print a list of files that have been modified outside debian/. + - Add -h and -q options. + - Add proper exit values. * debian/control: - - Bump standards version to 3.7.3 - - Move python-central to Build-Depends-Indep - - Rename XS-Vcs-{Bzr,Browser} fields to Vcs-{Bzr,Browser} - - Bump minimum cdbs version to 0.4.49 - * Add Albert Damen to the Authors and Copyright Holders + - Bump standards version to 3.7.3. + - Move python-central to Build-Depends-Indep. + - Rename XS-Vcs-{Bzr,Browser} fields to Vcs-{Bzr,Browser}. + - Bump minimum cdbs version to 0.4.49. + * Add Albert Damen to the Authors and Copyright Holders. + * Add reverse-build-depends script. -- Siegfried-Angel Gevatter Pujals (RainCT) Sun, 06 Jan 2008 12:02:54 +0100 diff --git a/reverse-build-depends b/reverse-build-depends new file mode 100755 index 0000000..1e6a35b --- /dev/null +++ b/reverse-build-depends @@ -0,0 +1,40 @@ +#!/bin/bash +# Copyright (C) 2007 Siegfried-A. Gevatter +# Based upon a short script by an unknown author +# License: GPLv2+ +# +# This script is used to find the reverse build dependencies +# that a package has. + +usage() { + echo "Usage: $0 [-c] " +} + +if [ "$1" = '-c' ] +then + count=1 + shift +fi + +if [ $# -ne 1 ]; +then + usage + exit 1 +fi + +if [ "$1" = '-h' ] || [ "$1" = '--help' ] +then + usage + exit 0 +fi + +result=$( + grep-dctrl -sPackage -F Build-Depends,Build-Depends-Indep $1 \ + /var/lib/apt/lists/*Sources | cut -d ' ' -f 2) + +if [ -z $count ] +then + echo $result +else + echo $result | wc -w +fi