#!/bin/bash

rm -fr /tmp/test_repository
mkdir -p /tmp/test_repository/{app-misc/test,profiles}
echo test_repository > /tmp/test_repository/profiles/repo_name

echo "=app-misc/test-0 -*" > $(portageq envvar PORTDIR)/profiles/base/package.keywords
echo "=app-misc/test-1 -*" > $(portageq envvar PORTDIR)/profiles/base/package.accept_keywords

cat << EOF > /tmp/test_repository/app-misc/test/test-0.ebuild
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
EOF

cat << EOF > /tmp/test_repository/app-misc/test/test-1.ebuild
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
EOF

cat << EOF > /tmp/test_repository/app-misc/test/Manifest
EBUILD test-0.ebuild 119 RMD160 2b7db7824af4639f3173bd80a9a682f26f1afbb1 SHA1 5802d75b9470dc522230eeb35673bff8888a69b7 SHA256 92c8c9618618ec1aa7f68f245d0b6e6e377687345ffd02c72990f019222d513e
EBUILD test-1.ebuild 119 RMD160 2b7db7824af4639f3173bd80a9a682f26f1afbb1 SHA1 5802d75b9470dc522230eeb35673bff8888a69b7 SHA256 92c8c9618618ec1aa7f68f245d0b6e6e377687345ffd02c72990f019222d513e
EOF
