Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 202910 - app-portage/cfg-update doesn't work with paludis
Summary: app-portage/cfg-update doesn't work with paludis
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Harald van Dijk (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-21 06:37 UTC by Vasiliy Tolstov
Modified: 2010-02-15 07:44 UTC (History)
3 users (show)

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 Vasiliy Tolstov 2007-12-21 06:37:09 UTC
i'm using paludis as package manager and completely removed portage from my system (alsa delete /etc/make.profile symlink and /etc/make.conf)
cfg-update -l does not found that i have one file need updating in /etc/init.d/._cfg0000_nscd


Reproducible: Always

Steps to Reproduce:
1.cfg-update -l


Actual Results:  
find 1 update

Expected Results:  
Searching for updates...
No protected directories found...
No ._cfg0000_* files found...


my /etc/cfg-update.conf

vase init.d # cat /etc/cfg-update.conf  | grep -v "#"
MERGE_TOOL = /usr/bin/meld
ENABLE_BACKUPS = yes
ENABLE_STAGE1 = yes
ENABLE_STAGE2 = yes
ENABLE_STAGE3 = yes
ENABLE_STAGE4 = yes
ENABLE_STAGE5 = yes
Comment 1 Vasiliy Tolstov 2007-12-21 06:38:07 UTC
vase init.d # cfg-update -d -v -s
<show_debug_info>
    version           = 1.8.2-r1
    merge_tool_name   = meld
    merge_tool        = /usr/bin/meld
    xxdiff_style      = --style Keramik
    index_file        = /var/lib/cfg-update/checksum.index
    hosts_file        = /etc/cfg-update.hosts
    portage_hook      = /etc/portage/bashrc
    paludis_hook      = /usr/share/paludis/hooks/install_all_pre/cfg-update.bash
    pkg_manager       = Portage
    pkg_db            = /var/db/pkg
    install_log       = /var/log/emerge.log
    find_string       = ::: completed emerge
    backup_path       = /var/lib/cfg-update/backups
    enable_backups    = yes
    enable_stage1     = yes
    enable_stage2     = yes
    enable_stage3     = yes
    enable_stage4     = yes
    enable_stage5     = yes
    config_new        = ._cfg????_*
    rm_new            = \._cfg...._
    temp_new          = ._temp-new-cfg_*
    backup_new        = ._new-cfg_*
    restore_new       = ._cfg0000_*
    rm_old            = \._old-cfg_
    temp_old          = ._temp-old-cfg_*
    backup_old        = ._old-cfg_*
    restore_old       = *
    merged            = *.merge
    opt_i = 0
    opt_f = 0
    opt_s = 1
    opt_l = 0
    opt_u = 0
    opt_b = 0
    opt_r = 0
    opt_a = 0
    opt_m = 0
    opt_d = 1
    opt_p = 0
    opt_v = 1
    opt_h = novalue
    opt_t = novalue
    opt_help                 = 0
    opt_test_code            = 0
    opt_ebuild               = 0
    opt_check_hosts          = 0
    opt_mount_hosts          = 0
    opt_unmount_hosts        = 0
    opt_check_packages       = 0
    opt_move_backups         = 0
    opt_disable_portage_hook = 0
    opt_disable_paludis_hook = 0
    opt_optimize_backups     = 0
    mount_count              = 1
    mount_first              = 0
    mount_last               = 0
    mount_point[0]           = ""
</show_debug_info>
<check_hooks>
    Paludis hook is already enabled...
</check_hooks>
<check_tool>
    merge_tool                        = /usr/bin/meld
    merge_tool_name                   = meld
    tool_supports_2way                = yes
    tool_supports_3way                = yes
    tool_saves_mergefile_when_aborted = yes
    tool_needs_gui                    = yes
</check_tool>
<list_dirs>
    <find_protected_dirs>
          portageq config_protect 
Can't exec "portageq": No such file or directory at /usr/bin/cfg-update line 992.
Use of uninitialized value in substitution (s///) at /usr/bin/cfg-update line 993.
Use of uninitialized value in pattern match (m//) at /usr/bin/cfg-update line 995.
        No protected directories found...
    </find_protected_dirs>
    
    These (localhost) directories are protected with CONFIG_PROTECT:
    <find_masked_dirs>
          portageq config_protect_mask 
Can't exec "portageq": No such file or directory at /usr/bin/cfg-update line 1025.
Use of uninitialized value in substitution (s///) at /usr/bin/cfg-update line 1026.
Use of uninitialized value in pattern match (m//) at /usr/bin/cfg-update line 1028.
        No masked directories found...
    </find_masked_dirs>
    
    These (localhost) directories are excluded with CONFIG_PROTECT_MASK:
    
</list_dirs>
Comment 2 Harald van Dijk (RETIRED) gentoo-dev 2007-12-23 19:20:55 UTC
Stephan, could you take a look at this?
Comment 3 S. van Boven 2007-12-23 22:14:54 UTC
Vasily,

Does /usr/bin/paludis exist or is it in another location?

>    pkg_manager       = Portage
>    pkg_db            = /var/db/pkg
>    install_log       = /var/log/emerge.log
>    find_string       = ::: completed emerge

The debug output above shows me that cfg-update still thinks that Portage is the main package installer.

Normally the cfg-update hook for Paludis (/usr/share/paludis/hooks/install_all_pre/cfg-update.bash) should correct this automatically as soon as you install a package with Paludis. Right before Paludis starts installing the new package, the hook should run "cfg-update --index --paludis", which should cause a rebuild of the checksum index, ***unless you still have ._cfg0000_ files on your system***. That's probably what's wrong here!

Running "cfg-update --force --index --paludis" once should fix your situation.
This will make sure that the first line of the checksum-index contains the word Paludis so that cfg-update knows that Paludis is the default package manager.
Then check again if "cfg-update -l" works correctly.
Comment 4 S. van Boven 2007-12-23 22:16:39 UTC
Hi Vasily,

>    pkg_manager       = Portage
>    pkg_db            = /var/db/pkg
>    install_log       = /var/log/emerge.log
>    find_string       = ::: completed emerge

The debug output above shows me that cfg-update still thinks that Portage is the main package installer.

Normally the cfg-update hook for Paludis (/usr/share/paludis/hooks/install_all_pre/cfg-update.bash) should correct this automatically as soon as you install a package with Paludis. Right before Paludis starts installing the new package, the hook should run "cfg-update --index --paludis", which should cause a rebuild of the checksum index, ***unless you still have ._cfg0000_ files on your system***.

That's probably what's wrong here!

Running "cfg-update --force --index --paludis" once should fix your situation.
This will make sure that the first line of the checksum-index contains the word Paludis so that cfg-update knows that Paludis is the default package manager.

After running the above comand check if "cfg-update -l" works correctly.
Comment 5 Vasiliy Tolstov 2007-12-24 10:02:40 UTC
(In reply to comment #3)
> Vasily,
> 
> Does /usr/bin/paludis exist or is it in another location?
> 
> >    pkg_manager       = Portage
> >    pkg_db            = /var/db/pkg
> >    install_log       = /var/log/emerge.log
> >    find_string       = ::: completed emerge
> 
> The debug output above shows me that cfg-update still thinks that Portage is
> the main package installer.
> 

Yes, simple output which paludis = /usr/bin/paludis

> Normally the cfg-update hook for Paludis
> (/usr/share/paludis/hooks/install_all_pre/cfg-update.bash) should correct this
> automatically as soon as you install a package with Paludis. Right before
> Paludis starts installing the new package, the hook should run "cfg-update
> --index --paludis", which should cause a rebuild of the checksum index,
> ***unless you still have ._cfg0000_ files on your system***. That's probably
> what's wrong here!
> 

Yes, hook works.

> Running "cfg-update --force --index --paludis" once should fix your situation.
> This will make sure that the first line of the checksum-index contains the word
> Paludis so that cfg-update knows that Paludis is the default package manager.
> Then check again if "cfg-update -l" works correctly.
> 

No, does not work
cfg-update --force --index --paludis
output is >>> cfg-update-1.8.2-r1: Creating checksum index...

then checksumming is complete i'm running cfg-update -l 
and see Searching for updates...
No protected directories found...
No ._cfg0000_* files found...

but i still have ._cfg0000_nscd in /etc/init.d/

Comment 6 Vasiliy Tolstov 2007-12-24 10:10:25 UTC
also i'm found file need updateting 
ls -aol /etc/X11/gdm/

._cfg0000_custom.conf
Comment 7 S. van Boven 2007-12-25 00:07:53 UTC
Hi Vasily,

Well, we fixed one problem, at least cfg-update is correctly running in Paludis compatible mode now :)

>
> No protected directories found...
>

The next problem is, why can't cfg-update find the protected directories?
"cfg-update -s" should show you the protected dirs, but it'll probably show none.

In Paludis mode, cfg-update gets these dirs from "/<pkg_db>/.cache/all_CONFIG_PROTECT" where the default <pkg_db> is "/var/db/pkg".
What is the output for "cat /var/pkg/db/.cache/all_CONFIG_PROTECT"?

If that file is empty, you should find out where Paludis stores the protected dirs on your system.
If needed, the <pkg_db> variable can be set to another directory in /etc/cfg-update.conf... (see bottom of file for example)

Keep us posted!
Comment 8 Vasiliy Tolstov 2007-12-25 05:37:45 UTC
(In reply to comment #7)
> Hi Vasily,
> 
> Well, we fixed one problem, at least cfg-update is correctly running in Paludis
> compatible mode now :)
> 
> >
> > No protected directories found...
> >
> 
> The next problem is, why can't cfg-update find the protected directories?
> "cfg-update -s" should show you the protected dirs, but it'll probably show
> none.
> 
> In Paludis mode, cfg-update gets these dirs from
> "/<pkg_db>/.cache/all_CONFIG_PROTECT" where the default <pkg_db> is
> "/var/db/pkg".
> What is the output for "cat /var/pkg/db/.cache/all_CONFIG_PROTECT"?
> 
> If that file is empty, you should find out where Paludis stores the protected
> dirs on your system.
> If needed, the <pkg_db> variable can be set to another directory in
> /etc/cfg-update.conf... (see bottom of file for example)
> 
> Keep us posted!
> 

cat /var/pkg/db/.cache/all_CONFIG_PROTECT output nothing because path is /var/db/pkg not a /var/pkg/db
in my config path is 
PKG_DB       = /var/db/pkg

cat /var/db/pkg/.cache/all_CONFIG_PROTECT output only /etc  dir
Comment 9 S. van Boven 2007-12-25 11:22:22 UTC
Vasiliy,

Portage has by default more protected directories than Paludis.
So you have installed some packages with Portage, but you didn't update the configfiles of those packages. Then you switch to Paludis which has only /etc as protected dir.

Now cfg-update only expects configfile updates in /etc because Paludis says it only protects /etc.

Luckily I have also hardcoded a set of protected dirs into cfg-update which will be used when portageq (Portage mode) and /var/db/pkg/.cache/all_CONFIG_PROTECT (Paludis mode) are not found.

Trick:
So if you temporarily set PKG_DB to a non-existant dir in /etc/cfg-update.conf, then cfg-update should use the hardcoded protected dirs and find your pending updates. Just update the configfiles and when finished you can comment out the PKG_DB line again so cfg-update will revert to normal.

The conclusion is, you can only switch from Portage to Paludis when you have updated all your configfiles. I cannot help users with this, it's not a bug.

Emerging should be followed by checking if all configfiles are up-to-date. If users stick to that rule, there should be no problems :)

Happy X-mas !
Comment 10 Vasiliy Tolstov 2007-12-25 12:17:47 UTC
(In reply to comment #9)

> Trick:
> So if you temporarily set PKG_DB to a non-existant dir in /etc/cfg-update.conf,
> then cfg-update should use the hardcoded protected dirs and find your pending
> updates. Just update the configfiles and when finished you can comment out the
> PKG_DB line again so cfg-update will revert to normal.
> 

I'm change PKG_DB to /var/empty but cfg-update -u not founded any updates =(

> The conclusion is, you can only switch from Portage to Paludis when you have
> updated all your configfiles. I cannot help users with this, it's not a bug.
> 

Can you provide listing of this directories ? On othe machine where portage is installed emerge --info | grep CONFIG_PROTECT displays only /etc dir...


> Emerging should be followed by checking if all configfiles are up-to-date. If
> users stick to that rule, there should be no problems :)
> 
> Happy X-mas !
> 

Thank you very much :) Happy Christmas too from Russia :)
Comment 11 S. van Boven 2007-12-26 12:52:10 UTC
The protected dirs can differ from system to system.
My Gentoo box hasn't had a re-install since 2003, maybe that's why I have more protected dirs than your system.

The hardcoded dirs (same as on my gentoo box) in cfg-update are:
/etc
/root
/usr/kde
/usr/share/config
/usr/share/X11/app-defaults
/usr/share/X11/xkb

Can you post the output of "cfg-update -vds"?
Comment 12 Vasiliy Tolstov 2007-12-27 07:12:59 UTC
(In reply to comment #11)
> The protected dirs can differ from system to system.
> My Gentoo box hasn't had a re-install since 2003, maybe that's why I have more
> protected dirs than your system.
> 
> The hardcoded dirs (same as on my gentoo box) in cfg-update are:
> /etc
> /root
> /usr/kde
> /usr/share/config
> /usr/share/X11/app-defaults
> /usr/share/X11/xkb
> 
> Can you post the output of "cfg-update -vds"?
> 

vase ~ # cfg-update -vds
<show_debug_info>
    version           = 1.8.2-r1
    merge_tool_name   = meld
    merge_tool        = /usr/bin/meld
    xxdiff_style      = --style Keramik
    index_file        = /var/lib/cfg-update/checksum.index
    hosts_file        = /etc/cfg-update.hosts
    portage_hook      = /etc/portage/bashrc
    paludis_hook      = /usr/share/paludis/hooks/install_all_pre/cfg-update.bash
    pkg_manager       = Portage
    pkg_db            = /var/db/pkg
    install_log       = /var/log/emerge.log
    find_string       = ::: completed emerge
    backup_path       = /var/lib/cfg-update/backups
    enable_backups    = yes
    enable_stage1     = yes
    enable_stage2     = yes
    enable_stage3     = yes
    enable_stage4     = yes
    enable_stage5     = yes
    config_new        = ._cfg????_*
    rm_new            = \._cfg...._
    temp_new          = ._temp-new-cfg_*
    backup_new        = ._new-cfg_*
    restore_new       = ._cfg0000_*
    rm_old            = \._old-cfg_
    temp_old          = ._temp-old-cfg_*
    backup_old        = ._old-cfg_*
    restore_old       = *
    merged            = *.merge
    opt_i = 0
    opt_f = 0
    opt_s = 1
    opt_l = 0
    opt_u = 0
    opt_b = 0
    opt_r = 0
    opt_a = 0
    opt_m = 0
    opt_d = 1
    opt_p = 0
    opt_v = 1
    opt_h = novalue
    opt_t = novalue
    opt_help                 = 0
    opt_test_code            = 0
    opt_ebuild               = 0
    opt_check_hosts          = 0
    opt_mount_hosts          = 0
    opt_unmount_hosts        = 0
    opt_check_packages       = 0
    opt_move_backups         = 0
    opt_disable_portage_hook = 0
    opt_disable_paludis_hook = 0
    opt_optimize_backups     = 0
    mount_count              = 1
    mount_first              = 0
    mount_last               = 0
    mount_point[0]           = ""
</show_debug_info>
<check_hooks>
    Paludis hook is already enabled...
</check_hooks>
<check_tool>
    merge_tool                        = /usr/bin/meld
    merge_tool_name                   = meld
    tool_supports_2way                = yes
    tool_supports_3way                = yes
    tool_saves_mergefile_when_aborted = yes
    tool_needs_gui                    = yes
</check_tool>
<list_dirs>
    <find_protected_dirs>
          portageq config_protect 
Can't exec "portageq": No such file or directory at /usr/bin/cfg-update line 992.
Use of uninitialized value in substitution (s///) at /usr/bin/cfg-update line 993.
Use of uninitialized value in pattern match (m//) at /usr/bin/cfg-update line 995.
        No protected directories found...
    </find_protected_dirs>
    
    These (localhost) directories are protected with CONFIG_PROTECT:
    <find_masked_dirs>
          portageq config_protect_mask 
Can't exec "portageq": No such file or directory at /usr/bin/cfg-update line 1025.
Use of uninitialized value in substitution (s///) at /usr/bin/cfg-update line 1026.
Use of uninitialized value in pattern match (m//) at /usr/bin/cfg-update line 1028.
        No masked directories found...
    </find_masked_dirs>
    
    These (localhost) directories are excluded with CONFIG_PROTECT_MASK:
    
</list_dirs>
Comment 13 Vasiliy Tolstov 2007-12-27 07:18:37 UTC
(In reply to comment #9)
> Vasiliy,
> 
> Portage has by default more protected directories than Paludis.
> So you have installed some packages with Portage, but you didn't update the
> configfiles of those packages. Then you switch to Paludis which has only /etc
> as protected dir.
> 

I'm manual update configs in /etc/conf.d /etc/init.d /etc/X11 . after that i'm running paludis -i world (some files been updated ) 

 * Searching for configuration files requiring action...
 * Found 6 files in /etc
 * Found files in 1 directories
 * Your action is required
sync-disks>  * Syncing disks ...


but cfg-update -l output
vase ~ # cfg-update -l
Searching for updates...
No protected directories found...
No ._cfg0000_* files found...

Comment 14 Vasiliy Tolstov 2007-12-28 06:59:31 UTC
(In reply to comment #13)
> (In reply to comment #9)
> > Vasiliy,
> > 
> > Portage has by default more protected directories than Paludis.
> > So you have installed some packages with Portage, but you didn't update the
> > configfiles of those packages. Then you switch to Paludis which has only /etc
> > as protected dir.
> > 
> 
> I'm manual update configs in /etc/conf.d /etc/init.d /etc/X11 . after that i'm
> running paludis -i world (some files been updated ) 
> 
>  * Searching for configuration files requiring action...
>  * Found 6 files in /etc
>  * Found files in 1 directories
>  * Your action is required
> sync-disks>  * Syncing disks ...
> 
> 
> but cfg-update -l output
> vase ~ # cfg-update -l
> Searching for updates...
> No protected directories found...
> No ._cfg0000_* files found...
> 

After i update cfg-update (edit some lines - default package manager  from Portage to Paludis and log from /var/log/portage.log to /var/log/paluis.log)
all work's fine...
Comment 15 Harald van Dijk (RETIRED) gentoo-dev 2008-03-18 20:22:10 UTC
This can probably be closed now. :)
Comment 16 Vasiliy Tolstov 2008-03-18 20:39:24 UTC
(In reply to comment #15)
> This can probably be closed now. :)
> 

problem is fixed ??
Comment 17 Harald van Dijk (RETIRED) gentoo-dev 2008-03-19 05:36:37 UTC
According to my understanding of your and Stephan's comments, cfg-update did already work with paludis. Your switch from portage to paludis was incomplete, which is a problem that cfg-update can't really be held responsible for, and in comment #14, you said it's working for you now. If you still have problems, yes, this should stay opened, but otherwise, I don't think there's anything that needs to change here.
Comment 18 Vasiliy Tolstov 2008-03-19 05:42:57 UTC
(In reply to comment #17)
> According to my understanding of your and Stephan's comments, cfg-update did
> already work with paludis. Your switch from portage to paludis was incomplete,
> which is a problem that cfg-update can't really be held responsible for, and in
> comment #14, you said it's working for you now. If you still have problems,
> yes, this should stay opened, but otherwise, I don't think there's anything
> that needs to change here.
> 

cfg-update works with paludis only if manualy edit lines in cfg-update contains defaults values!

Comment 19 Samuli Suominen (RETIRED) gentoo-dev 2010-02-15 07:44:36 UTC
(In reply to comment #14)
> After i update cfg-update (edit some lines - default package manager  from
> Portage to Paludis and log from /var/log/portage.log to /var/log/paluis.log)
> all work's fine...

(In reply to comment #15)
> This can probably be closed now. :)

(In reply to comment #17)
> According to my understanding of your and Stephan's comments, cfg-update did
> already work with paludis. Your switch from portage to paludis was incomplete,
> which is a problem that cfg-update can't really be held responsible for, and in
> comment #14, you said it's working for you now. If you still have problems,
> yes, this should stay opened, but otherwise, I don't think there's anything
> that needs to change here.

All of above tells me that cfg-update already has sane defaults, to the official package manager, Portage. 

Closing as INVALID