Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

dispatch-conf

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
49 posts
  • 1
  • 2
  • Next
Author
Message
Kope
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 136
Joined: Mon May 17, 2004 5:18 am

dispatch-conf

  • Quote

Post by Kope » Thu Jun 10, 2004 5:03 pm

Anyone want to give a quick dispatch-conf tutorial for those of us who have hosed their systems with etc-update one too many times?
"Computers are useless -- they only give you answers!" -- Pablo Picasso
Top
allucid
Veteran
Veteran
Posts: 1314
Joined: Sat Nov 02, 2002 6:27 pm
Location: atlanta

  • Quote

Post by allucid » Thu Jun 10, 2004 5:55 pm

Not sure how it gets installed, it was already on my system.

First lets emerge some complementary programs to make diffing easier and safer:

Code: Select all

#emerge -a colordiff rcs
colordiff colorizes diff output. rcs allows you to easily switch back to an old version of a file if you accidently hose your settings with dispatch-conf. both are optional.

if you are using rcs you need to make the repository:

Code: Select all

#mkdir /etc/config-archive
.

Now edit /etc/dispatc-conf.conf to your liking.
Here is mine:

Code: Select all

#                                                                               
# dispatch-conf.conf                                                            
#                                                                               
                                                                                
# Directory to archive replaced configs                                         
archive-dir=/etc/config-archive                                                 
                                                                                
# Use rcs for storing files in the archive directory?                           
# (yes or no)                                                                   
use-rcs=yes                                                                     
                                                                                
# Diff for display                                                              
diff="colordiff -Nu %s %s"                                                     
                                                                                
# Pager for diff display                                                        
pager="less -R --no-init --QUIT-AT-EOF"                                            
                                                                                
# Automerge files comprising only CVS interpolations (e.g. Header or Id)        
# (yes or no)                                                                   
replace-cvs=yes                                                                 
                                                                                
# Automerge files comprising only whitespace and/or comments                    
# (yes or no)                                                                   
replace-wscomments=yes                                                          
                                                                                
# Automerge files that the user hasn't modified                                 
# (yes or no)                                                                   
replace-unmodified=yes 
Now to update config files just run "dispatch-conf" as root and follow the on-screen directions.
Some notes:
1) i've had dispatch-conf try to diff binary files before. not sure what to do about this (not even sure how it happened...). FIXED: thanks robmoss2k! (see below)
2) If the diff output is larger than your screen it will use your pager. When you exit the pager you will be dumped back into dispatch-conf. Just FYI, some people may get confused by this.

[edit] added the -R flag to the less command so it will display ansi color sequences correctly.
Last edited by allucid on Thu Jul 01, 2004 1:54 pm, edited 3 times in total.
Top
dhurt
Apprentice
Apprentice
Posts: 278
Joined: Wed May 14, 2003 6:21 pm
Location: Davis, CA
Contact:
Contact dhurt
Website

  • Quote

Post by dhurt » Fri Jun 11, 2004 8:51 am

Thanks for the guide, I have a couple times tried to get dispatch-conf going, but have not been able to and just fallen back on etc-update. I am finally able to get dispatch-conf and have it look nice.
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Top
Stiffler
n00b
n00b
Posts: 19
Joined: Sat Jul 12, 2003 5:20 pm
Location: Monmouth, OR

  • Quote

Post by Stiffler » Sun Jun 13, 2004 2:32 am

Can someone please explain the differences between etc-update and dispatch-conf? I've hosed my box using etc-update and I really don't want to do that again. The best way to not screw something up is understanding how it works...
Top
robmoss
Retired Dev
Retired Dev
Posts: 2634
Joined: Tue May 27, 2003 4:42 pm
Location: Jesus College, Oxford
Contact:
Contact robmoss
Website

  • Quote

Post by robmoss » Sun Jun 13, 2004 2:24 pm

If you're prepared to wait a week I'm going to write a manpage, a FAQ and anything else I can find. This has needed doing for ages. Keep an eye on the "Documentation, Tips & Tricks" forum next week...

Oh, and don't let dispatch-conf try to diff binary files (that's the -a flag in your diff line in dispatch-conf.conf). Take that flag out! Otherwise you'll get all sorts of interesting bugs showing up...
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Top
dhurt
Apprentice
Apprentice
Posts: 278
Joined: Wed May 14, 2003 6:21 pm
Location: Davis, CA
Contact:
Contact dhurt
Website

  • Quote

Post by dhurt » Sun Jun 13, 2004 4:01 pm

Thanks robmoss2k, you are one step ahead of me. I was just going to ask if there was a way to keep it from parsing binary files. I was using etc-update to merge those and then dispatch-conf to merge the other files. By the way, dispatch-conf is a much cleaner solution than etc-update.
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Top
robmoss
Retired Dev
Retired Dev
Posts: 2634
Joined: Tue May 27, 2003 4:42 pm
Location: Jesus College, Oxford
Contact:
Contact robmoss
Website

  • Quote

Post by robmoss » Sun Jun 13, 2004 6:33 pm

Indeed - for example, you'll get that weird xkb error with xorg-x11 if you use -a with dispatch-conf.

I'm going to go through the dispatch-conf source with a fine toothcomb in a week or so and write a set of documentation that misses absolutely nothing, and also actually tells you how to use the RCS stuff, for example. Should be good... :D
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Top
MikeP
Tux's lil' helper
Tux's lil' helper
Posts: 115
Joined: Thu Feb 27, 2003 1:02 pm
Location: Germany

  • Quote

Post by MikeP » Sun Jun 13, 2004 7:45 pm

though i wonder why the diff -a flag is set by default in its config? :/

good luck with your docs anyway :)
Top
drescherjm
Advocate
Advocate
Posts: 2792
Joined: Sat Jun 05, 2004 5:46 am
Location: Pittsburgh, PA, USA

  • Quote

Post by drescherjm » Tue Jun 29, 2004 5:45 am

Thanks for the guide. Thats just what I needed.
John

My gentoo overlay
Instructons for overlay
Top
robmoss
Retired Dev
Retired Dev
Posts: 2634
Joined: Tue May 27, 2003 4:42 pm
Location: Jesus College, Oxford
Contact:
Contact robmoss
Website

  • Quote

Post by robmoss » Tue Jun 29, 2004 9:59 am

MikeP wrote:though i wonder why the diff -a flag is set by default in its config? :/
This wasn't spotted as being a problem until recently, when people started getting (for example) xkb errors with dispatch-conf, or strange rstartd.real errors, or screwed up mime-magic files.

I'm going to also update dispatch-conf so that you can choose the interactive diff programme to be used, rather than being chained to sdiff (current workaround: write a wrapper script and save it over the top of sdiff).
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Top
dhurt
Apprentice
Apprentice
Posts: 278
Joined: Wed May 14, 2003 6:21 pm
Location: Davis, CA
Contact:
Contact dhurt
Website

  • Quote

Post by dhurt » Tue Jun 29, 2004 4:02 pm

I really like the functionality of dispatch-conf. However (Prefix following comment, with I used etc-update for months without it breaking my system) the one thing I miss from etc-update is the list of files that need to be modified. I know which files on my system I have modified, and so I would change those and then just scan the list of files one more time and then have etc-update nuke/update all the rest of the files. Oh well, just pressing "u" after I have read the file name and scanned the contents is not too bad either ;) But I do have to say dispatch-conf is much more intuitive and user friendly.
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Top
robmoss
Retired Dev
Retired Dev
Posts: 2634
Joined: Tue May 27, 2003 4:42 pm
Location: Jesus College, Oxford
Contact:
Contact robmoss
Website

  • Quote

Post by robmoss » Tue Jun 29, 2004 7:17 pm

You don't even have to remember which files you've modified - check out /etc/dispatch-conf.conf.
Reality is for those who can't face Science Fiction.

emerge -U will kill your Gentoo
ecatmur, Lord of Portage Bash Scripts
Top
dhurt
Apprentice
Apprentice
Posts: 278
Joined: Wed May 14, 2003 6:21 pm
Location: Davis, CA
Contact:
Contact dhurt
Website

  • Quote

Post by dhurt » Tue Jun 29, 2004 8:21 pm

Thanks, thought I had those options set that set, but had not set that on all my machines. Thanks that should speed up the process ;)
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Top
kamagurka
Veteran
Veteran
User avatar
Posts: 1026
Joined: Sun Jan 25, 2004 1:55 am
Location: /germany/munich
Contact:
Contact kamagurka
Website

  • Quote

Post by kamagurka » Thu Jul 01, 2004 1:18 pm

pretty cool. just one question, though:

is there any pager that doesn't strip color? because with less the fact that i emerge colordiff is more or less pointless...
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Top
allucid
Veteran
Veteran
Posts: 1314
Joined: Sat Nov 02, 2002 6:27 pm
Location: atlanta

  • Quote

Post by allucid » Thu Jul 01, 2004 1:48 pm

use less -R. i edited my original post to reflect this.
Top
drescherjm
Advocate
Advocate
Posts: 2792
Joined: Sat Jun 05, 2004 5:46 am
Location: Pittsburgh, PA, USA

  • Quote

Post by drescherjm » Thu Jul 01, 2004 3:20 pm

Prefix following comment, with I used etc-update for months without it breaking my system
I was aware of the some of the dangers with etc-update and thought I would be careful enough so that it would not mess up my system until I updated kde and had to update 100+ configuration files. There was no way I was going to examine each file so I had it finish without prompting. A few days later I tried to reboot and had major problems. My fstab and about 5 other essential files were overwritten. The system told me my hard drive was corrupt run fsck but when I tried to login to do this none of my passwords worked. Good thing I had a livecd handy and I knew I could boot off that and then do a chroot... After I figured out what happened all was well in about 3 reboots...
John

My gentoo overlay
Instructons for overlay
Top
Hydraulix
Guru
Guru
User avatar
Posts: 447
Joined: Fri Dec 12, 2003 4:28 am

  • Quote

Post by Hydraulix » Mon Jul 19, 2004 8:52 am

I'll give this a shot.
It is the fate of operating systems to become free.
- Neal Stephenson
Top
00tux
n00b
n00b
User avatar
Posts: 27
Joined: Sun May 30, 2004 7:17 pm
Location: British Columbia, Canada

  • Quote

Post by 00tux » Fri Jul 30, 2004 6:38 am

I'm totally confused by the output that I am given. So if I know that I have edited the config file what do I do. The - and + everywhere are confuzling the newby.
"But I don't wanna be a pirate"
Top
dhurt
Apprentice
Apprentice
Posts: 278
Joined: Wed May 14, 2003 6:21 pm
Location: Davis, CA
Contact:
Contact dhurt
Website

  • Quote

Post by dhurt » Fri Jul 30, 2004 3:32 pm

For instance this is the output from a recent run of dispatch-conf that I ran:

Code: Select all

 # START bash completion -- do not remove this line
 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
-if [ "$PS1" ] && [ $bmajor -eq 2 ] && [ $bminor '>' 04 ] \
-   && [ -f /etc/bash_completion ]; then # interactive shell
-        # Source completion code
-        . /etc/bash_completion
+# interactive shell
+if [ "$PS1" ] && [ -f /etc/bash_completion ] ; then
+       if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -ge 3 ]; then
+               # Source completion code
+               . /etc/bash_completion
+       fi
 fi
 unset bash bmajor bminor
 # END bash completion -- do not remove this line

>> (1 of 1) -- /etc/profile.d/bash-completion
>> q quit, h help, n next, e edit-new, z zap-new, u use-new
   m merge, t toggle-merge, l look-merge: 
The minus signs indicate the parts of the file that dispatch-conf wants to remove. The plus signs indicate the parts that it wants to add to the file. The options at the bottom should be fairly self explanitory. "e" allows you to edit the new file before merging it. "z" deletes the new file. "u" uses the new file. I have not played around with the bottom options, "m", "t" and "l" much so someone else will have to enlighten you to their functionallity. ;) Just a note if you have a really long file that outputs changes longer than the screen, you can hit q to bring up the menu quickly instead of trying to scroll for it.
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Top
zojas
Veteran
Veteran
User avatar
Posts: 1136
Joined: Mon Apr 22, 2002 11:29 pm
Location: Phoenix, AZ
Contact:
Contact zojas
Website

  • Quote

Post by zojas » Fri Aug 13, 2004 8:39 pm

did the in-depth manual/description/faqs ever get posted?

from the description so far, I think I prefer etc-update. I simply configured etc-update to use 'gvim -d' as the diff program. then I can easily change the two versions however I need to, with both versions side-by-side in my favorite editor. I know which files I need to worry about, and I always carefully scan the list, no matter how long it is. :)

automatically handling whitespace changes and cvs cruft sounds nice though.
http://www.desertsol.com/~kevin/ppc
Top
spb
Retired Dev
Retired Dev
User avatar
Posts: 2135
Joined: Fri Jan 02, 2004 1:18 pm
Location: Cambridge, UK

  • Quote

Post by spb » Fri Aug 13, 2004 8:50 pm

I don't know about descriptions/faqs, but dispatch-conf does have a proper man page now. It's not hugely detailed, but it's a start. ;)
14:20:19 <mark_alec> i fail
..shortly afterwards...
14:32:09 <spb> so it's "do what i want or i ban you"
14:32:13 <mark_alec> yes
Top
mallchin
l33t
l33t
User avatar
Posts: 655
Joined: Tue Jan 21, 2003 9:59 pm
Location: United Kingdom
Contact:
Contact mallchin
Website

  • Quote

Post by mallchin » Sat Aug 14, 2004 1:02 am

Great guide, just what I was after. I will use this on my site, if that's okay, in my Gentoo section when I build it that is.
6700 @ 2.66GHz, 4Gb RAM, 2 x 500Gb, 8800 GTX, PhysX, X-Fi, 24" Widescreen, Tux mascot
Top
squeegy
Guru
Guru
User avatar
Posts: 321
Joined: Sat Mar 13, 2004 11:46 pm
Location: Cincinnati, OH

  • Quote

Post by squeegy » Thu Sep 16, 2004 6:10 pm

Can anyone explain how to properly roll-back configuration files with dispatch-conf / rcs ? I know all the files are put into /etc/config-archive, I have looked through and found all the backups, so I could easily just copy them over to their old locations, but I just have a gut feeling there is a better way to go about doing this, actually using rcs.

I read both the rcs and dispatch-conf manpages, and searched the forums for what its worth.
Top
oberyno
Guru
Guru
Posts: 467
Joined: Sun Feb 15, 2004 10:39 am
Location: /bin/zsh

  • Quote

Post by oberyno » Thu Sep 16, 2004 6:34 pm

There's a short explanation on using co with dispatch-conf here.
Top
Duty
Apprentice
Apprentice
User avatar
Posts: 253
Joined: Sat Nov 15, 2003 7:00 am

  • Quote

Post by Duty » Tue Nov 09, 2004 8:45 pm

I get this error trying to run dispatch-conf:

Code: Select all

Traceback (most recent call last):
  File "/usr/sbin/dispatch-conf", line 309, in ?
    d.grind (portage.settings ['CONFIG_PROTECT'])
  File "/usr/sbin/dispatch-conf", line 145, in grind
    confs = filter (f, confs)
  File "/usr/sbin/dispatch-conf", line 135, in f
    self.replace(newconf, conf['current'])
  File "/usr/sbin/dispatch-conf", line 222, in replace
    os.system((DIFF_CONTENTS % (curconf, newconf)) + '>>' + self.config["log-file"])
AttributeError: dispatch instance has no attribute 'config'
Anyone have an idea?
Top
Post Reply

49 posts
  • 1
  • 2
  • Next

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic