Re: fakeroot: log open() calls?
- To: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
- Cc: Debian developers list <debian-devel@lists.debian.org>
- Subject: Re: fakeroot: log open() calls?
- From: Fabrizio Polacco <fab@prosa.it>
- Date: Fri, 12 Nov 1999 09:09:52 +0200
- Message-id: <19991112090952.O15718@none>
- In-reply-to: <E11ls8n-0001i3-00@polya>
- References: <E11ls8n-0001i3-00@polya>
On Thu, Nov 11, 1999 at 11:11:45AM +0000, Julian Gilbey wrote:
>
> How easy would it be for fakeroot/faked to log all successful calls
> to open(), so that a command such as:
>
> dpkg-buildpackage -r'fakeroot --log ../open.log'
>
> will create a log of all successful open() calls. For then one
> could do something like
>
> dpkg -S `<extract filenames from open.log> | grep ^/ | sort | uniq` | \
> cut -d: -f1 | sort | uniq
>
> to get a list of all packages used during the build. In this way,
> creation of the Build-Depends/Build-Depends-Indep lists could
> initially be created automatically, requiring the developer only to
> deal with details such as version numbers where applicable.
Without modification on any existing program, I got the result using the long
pipes that I attach below (broken into three for sake of readability).
the output of strace should also be sent to a named pipe, to avoid creation of
huge temp files.
My idea was to add this _inside_ dpkg-buildpackage, maybe enabling it by use of
a new option flag.
It slows down compilation a lot, so maybe tailoring strace to the intent would
be profitable.
The last command of the pipe is dpkg -l , which produces the human readable
output you see in this example. It should be substituted with some command to
grep away essential packages and pack the rest in the new format for the
Source-dependecies field.
cheers,
fab
--
---------------------------------------------------------------cut--------
sudo strace -f -etrace=file -o ../trace.69i -q -a80 debian/rules binary 2>&1 | \
tee ../log.69i
cat ../trace.69i | grep -v ' = -1 ' | awk -F\" '{ print $2 }' | grep -v '^/tmp/' | \
grep -v '^/dev/' | grep '^/' | grep -v "^$PWD" | grep -v '/var/lib/dpkg' | \
sort -u >../trace.filt.69i
for j in `cat ../trace.filt.69i`;do test -f $j && realpath $j;done | \
xargs dpkg -S 2>/dev/null | awk -F: '{ print $1 }' | sort -u | xargs dpkg -l
Desired=Unknown/Install/Remove/Purge
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===============-==============-============================================
ii autoconf 2.12-13 automatic configure script builder.
ii base-files 2.1.0 Debian Base System Miscellaneous Files
ii bash 2.01.1-4.1 The GNU Bourne Again SHell
ii binutils 2.9.1.0.19a-2 The GNU assembler, linker and binary utiliti
ii bsdmainutils 4.4.0.1 More utilities from 4.4BSD-Lite.
ii cpp 2.7.2.3-7 The GNU C preprocessor.
ii debianutils 1.10 Miscellaneous utilities specific to Debian.
ii diff 2.7-18 File comparison utilities
ii dpkg 1.4.0.34 Package maintenance system for Debian Linux
ii dpkg-dev 1.4.0.34 Package building tools for Debian Linux
ii exuberant-ctags 2.3.2-1 Reincarnation of the classic ctags(1): facil
ii fileutils 3.16-5.3 GNU file management utilities.
ii findutils 4.1-33 utilities for finding files--find, xargs, an
ii flex 2.5.4a-3 A fast lexical analyzer generator.
ii gcc 2.7.2.3-7 The GNU C compiler.
ii gettext 0.10.35-7 GNU Internationalization utilities
ii grep 2.2-1 GNU grep, egrep and fgrep.
ii groff 1.11a-7 GNU troff text-formatting system.
ii gzip 1.2.4-28 The GNU compression utility.
ii hostname 2.04 A utility to set/show the host name or domai
ii ldso 1.9.10-1 The Linux dynamic linker, library and utilit
ii less 332-4.1 A file pager program, similar to more(1)
ii libc6 2.0.7.19981211 GNU C Library: shared libraries
ii libc6-dev 2.0.7.19981211 GNU C Library: Development libraries and hea
ii libdb2 2.4.14-5 The Berkeley database routines (run-time fil
ii libdb2-dev 2.4.14-5 The Berkeley database routines (development
ii libgdbmg1 1.7.3-25 GNU dbm database routines (runtime version).
ii libncurses4 4.2-3 Shared libraries for terminal handling
ii libreadlineg2 2.1-12 GNU readline and history libraries, run-time
ii libstdc++2.9 2.91.60-5 The GNU stdc++ library (egcs version)
ii locales 2.0.7.19981211 GNU C Library: National Language (locale) da
ii m4 1.4-9 a macro processing language
ii make 3.77-4 The GNU version of the "make" utility.
ii mawk 1.3.3-2 a pattern scanning and text processing langu
ii perl 5.004.04-7 Larry Wall's Practical Extracting and Report
ii perl-base 5.004.04-7 The Pathologically Eclectic Rubbish Lister
ii sed 3.02-1 The GNU sed stream editor.
ii shellutils 1.16-6.3 The GNU shell programming utilities.
ii tar 1.12-7 GNU tar
ii textutils 1.22-2.4 The GNU text file processing utilities.
ii timezones 2.0.7.19981211 GNU C Library: Timezone data and utilities
---------------------------------------------------------------cut--------
--
| fab@pukki.ntc.nokia.com fpolacco@prosa.it fpolacco@debian.org
| 6F7267F5 fingerprint 57 16 C4 ED C9 86 40 7B 1A 69 A1 66 EC FB D2 5E
| fabrizio.polacco@nokia.com gsm: +358 (0)40 707 2468
Reply to: