Le 25/08/15 16:48, Eric Noulard a écrit :
I would suggest checking (in CPackDeb generator code) whether if CPack
has been called in a fakerootED environment. This can be done by
checking whether if "FAKEROOTKEY" env var is defined or not.
If fakeroot is already in action then one should not call fakeroot again
(whatever the fakerootED user is).

Hmmm, unfortunately it does not work. This variable does not exist on the fakerooted shell. I think there is no "good" way to detect that we are in a fakerooted environment because their purpose is to mimic the commands as if the real root user is entering them (and introspection should not be possible by design).

I see two technical solutions:
- either using the system tar: this would not work in the case of cross compilation (and in some circumstances only) but would work in the other case. I believe that all the debian packaging tools are just using the system provided tar, so this should closely mimic the debian-packaging machinery better,
- or using a CPACK variable to avoid having fakeroot executed

I see several workarounds/hacks:
- executing with fakeroot in cpack first and in case of failure falling back to run tar without fakeroot
- detect if the current user is root already

Raffi

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to