[wishlist] please add pull-debian-source script

Bug #289141 reported by Iain Lane
4
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.

Changed in ubuntu-dev-tools:
assignee: nobody → nhandler
importance: Undecided → Wishlist
status: New → In Progress
Revision history for this message
Cesare Tirabassi (norsetto) wrote :

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
version=`wget -q -O - "http://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"`

#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!
first=`echo $1 | cut -c 1`
dget "http://ftp.debian.org/debian/pool/main/$first/$1/$1_$version.dsc"

exit 0

Instead of ftp.debian.org one can use his preferred mirror of course.

Revision history for this message
Nathan Handler (nhandler) wrote :

I just pushed a new revision to the trunk branch (http://bazaar.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/trunk/revision/236) that adds a pull-debian-source script. However, the version in the repositories does NOT have this script right now. It will get the script once a new version of ubuntu-dev-tools is uploaded.

Changed in ubuntu-dev-tools:
assignee: nhandler → nobody
status: In Progress → Fix Committed
Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Fantastic job Nathan! Don't forget to add the tag (LP: #289141) to the changelog though.
You should also add your name to the changelog entry (with [Nathan Handler]) so that it is clear who made that entry ...

Revision history for this message
Nathan Handler (nhandler) wrote :

Thanks for catching that Cesare. I just pushed a new revision which fixes those things.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-dev-tools - 0.50

---------------
ubuntu-dev-tools (0.50) jaunty; urgency=low

  [ Nathan Handler ]
  * Add pull-debian-source script (LP: #289141)
    - debian/copyright:
      + Add myself to the Upstream Authors and Copyright sections
      + Add pull-debian-source to the License section
    - Add doc/pull-debian-source.1

  [ Siegfried-Angel Gevatter Pujals ]
  * debian/control: Add perl-modules and libwww-perl as Recommended packages

  [ Iain Lane ]
  * pbuilder-dist.new: Add 'experimental' to list of known Debian releases.
    pbuilder-experimental works fine with pbuilder-dist.new.

  [ Jonathan Davies ]
  * buildd: Show which architectures are available in help and created a
    list of them for easy addition of new ones.
  * requestsync:
    - Readd sponsorship flag and related documentation in
      doc/requestsync.1 (LP: #270605).
    - Do not check package's Launchpad bug list page if the package to be
      synced is a new package. As this page does not exist for
      it (LP: #312297).

 -- Jonathan Davies <email address hidden> Mon, 29 Dec 2008 18:45:02 +0000

Changed in ubuntu-dev-tools:
status: Fix Committed → Fix Released
Changed in ubuntu-dev-tools:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.