# @TEST-EXEC: bro-pkg install foo

# @TEST-EXEC: bash %INPUT
# @TEST-EXEC: bro-pkg refresh
# @TEST-EXEC: bro-pkg list outdated > outdated.out
# @TEST-EXEC: btest-diff outdated.out

# @TEST-EXEC: bro-pkg list all > list.out
# @TEST-EXEC: btest-diff list.out

# @TEST-EXEC: bro-pkg refresh --aggregate

# @TEST-EXEC: bro-pkg search lucky > search.out
# @TEST-EXEC: btest-diff search.out

# @TEST-EXEC: bro-pkg list all > list_after_agg.out
# @TEST-EXEC: btest-diff list_after_agg.out
# note: foo's description isn't in the list output since the installed
# version's metadata has no 'description' field

cd packages/foo
echo 'tags = esoteric lucky land' >> bro-pkg.meta
echo 'description = This is the foo package description' >> bro-pkg.meta
git commit -am 'new stuff'

cd ..
mkdir new_pkg
cd new_pkg
git init
echo '[package]' > bro-pkg.meta
echo 'tags = esoteric lucky land' >> bro-pkg.meta
echo 'description = This is the new_pkg package description' >> bro-pkg.meta
echo 'print "hello";' >> __load__.bro
git add *
git commit -m 'init'

cd ../..
echo "$(pwd)/packages/new_pkg" >> sources/one/alice/bro-pkg.index
cd sources/one
git commit -am 'add new_pkg'
