vinaigrette/repo/move-to-incoming
2017-08-30 05:30:18 +02:00

26 lines
621 B
Bash
Executable file

#!/bin/bash
changes_file=$1
source /home/vinaigrette/config
source /home/vinaigrette/package_helpers.sh
INCOMING_DIR=${REPO_DIR}/incoming
# Retrieve changes file directory
dir=$(cd `dirname $changes_file` && pwd)
# Move file to incoming directory
for f in $(get_files ${changes_file}); do
if [[ $f =~ \.orig\.tar\.(gz|xz)$ ]]; then
echo "* Copying ${f}..."
sudo cp ${dir}/${f} $INCOMING_DIR
else
echo "* Moving ${f}..."
sudo mv ${dir}/${f} $INCOMING_DIR
fi
done
# Move changes file too
echo "* Moving $(basename ${changes_file})..."
sudo mv ${changes_file} $INCOMING_DIR