42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
VERSION=$3
|
|
APP_PATH=$1
|
|
MIRRORPATH=$2
|
|
ARCH="x86_64 i586 armv7hl aarch64"
|
|
|
|
if [ -e "/usr/local/etc/cp2mirror.conf" ]; then
|
|
echo "utilisation de /usr/local/etc/cp2mirror.conf"
|
|
. /usr/local/etc/cp2mirror.conf
|
|
fi
|
|
|
|
if [ -z $VERSION ] || [ -z $APP_PATH ] || [ -z $MIRRORPATH ]; then
|
|
echo "arguments invalides"
|
|
exit 1
|
|
fi
|
|
|
|
rsync -aP $APP_PATH/SRPMS/*.mga"$VERSION".* $MIRRORPATH/lalis/$VERSION/SRPMS/core/updates/
|
|
|
|
if [ -e "$APP_PATH/RPMS/noarch" ]; then
|
|
NOARCH=1
|
|
fi
|
|
|
|
for i in $ARCH; do
|
|
if [ $NOARCH ]; then
|
|
echo "noarch"
|
|
ARCH_O="noarch"
|
|
else
|
|
echo "arch"
|
|
ARCH_O=$i
|
|
fi
|
|
if [ -e "$APP_PATH/RPMS/$ARCH_O/" ]; then
|
|
if ! [ -e "$MIRRORPATH/lalis/$VERSION/$i/media/core/updates/" ]; then
|
|
/usr/bin/mkdir -p "$MIRRORPATH/lalis/$VERSION/$i/media/core/updates/"
|
|
fi
|
|
echo "rsync -aP $APP_PATH/RPMS/$ARCH_O/*.mga"$VERSION".* $MIRRORPATH/lalis/$VERSION/$i/media/core/updates/"
|
|
rsync -aP $APP_PATH/RPMS/$ARCH_O/*.mga"$VERSION".* $MIRRORPATH/lalis/$VERSION/$i/media/core/updates/
|
|
gendistrib --nobadrpm --blind --skipmissingdir $MIRRORPATH/lalis/$VERSION/$i
|
|
fi
|
|
done
|
|
|