1
0

outils de creation du miroir Lalis

This commit is contained in:
Daniel Tartavel 2019-06-30 12:49:55 +02:00
parent 3ac2e6ce6c
commit 270a27b851
2 changed files with 69 additions and 24 deletions

41
cp2mirror Executable file
View File

@ -0,0 +1,41 @@
#!/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

40
mkmirrortree Normal file → Executable file
View File

@ -1,26 +1,30 @@
#!/bin/bash
ARCH="SRPMS x86_64 i586 armv7hl aarch64"
DEPOT="release update"
echo "Créer une arborescence de miroir MAgeia dans le dossier `pwd`?"
read YN
if [ "$YN" = "y" ] || [ "$YN" = "Y" ] ;then
for i in $*; do
for j in $ARCH;do
if [ "$j" = "SRPMS" ]; then
MIRROR="/mnt/lalis/mirror"
ARCHLIST="SRPMS x86_64 i586 armv7hl aarch64"
DEPOT="release updates"
cd "$MIRROR"
echo `pwd`
for DIR in `ls -A $MIRROR/mageia/distrib`
do
for ARCH in $ARCHLIST;do
if [ "$ARCH" = "SRPMS" ]; then
MEDIA="";
else
MEDIA="/media"
fi
for k in $DEPOT;do
echo "./mageia/distrib/$i/$j$MEDIA/core/$k"
mkdir -p "./mageia/distrib/$i/$j$MEDIA/core/$k"
if ! [ -z $MEDIA ]; then
mkdir -p "./mageia/distrib/$i/$j$MEDIA/media_info"
for k in $DEPOT; do
echo "./mageia/lalis/$DIR/$ARCH$MEDIA/core/$k"
mkdir -p "./mageia/lalis/$DIR/$ARCH$MEDIA/core/$k"
if ! [ -z "$MEDIA" ]; then
echo "generation des medias"
mkdir -p "./mageia/lalis/$DIR/$ARCH$MEDIA/media_info"
printf "[media_info]
version=$i
version=$DIR
mediacfg_version=2
branch=Official
arch=$j
arch=$ARCH
xml-info=1
[core/release]
@ -69,9 +73,9 @@ media_types=official:free:updates:source
name=Core Updates Sources
noauto=1
rpms=core/updates
">"./mageia/distrib/$i/$j$MEDIA/media_info/media.cfg"
">"./mageia/lalis/$DIR/$ARCH$MEDIA/media_info/media.cfg"
fi
gendistrib --nobadrpm --blind --skipmissingdir "./mageia/lalis/$DIR/$ARCH$MEDIA/core/$k"
done
done
done
fi
done