From 2ad5c44774e64366ac576fc8a6df56f6487c39b0 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Sat, 22 Jun 2019 23:37:53 +0200 Subject: [PATCH] first commit of mkmirrortree --- mkmirrortree | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 mkmirrortree diff --git a/mkmirrortree b/mkmirrortree new file mode 100644 index 0000000..3fb16d8 --- /dev/null +++ b/mkmirrortree @@ -0,0 +1,77 @@ +#!/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 + 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" + printf "[media_info] +version=$i +mediacfg_version=2 +branch=Official +arch=$j +xml-info=1 + +[core/release] +hdlist=hdlist_core_release.cz +media_type=official:free:release +media_types=official:free:release +name=Core Release +srpms=../../SRPMS/core/release + +[debug/core/release] +hdlist=hdlist_debug_core_release.cz +media_type=official:free:release:debug +media_types=official:free:release:debug +name=Core Release Debug +noauto=1 +srpms=../../SRPMS/core/release + +[../../SRPMS/core/release] +hdlist=hdlist_core_release.src.cz +media_type=official:free:release:source +media_types=official:free:release:source +name=Core Release Sources +noauto=1 +rpms=core/release + +[core/updates] +hdlist=hdlist_core_updates.cz +media_type=official:free:updates +media_types=official:free:updates +name=Core Updates +srpms=../../SRPMS/core/updates +updates_for=core/release + +[debug/core/updates] +hdlist=hdlist_debug_core_updates.cz +media_type=official:free:updates:debug +media_types=official:free:updates:debug +name=Core Updates Debug +noauto=1 +srpms=../../SRPMS/core/updates + +[../../SRPMS/core/updates] +hdlist=hdlist_core_updates.src.cz +media_type=official:free:updates:source +media_types=official:free:updates:source +name=Core Updates Sources +noauto=1 +rpms=core/updates +">"./mageia/distrib/$i/$j$MEDIA/media_info/media.cfg" + fi + done + done + done +fi