From 8bb9d760b54f103fe1c6be67fde307666b81b789 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 1 Oct 2016 17:01:02 +0200 Subject: Add rep-{update,test,publish} scripts --- rep-publish | 33 +++++++++++ rep-test | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ rep-update | 84 ++++++++++++++++++++++++++++ 3 files changed, 296 insertions(+) create mode 100755 rep-publish create mode 100755 rep-test create mode 100755 rep-update diff --git a/rep-publish b/rep-publish new file mode 100755 index 0000000..8db26e0 --- /dev/null +++ b/rep-publish @@ -0,0 +1,33 @@ +#! /usr/bin/env bash + +# Publish the repository. +# +# Usage: publish : [] +# +# Some commonly useful rsync options: +# +# --dry-run +# --progress +# +usage="$0 : []" + +trap 'exit 1' ERR +set -o errtrace # Trap in functions. + +function info () { echo "$*" 1>&2; } +function error () { info "$*"; exit 1; } + +dir=${1%/} +if [ -z "$dir" ]; then + error $usage +fi +shift + +host=$1 +if [ -z "$host" ]; then + error $usage +fi +shift + +rsync -v -rlpt -c --exclude '.*' --copy-unsafe-links --prune-empty-dirs \ +--delete-after $* $dir/ $host diff --git a/rep-test b/rep-test new file mode 100755 index 0000000..2e45840 --- /dev/null +++ b/rep-test @@ -0,0 +1,179 @@ +#! /usr/bin/env bash + +# Test repository. +# +# Usage: update [options] +# +# First, the script determines the list of repositories/sections. If +# contains the 'repositories' file, then it is the only repository to be +# tested. Otherwise, every first-level subdirectory of that doesn't +# start with '.' and contains the 'repositories' file is to be tested. +# +# Then, it makes sure that every package in every repository can be built +# in a clean configuration. +# +# -n +# Only test new packages. For this to work, should be (part of) a +# git repository. Untracked (and changed) files are considered new. +# +# -e +# Exclude the specified sub-directory. Currently only one directory can +# be excluded. +# +# -t +# Specify the build2 toolchain install/stage directory. The script will +# use /bin/b and /bin/bpkd instead of just b and +# bpkg. +# +# -c