Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 117396 - cfg-update-1.8.0 (Update)
Summary: cfg-update-1.8.0 (Update)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Harald van Dijk (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-01 15:05 UTC by S. van Boven
Modified: 2008-04-09 07:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cfg-update-1.8.0.ebuild (cfg-update-1.8.0.ebuild,1.76 KB, text/plain)
2006-01-01 15:07 UTC, S. van Boven
Details
cfg-update-1.8.0-r1.ebuild (cfg-update-1.8.0-r1.ebuild,1.67 KB, text/plain)
2006-01-03 13:23 UTC, S. van Boven
Details

Note You need to log in before you can comment on or make changes to this bug.
Description S. van Boven 2006-01-01 15:05:29 UTC
Finally the new version is ready for testing...
The script has been improved by a complete rewrite of the subroutines
for updating and lot's of minor changes in the other subroutines.

I have attached the new ebuild, which also contains minor changes.
Maybe you can move version 1.7.2 to stable and this one in testing.

Thanks, and best wishes for the new year!

Stephan van Boven몔
Comment 1 S. van Boven 2006-01-01 15:07:22 UTC
Created attachment 75955 [details]
cfg-update-1.8.0.ebuild

The new update for version 1.8.0
Happy New Year !
Comment 2 Harald van Dijk (RETIRED) gentoo-dev 2006-01-01 23:01:39 UTC
Hi,

I see this version automatically modifies /root again, while the previous version set the alias in /etc/profile. Sorry to ask again, but could you please make it not do that? Alternatively, if you prefer, I could modify the ebuild to not automatically set the alias, and have it print instructions on how to enable it.

Thanks, and happy New Year to you too.
Comment 3 S. van Boven 2006-01-02 12:15:00 UTC
Sorry, didn't think about that.
The previous ebuild added the alias to /etc/profile,
this one removes the old alias and now put's it in
/root/.bash_profile

You can take that out of the ebuild and put a ewarn
message in it's place. I'll update the installation
instructions in the forums to include this.

Thanks for notifying me.
Comment 4 S. van Boven 2006-01-02 22:36:36 UTC
The ebuild is missing:

    insinto /etc
    doins cfg-update.conf
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2006-01-03 00:15:25 UTC
Some issues I ran into:
- the cfg-update commands that are run after installation show error messages if PORT_LOGDIR is not set. Can this safely be ignored if it'll be set later? If so, I'll change the ebuild to hide all output.
- cfg-update --on doesn't work (tells the user to run --fix) if /root/.bash_profile doesn't exist, but does work if it exists as an empty file, even if the other files --fix would create don't exist. Is that intentional?
- on the first run, "Building checksum index... [...] (takes a few seconds)" takes a few minutes in UTF-8 locales; it'd be great if you could run cat/grep/awk with LC_ALL=C
- Any objections if I change the default diff from xxdiff to sdiff in the configuration file? That one's sure to be installed, xxdiff isn't.

For the rest, nice work, I don't see any serious problems -- at least, not right now :) -- so it looks okay for me to add, thanks.
Comment 6 S. van Boven 2006-01-03 12:35:43 UTC
Please wait with adding 1.8.0 to portage!
I need to change some small things in the cfg-update script.

1. it has a cosmetic flaw during indexing. (simple to fix)
2. if stage3 is not enabled or skipped because the tool doesn't support 3-way merging, the files in the stage3 queue are not moved to the stage4 queue. This means that those files never get picked up by the script.
3. the UTF-8 locales issue.
4. add a message with instructions in case xxdiff is not found.

> - cfg-update --on doesn't work (tells the
> user to run --fix) if /root/.bash_profile
> doesn't exist, but does work if it exists
> as an empty file, even if the other files
> --fix would create don't exist. Is that
> intentional?

Yes, I just check if .bash_profile exists, and force the user to run --fix to get a properly set up root account which can start tools from the commandline when su'ed to root.

> - on the first run, "Building checksum
> index... [...] (takes a few seconds)"
> takes a few minutes in UTF-8 locales;
> it'd be great if you could run cat/grep/awk
> with LC_ALL=C

I don't understand this UTF-8 locales thing. Do I simply need to put system("set LC_ALL=C"); in the script before running the cat command? 

> - Any objections if I change the default
> diff from xxdiff to sdiff in the config
> file? That one's sure to be installed,
> xxdiff isn't.

Hmm... I can improve the textmessage when xxdiff is not found. But I want to keep it as the default tool though! I'll add a similar textmessage like the one cfg-update gives when being started from a virtual terminal (no GUI available). If xxdiff doesn't exist users will be instructed to change the tool to sdiff or another tool in /etc/cfg-update.conf
OK!?

Do you want me to submit a fixed 1.8.0 or a new 1.8.0-r1 tarball and ebuild if I have fixed the above stuff?

Comment 7 Harald van Dijk (RETIRED) gentoo-dev 2006-01-03 13:14:26 UTC
> Please wait with adding 1.8.0 to portage!
> I need to change some small things in the cfg-update script.

Alright.

> Yes, I just check if .bash_profile exists, and force the user to run --fix to
> get a properly set up root account which can start tools from the commandline
> when su'ed to root.

Okay.

> I don't understand this UTF-8 locales thing. Do I simply need to put
> system("set LC_ALL=C"); in the script before running the cat command? 

There are several ways to do it, but one is to add
local $ENV{LC_ALL}='C';
to set LC_ALL for all executed programs in current scope. (You could set it globally, but you shouldn't, because the user's locale should not be ignored by the *diff utilities.)

To clarify:

perl -e 'system "locale"; { local $ENV{LC_ALL}="C"; system "locale" } system "locale"'

will only override LC_ALL for the middle call, but would for the last two if "local" wasn't there.

> Hmm... I can improve the textmessage when xxdiff is not found. But I want to
> keep it as the default tool though! I'll add a similar textmessage like the one
> cfg-update gives when being started from a virtual terminal (no GUI available).
> If xxdiff doesn't exist users will be instructed to change the tool to sdiff or
> another tool in /etc/cfg-update.conf
> OK!?

That's fine with me.

> Do you want me to submit a fixed 1.8.0 or a new 1.8.0-r1 tarball and ebuild if
> I have fixed the above stuff?

If it's only a few changes, you can just attach a patch here if you want, and I'll make the ebuild use your original 1.8.0 plus that patch. If you want a new tarball, that's okay too, but it'd be best if you use a new filename for that.

Also, do you want the revised version to be available in portage as 1.8.0, or as 1.8.0-r1 so that users who installed it already via an overlay will be told to upgrade?
Comment 8 S. van Boven 2006-01-03 13:23:12 UTC
Created attachment 76109 [details]
cfg-update-1.8.0-r1.ebuild

updated the ebuild so it installs /etc/cfg-update.conf
Comment 9 S. van Boven 2006-01-03 15:28:09 UTC
1. cosmetic bug during indexing is fixed.
2. if stage3 is disabled or tool doesn't support 3-way merges files in stage3 queue are now pushed to stage4 queue.
3. added local $ENV{LC_ALL}="C"; infront of all cat/grep/awk commands and checked if tools use the global locales, tested and OK.
4. added text message with instructions when xxdiff (default tool) is not found.
5. added text message with instructions if PORT_LOGDIR not specified/found.
6. removed the forced exit if PORT_LOGDIR not specified/found.
7. found and fixed issue when portage logging is not enabled, writes "portage log not found" to top of checksum-index.
8. found and fixed issue if PORT_LOGDIR is commented out in /etc/make.conf it now respects that.
9. fixed (undocumented) diff_two_files and diff_three_files subroutines, they didn't call lauch_tool correctly.
10. renamed the 2nd submitted ebuild to: cfg-update-1.8.0-r1
11. created and uploaded a new tarball: cfg-update-1.8.0-r1.tar.gz

I have never uploaded an -r1 version because I couldn't get that to work last year...
Harold, please check if that works with the following line in the ebuild:
SRC_URI="http://people.zeelandnet.nl/xentric/${P}.tar.gz"
Comment 10 Harald van Dijk (RETIRED) gentoo-dev 2006-01-03 22:43:33 UTC
Thanks, a slightly modified 1.8.0-r1 ebuild is in the tree.