1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__config_lalis/cp2mirror

50 lines
1.3 KiB
Plaintext
Raw Normal View History

2019-06-30 12:49:55 +02:00
#!/usr/bin/bash
APP_PATH=$1
2019-06-30 17:06:08 +02:00
MIRRORPATH="/mnt/lalis/mirror"
2019-06-30 12:49:55 +02:00
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
2019-06-30 17:06:08 +02:00
if [ -z $APP_PATH ] || ! [ -d $APP_PATH ]; then
echo "argument invalide"
2019-06-30 12:49:55 +02:00
exit 1
fi
2019-06-30 17:06:08 +02:00
for VERSION in `ls -A $MIRRORPATH/mageia/distrib`
do
echo "$MIRRORPATH/mageia/distrib/$VERSION"
2019-06-30 18:00:17 +02:00
if [ "$VERSION" -eq "cauldron" ]; then
VSTRING="cauldron"
else
VSTRING="mga$VERSION"
fi
rsync -aP $APP_PATH/SRPMS/*."$VSTRING".* $MIRRORPATH/lalis/$VERSION/SRPMS/core/updates/
2019-06-30 12:49:55 +02:00
2019-06-30 17:06:08 +02:00
if [ -e "$APP_PATH/RPMS/noarch" ]; then
NOARCH=1
2019-06-30 12:49:55 +02:00
fi
2019-06-30 17:06:08 +02:00
for i in $ARCH; do
if [ $NOARCH ]; then
echo "noarch"
ARCH_O="noarch"
else
echo "arch"
ARCH_O=$i
2019-06-30 12:49:55 +02:00
fi
2019-06-30 17:06:08 +02:00
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
2019-06-30 12:49:55 +02:00
done