From db85f73d588c9ea27fe6ab9bdfa40a194b456d7a Mon Sep 17 00:00:00 2001 From: Camille Lafitte Date: Thu, 30 Aug 2012 08:09:08 +0000 Subject: [PATCH] =?UTF-8?q?Pr=C3=A9parer=20l'environnement=20chroot=20avan?= =?UTF-8?q?t=20de=20faire=20les=20compilation=20et=20apr=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * /tmp/ n'est pas vidé automatiquement, on doit y penser avant autrement * autrement on est bon pour un df -i 100% * Les anciens paquets ne servent plus, supprimons les aussi --- nightlybuild/mchroot.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/nightlybuild/mchroot.sh b/nightlybuild/mchroot.sh index 5f39105d..6813d4c0 100644 --- a/nightlybuild/mchroot.sh +++ b/nightlybuild/mchroot.sh @@ -18,6 +18,33 @@ DEPOT_DIR="$ROOT_DIR/depot" SOURCES[0]='svn https://www.alternc.org/svn/ /root/vcs/' #SOURCES[1]='vcs url_ressource target_directory_in_chroot' + +function prepare_chroot() { + + #Traiter dans les chroot + for dir in $(ls $CHROOT_DIR); do + if [[ ! -d $CHROOT_DIR/$dir ]]; then + continue + fi + dist=$(echo $dir | sed 's/-.*//' ) + arch=$(echo $dir | sed 's/.*-//' ) + + #Ouvrir un chroot + SCHROOT_SESSION=$(schroot -b -c $dir) + if [[ ! $SCHROOT_SESSION ]]; then + continue + fi + + #Nettoyer les chroot + chroot_run $SCHROOT_SESSION "find /tmp/ -type f -exec rm {} \;" "./" + done; + + #Nettoyer les build-area dans les sources +# find $SRC_DIR -iname build-area -exec rm -r {} \; + + #Purger le depot de transition + rm -r $DEPOT_DIR +} function get_sources() { @@ -57,6 +84,7 @@ function chroot_run() { function create_packages() { rm -r $BUILD_AREA + rm -r $DEPOT_DIR for dir in $(ls $CHROOT_DIR); do if [[ ! -d $CHROOT_DIR/$dir ]]; then @@ -159,6 +187,7 @@ function create_apt() { done } +prepare_chroot get_sources create_packages create_apt