Hi everyone,
I'm just writing a test for a script which uses dpkg --add-architecture. For 
running the test, i dont want to use root priviledges since i dont want to 
potentially ruin my host system.

 I discovered that there is a --root parameter for this, which enables me to do 
this in a different directory than /. Running dpkg --root=<my test directory> 
--add-architecture runs also without root and adds a entry in <my test 
directory>/var/lib/dpkg/arch as expected.

But now  the problem. Since --root does not shift the configuration directory 
from /etc/dpkg to <my test directory>/etc/dpkg always my host dpkg 
configuration is used. But since my host dpkg configuration contains hooks 
which are run after --add-architecture which require root I see always errors 
while running dpkg --root as a non-root user. Further I did not find a 
possibility (which does not require root) to disable the running of the hooks 
(like a command line parameter to dpkg) or switching the configuration 
directory.

I thought about following solutions of this problem:

 1.
 Make --root also change configuration directory to <rootdir>/etc/dpkg.
    *
PRO: Makes dpkg --root easier to use, make it as non-root independent of the 
host dpkg configuration
    *
CON: Changes the semantics of --root, might break scripts
 2.
Add a --configdir Option to switch configdir to <rootdir>/etc/dpkg.
    *
PRO: does not change existing options
    *
CON: {inst, admin}dir are switched with --root but not --configdir
 3.
Combine 1 & 2: Make --root also change configuration directory to 
<rootdir>/etc/dpkg, and add a --configdir Option to switch configdir 
to<rootdir>/etc/dpkg
    *
PRO: {inst, admin,config}dir are switched with --root which would be more 
consistent and --configdir matches the pattern of the {inst, admin}dir
    *
CON: Changes the semantics of --root, might break scripts
 4.
Add an option to skip the hooks
    *
PRO: Should break nothing since its added on top, should be simple to implement
    *
CON: Solves the problem only half since the rest of the host dpkg configuration 
is still used

What do you think about this problem? Or have i just missed something and its 
already possible with a command line parameter i didn't found. Would be also ok 
for me đŸ˜‰.

Since i got experience in C i can help/do the proposed implementations.

Greetings,
André
[https://www.richard-wolf.com/mam/data/Typo3/banner/Masterclass-Mainz-25-e-mail-banner-468x73px.jpg]<https://www.richard-wolf.com/de/academy-prima-vista/masterclass-workshops/masterclass-workshop-minimally-invasive-upper-gi-surgery-2><https://www.richard-wolf.com/en/company/congresses/congress-detail/arab-health-2025>

Richard Wolf GmbH, Pforzheimer Strasse 32, 75438 Knittlingen
Managing Directors: Juergen Pfab, Juergen Steinbeck. Trade Register: Mannheim 
HRB 510031

Richard Wolf GmbH routinely monitors the content of e-mail sent and received 
via its network for the purposes of ensuring compliance with its policies and 
procedures. Richard Wolf GmbH is not responsible for any changes made to the 
message after it has been sent. Where opinions are expressed, they are not 
necessarily those of Richard Wolf GmbH. This e-mail and any files transmitted 
with it are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you are not the intended addressee, or 
the person responsible for delivering it to them, you may not copy, forward, 
disclose, or otherwise use it or any part of it in any way. To do so may be 
unlawful. If you receive this e-mail by mistake, please advise the sender 
immediately.

Data Protection Policy<https://www.richard-wolf.com/en/data-protection-policy>  
|  Legal Information<https://www.richard-wolf.com/en/legal-information/>  |  
Terms & Conditions<https://www.richard-wolf.com/en/terms-conditions/>

Reply via email to