source: tt-tools/dossiers-de-cross-compilation.sh @ 6

Last change on this file since 6 was 6, checked in by guillaume, 16 years ago

Publication tt-ttols v0.1
Des outils pour le TwinTact

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#! /bin/bash
2
3source versions.sh
4
5for a in $ARCHIVES
6do
7        eval tar="\${${a}_TAR}"
8        eval sha="\${${a}_SHA}"
9        eval bas="\${${a}_BAS}"
10       
11        if [ -e "archives/$tar" ]; then
12                chk="$(sha1sum archives/$tar|cut -d' ' -f1)"
13                if [ "$chk" == "$sha" ]; then
14                        echo "L'archive $tar est disponible"
15                else
16                        echo "L'archive $tar est présente mais semble être corrompue..."
17                        echo "SHA1 du fichier local: $chk"
18                        echo "Empreinte SHA1 attendue: $sha"
19                        echo
20                        echo "Effacez le fichier '$PWD/archives/$tar' et lancez le téléchargement"
21                        exit 1
22                fi
23        fi
24       
25        # Effacer le dossier local si nécessaire
26        if [ -d "$bas" ]; then
27                echo "L'archive $tar semble être déjà décompressée"
28        else
29       
30                # Contrôle de l'option à utiliser pour tar
31                Z='z'
32                [ "${tar/tar.bz2}" == "$tar" ] || Z='j'
33       
34                echo "Décompression de archives/$tar"
35                tar x${Z}f archives/$tar
36        fi
37       
38        if [ -e "patchs/$bas.patch" ]; then
39                # Contrôler le dossier local de travail
40                [ -d "$bas-tt.bak" ] && rm -rf "$bas-tt.bak"
41                [ -d "$bas-tt" ]     && mv -vf "$bas-tt" "$bas-tt.bak"
42               
43                echo "Copie du package $bas dans $bas-tt"
44                cp -a $bas $bas-tt
45                cd $bas-tt
46                echo "Application du patch patchs/$bas.patch sur $bas-tt"
47                patch -p1 <../patchs/$bas.patch
48                cd ..
49        fi
50       
51        if [ -e "patchs/$bas.config" ]; then
52                echo "Copie de la configuration patchs/$bas.config dans $bas"
53                cp -a "patchs/$bas.config" "$bas/.config"
54        fi
55       
56done
Note: See TracBrowser for help on using the repository browser.