[wishlist] please add pull-debian-source script
Bug #289141 reported by
Iain Lane
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Developer Tools |
Fix Released
|
Undecided
|
Unassigned | ||
ubuntu-dev-tools (Ubuntu) |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: ubuntu-dev-tools
Currently to grab a Debian package from sid I find myself going to the PTS to get a link to the .dsc file. It would be great if there could be a script in u-d-t to do this, along the lines of pull-lp-source. We have pull-debian-debdiff which could maybe be cannibalised to make up part of this.
Usage: pull-debian-source <source package> [release].
I may do this if I get time, but if someone else is so inclined I'd urge them to do it instead.
Related branches
Changed in ubuntu-dev-tools: | |
assignee: | nobody → nhandler |
importance: | Undecided → Wishlist |
status: | New → In Progress |
Changed in ubuntu-dev-tools: | |
status: | New → Fix Released |
To post a comment you must log in.
A KISS version using wget/dget:
#!/bin/bash
#Check invocation
if [ -z "$1" ]; then
name=`basename $0`
echo "Usage: $name <package> [suite]"
echo "Download given Debian source package from Debian archive"
exit 1
fi;
#Escapes any + sign in the package name
arg_uri=`echo "$1" | sed -n 's/\+/%2b/p'`
if [ -z "$arg_uri" ]; then
arg_uri="$1"
fi;
#Set suite to unstable unless given
#(most probably its worth checking if given suite is valid too)
suite="$2"
if [ -z "$suite" ]; then
echo "Using the unstable suite"
suite="unstable"
fi;
#Retrieve version qa.debian. org/madison. php?package= $arg_uri& a=source& c=&s=$suite& text=on" | sed -n "/source/ s/\s*$1\ s|\s*\( \S*\)\s| .*/\1/p" `
version=`wget -q -O - "http://
#If package do not exist in given suite, exit with error
if [ -z "$version" ]; then
echo "Either the source package doesn't exist, or its not in the given suite"
exit 1
fi;
#dget it! ftp.debian. org/debian/ pool/main/ $first/ $1/$1_$ version. dsc"
first=`echo $1 | cut -c 1`
dget "http://
exit 0
Instead of ftp.debian.org one can use his preferred mirror of course.