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

52
mkmirrortree Normal file → Executable file
View File

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