2
DSCURL="$(wget -qO- "https://packages.debian.org/${SUITE}/${PKG}" \
    | grep -o 'http.*\.dsc">\[' | cut -d'"' -f1)"
[ -z "$DSCURL" ] && die 2 "no .dsc"
dget ${ALLOW_UNAUTH} -x "$DSCURL" 2> "$TEMP"

I am looking for the Debain-way of getting a source package from jessie to download it by dget -x $DSCURL. It is for backporting so apt-get source is not a solution, it would interfere with the apt system on wheezy. I am doing it now by parsing the Debian webpage. I couldn't found the right Debian API.

  • I don't understand how does it interfere. You can have multiple `deb-src` lines and select which one you want to use with `apt-get source -t jessie`, for example. Or do you mean something different? – dawud May 15 '14 at 19:07
  • I'd like to use a tool that queries Debian's databases without downloading the whole source package list of several `${SUITE}`-s – Szépe Viktor May 15 '14 at 19:16
  • e.g. jessie source package lists are 195k + 29,960k + 398k – Szépe Viktor May 15 '14 at 19:21

1 Answers1

2

apt-get source -t jessie dpkg is one way to go:

To quote the relevant sections from the manpage

       Source packages are tracked separately from binary packages via
       deb-src lines in the sources.list(5) file. This means that you will
       need to add such a line for each repository you want to get sources
       from; otherwise you will probably get either the wrong (too old/too
       new) source versions or none at all.

And also:

   -t, --target-release, --default-release
       This option controls the default input to the policy engine; it
       creates a default pin at priority 990 using the specified release
       string. This overrides the general settings in
       /etc/apt/preferences. Specifically pinned packages are not affected
       by the value of this option. In short, this option lets you have
       simple control over which distribution packages will be retrieved
       from. Some common examples might be -t '2.1*', -t unstable or -t
       sid. Configuration Item: APT::Default-Release; see also the
       apt_preferences(5) manual page.

Another option is to use debootstrap and create a complete chroot.

Do not forget to use stuff like pbuilder to have reliable builds of your package.

serverhorror
  • 6,478
  • 2
  • 25
  • 42
  • Thank you for your quick answer. I would like to avoid downloading source package lists. [These backports](http://mirror.szepe.net/debian/) are needed only for running my vps-s. – Szépe Viktor May 15 '14 at 19:17
  • Wait what? You don't want `apt-get update` to get a few KB of data and therefore don't want the `deb-src` entry? That is how I read your answer but I think i misinterpreted that – serverhorror May 15 '14 at 19:25
  • And another outdated: https://packages.debian.org/jessie/debget – Szépe Viktor May 15 '14 at 19:44
  • An work-in-progress SOAP API https://wiki.debian.org/qa.debian.org/pts/SoapInterface – Szépe Viktor May 15 '14 at 20:03
  • So you found 2 outdated solutions and one that is not yet implemented aside from the one "just works". :) – serverhorror May 15 '14 at 20:08
  • Sorry. I've found the solution. Look! qa.debian.org/cgi-bin/dcontrol But somehow testin/jessie is missing from this system! – Szépe Viktor May 15 '14 at 20:17