I’d like to compare a few files from the bazaar branch lp:ubuntu/nvidia-graphics-drivers. I’m mainly interested in the debian subdirectory inside that branch, but due to the binary blob in http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/oneiric/nvidia-graphics-drivers/oneiric/files, it takes ages to get just the text files. I’ve already downloaded 555MB and it’s still counting.
Is it possible to retrieve a bazaar branch, including or excluding certain files by one of the following properties:
- file size
- file extension
- file name (include only
debian/for example)
I do not need to push back any changes, nor do I need to view the history of a file. I just want to compare two files in the debian/ directory, files with the .in extension and files without.
I ended up doing some dirty grep-ing on the HTTP response since
bzr info "$branch"andbzr ls -d "$branch" "$directory"did not provide enough information to me.The below Bash script relies on the working of Launchpads front-end Loggerhead. It recursively downloads from a given URL. Currently, it ignores
*.runfiles. Save it asbzrdlin a directory available from$PATHand run it withbzrdl http://launchpad.net/~ubuntu-branches/ubuntu/oneiric/nvidia-graphics-drivers/oneiric/files/head:/debian/. All files will be saved in the current directory, be sure that it’s empty to avoid conflicts.The temporary directory and file is not removed afterwards, that must be done manually. Any errors (failures to download) will be written to
$tmpdir/errorsIt’s confirmed to work with:
Feel free to correct any mistakes or add improvements.