Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm looking for a utility similar to apt-file that allows me to search the contents of source packages for certain files, rather than just binary packages.

Is such a utility available for Ubuntu?

share|improve this question
    
OP are you still looking for an answer? If so, you may need to repost your question as this is flagged for closure. Regards, –  Ringtail Mar 27 '12 at 20:21
add comment

1 Answer 1

apt-file is a simple wrapper for downloading the Contents-<ARCH>.gz files from a given Debian repository, then unpackaging and greping through them. Contents files are generated server-side (with great computional intensity) by merging the paths of all deb packages in the archive.

The specification for Debian repositories has no location reserved for a summary of all source package paths, and no implementation (apt-ftparchive and Launchpad's homebrewed method) has any facility for generating one.

If you really, really want this functionality, you could easily compile it yourself. Make this script, make it executable, and run it. It will take forever and eight days, but its output will be equivalent to a Source-Contents file.

#!/bin/bash

for PKGNAME in $(apt-cache pkgnames); do
    apt-get source $PKGNAME >> log
    for LINE in $(find $PKGNAME-*); do
        echo "$LINE $PKGNAME"
    done
done
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.