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__cp2mirror/cp2mirror.sh

37 lines
1.1 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/bash
MIRRORPATH="/mnt/lalis/mirror/mageia/lalis"
for X in 7 8
{
rsync -aP SRPMS/*mga$X* $MIRRORPATH/$X/SRPMS/core/
if [ $? -ne 0 ]; then
echo "error rsync : $LINENO"
exit 1
fi
for ARCH in x86_64 i586 #aarch64 armv7hl
{
2020-04-12 11:38:35 +02:00
if [ -d RPMS/$ARCH ]; then
echo "rsync -aP RPMS/$ARCH/*mga$X* $MIRRORPATH/$X/$ARCH/media/core/"
2020-04-13 20:23:45 +02:00
rsync -aP RPMS/$ARCH/*mga$X* $MIRRORPATH/$X/$ARCH/media/core/
if [ $? -ne 0 ]; then
echo "error rsync : $LINENO"
exit 1
fi
2020-04-12 11:38:35 +02:00
fi
if [ -d RPMS/noarch ]; then
echo "rsync -aP RPMS/noarch/*mga$X* $MIRRORPATH/$X/$ARCH/media/core/"
2020-04-13 20:23:45 +02:00
rsync -aP RPMS/noarch/*mga$X* $MIRRORPATH/$X/$ARCH/media/core/
if [ $? -ne 0 ]; then
echo "error rsync : $LINENO"
exit 1
fi
2020-04-12 11:38:35 +02:00
fi
2020-04-13 20:07:48 +02:00
nice -n 19 /usr/bin/gendistrib --nobadrpm --blind --skipmissingdir --mediacfg $MIRRORPATH/$X/$ARCH/media/media_info/media.cfg $MIRRORPATH/$X/$ARCH
nice -n 19 /usr/bin/createrepo_c /mnt/lalis/mirror/mageia/lalis/$X/
}
}
2020-04-13 20:10:35 +02:00
chmod a+rX -R $MIRRORPATH
2020-04-13 20:07:48 +02:00
echo "signing rpms"
2020-04-13 20:29:53 +02:00
find $MIRRORPATH -name "*.rpm" -exec rpmsign --resign {} ";"