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

36
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`
do
for ARCH in $ARCHLIST;do
if [ "$ARCH" = "SRPMS" ]; then
MEDIA=""; MEDIA="";
else else
MEDIA="/media" MEDIA="/media"
fi fi
for k in $DEPOT; do for k in $DEPOT; do
echo "./mageia/distrib/$i/$j$MEDIA/core/$k" echo "./mageia/lalis/$DIR/$ARCH$MEDIA/core/$k"
mkdir -p "./mageia/distrib/$i/$j$MEDIA/core/$k" mkdir -p "./mageia/lalis/$DIR/$ARCH$MEDIA/core/$k"
if ! [ -z $MEDIA ]; then if ! [ -z "$MEDIA" ]; then
mkdir -p "./mageia/distrib/$i/$j$MEDIA/media_info" echo "generation des medias"
mkdir -p "./mageia/lalis/$DIR/$ARCH$MEDIA/media_info"
printf "[media_info] printf "[media_info]
version=$i 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
gendistrib --nobadrpm --blind --skipmissingdir "./mageia/lalis/$DIR/$ARCH$MEDIA/core/$k"
done done
done done
done done
fi