From b33fcf78db347a9716e2305b157bdf61eee8f73c Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Fri, 8 Feb 2013 11:20:04 +0000 Subject: [PATCH] Bug de upgrade check --- .gitattributes | 10 +++++----- install/upgrade_check.sh | 6 ++++-- install/upgrades/{1.0.sql => 1.0.0.sql} | 0 install/upgrades/{1.1.php => 1.1.0.php} | 0 install/upgrades/{1.1.sh => 1.1.0.sh} | 0 install/upgrades/{3.0.sh => 3.0.0.sh} | 0 install/upgrades/{3.0.sql => 3.0.0.sql} | 0 install/upgrades/README | 10 ++++++++++ 8 files changed, 19 insertions(+), 7 deletions(-) rename install/upgrades/{1.0.sql => 1.0.0.sql} (100%) rename install/upgrades/{1.1.php => 1.1.0.php} (100%) rename install/upgrades/{1.1.sh => 1.1.0.sh} (100%) rename install/upgrades/{3.0.sh => 3.0.0.sh} (100%) rename install/upgrades/{3.0.sql => 3.0.0.sql} (100%) diff --git a/.gitattributes b/.gitattributes index 7764b8f2..fbacbec8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -535,14 +535,14 @@ install/upgrades/0.9.5.sql -text install/upgrades/0.9.6.sql -text install/upgrades/0.9.7.sql -text install/upgrades/0.9.9.sql -text +install/upgrades/1.0.0.sql -text install/upgrades/1.0.1.php -text install/upgrades/1.0.3.sql -text install/upgrades/1.0.4.sh -text -install/upgrades/1.0.sql -text -install/upgrades/1.1.php -text -install/upgrades/1.1.sh -text -install/upgrades/3.0.sh -text -install/upgrades/3.0.sql -text +install/upgrades/1.1.0.php -text +install/upgrades/1.1.0.sh -text +install/upgrades/3.0.0.sh -text +install/upgrades/3.0.0.sql -text install/upgrades/README -text lang/.svnignore -text lang/README -text diff --git a/install/upgrade_check.sh b/install/upgrade_check.sh index f32ebc6c..e113f82f 100755 --- a/install/upgrade_check.sh +++ b/install/upgrade_check.sh @@ -33,8 +33,7 @@ fi # the upgrade script we are considering extensions="*.sql *.sh *.php" cd /usr/share/alternc/install/upgrades -for file in $extensions -do +for file in $( ls $extensions | sort -n ) ; do if [ -r $file ]; then # the version in the filename upvers=`strip_ext $file` @@ -54,6 +53,9 @@ do sh) sh $file || true ;; + *) + # Do nothing + ;; esac fi fi diff --git a/install/upgrades/1.0.sql b/install/upgrades/1.0.0.sql similarity index 100% rename from install/upgrades/1.0.sql rename to install/upgrades/1.0.0.sql diff --git a/install/upgrades/1.1.php b/install/upgrades/1.1.0.php similarity index 100% rename from install/upgrades/1.1.php rename to install/upgrades/1.1.0.php diff --git a/install/upgrades/1.1.sh b/install/upgrades/1.1.0.sh similarity index 100% rename from install/upgrades/1.1.sh rename to install/upgrades/1.1.0.sh diff --git a/install/upgrades/3.0.sh b/install/upgrades/3.0.0.sh similarity index 100% rename from install/upgrades/3.0.sh rename to install/upgrades/3.0.0.sh diff --git a/install/upgrades/3.0.sql b/install/upgrades/3.0.0.sql similarity index 100% rename from install/upgrades/3.0.sql rename to install/upgrades/3.0.0.sql diff --git a/install/upgrades/README b/install/upgrades/README index c1ab1500..6fe31851 100644 --- a/install/upgrades/README +++ b/install/upgrades/README @@ -1,6 +1,16 @@ Fonctionnement des scripts de mise-à-jour d'AlternC =================================================== +/!\ ATTENTION /!\ +Votre script DOIT etre numéroté sur trois chiffres, pas plus, pas moins. +Donc : + 1.0.1.sql -> OK + 1.0.2.5.sql -> PAS OK + 1.0.sql -> PAS OK + +Sinon, ca sera dans n'importe quel ordre. + + Il a été décidé que des mises-à-jour pourront être "accrochées" à certaines versions en les mettant dans le dossier upgrades. Lors de l'installation d'un paquet, un script (upggrade_check.sh) examine ce