Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 427068 - etc-update --automode -5 uses mv -i
Summary: etc-update --automode -5 uses mv -i
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 423075
  Show dependency tree
 
Reported: 2012-07-18 09:20 UTC by Alexander Zubkov
Modified: 2012-07-18 22:57 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Zubkov 2012-07-18 09:20:58 UTC
A am running "etc-update --automode -5"
Help to etc-update says:
-5 to auto-merge AND not use 'mv -i'

But using "-5" is the same as "-3". mv still waits confirmations. And "-i" flag can be seen in ps output.
I think it is mistype in /usr/sbin/etc-update script. There is lines:

        -5)
                parse_automode_flag -3
                export mv_opts=" ${mv_opts} "
                mv_opts="${mv_opts// -i / }"
                ;;

It is unconditionally adding "-i" option instead of removing it!
Comment 1 Zac Medico gentoo-dev 2012-07-18 10:07:45 UTC
(In reply to comment #0)
> It is unconditionally adding "-i" option instead of removing it!

Really? Here's what I get if I paste these lines in the shell:

$ mv_opts="mv -i"
$ mv_opts=" ${mv_opts} "
$ mv_opts="${mv_opts// -i / }"
$ echo $mv_opts
mv
Comment 2 Alexander Zubkov 2012-07-18 10:46:43 UTC
> Really? Here's what I get if I paste these lines in the shell

You are right. I was fooled by "//". Thaugh it uses empty pattern. :)

So bug is somwhere else.
Comment 3 Alexander Zubkov 2012-07-18 13:03:09 UTC
Another try. :)
I think this is because parameters is parsed before call to "get_config ...". I have inserted echo's it etc-update: after parameters parse, after get_config and after parsing "-5" in parse_automode_flag():
Result is:

# etc-update --automode -5
during parse: mv_opts =   
after params: mv_opts =   
after get_config: mv_opts = -i
Scanning Configuration files...
Replacing /etc/portage/savedconfig/sys-apps/busybox-1.20.1 with /etc/portage/savedconfig/sys-apps/._cfg0000_busybox-1.20.1
mv: overwrite `/etc/portage/savedconfig/sys-apps/busybox-1.20.1'? 

So "-i" is added later and not removed.
Comment 5 Zac Medico gentoo-dev 2012-07-18 22:57:05 UTC
This is fixed in 2.1.11.9 and 2.2.0_alpha120.