1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| ############################################################################################
# Script qui teste si le fichier en paramètre possède le tag du troisième paramètre
# Si c'est le cas il renvoie "Taggué $tag", sinon il renvoie la version du fichier ayant ce TAG
# Ce script prend trois paramètres, le premier étant le nom du fichier,
# le second étant la version du fichier,
# le troisième étant le tag à tester
#!/bin/bash
############################################################################################
# Description des paramètres
nom_fichier=$1
version_fichier=$2
tag=$3
# On se met dans le repository_cvs
cd /local/bea/repository_cvs/
#echo "version:$version_fichier nom:$nom_fichier tag:$tag"
#echo cvs log -h $nom_fichier
# On accède aux log de ce fichier et on récupère la version associée au tag
version_tag=`cvs log -h $nom_fichier | grep " $tag" | sed -e "s/ $tag: //"`
if [ ${version_tag} = ${version_fichier} ]
then echo "Taggué $tag"
else echo "La version tagguée $tag est: ${version_tag}"
fi |