#!/bin/sh . $(dirname $0)/conf.sh reprepro_check() { cd $repos/apt/ || { echo "Repository not found. Have you set it up?" >&2 exit 1 } which reprepro || { echo "Must install reprepro to add packages" >&2 exit 1 } } help="Options: setup add ..." case $1 in setup) mkdir -p $repos || exit 1 echo conf=$repos/apt/conf echo "Making reprepro conf dir '$conf'" mkdir -p $conf || exit 1 echo keyid=$(get_gpg) echo "Making reprepro distributions file" echo "\ Origin: $origin Label: $label Codename: $codename Architectures: $arch Components: main Description: $description SignWith: $keyid" | write $conf/distributions echo echo "Making reprepro options file" echo "\ verbose ask-passphrase" | write $conf/options echo echo "Making ReadMe file" echo "\ $setup_cmd_instruction echo 'deb http://$uri_root/apt $codename main' > /etc/apt/sources.list.d/greenstone.list curl -L 'http://$uri_root/gpg.key' | apt-key add - apt-get update $install_cmd_instruction sudo apt-get install greenstone " > $repos/apt/ReadMe.txt ;; add) reprepro_check shift reprepro includedeb $codename $@ ;; -h|--help|help) echo "$help" ;; *) if test -z "$*"; then echo "$help" else reprepro_check reprepro $@ fi ;; esac