#!/usr/bin/perl -w
#
# source:
#   $Source: /var/cvs/projects/debian/dpkg.common/getpackages,v $
#
# revision:
#   @(#) $Id: getpackages,v 1.1 1998/09/12 21:51:05 jplejacq Exp $
#
# copyright:
#   Copyright (C) 1998 Jean Pierre LeJacq <jplejacq@quoininc.com>
#
#   Distributed under the GNU GENERAL PUBLIC LICENSE.
#
# synopsis:
#   getpackages [ arch | indep ]
#
# description:
#   Returns list of binary packages for this source package.
#
#   If no argument is provided it returns all binary packages.  If the
#   argument "arch" is supplied (without quotes), the architecture
#   dependent binary packages are returned.  If the argument "indep"
#   is supplied (without quotes), the architecture independent binary
#   packages are returned.  The lists are space separated.
#
#   This program is package independent and should work unmodified
#   with any package.
#
#   This is modeled after the GetPackages subroutine in the Dh_lib.pm
#   file which is part of debhelper.
#
# bugs:
#   No error handling.
#
#   This should be part of dpkg or debhelper.
#
#   This should be modeled after dpkg-parsechangelog.


# main:
  BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
  use Dh_Lib;
  init();

  my $type=shift;
  $type="" if ! defined $type;

  my @allpackages=GetPackages($type);
  print "@allpackages";
