#!/usr/bin/env bash

repo="alter-testing"

function remove () {
    local _list
    local _file
    _list=($(echo "$@"))
    for _file in "${_list[@]}"; do
        if [[ -f ${_file} ]]; then
            rm -f "${_file}"
        elif [[ -d ${_file} ]]; then
            rm -rf "${_file}"
        fi
    done
}

remove ${repo}.db ${repo}.db.tar.gz ${repo}.files ${repo}.files.tar.gz

pkglist=($(ls ./ | grep -v .sig | grep -v *.sh))

repo-add alter-testing.db.tar.gz "${pkglist[@]}"
