#!/bin/bash
# 
# $Id: custom-pkgtrans 12072 2010-12-22 16:08:42Z wahwah $
#
# This file exists in order to avoid implementing pipelines in Python.  It
# could be integrated into the package stats collection program.
#
# It has to use the same interpreter as lib/sh/libcheckpkg.sh, currently bash.

set -u
set -e

command_basename=`basename $0`
command_basedir="${0%/${command_basename}}"
libshdir="${command_basedir}/../lib/sh"
readonly command_basename command_basedir libshdir
. "${libshdir}/libcheckpkg.sh"

if [[ -z "$1" || -z "$2" || -z "$3" ]]; then
	echo >&2 "usage: $0 <file.pkg> <targetdir> <pkgname>"
	exit 1
fi
if [[ "$3" == "all" ]]; then
  echo >&2 "This script can't handle 'all' as the third argument"
  exit 1
fi
custom_pkgtrans "$1" "$2" "$3"
