Summary: | =sys-apps/portage-2.2.14 etc-update problem | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Christian Roessner <c> |
Component: | Tools | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mschiff |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 611328 | ||
Attachments: | /usr/sbin/etc-update |
Description
Christian Roessner
2015-03-25 10:09:15 UTC
@Marc: Who could fix that? A fix should be easy (I guess), by replacing: elif diff_command "${file}" "${efile}" &> /dev/null; then with: elif diff -uN "${file}" "${efile}" &> /dev/null; then Created attachment 461874 [details, diff]
/usr/sbin/etc-update
Could PLEASE someone commit this patch and respond to my very old bug report. It is really annoying now
Indeed it seems like using diff_command here is wrong because it may be interactive. Since options/flags can be passed to diff, it may be a bit tricky if the user specified -b or something, so I guess it should respect editor indeed. Perhaps something like this? --- /usr/sbin/etc-update 2015-10-07 23:49:58.000000000 +0200 +++ /var/tmp/etc-update 2017-01-30 09:00:16.386340335 +0100 @@ -649,10 +649,21 @@ elif [[ -L ${efile} || -L ${file} ]] ; then # not the same file types continue - elif diff_command "${file}" "${efile}" &> /dev/null; then - # replace identical copy - mv "${file}" "${efile}" - break + else + local ret= + if [[ ${using_editor} == 0 ]] ; then + diff_command "${file}" "${efile}" &> /dev/null + ret=$? + else + # fall back to plain diff + diff -q "${file}" "${efile}" &> /dev/null + ret=$? + fi + if [[ ${ret} == 0 ]] ; then + # replace identical copy + mv "${file}" "${efile}" + break + fi fi done } It is ok to just use "diff -uN" like in my patch, as it doesn't matter what the user specified in his configuration file. It is not interactive or something else :-) It only tries to figure out, if to *.dist_xxxx files are the same or not. And diff is always there, so the patch perfectly works. Can you please accept it and use it :-) Why tell diff to produce unified diffs and treat non-existing files as empty ones if we just ensured both files exist? It just results in more output that we're going to ignore, hence my switch to -q. This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=246373bbe52c55e912381d8555cceb70db0ec41b (In reply to Zac Medico from comment #7) > This is in the master branch: > > https://gitweb.gentoo.org/proj/portage.git/commit/ > ?id=246373bbe52c55e912381d8555cceb70db0ec41b Thanks :) Looking forward to see it in stable package :) Please leave me a note when it is available Fixed in portage-2.3.5. |