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

Re: It's Huntin' Season



Hi!

On Sat, Feb 02, 2002 at 08:41:54PM -0600, Manoj Srivastava wrote:
> 
> 	You realize that you are asking more of this script that you
>  ask of dpkg? What happens if you try making a non-conffile into a
>  conffile? You think dpkg is going to check md5sums of old files
>  before asking? You think dpkg even preserves user changes?

I do realize that I'm asking more of this script than I ask of dpkg.
But, AFAIK, dpkg is not supposed to correct previous mistakes of
maintainers.

I don't know of any good reason to use such a script on a regular basis,
instead of declaring a conffile. If there are some, please explain me.
But, IMNSHO, such a scrpt should only be used in a transition phase,
when a file was not declared as a conffile, and it now is.

I would have suggested to use a (probably dirty) simple hack such as
this preinst :

if [ x$1 = xupgrade ] 
then
  case $2 in
  (<previous-stable-version>)
    if [ `md5sum < <configuration-file>` = <md5sum-of-previous-stable> ]
    then
      mv <configuration-file> <configuration-file>.dpkg-old
    fi
    ;;
  (<previous-testing-version>)
    if [ `md5sum < <configuration-file>` = <md5sum-of-previous-testing> ]
    then
      mv <configuration-file> <configuration-file>.dpkg-old
    fi
    ;;
  (<previous-unstable-version>)
    if [ `md5sum < <configuration-file>` = <md5sum-of-previous-unstable> ]
    then
      mv <configuration-file> <configuration-file>.dpkg-old
    fi
    ;;
  esac
fi


This script would of course need extra work, at least to be able to
roll-back if there is some problem... It may also contain a lot of bugs,
since I've just written it in a few minutes.


Anyway, your script is surely much better that my crude hack, but I
guess you've spend quite some time writing it.

Anyway, if your script works fine (I've not found courage to read it
extensively), it surely is the best available solution to upgrade
smoothly.


Regards,

Nicolas



Reply to: