Changeset 407


Ignore:
Timestamp:
02/22/06 00:15:05 (7 years ago)
Author:
anarcat
Message:

[project @ alternc: changeset 2004-10-24 00:40:47 by anonymous]
document

Original author: anonymous
Date: 2004-10-24 00:41:16

Location:
install/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • install/scripts/upgrade_check.sh

    r352 r407  
    11#!/bin/sh -e 
    22 
    3 # extract version from filename by stripping the extension 
     3# this script will look for upgrade scripts in 
     4# /usr/share/alternc/install/upgrades and execute them based on the 
     5# extension 
     6# 
     7# usage: 
     8# $0 oldvers, where oldvers is the version of the package previously 
     9# installed 
     10# 
     11# an upgrade file is considered only if its basename is a version 
     12# number greater than the $oldvers argument 
     13 
     14# remove version from filename by stripping the extension 
    415strip_ext() { 
    516        echo $1 | sed 's/\.[^.]*$//' 
    617} 
    718 
     19# find the version from a filename by stripping everything but the extension 
    820get_ext() { 
    921        echo $1 | sed 's/^.*\.\([^.]*\)$/\1/' 
     
    1729fi 
    1830 
     31# the upgrade script we are considering 
    1932extensions="*.sh *.php *.sql" 
    2033cd /usr/share/alternc/install/upgrades 
     
    2235do 
    2336        if [ -r $file ]; then 
     37                # the version in the filename 
    2438                upvers=`strip_ext $file` 
     39                # the extension 
    2540                ext=`get_ext $file` 
    2641                if dpkg --compare-versions $upvers gt $oldvers; then 
    2742                  echo running upgrade script $file 
     43                  # run the proper program to interpret the upgrade script 
    2844                  case "$ext" in 
    2945                  sql) 
  • install/scripts/upgrades/README

    r331 r407  
    3232package 0.9, car il sera exécuté, même si la version installée est 1.0.) 
    3333 
     34Pour plus de détails, consultez directement le script 
     35../upgrade_check.sh, qui gère ces upgrades. 
     36 
    3437Mise en situation 
    3538----------------- 
Note: See TracChangeset for help on using the changeset viewer.