From e89bc010bd0ee47fbe19bcecc8d7935357090acf Mon Sep 17 00:00:00 2001 From: Christian Schneemann Date: Sat, 24 Feb 2024 10:59:51 +0100 Subject: [PATCH] Fixed example Scripts for publisher hook Variable definition was broken and the destination path has to be created on first run. --- xml/obs_ag_publish_hooks.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/obs_ag_publish_hooks.xml b/xml/obs_ag_publish_hooks.xml index 6ee1a06a..2e885001 100644 --- a/xml/obs_ag_publish_hooks.xml +++ b/xml/obs_ag_publish_hooks.xml @@ -110,12 +110,12 @@ our $publishedhook = { OBSHOME="/srv/obs" SRC_REPO_DIR="$OBSHOME/repos" LOGFILE="$OBSHOME/log/reposync.log" -$DST_REPO_DIR="/srv/repo-mirror" +DST_REPO_DIR="/srv/repo-mirror" # Global substitution! To handle strings like Foo:Bar:testing - two #+double-colons! PRJ_PATH=${1//:/:\/} PATH_TO_REPO=$2 -rsync -a --log-file=$LOGFILE $PATH_TO_REPO/ $DST_REPO_DIR/$PRJ_PATH/ +rsync -a --log-file=$LOGFILE --mkpath $PATH_TO_REPO/ $DST_REPO_DIR/$PRJ_PATH/ For testing purposes, it can be invoked as follows: $ sudo -u obsrun /usr/local/bin/publish-hook.sh Product/SLES11-SP1 \ /srv/obs/repos/Product/SLE11-SP1 @@ -132,7 +132,7 @@ DST_REPO_DIR=$1 PRJ_PATH=${2//:/:\/} PATH_TO_REPO=$3 mkdir -p $DST_REPO_DIR/$PRJ_PATH -rsync -a --log-file=$LOGFILE $PATH_TO_REPO/ $DST_REPO_DIR/$PRJ_PATH/ +rsync -a --log-file=$LOGFILE --mkpath $PATH_TO_REPO/ $DST_REPO_DIR/$PRJ_PATH/ For testing purposes, it can be invoked as follows: $ sudo -u obsrun /usr/local/bin/publish-hook.sh \ /srv/www/public_mirror/Product/SLES11-SP1 \