95 lines
2.7 KiB
Bash
Executable File
95 lines
2.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
|
|
GITPACKAGE=~/git/eole/git-package/git-package
|
|
export EDITOR=/bin/true
|
|
|
|
MASTER_INSTABLE=2.9
|
|
MASTER=$MASTER_INSTABLE.0
|
|
MASTER_DEV=true
|
|
INSTABLE_27=2.7.3
|
|
|
|
|
|
CURRENT_REF=$(git symbolic-ref -q HEAD)
|
|
CURRENT_BRANCH=$(echo "$CURRENT_REF" | awk -F'/' '{ print $3 }')
|
|
CURRENT_SUBBR=$(echo "$CURRENT_REF" | awk -F'/' '{ print $4 }')
|
|
echo $CURRENT_BRANCH
|
|
if [ "$CURRENT_BRANCH" = "master" ]; then
|
|
VERSION=$MASTER
|
|
ORI_BR=master
|
|
else
|
|
VERSION=$CURRENT_BRANCH
|
|
if [ ! "$CURRENT_SUBBR" = 'master' ]; then
|
|
echo "impossible de déterminer la branche"
|
|
exit 1
|
|
fi
|
|
ORI_BR=$VERSION/master
|
|
fi
|
|
set -e
|
|
if [ $MASTER_DEV = true ] && [ $VERSION = $MASTER ]; then
|
|
DEPOT=eole-$MASTER_INSTABLE/unstable
|
|
elif [ $VERSION = $INSTABLE_27 ]; then
|
|
ORI_BR=$VERSION/master
|
|
DEPOT=eole-2.7/unstable
|
|
else
|
|
DEPOT=eole-$VERSION/proposed-updates
|
|
fi
|
|
echo "attention version $VERSION ($DEPOT)"
|
|
DIST_BR=dist/eole/$VERSION/master
|
|
git push
|
|
git checkout $DIST_BR
|
|
if [ $CURRENT_BRANCH = 'master' ]; then
|
|
if grep -q Zgzip debian/rules; then
|
|
echo "compilable en 2.9"
|
|
else
|
|
echo "NON COMPILABLE EN 2.9"
|
|
echo "Voir des exemples de modifications ici : https://dev-eole.ac-dijon.fr/issues/33643#note-6 (notamment la partie dh_builddeb)"
|
|
git checkout $ORI_BR > /dev/null 2>&1
|
|
git branch -d $DIST_BR > /dev/null 2>&1
|
|
exit 1
|
|
fi
|
|
if grep -q dh_systemd_enable debian/rules; then
|
|
echo "NON COMPILABLE EN 2.9"
|
|
echo "Voir des exemples de modifications ici : https://dev-eole.ac-dijon.fr/issues/33643#note-6 (notamment la partie systemd)"
|
|
git checkout $ORI_BR > /dev/null 2>&1
|
|
git branch -d $DIST_BR > /dev/null 2>&1
|
|
exit 1
|
|
else
|
|
echo "systemd ok"
|
|
fi
|
|
if grep -q 1 debian/compat; then
|
|
echo "bonne version compat"
|
|
else
|
|
echo "NON COMPILABLE EN 2.9"
|
|
echo "Il doit y avoir au moins 10 (idéalement 13) dans debian/compat !!!"
|
|
git checkout $ORI_BR > /dev/null 2>&1
|
|
git branch -d $DIST_BR > /dev/null 2>&1
|
|
exit 1
|
|
fi
|
|
if grep -q "with systemd" debian/control; then
|
|
echo "NON COMPILABLE EN 2.9"
|
|
echo "Supprimer --with systemd dans debian/control !!!"
|
|
git checkout $ORI_BR > /dev/null 2>&1
|
|
git branch -d $DIST_BR > /dev/null 2>&1
|
|
exit 1
|
|
else
|
|
echo "pas de dh-systemd"
|
|
fi
|
|
if grep -q dh-systemd debian/control; then
|
|
echo "NON COMPILABLE EN 2.9"
|
|
echo "Dépendance à dh-systemd dans debian/control !!!"
|
|
git checkout $ORI_BR > /dev/null 2>&1
|
|
git branch -d $DIST_BR > /dev/null 2>&1
|
|
exit 1
|
|
else
|
|
echo "pas de dh-systemd"
|
|
fi
|
|
fi
|
|
git pull --rebase
|
|
git merge $ORI_BR
|
|
git push
|
|
|
|
yes | $GITPACKAGE -b -d $DEPOT
|
|
git checkout $ORI_BR
|
|
git branch -d $DIST_BR
|