Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

Troubleshooting cfg-update..

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
200 posts
  • Page 4 of 8
    • Jump to page:
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • …
  • 8
  • Next
Author
Message
masseya
Bodhisattva
Bodhisattva
User avatar
Posts: 2602
Joined: Wed Apr 17, 2002 3:56 pm
Location: Baltimore, MD
Contact:
Contact masseya
Website

  • Quote

Post by masseya » Wed Oct 22, 2003 3:46 pm

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..
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Wed Oct 22, 2003 6:15 pm

Masseya, thanks for cleaning out the original topic in Docs, Tips & Tricks!
Top
RSnow
n00b
n00b
Posts: 23
Joined: Fri Jul 26, 2002 8:30 pm

  • Quote

Post by RSnow » Wed Oct 22, 2003 6:24 pm

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.
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Mon Oct 27, 2003 8:43 pm

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
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: Select all

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: Select all

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...
----------------------------------------------------------------------------------------------
Top
canibuz
n00b
n00b
User avatar
Posts: 61
Joined: Sun Feb 23, 2003 1:49 pm

Problems using cfg-config

  • Quote

Post by canibuz » Fri Oct 31, 2003 11:59 am

Code: Select all

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: Select all

root@gentoo bin $ cfg-update --on
i get this:

Code: Select all

bash: cfg-update: command not found
Can someone help me ?

EDIT:
If i do a

Code: Select all

root@gentoo bin $ perl cfg-update -i
I get:

Code: Select all

Portage Logdir:  not found... Edit /etc/make.conf !
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Fri Oct 31, 2003 3:20 pm

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: Select all

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.
Top
canibuz
n00b
n00b
User avatar
Posts: 61
Joined: Sun Feb 23, 2003 1:49 pm

  • Quote

Post by canibuz » Fri Oct 31, 2003 3:31 pm

Hmm...
Updated my make.conf.
And now i get this:

Code: Select all

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"?
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Fri Oct 31, 2003 3:50 pm

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!
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Fri Oct 31, 2003 9:17 pm

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: Select all

## 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: Select all

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...
Top
kyron
Apprentice
Apprentice
User avatar
Posts: 198
Joined: Mon Aug 26, 2002 6:21 pm
Location: Montreal, Qc.

  • Quote

Post by kyron » Sat Nov 08, 2003 12:22 am

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: Select all

PORT_LOGDIR=/var/log/portage
xentric, add the following in your "sub check_index", after parsing PORT_LOGDIR:

$logdir =~ s/"//g;

More specifically:

Code: Select all

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 :P
M$ Windows: When in doubt, REBOOT
Linux: When in doubt, RTFM ;-)
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Sat Nov 08, 2003 4:42 am

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 :P
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!
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Tue Nov 11, 2003 7:05 pm

dabi_du wrote:I get the folowing reply after "cfg-update --check"

Code: Select all

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:

Code: Select all

#PORT_LOGDIR=
to

Code: Select all

PORT_LOGDIR=/var/log/portage
(And make sure that the /var/log/portage directory exists...)
Top
canibuz
n00b
n00b
User avatar
Posts: 61
Joined: Sun Feb 23, 2003 1:49 pm

  • Quote

Post by canibuz » Wed Nov 12, 2003 1:00 pm

Thanks for your great work.
Now it work's fine for me ... !!!
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Thu Nov 13, 2003 9:20 am

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.
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Thu Nov 13, 2003 2:07 pm

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...
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Thu Nov 13, 2003 2:16 pm

thank you kindly.

*update* i get this error message:

Use of uninitialized value in concatenation (.) or string at /usr/bin/cfg-update line 690.
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Thu Nov 13, 2003 2:52 pm

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?
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Thu Nov 13, 2003 3:14 pm

BTW, you still have to do some stuff after emerging the package:

Code: Select all

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: Select all

xentric@gentoo / $ xhost +localhost         # run as user who started XFree!
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Thu Nov 13, 2003 4:11 pm

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
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Thu Nov 13, 2003 5:23 pm

Ok, I've fixed the script and uploaded it...
Here's how you can update your emerged version:

Code: Select all

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
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Thu Nov 13, 2003 5:35 pm

thank you kindly :wink:
Top
smith
Apprentice
Apprentice
Posts: 222
Joined: Fri Sep 12, 2003 1:32 am

  • Quote

Post by smith » Sat Nov 15, 2003 3:21 pm

Code: Select all

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 > *
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Sun Nov 16, 2003 1:54 am

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.
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...
Top
smith
Apprentice
Apprentice
Posts: 222
Joined: Fri Sep 12, 2003 1:32 am

  • Quote

Post by smith » Sun Nov 16, 2003 2:01 am

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 > *
Top
xentric
Guru
Guru
User avatar
Posts: 410
Joined: Sun Mar 16, 2003 1:57 am
Location: Netherlands

  • Quote

Post by xentric » Sun Nov 16, 2003 11:36 am

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...
Top
Post Reply

200 posts
  • Page 4 of 8
    • Jump to page:
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • …
  • 8
  • Next

Return to “Other Things Gentoo”

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