Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 8416

Summary: Slightly more inteligent diff of config files.
Product: Portage Development Reporter: Jason Price <jprice>
Component: CoreAssignee: Nicholas Jones (RETIRED) <carpaski>
Status: RESOLVED FIXED    
Severity: enhancement CC: h3y, mholzer
Priority: Low    
Version: 2.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 7737    

Description Jason Price 2002-09-26 10:40:39 UTC
When running through the ._cfg0000 files that portage dumps around, I find that
many of them differ just by the header line managed by source control.

If portage could note that "oh, this file has only changed the header line" and
procede to place the new config on top of the old.  Something like:

head -1 $current_cfg > tmpfile1
head -1 $new_cfg > tmpfile2
echo "<" > tmpfile3
cat tmpfile1 >> tmpfile3
echo ">" >> tmpfile3
cat tmpfile2 >> tmpfile3
diff $current_cfg $new_cfg > tmpfile4
if [ "`diff tmpfile3 tmpfile4`" == "" ]; then
   mv $new_cfg $current_cfg
else
   mv $new_cfg `basename $current_cfg`/._cfg0000_${current_cfg}
fi

Note: logic is just typed in, not tested, at all.
Note2: this might be a duplicate.  I couldn't find one though.

Jason
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-04-03 16:38:58 UTC
/etc/etc-update.conf

# Whether trivial/comment changes should be automerged
eu_automerge="yes"


quite good enough ?
Comment 2 Caleb Tennis (RETIRED) gentoo-dev 2003-07-07 19:54:57 UTC
Inactive, but the problem was solved.