#294073 [CONFFILE] add 'R' command to resolve diffs with external program

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Jari Aalto
Date:
2021-09-22 04:39:25 UTC
Severity:
wishlist
Tags:
#294073#5
Date:
2005-02-07 18:53:19 UTC
From:
To:
Many times on upgrage, the manual work to resolve situations like
this could be made easier:

    Configuration file `/etc/cups/cupsd.conf'
     ==> Modified (by you or by a script) since installation.
     ==> Package distributor has shipped an updated version.
       What would you like to do about it ?  Your options are:
	Y or I  : install the package maintainer's version
	N or O  : keep your currently-installed version
	  D     : show the differences between the versions
	  Z     : background this process to examine the situation
     The default action is to keep your current version.

FEATURE SUGGESTION
==================

Add command "R" to (R)esolve diffs with an external program. The
command R would be implemented as:

* Call external COMMAND with ARG1 and ARG2. The ARG1 would
  be the old file and ARG2 would be the new file file. In this the
  exec all:

      COMMAND /etc/cups/cupsd.conf /etc/cups/cupsd.conf.dpkg-new

* The COMMAND would be defined somewhere in /etc/apt/ configuration
  files. Like in /etc/apt/conf.d/30diff which would contain:

  APT::diff-resolve-command "/etc/apt/diff-resolve-emacs.sh";

* The default /etc/apt/diff-resolve-emacs.sh could be a simple bash script
  that would call Emacs ediff interface to resolve the situation.
  Something like:

   #!/bin/sh

   Main()
   {
        current=$1
        orig=$2

        [ ! "$current" ]  && return 1
        [ ! "$orig" ] 	  && return 1

        [ ! -f $current ] && return 1
        [ ! -f $orig ] 	  && return 1

        bin=${EMACS:-emacs}

        type -P $bin > /dev/null || return 1   # No 'emacs' installed yet

	${EMACS:-emacs} --no-windows --no-init-file --no-site-file \
	      --load ediff \
	      --eval "(ediff \"$orig\" \"$current\")"
   }

   Main "$@"

   # End of example

After that, it would be a simple task of:

  * Pess "n" to go to next diff, "p" to previous
  * Press "A" to copy diff from new upgrade to CURRENT file (B)
  * Press "wb" to write patched CURRENT (B)
  * Exit emacs C-x C-b

The diff interface would return to the original screen:

       What would you like to do about it ?  Your options are:
	Y or I  : install the package maintainer's version
	N or O  : keep your currently-installed version
	  D     : show the differences between the versions
	  Z     : background this process to examine the situation
	  R     : Resolve differencies

And the user would press "N" to continue to next upgrade problem.

While this example is Emacs specific, the modular design would
allow user to write, or APT to ship with, any other example
scripts e.g. that could use some graphical interface. Selecting
another interface would be just adding user entry:

 /etc/apt/conf.d/99diff

That would override the package's default.

Jari

#294073#10
Date:
2005-02-08 18:53:28 UTC
From:
To:
reassign 294073 dpkg
severity 294073 wishlist
retitle 294073 "[DPKG][CONFFILE] add 'R' command to resolve diffs with external program"
merge 268154 294073
retitle 268154 "[DPKG][CONFFILE] should offer configurable diff/merge program"
thanks
This bug is a dpkg bug, not an APT bug.  Futhermore, this is a duplicate
of a bug (#268154) which _you_ filed.

Scott

#294073#21
Date:
2005-03-02 04:53:49 UTC
From:
To:
reassign 294073 dpkg
thanks

This functionality is part of dpkg.

This would require saving a copy of the original, unmodified file, which
dpkg currently doesn't do.

#294073#46
Date:
2021-09-22 04:26:56 UTC
From:
To:
Hello,

Good morning,

We have gone through your samples from a partner and Here is our  Order
List. Please do bear in mind that we are very much in  need of this
order, quote your competitive prices.

Kindly send the Order confirmation.

Your early reply will be much appreciated.

Best Regards,

Maryanah Erwin.

PT FINDORA INTERNUSA

Jln Pahlawan 66 Kec. Arjawinangun

45162 CIREBON West-Java INDONESIA

tel : +62 231 357334

fax: +62 231 357260

email: marketing@findora.com