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

Re: how to view config file changes without running an upgrade?



On Wed 21 Mar 2018 at 11:16:04 (-0400), Greg Wooledge wrote:
> On Wed, Mar 21, 2018 at 09:56:09AM -0500, David Wright wrote:
> > If you unpack the package somewhere, either using ar etc or,
> > more easily, by selecting it in mc and copying CONTENTS into,
> > say, /tmp
> 
> Or "dpkg -x".

Noted. One of the reason I use mc is that I'll usually be using a
function that does mc sh://alum.local/~ "$@" (with a few mods so
that the colouring is different from normal) to get to my
apt-cache-ng archive. Then the copying is cross-host to where I'm
actually performing the check.

> > $ for j in $(dpkg -L packagename) ; do [ -f $j ] && diff -u $j /tmp/CONTENTS/$j ; done
> 
> This only works if the filenames contained in the package are "safe",
> not containing any whitespace characters or ? or * or [ or any other
> characters that a shell may interpret as part of word splitting or
> filename expansion (with or without extended globs enabled).
> 
> https://mywiki.wooledge.org/Quotes
> https://mywiki.wooledge.org/BashPitfalls#pf1

Yes, I use your pages a fair bit, for which thanks.

> For most Debian packages, the filenames probably are "safe", but relying
> on that is not a good habit to fall into.

Nope. Hence my "add quotes to taste". But failure on that account is
likely to be noisy so at least you won't get false successes.

> dpkg -L packagename | while IFS= read -r f; do [ -f "$f" ] && diff -u "$f" /tmp/CONTENTS/"$f"; done
> 
> That's safe for all filenames that don't contain newlines.  And I'm
> pretty sure a filename with a newline cannot occur in a package, because
> all of the tools like dpkg -L would break.  In any case, dpkg -L would
> *definitely* break, so you wouldn't be able to do this at all.

Neatly done.

Cheers,
David.


Reply to: