package/pseudo: fix build and better mimic fakeroot
v2 cover package/pseudo: fix build and better mimic fakeroot
Hello All!
When we switched from using fakeroot to using pseudo, a lot of assumptions were made, in that we assumed pseudo was by default behaving as fakeroot did.
That is wrong. pseudo is a little bit more versatile than fakeroot is, so using it is a little bit more involved.
First, its buildsystem is a bit convoluted, and can incorrectly guess the host charateristics, like bitness.
Second, it needs to be told at runtime where to look at, and put its own stuff. It correctly gueses, but prints a warning that it had to gues, and the location to store its DB is not optimum (even if not incorrect).
So, this series ensures that pseudo is correctly built and that we correctly specify the runtime configuration.
Regards,
Yann E. MORIN.
The following changes since commit 64904f0f6d691cfea5ae1c8f58e2d61aac0684c2
mpv: fix build on powerpc64 w/ altivec (2016-11-08 09:37:17 +0100)
are available in the git repository at:
git://git.buildroot.org/~ymorin/git/buildroot.git
for you to fetch changes up to 29ffadca0013de2c9d9c7e749f13cb6e0361a9f0
package/pseudo: provide better legacy handling for fakeroot (2016-11-08 23:17:51 +0100)
----------------------------------------------------------------
Yann E. MORIN (5):
package/pseudo: enforce the host bitness package/pseudo: force rpath and pass our host CFLAGS package/pseudo: wrap the real pseudo with a wrapper
fs: call the pseudo wrapper
package/pseudo: provide better legacy handling for fakeroot
fs/common.mk | 2 +- package/pseudo/pseudo-wrapper | 19 +++++++++++++++++++ package/pseudo/pseudo.mk | 14 +++++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 package/pseudo/pseudo-wrapper
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/5 package/pseudo: enforce the host bitness
pseudo can detect the host bitness, but is not sure about it: it checks what type of file /bin/sh is, using file(1).
However, in some conditions, /bin/sh can be of a different bitness than the rest of the system (weird, but not impossible), which causes build issues.
Just enforce the bitness, so that pseudo needs not (wrongly) guess it.
---
Changes v1 -> v2:
- directly extract bitness for $(HOSTARCH) (Arnout)
--- package/pseudo/pseudo.mk | 1 + 1 file changed, 1 insertion(+)
package/pseudo/pseudo.mk +1 -0
@@ -17,6 +17,7 @@ HOST_PSEUDO_DEPENDENCIES = host-attr host-sqlite # configure script is not generated by autoconf, so passing --libdir # is necessary, even if the infrastructure passes --prefix already. HOST_PSEUDO_CONF_OPTS = \ + --bits=$(if $(filter %64,$(HOSTARCH)),64,32) \ --libdir=$(HOST_DIR)/usr/lib \ --with-sqlite=$(HOST_DIR)/usr
Signature · 1 line
2.7.4
PATCH 1/5 package/pseudo: enforce the host bitness
Quoted 7 lines · Yann E. MORIN
pseudo can detect the host bitness, but is not sure about it: it checks what type of file
/bin/shis, using file(1).However, in some conditions,
/bin/shcan be of a different bitness than the rest of the system (weird, but not impossible), which causes build issues.
Quoted 8 lines
Just enforce the bitness, so that pseudo needs not (wrongly) guess it.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Ga?l PORTAY <[email protected]>Cc Patrick Keroulas <[email protected]>Cc Erico Nunes <[email protected]>Cc Julien BOIBESSOT <[email protected]>Cc Arnout Vandecappelle <[email protected]>
Regards,
Arnout
Quoted 21 lines
---
Changes v1 -> v2:
- directly extract bitness for $(HOSTARCH) (Arnout)--- package/pseudo/pseudo.mk | 1 + 1 file changed, 1 insertion(+)package/pseudo/pseudo.mk +1
-0@@ -17,6 +17,7 @@ HOST_PSEUDO_DEPENDENCIES = host-attr host-sqlite # configure script is not generated by autoconf, so passing --libdir # is necessary, even if the infrastructure passes --prefix already. HOST_PSEUDO_CONF_OPTS = \ + --bits=$(if $(filter %64,$(HOSTARCH)),64,32) \ --libdir=$(HOST_DIR)/usr/lib \ --with-sqlite=$(HOST_DIR)/usr
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
Thomas Petazzoni
AppliedPATCH 1/5 package/pseudo: enforce the host bitness
In reply to Yann E. MORINHello,
Quoted 16 lines · Yann E. MORIN
pseudo can detect the host bitness, but is not sure about it: it checks what type of file
/bin/shis, using file(1).However, in some conditions,
/bin/shcan be of a different bitness than the rest of the system (weird, but not impossible), which causes build issues.Just enforce the bitness, so that pseudo needs not (wrongly) guess it.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Ga?l PORTAY <[email protected]>Cc Patrick Keroulas <[email protected]>Cc Erico Nunes <[email protected]>Cc Julien BOIBESSOT <[email protected]>Cc Arnout Vandecappelle <[email protected]>
Quoted 6 lines
---
Changes v1 -> v2:
- directly extract bitness for $(HOSTARCH) (Arnout)--- package/pseudo/pseudo.mk | 1 + 1 file changed, 1 insertion(+)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 2/5 package/pseudo: force rpath and pass our host CFLAGS
In reply to Yann E. MORINpseudo whines when those are not set, and tries to find a suitable value; this is usually correct but risk an incorrect guess in corner cases.
Rather than leaving those in guess-mode, just force them to values we know are correct.
--- package/pseudo/pseudo.mk | 5 +++++ 1 file changed, 5 insertions(+)
package/pseudo/pseudo.mk +5 -0
@@ -16,7 +16,12 @@ HOST_PSEUDO_DEPENDENCIES = host-attr host-sqlite # configure script is not generated by autoconf, so passing --libdir # is necessary, even if the infrastructure passes --prefix already. +# It also does not use CFLAGS from the environment, they need to be +# specified with a custom --cflags option. Also force rpath to avoid +# a warning at configure time. HOST_PSEUDO_CONF_OPTS = \ + --cflags='$(HOSTCFLAGS)' \ + --with-rpath=$(HOST_DIR)/usr/lib \ --bits=$(if $(filter %64,$(HOSTARCH)),64,32) \ --libdir=$(HOST_DIR)/usr/lib \ --with-sqlite=$(HOST_DIR)/usr
Signature · 1 line
2.7.4
Thomas Petazzoni
AppliedPATCH 2/5 package/pseudo: force rpath and pass our host CFLAGS
Hello,
Quoted 14 lines · Yann E. MORIN
pseudo whines when those are not set, and tries to find a suitable value; this is usually correct but risk an incorrect guess in corner cases.
Rather than leaving those in guess-mode, just force them to values we know are correct.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Ga?l PORTAY <[email protected]>Cc Patrick Keroulas <[email protected]>Cc Erico Nunes <[email protected]>Cc Julien BOIBESSOT <[email protected]>Cc Arnout Vandecappelle <[email protected]>Reviewed-by Arnout Vandecappelle <[email protected]>
Quoted 3 lines
--- package/pseudo/pseudo.mk | 5 +++++ 1 file changed, 5 insertions(+)
Applied to master, after changing the single quotes to double quotes, since that's what we use pretty much everywhere in BR.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 3/5 package/pseudo: wrap the real pseudo with a wrapper
In reply to Yann E. MORINRunning pseudo is more involved than running fakeroot. In the transition from using fakeroot, we just did not account for the extra requirements.
First, we explicitly tell pseudo where it is, otherwise it tries to guess. Its guess is correct, but it prints a warning, which is not nice.
Second, we tell it where to find the passwd and group files in case it has to emulate access to them. We currently do not use that feature, but better safe than sorry.
Third, pseudo spawns a background daemon, and talks to it (when fakeroot would emulate the state all in the current process' state, pseudo uses the daemon to coordinate the state across multiple processes). We are not much interested in the daemon lingering around, so we just tell it to terminate as soon as the last clients quits (this can take up to one second).
Fourth and last, pseudo always stores its internal database when exiting, and reloads it when spawned. The database is by default stored in a sub-directory of the prefix it was installed in, but this is impractical for us. We want the database to be specific to the one config dir we are building, so we store the database in a (hidden) sub-dir of the build dir, thus ensuring it is never shared with another build. That directory is hidden (starts with a dot) because we consider that to be our internal state that we do not want to expose to the user.
The wrapper has to be relocatable, so we avoid using hard-coded paths in there: we derive those paths fom the runtime path of pseudo. However, the build directory $(BUILD_DIR) is not available in the environment (we do not export it because it conflicts with some buildsystems). Instead, we use $(BASE_DIR) which is exported.
Finally, when relocated, the wrapper would not be used in the Buildroot environment, so may not have access to TARGET_DIR or BASE_DIR, unless the user sets them. If he does not, we still want the wrapper to be working (to avoid the warning about the prefix, and to exit the daemon asap); thus we leave the passwd and localstatedir variable alone if we don't have what it needs to set them, rather than set them to incorrect values.
---
Changes v1 -> v2:
- do not use a variable, but use a wrapper
--- package/pseudo/pseudo-wrapper | 12 ++++++++++++ package/pseudo/pseudo.mk | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 package/pseudo/pseudo-wrapper
package/pseudo/pseudo-wrapper new file +12 -0
@@ -0,0 +1,12 @@ +#!/bin/sh + +export PSEUDO_PREFIX="$(dirname "${0%/*}")" +export PSEUDO_OPTS="-t0" +if [ -n "${TARGET_DIR}" ]; then + export PSEUDO_PASSWD="${TARGET_DIR}" +fi +if [ -n "${BASE_DIR}" ]; then + export PSEUDO_LOCALSTATEDIR="${BASE_DIR}/build/.pseudodb" +fi + +exec "${0%-wrapper}" "${@}"
package/pseudo/pseudo.mk +6 -0
@@ -26,6 +26,12 @@ HOST_PSEUDO_CONF_OPTS = \ --libdir=$(HOST_DIR)/usr/lib \ --with-sqlite=$(HOST_DIR)/usr +define HOST_PSEUDO_INSTALL_WRAPPER + $(INSTALL) -D -m 0755 $(HOST_PSEUDO_PKGDIR)/pseudo-wrapper \ + $(HOST_DIR)/usr/bin/pseudo-wrapper +endef +HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_INSTALL_WRAPPER + define HOST_PSEUDO_FAKEROOT_SYMLINK ln -sf pseudo $(HOST_DIR)/usr/bin/fakeroot endef
Signature · 1 line
2.7.4
PATCH 3/5 package/pseudo: wrap the real pseudo with a wrapper
Quoted 26 lines · Yann E. MORIN
Running pseudo is more involved than running fakeroot. In the transition from using fakeroot, we just did not account for the extra requirements.
First, we explicitly tell pseudo where it is, otherwise it tries to guess. Its guess is correct, but it prints a warning, which is not nice.
Second, we tell it where to find the passwd and group files in case it has to emulate access to them. We currently do not use that feature, but better safe than sorry.
Third, pseudo spawns a background daemon, and talks to it (when fakeroot would emulate the state all in the current process' state, pseudo uses the daemon to coordinate the state across multiple processes). We are not much interested in the daemon lingering around, so we just tell it to terminate as soon as the last clients quits (this can take up to one second).
Fourth and last, pseudo always stores its internal database when exiting, and reloads it when spawned. The database is by default stored in a sub-directory of the prefix it was installed in, but this is impractical for us. We want the database to be specific to the one config dir we are building, so we store the database in a (hidden) sub-dir of the build dir, thus ensuring it is never shared with another build. That directory is hidden (starts with a dot) because we consider that to be our internal state that we do not want to expose to the user.
Quoted 2 lines
The wrapper has to be relocatable, so we avoid using hard-coded paths in there: we derive those paths fom the runtime path of pseudo. However,
^^^ Gah, I missed one :-P
Quoted 12 lines
the build directory $(BUILD_DIR) is not available in the environment (we do not export it because it conflicts with some buildsystems). Instead, we use $(BASE_DIR) which is exported.
Finally, when relocated, the wrapper would not be used in the Buildroot environment, so may not have access to
TARGET_DIRorBASE_DIR, unless the user sets them. If he does not, we still want the wrapper to be working (to avoid the warning about the prefix, and to exit the daemon asap); thus we leave the passwd and localstatedir variable alone if we don't have what it needs to set them, rather than set them to incorrect values.
Quoted 6 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Ga?l PORTAY <[email protected]>Cc Patrick Keroulas <[email protected]>Cc Erico Nunes <[email protected]>Cc Julien BOIBESSOT <[email protected]>Cc Arnout Vandecappelle <[email protected]>
Regards,
Arnout
Quoted 46 lines
---
Changes v1 -> v2:
- do not use a variable, but use a wrapper--- package/pseudo/pseudo-wrapper | 12 ++++++++++++ package/pseudo/pseudo.mk | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 package/pseudo/pseudo-wrapperpackage/pseudo/pseudo-wrapper new file +12
-0@@ -0,0 +1,12 @@ +#!/bin/sh + +export PSEUDO_PREFIX="$(dirname "${0%/*}")" +export PSEUDO_OPTS="-t0" +if [ -n "${TARGET_DIR}" ]; then + export PSEUDO_PASSWD="${TARGET_DIR}" +fi +if [ -n "${BASE_DIR}" ]; then + export PSEUDO_LOCALSTATEDIR="${BASE_DIR}/build/.pseudodb" +fi + +exec "${0%-wrapper}" "${@}"package/pseudo/pseudo.mk +6
-0@@ -26,6 +26,12 @@ HOST_PSEUDO_CONF_OPTS = \ --libdir=$(HOST_DIR)/usr/lib \ --with-sqlite=$(HOST_DIR)/usr +define HOST_PSEUDO_INSTALL_WRAPPER + $(INSTALL) -D -m 0755 $(HOST_PSEUDO_PKGDIR)/pseudo-wrapper \ + $(HOST_DIR)/usr/bin/pseudo-wrapper +endef +HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_INSTALL_WRAPPER + define HOST_PSEUDO_FAKEROOT_SYMLINK ln -sf pseudo $(HOST_DIR)/usr/bin/fakeroot endef
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 3/5 package/pseudo: wrap the real pseudo with a wrapper
In reply to Yann E. MORINHello,
Quoted 47 lines · Yann E. MORIN
Running pseudo is more involved than running fakeroot. In the transition from using fakeroot, we just did not account for the extra requirements.
First, we explicitly tell pseudo where it is, otherwise it tries to guess. Its guess is correct, but it prints a warning, which is not nice.
Second, we tell it where to find the passwd and group files in case it has to emulate access to them. We currently do not use that feature, but better safe than sorry.
Third, pseudo spawns a background daemon, and talks to it (when fakeroot would emulate the state all in the current process' state, pseudo uses the daemon to coordinate the state across multiple processes). We are not much interested in the daemon lingering around, so we just tell it to terminate as soon as the last clients quits (this can take up to one second).
Fourth and last, pseudo always stores its internal database when exiting, and reloads it when spawned. The database is by default stored in a sub-directory of the prefix it was installed in, but this is impractical for us. We want the database to be specific to the one config dir we are building, so we store the database in a (hidden) sub-dir of the build dir, thus ensuring it is never shared with another build. That directory is hidden (starts with a dot) because we consider that to be our internal state that we do not want to expose to the user.
The wrapper has to be relocatable, so we avoid using hard-coded paths in there: we derive those paths fom the runtime path of pseudo. However, the build directory $(BUILD_DIR) is not available in the environment (we do not export it because it conflicts with some buildsystems). Instead, we use $(BASE_DIR) which is exported.
Finally, when relocated, the wrapper would not be used in the Buildroot environment, so may not have access to
TARGET_DIRorBASE_DIR, unless the user sets them. If he does not, we still want the wrapper to be working (to avoid the warning about the prefix, and to exit the daemon asap); thus we leave the passwd and localstatedir variable alone if we don't have what it needs to set them, rather than set them to incorrect values.Signed-off-by "Yann E. MORIN" <[email protected]>Cc Ga?l PORTAY <[email protected]>Cc Patrick Keroulas <[email protected]>Cc Erico Nunes <[email protected]>Cc Julien BOIBESSOT <[email protected]>Cc Arnout Vandecappelle <[email protected]>
Quoted 8 lines
---
Changes v1 -> v2:
- do not use a variable, but use a wrapper--- package/pseudo/pseudo-wrapper | 12 ++++++++++++ package/pseudo/pseudo.mk | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 package/pseudo/pseudo-wrapper
Patches to 3 to 5 applied to master. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 4/5 fs: call the pseudo wrapper
In reply to Yann E. MORIN--- fs/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/common.mk +1 -1
@@ -97,7 +97,7 @@ endif echo $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep)) $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT) chmod a+x $$(FAKEROOT_SCRIPT) - PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/pseudo -- $$(FAKEROOT_SCRIPT) + PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/pseudo-wrapper -- $$(FAKEROOT_SCRIPT) $$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $$(TARGET_DIR_WARNING_FILE) - at rm -f $$(FAKEROOT_SCRIPT) $$(FULL_DEVICE_TABLE) ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),)
Signature · 1 line
2.7.4
PATCH 4/5 fs: call the pseudo wrapper
Quoted 6 lines · Yann E. MORIN
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Ga?l PORTAY <[email protected]>Cc Patrick Keroulas <[email protected]>Cc Erico Nunes <[email protected]>Cc Julien BOIBESSOT <[email protected]>Cc Arnout Vandecappelle <[email protected]>
Regards,
Arnout
Quoted 18 lines
--- fs/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/common.mk +1
-1@@ -97,7 +97,7 @@ endif echo $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep)) $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT) chmod a+x $$(FAKEROOT_SCRIPT) - PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/pseudo -- $$(FAKEROOT_SCRIPT) + PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/pseudo-wrapper -- $$(FAKEROOT_SCRIPT) $$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $$(TARGET_DIR_WARNING_FILE) - at rm -f $$(FAKEROOT_SCRIPT) $$(FULL_DEVICE_TABLE) ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),)
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v2 5/5 package/pseudo: provide better legacy handling for fakeroot
In reply to Yann E. MORINWe now have a wrapper that makes pseudo behaves like the fakeroot of the good ol' days. So the symlink will just magically keep old scripts working as they did before the switch to pseudo.
However, using fakeroot is deprecated, and we want people to stop using it altogether and switch to pseudo.
So, make the wrapper recognise how it's called, and if called as fakeroot, print a warning message.
--- package/pseudo/pseudo-wrapper | 9 ++++++++- package/pseudo/pseudo.mk | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-)
package/pseudo/pseudo-wrapper +8 -1
@@ -1,5 +1,12 @@ #!/bin/sh +if [ "${0##*/}" = "fakeroot" ]; then + cat >&2 <<-_EOF_ + WARNING: fakeroot has been replaced with pseudo. + WARNING: Update your script(s) to use pseudo or pseudo-wrapper instead. + _EOF_ +fi + export PSEUDO_PREFIX="$(dirname "${0%/*}")" export PSEUDO_OPTS="-t0" if [ -n "${TARGET_DIR}" ]; then
@@ -9,4 +16,4 @@ if [ -n "${BASE_DIR}" ]; then export PSEUDO_LOCALSTATEDIR="${BASE_DIR}/build/.pseudodb" fi -exec "${0%-wrapper}" "${@}" +exec "${0%/*}/pseudo" "${@}"
package/pseudo/pseudo.mk +1 -1
@@ -33,7 +33,7 @@ endef HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_INSTALL_WRAPPER define HOST_PSEUDO_FAKEROOT_SYMLINK - ln -sf pseudo $(HOST_DIR)/usr/bin/fakeroot + ln -sf pseudo-wrapper $(HOST_DIR)/usr/bin/fakeroot endef HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_FAKEROOT_SYMLINK
Signature · 1 line
2.7.4
PATCH 5/5 package/pseudo: provide better legacy handling for fakeroot
Quoted 39 lines · Yann E. MORIN
We now have a wrapper that makes pseudo behaves like the fakeroot of the good ol' days. So the symlink will just magically keep old scripts working as they did before the switch to pseudo.
However, using fakeroot is deprecated, and we want people to stop using it altogether and switch to pseudo.
So, make the wrapper recognise how it's called, and if called as fakeroot, print a warning message.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Ga?l PORTAY <[email protected]>Cc Patrick Keroulas <[email protected]>Cc Erico Nunes <[email protected]>Cc Julien BOIBESSOT <[email protected]>Cc Arnout Vandecappelle <[email protected]>--- package/pseudo/pseudo-wrapper | 9 ++++++++- package/pseudo/pseudo.mk | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-)package/pseudo/pseudo-wrapper +7
-0@@ -1,5 +1,12 @@ #!/bin/sh +if [ "${0##*/}" = "fakeroot" ]; then + cat >&2 <<-_EOF_ + WARNING: fakeroot has been replaced with pseudo. + WARNING: Update your script(s) to use pseudo or pseudo-wrapper instead. + _EOF_ +fi + export PSEUDO_PREFIX="$(dirname "${0%/*}")" export PSEUDO_OPTS="-t0" if [ -n "${TARGET_DIR}" ]; then
package/pseudo/pseudo-wrapper if [ -n "${BASE_DIR}" ]; then · line 19
Quoted 5 lines
package/pseudo/pseudo-wrapper +1
-1@@ -9,4 +16,4 @@ if [ -n "${BASE_DIR}" ]; then export PSEUDO_LOCALSTATEDIR="${BASE_DIR}/build/.pseudodb" fi -exec "${0%-wrapper}" "${@}" +exec "${0%/*}/pseudo" "${@}"
This hunk should have been squashed into patch 3. But who cares.
Regards,
Arnout
Quoted 14 lines
package/pseudo/pseudo.mk +1
-1@@ -33,7 +33,7 @@ endef HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_INSTALL_WRAPPER define HOST_PSEUDO_FAKEROOT_SYMLINK - ln -sf pseudo $(HOST_DIR)/usr/bin/fakeroot + ln -sf pseudo-wrapper $(HOST_DIR)/usr/bin/fakeroot endef HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_FAKEROOT_SYMLINK
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v2 5/5 package/pseudo: provide better legacy handling for fakeroot
Arnout, All,
On 2016-11-09 01:29 +0100, Arnout Vandecappelle spake thusly:
Quoted 43 lines · Yann E. MORIN
Quoted 42 lines
We now have a wrapper that makes pseudo behaves like the fakeroot of the good ol' days. So the symlink will just magically keep old scripts working as they did before the switch to pseudo.
However, using fakeroot is deprecated, and we want people to stop using it altogether and switch to pseudo.
So, make the wrapper recognise how it's called, and if called as fakeroot, print a warning message.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Ga?l PORTAY <[email protected]>Cc Patrick Keroulas <[email protected]>Cc Erico Nunes <[email protected]>Cc Julien BOIBESSOT <[email protected]>Cc Arnout Vandecappelle <[email protected]>--- package/pseudo/pseudo-wrapper | 9 ++++++++- package/pseudo/pseudo.mk | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-)package/pseudo/pseudo-wrapper +7
-0@@ -1,5 +1,12 @@ #!/bin/sh +if [ "${0##*/}" = "fakeroot" ]; then + cat >&2 <<-_EOF_ + WARNING: fakeroot has been replaced with pseudo. + WARNING: Update your script(s) to use pseudo or pseudo-wrapper instead. + _EOF_ +fi + export PSEUDO_PREFIX="$(dirname "${0%/*}")" export PSEUDO_OPTS="-t0" if [ -n "${TARGET_DIR}" ]; then@@ -9,4 +16,4 @@ if [ -n "${BASE_DIR}" ]; then export PSEUDO_LOCALSTATEDIR="${BASE_DIR}/build/.pseudodb" fi
Quoted 4 lines
package/pseudo/pseudo-wrapper if [ -n "${BASE_DIR}" ]; then · line 19
Quoted 2 lines
package/pseudo/pseudo-wrapper +1
-1-exec "${0%-wrapper}" "${@}" +exec "${0%/*}/pseudo" "${@}"This hunk should have been squashed into patch 3. But who cares.
I disagree, because until this very patch, there is no reason to replace the filebname. Patch 3 expects the wrapper to be called 'pseudo-wrapper' so it really only needs -wrapper to be stripped. Only with this patch 5 do we introduce the fakeroot wrapper, so only now do we need to remove the full filename.
Technically, this does not change at all, agreed. Semantically, it is as I explained above. ;-)
Regards,
Yann E. MORIN.
Quoted 27 lines
Regards,
ArnoutQuoted 14 lines
package/pseudo/pseudo.mk +1
-1@@ -33,7 +33,7 @@ endef HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_INSTALL_WRAPPER define HOST_PSEUDO_FAKEROOT_SYMLINK - ln -sf pseudo $(HOST_DIR)/usr/bin/fakeroot + ln -sf pseudo-wrapper $(HOST_DIR)/usr/bin/fakeroot endef HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_FAKEROOT_SYMLINKSignature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'