Debian Codegraph @

which-pkg-broke-build

raw
1 #!/bin/sh
2 # Copyright (C) 2016 by Axel Beckert <[email protected]> under GPL-2+
3
4 if [ -z "$1" ]; then
5 srcdir=.
6 fi
7
8 if [ -d "$1" ]; then
9 srcdir="$1"
10 fi
11
12 if [ -z "$srcdir" ]; then
13 pkg="$1"
14 fi
15
16 # For now we ignore that some dependencies might be
17 # architecture-specific
18 bd=$(
19 echo -n "build-essential "
20 if [ -n "$pkg" ]; then
21 apt-cache showsrc "$pkg"
22 elif [ -n "$srcdir" ]; then
23 cat debian/control | sed ':a;N;$!ba;s/\(Build-Depends[^ ]*:[^\n:]*\)\n/\1 /g'
24 fi | \
25 grep -F Build-Depends | \
26 tr '|,' ' ' | \
27 sed -e 's/^Build-Depends[^ ]*://; s/([^()]*)//g; s/<[^<>]*>//g; s/\[[^]]*\]//g;'
28 )
29
30 # Schwartzian transform in bourne shell
31 for pkg in $bd; do
32 which-pkg-broke $pkg
33 done | \
34 grep -Fv "has no install time info" | \
35 while read pkg date; do
36 echo `date +%s -d "$date"` $pkg
37 done | \
38 sort -n | \
39 uniq | \
40 while read date pkg; do
41 echo $pkg `date +"%x %X" -d "@$date"`
42 done | \
43 column -t