vinaigrette/scripts/repo/move-to-incoming
2017-08-31 00:35:28 +02:00

26 lines
636 B
Bash
Executable file

#!/bin/bash
changes_file=$1
source /home/vinaigrette/config/config
source /home/vinaigrette/scripts/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