#!/bin/bash # After running of ./upstream-collect.sh, this script will update FTP. set -o errexit OSC_PACKAGE_DIR=/home/sbrabec/OSCI/home:sbrabec:branches:SUSE:SLE-12:GA:proposed-translation-fixes/translation-update-upstream FTP_MIRROR_DIR=/home/sbrabec/local/ftp.suse.com/pub/people/sbrabec/translation-update-upstream BRANCH=SLE12 API=https://api.suse.de PROJECT=home:sbrabec:branches:SUSE:SLE-12:GA:proposed-translation-fixes cd "$OSC_PACKAGE_DIR" RPM_NAME=$(sed -n 's/^Name: *//p' "$FTP_MIRROR_DIR/$BRANCH/proposed-translation-fixes/$PKG.patch" for FILE in $(sed -n "s/^Binary files \([^ ]*\) .* differ/\1/p" <"$FTP_MIRROR_DIR/$BRANCH/proposed-translation-fixes/$PKG.patch") ; do mkdir -p "$FTP_MIRROR_DIR/$BRANCH/proposed-translation-fixes/$PKG" osc -A "$API" cat "$PROJECT" "$PKG" "$FILE" >"$FTP_MIRROR_DIR/$BRANCH/proposed-translation-fixes/$PKG/$FILE" done done rm -f "$FTP_MIRROR_DIR/$BRANCH/proposed-translation-fixes/translation-update-upstream.patch" "$FTP_MIRROR_DIR/$BRANCH/proposed-translation-fixes/translation-update.patch" echo "Statistics..." cp -a check-translation-completeness.zip "$FTP_MIRROR_DIR/$BRANCH/statistics/" touch -r . "$FTP_MIRROR_DIR/$BRANCH" "$FTP_MIRROR_DIR/$BRANCH/generated-outputs" touch -r . "$FTP_MIRROR_DIR/$BRANCH" "$FTP_MIRROR_DIR/$BRANCH/statistics" echo "Done!"