gforge-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-commits] %s


From: Christian Bayle,,,
Subject: [Gforge-commits] %s
Date: Tue, 18 Jan 2005 00:37:28 +0000

Update of /cvsroot/gforge/gforge/debian/dsf-helper
In directory db.perdue.net:/tmp/cvs-serv27487/debian/dsf-helper

Modified Files:
        replace-files.config 
Added Files:
        replace-files.postinst 
Log Message:
Move replace_file function from debian/dsf-helper/replace-files.config 
to debian/dsf-helper/replace-files.postinst


--- NEW FILE: replace-files.postinst ---
###
# Functions to propose changes in configuration files
###
# Replace an existing file with the proposed one
# A copy of the original file is realized in config if we want
# to change the original file
replace_file () {
    file=$1
    if [ -e ${file}.gforge-old ] ; then
        if [ ! -e ${file}.gforge-new ] ; then
                echo "WARNING: ${file}.gforge-new replacement not generated, 
this shouldn't happen"
        else
                mv ${file}.gforge-new $file
        fi
    fi
}

Index: replace-files.config
===================================================================
RCS file: /cvsroot/gforge/gforge/debian/dsf-helper/replace-files.config,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** replace-files.config        16 Jan 2005 12:45:37 -0000      1.1
--- replace-files.config        18 Jan 2005 00:37:26 -0000      1.2
***************
*** 2,14 ****
  # Functions to propose changes in configuration files
  ###
- # Replace an exsting file with the proposed one
- replace_file () {
-     file=$1
-     if [ -e $file ] ; then
-         cp $file ${file}.gforge-old
-     fi
-     mv ${file}.gforge-new $file
- }
- 
  # Propose a replacement to the user
  propose_update () {
--- 2,5 ----
***************
*** 16,24 ****
      mode=$2
      template=gforge/shared/replace_file_$mode
!     if [ ! -e ${file}.gforge-new ] ; then
!         echo "${file} already configured, not changing."
!     elif diff -q ${file} ${file}.gforge-new > /dev/null 2>&1 ; then
!         # Old file and new file are identical
!         rm -f ${file}.gforge-new
      else
          db_fset $template seen false
--- 7,12 ----
      mode=$2
      template=gforge/shared/replace_file_$mode
!     if [ -e ${file}.gforge-old ] ; then
!         echo "${file} replacement already wanted, not changing."
      else
          db_fset $template seen false
***************
*** 29,34 ****
          case "$RET" in
              "true")
!                 echo >&2 "Replacing file $file with changed version"
!                 replace_file $file
                  ;;
              "false")
--- 17,22 ----
          case "$RET" in
              "true")
!                 echo >&2 "Will be replacing file $file with changed version, 
saving original"
!               cp $file ${file}.gforge-old
                  ;;
              "false")





reply via email to

[Prev in Thread] Current Thread [Next in Thread]