#!/bin/bash -euE . $(which libremessages) cmd=${0##*/} usage() { echo "Usage: $cmd [OPTIONS]" echo 'Fetches and merges changes from an upstream package' echo '' echo 'The repository and refspec that are merged are controlled by the' echo 'file `pbstrack`.' echo '' echo 'Options:' echo ' -h Show this message' } main() { while getopts 'h' arg; do case $arg in h) usage; return 0;; *) usage; return 1;; esac done shift $(($OPTIND - 1)) if [[ $# > 0 ]]; then usage return 1 fi if [[ ! -f .git ]]; then error "Must be in a package directory" fi if [[ ! -r pbstrack ]]; then error "No pbstrack file found, don't know where to pull from" fi git pull $(cat pbstrack) } main "$@"