#!/bin/bash
# takes all build files and extracts them as tar
# on the stdout
# TODO: probably rewrite, cause it's tricky

cd /root/pkg

grep "native" ./sources/debian/source/format > /dev/null
code=$?

if [ $code = 0 ]; then
    # native
    exec tar -cf - *.changes *.deb *.dsc *.tar.*
else
    # non-native
    exec tar -cf - *.changes *.deb *.dsc *.debian.tar.* *.orig.tar.*
fi
