]> git.wh0rd.org Git - home.git/blob - .bin/upload-gentoo-package
crostini-vapier-setup: helper for setting up new installs
[home.git] / .bin / upload-gentoo-package
1 #!/bin/bash
2
3 err() { echo "$*" 1>&2; exit 1; }
4
5 if [[ $# -eq 0 ]] ; then
6         cat <<-EOF
7         Usage: $0 <files to post>
8         EOF
9         exit 1
10 fi
11
12 for pkg in "$@" ; do
13         if [[ ! -e ${pkg} ]] ; then
14                 case ${pkg} in
15                         */*) err "${pkg}: does not exist" ;;
16                         *)
17                                 pkg="/usr/portage/distfiles/${pkg}"
18                                 if [[ ! -e ${pkg} ]] ; then
19                                         err "${pkg}: does not exist"
20                                 fi
21                                 ;;
22                 esac
23         fi
24
25         p=${pkg##*/}
26         echo "${p}: posting"
27         scp "${pkg}" dev:~/
28         ssh dev "cp -i ${p} public_html/dist/ && mv -i ${p} /space/distfiles-local/"
29 done