#!/bin/bash

dbname=extra

echo " Making Database for current packages"

repo-add /mnt/shared/$dbname/packages/$dbname.db.tar.xz /mnt/shared/$dbname/packages/*x86_64*.gz

rm -v /mnt/shared/$dbname/packages/$dbname.db
rm -v /mnt/shared/$dbname/packages/$dbname.files

cp -vrf /mnt/shared/$dbname/packages/$dbname.db.tar.xz /mnt/shared/$dbname/packages/$dbname.db
cp -vrf /mnt/shared/$dbname/packages/$dbname.files.tar.xz /mnt/shared/$dbname/packages/$dbname.files

rm -v /mnt/shared/$dbname/packages/$dbname.db.tar.xz
rm -v /mnt/shared/$dbname/packages/$dbname.files.tar.xz

echo "Database Build finished successfully "
