View previous topic :: View next topic |
Author |
Message |
masseya Bodhisattva
Joined: 17 Apr 2002 Posts: 2602 Location: Baltimore, MD
|
Posted: Wed Oct 22, 2003 3:46 pm Post subject: |
|
|
I have cleaned up the thread by splitting the support related posts and moving them to P&P as this is a programming project. You can find the original thread here: GUI alternative for etc-update -> cfg-update v1.0
[edit - I moved to Other Things Gentoo after thinking about it a little more clearly.. - masseya] _________________ if i never try anything, i never learn anything..
if i never take a risk, i stay where i am.. |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Wed Oct 22, 2003 6:15 pm Post subject: |
|
|
Masseya, thanks for cleaning out the original topic in Docs, Tips & Tricks! |
|
Back to top |
|
|
RSnow n00b
Joined: 26 Jul 2002 Posts: 23
|
Posted: Wed Oct 22, 2003 6:24 pm Post subject: |
|
|
Is there any easy way to turn off or clean up the creation of oldcfg and newcfg files?
Also, it would be nice to have the option to either replace the original or remove the update after the editor is closed. Sometimes I just need to see what's going on with the new update. As it is now I have to kill the program and restart it.
Really like this utility. I hope it makes it in as a standard addon, etc-update makes it a bit difficult to tell what is going on. |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Mon Oct 27, 2003 8:43 pm Post subject: |
|
|
Quote: | Is there any easy way to turn off or clean up the creation of oldcfg and newcfg files? |
You can turn off the backup function with "cfg-update -c"
Just hit enter until you reach the backup mode setting... and type: off
Quote: | Also, it would be nice to have the option to either replace the original or remove the update after the editor is closed. Sometimes I just need to see what's going on with the new update. As it is now I have to kill the program and restart it. |
Example:
When you run "cfg-update -u" and it finds /etc/._cfg0000_test it will ask you if you would
like to update /etc/test :
Code: | Update file: /etc/test [y|n|o|q|?] ? |
You choose [y]es and xxdiff (or other editor) will pop-up in X
You diff the files and save the merged result with "save as left file" in xxdiff, which effectively
rewrites you current config file /etc/test
Now, all you have to do is to remove the /etc/._cfg0000_test file (if you have saved as left)
and thus, after closing xxdiff, cfg-update asks you if you want to remove /etc/._cfg0000_test
Code: | Delete file: /etc/._cfg0000_test [y|n|q|?] ? |
Just choose [y]es to delete it or [n]o to update it later if you only took a look at the files
in xxdiff and haven't saved the merged result "as left file" !
If you choose [o]verwrite it simply does a "mv /etc/._cfg0000_test /etc/test" and the ._cfg0000_
file will be gone. That's why it won't ask if you want to delete the ._cfg0000_ file...
But you should only use [o]verwrite when you are sure that the current config file has NOT
been edited !!! (v1.1 will check this and disable [o]verwrite for modified/unknown files!)
----------------------------------------------------------------------------------------------
Also, v1.1 is almost ready for release...
In v1.0 you can use [o]verwrite for every update but that's not safe!
In v1.1 you can only [o]verwrite the current config file with the new (._cfg0000_)
config file when the current one hasn't been modified. Naan Yaar posted a method
to determine if a file has been modified. (see dispatch-conf)
I've implemented this function in the new version of cfg-update and am testing
it before it's release...
---------------------------------------------------------------------------------------------- |
|
Back to top |
|
|
canibuz n00b
Joined: 23 Feb 2003 Posts: 61
|
Posted: Fri Oct 31, 2003 11:59 am Post subject: Problems using cfg-config |
|
|
Code: | xentric@gentoo / $ su
password: **********
root@gentoo / $ cd /usr/local/bin
root@gentoo bin $ wget http://people.zeelandnet.nl/xentric/cfg-update/1.1/cfg-update
root@gentoo bin $ chmod 755 cfg-update
root@gentoo bin $ emerge perl
root@gentoo bin $ emerge gentoolkit
root@gentoo bin $ emerge xxdiff
|
Until here, it works fine.
But when i want to do:
Code: |
root@gentoo bin $ cfg-update --on
|
i get this:
Code: |
bash: cfg-update: command not found
|
Can someone help me ?
EDIT:
If i do a
Code: |
root@gentoo bin $ perl cfg-update -i
|
I get:
Code: |
Portage Logdir: not found... Edit /etc/make.conf !
|
|
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Fri Oct 31, 2003 3:20 pm Post subject: |
|
|
Hi canibuz,
That error message means that you probably don't have a logdir
specified in /etc/make.conf
Just enable this line and add a directory in /etc/make.conf:
Code: | PORT_LOGDIR=/var/log/portage |
It could also be that either /bin/cat or /bin/grep are not available
as the PORT_LOGDIR variable is read with these two tools...
"cfg-update -s /bin/cat" tells me it's installed by the coreutils and
textutils package, so emerge one of those to get cat working.
(but it should be there because I can't imagine coreutils won't be
installed by default)
"cfg-update -s /bin/grep" tells me it's installed by the grep package.
Check if /bin/grep is there and "emerge grep" if you don't have it.
There's one more tool that cfg-update uses... awk
"cfg-update -s /bin/awk" tells me it's installed by the gawk package.
Check if /bin/awk is there and "emerge gawk" if you don't have it.
I will update the list of dependencies in the install instructions!
Ow... and having to type "perl cfg-update" probably means that the
perl executable isn't located in /usr/bin. Look at the first line of my script... That line enables the shell to parse the script to /usr/bin/perl
so you don't have to type perl in front of it.
You can simply create a link called /usr/bin/perl pointing to the actual
location of perl if /usr/bin/perl doesn't exist...
(as root): "ln -sf /location/of/perl /usr/bin/perl"
Last edited by xentric on Fri Oct 31, 2003 3:33 pm; edited 1 time in total |
|
Back to top |
|
|
canibuz n00b
Joined: 23 Feb 2003 Posts: 61
|
Posted: Fri Oct 31, 2003 3:31 pm Post subject: |
|
|
Hmm...
Updated my make.conf.
And now i get this:
Code: | Portage Logdir: "/var/log/portage" not found... Edit /etc/make.conf !
|
But i have a directory called /var/log/portage ...
Those Three Packages i have also installed [gawk,grep and coreutils].
Thanx for your help...
BTW... why do i have to start it with "perl cfg-update" ? And it won't work for me with only "cfg-update"? |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Fri Oct 31, 2003 3:50 pm Post subject: |
|
|
I bet you share some problems with wrc...
Do you have these files:
/root/.bashrc
/root/.bash_profile ?
If not, just read through page 1, 2 and 3 of this thread to get an idea
on how to set up the environment for the root user. The main problem
is that the PATH for root isn't set up properly.
You can find the above files in /etc/skel, and they should be copied to
each users home dir (incl. /root) when an account is created with the
useradd -m option!
I had to add a line to my ~/.bashrc to properly source /etc/profile
and it's all in this thread...
I wonder how many people tried, but failed to use cfg-update, because
of this seemingly default setup on gentoo systems. Please post if you
cannot get it to run! |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Fri Oct 31, 2003 9:17 pm Post subject: |
|
|
I have found the reason why some people have problems with the
root environment! I will update the installation guide with this info:
(interactive login bash shell)
When a bash-shell is started with /bin/bash --login it sources
/etc/profile followed by ~/.bash_profile if it exists.
(interactive non-login bash shell)
When a bash-shell is invoked by running "su" it only sources
~/.bashrc and nothing else !!!
Usually this file sources ~/.bash_profile but I guess some users
don't have these files in /root as they are not installed by default.
Here's how to fix this, add this on the bottom of /root/.bashrc
(if there is no such file copy /etc/skel/.bashrc to /root/.bashrc)
Code: | ## Quick fix to set up environment when su'ed to root:
[ -f /etc/profile ] && source /etc/profile |
Then exit the shell and su to root again, and run cfg-update
That's all... this should work!
For similar problems from a super user mode xterm just create
~/.Xdefaults and add the following line:
Code: | XTerm*loginShell: true |
That would force xterm to use "bin/bash --login" and this will
have the same effect as the fix mentioned above, bash sources
/etc/profile and the environment is properly set... |
|
Back to top |
|
|
kyron Apprentice
Joined: 26 Aug 2002 Posts: 198 Location: Montreal, Qc.
|
Posted: Sat Nov 08, 2003 12:22 am Post subject: |
|
|
xentric wrote: | Hi canibuz,
That error message means that you probably don't have a logdir
specified in /etc/make.conf
Just enable this line and add a directory in /etc/make.conf:
Code: | PORT_LOGDIR=/var/log/portage |
|
xentric, add the following in your "sub check_index", after parsing PORT_LOGDIR:
$logdir =~ s/\"//g;
More specifically:
Code: | kyron root # diff -Nau cfg-update.1 cfg-update
--- cfg-update.1 2003-11-04 14:47:05.000000000 -0500
+++ cfg-update 2003-11-07 19:08:51.000000000 -0500
@@ -141,6 +141,7 @@
sub check_index{
$logdir = `cat /etc/make.conf | grep '^PORT_LOGDIR='`;
$logdir =~ s/^PORT_LOGDIR\s*=\s*//;
+ $logdir =~ s/\"//g;
chomp $logdir;
if (!-e $logdir) { print "Portage Logdir: $logdir not found... Edit /etc/make.conf !\n\n"; exit; }
$log_pkg = `ls -t $logdir`;
|
If PORT_LOGDIR in make.conf is written as follows:
PORT_LOGDIR="/var/log/portage/"
The double quotes weren't filtered out and that is why your script didn't recognise the path as valid.
Needless to say I had the same problem...and it's now fixed with that added line _________________ M$ Windows: When in doubt, REBOOT
Linux: When in doubt, RTFM |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Sat Nov 08, 2003 4:42 am Post subject: |
|
|
kyron wrote: | xentric, add the following in your "sub check_index", after parsing PORT_LOGDIR:
$logdir =~ s/\"//g;
The double quotes weren't filtered out and that is why your script didn't recognise the path as valid.
Needless to say I had the same problem...and it's now fixed with that added line |
I have overlooked the fact that some people might use " quotes in the
declaration of those variables. I will go through the script again to check
if I can find more similar situations and fix it right away...
Thanks kyron! |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Tue Nov 11, 2003 7:05 pm Post subject: |
|
|
dabi_du wrote: | I get the folowing reply after "cfg-update --check"
Code: | matt bin # cfg-update --check
Portage Logdir: not found... Edit /etc/make.conf ! |
I have no idea what to change in make.conf.
Any sugestion please. |
Change the following line in /etc/make.conf:
to Code: | PORT_LOGDIR=/var/log/portage |
(And make sure that the /var/log/portage directory exists...) |
|
Back to top |
|
|
canibuz n00b
Joined: 23 Feb 2003 Posts: 61
|
Posted: Wed Nov 12, 2003 1:00 pm Post subject: |
|
|
Thanks for your great work.
Now it work's fine for me ... !!! |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Thu Nov 13, 2003 9:20 am Post subject: |
|
|
how would i use the ebuild? i have a local
portage dir and such, but i do not know
where to put it before digesting it. |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Thu Nov 13, 2003 2:07 pm Post subject: |
|
|
I have tested it like this:
Make dir: /usr/local/portage/app-portage/cfg-update
Copy the ebuild to it and type
"ebuild /usr/local/portage/app-portage/cfg-update/cfg-update-1.2.ebuild digest"
Then you can emerge it... |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Thu Nov 13, 2003 2:16 pm Post subject: |
|
|
thank you kindly.
*update* i get this error message:
Use of uninitialized value in concatenation (.) or string at /usr/bin/cfg-update line 690. |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Thu Nov 13, 2003 2:52 pm Post subject: |
|
|
Well at line 690 the script uses the variable named $tool which is set after
determining if TERM=linux or TERM=xterm. It could be that your TERM variable
is set to something else.
Can you run "env | grep TERM=" on the commandline and tell me what it says? |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Thu Nov 13, 2003 3:14 pm Post subject: |
|
|
BTW, you still have to do some stuff after emerging the package:
Code: |
xentric@gentoo / $ su
password: ******
root@gentoo / $ emerge cfg-update
root@gentoo / $ cfg-update --check # quickfix for root environment
root@gentoo / $ cfg-update --on # to integrate with emerge
root@gentoo / $ source /etc/profile # to load /etc/profile again
root@gentoo / $ cfg-update --index # create the checksum index
|
Now you are ready to use cfg-update...
Maybe you have to do this if you can't connect to the X display:
Code: |
xentric@gentoo / $ xhost +localhost # run as user who started XFree!
|
|
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Thu Nov 13, 2003 4:11 pm Post subject: |
|
|
thank you for your prompt replies.
i performed those steps; the error message stays.
here is my output of env | grep TERM=
TERM=rxvt
COLORTERM=rxvt-xpm |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Thu Nov 13, 2003 5:23 pm Post subject: |
|
|
Ok, I've fixed the script and uploaded it...
Here's how you can update your emerged version:
Code: |
root@yourbox / # cd /usr/lib/cfg-update
root@yourbox cfg-update # rm cfg-update.pl
root@yourbox cfg-update # wget http://people.zeelandnet.nl/xentric/cfg-update/1.2/cfg-update
root@yourbox cfg-update # mv cfg-update cfg-update.pl
root@yourbox cfg-update # chmod 755 cfg-update.pl
|
|
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Thu Nov 13, 2003 5:35 pm Post subject: |
|
|
thank you kindly |
|
Back to top |
|
|
smith Apprentice
Joined: 12 Sep 2003 Posts: 222
|
Posted: Sat Nov 15, 2003 3:21 pm Post subject: |
|
|
Code: | use of uninitialized value in concatenation (.) or string at cfg-update line 643 |
The script is running fine.. however I still gt this message at start up.. any ideas?
btw: Just to let you know... I think the changelog dates in the other thread might be out of order.. not trying to be picky just thought you would want to check it. _________________ gentoo portage > * |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Sun Nov 16, 2003 1:54 am Post subject: |
|
|
smith wrote: | I still get this message at start up.. any ideas? |
I don't have any variable on line 643 so your best bet is to download the latest version
and see if that fixes your problem.
Quote: | btw: Just to let you know... I think the changelog dates in the other thread might be out of order.. not trying to be picky just thought you would want to check it. |
Thanks for notifying me, fixed it... |
|
Back to top |
|
|
smith Apprentice
Joined: 12 Sep 2003 Posts: 222
|
Posted: Sun Nov 16, 2003 2:01 am Post subject: |
|
|
I can live with the error message... the script works perfectly the way it is.. I am going to leave it alone for now. _________________ gentoo portage > * |
|
Back to top |
|
|
xentric Guru
Joined: 16 Mar 2003 Posts: 410 Location: Netherlands
|
Posted: Sun Nov 16, 2003 11:36 am Post subject: |
|
|
smith wrote: | I can live with the error message... the script works perfectly the way it is.. I am going to leave it alone for now. |
Ok, if it works perfectly you could remove the -w flag from the very first
line of the script. That turns off perl interpreter warning reporting... |
|
Back to top |
|
|
|