From: <abe...@us...> - 2017-03-15 22:40:20
|
Revision: 8213 http://sourceforge.net/p/astlinux/code/8213 Author: abelbeck Date: 2017-03-15 22:40:18 +0000 (Wed, 15 Mar 2017) Log Message: ----------- bash, add support for the loadable builtin 'sleep'. This is useful for scripts that contain a wait loop, ex. -- while test_something; do do_something sleep 1 done -- since by default sleep is not a builtin to bash, a new /bin/sleep process is called every second. We can now call -- enable -f /usr/lib/bash/sleep sleep -- whenever this is important, for example with AIF plugin helper scripts. Modified Paths: -------------- branches/1.0/package/bash/bash.mk Modified: branches/1.0/package/bash/bash.mk =================================================================== --- branches/1.0/package/bash/bash.mk 2017-03-13 15:47:36 UTC (rev 8212) +++ branches/1.0/package/bash/bash.mk 2017-03-15 22:40:18 UTC (rev 8213) @@ -18,6 +18,11 @@ BASH_DEPENDENCIES += busybox endif +define BASH_LOADABLE_BUILTINS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/examples/loadables sleep +endef +BASH_POST_BUILD_HOOKS = BASH_LOADABLE_BUILTINS + ifeq ($(BR2_PACKAGE_BASH_DEFAULT_SHELL),y) define BASH_DEFAULT_SHELL if [ -e $(TARGET_DIR)/bin/sh ]; then \ @@ -42,6 +47,7 @@ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \ DESTDIR=$(TARGET_DIR) exec_prefix=/ install rm -f $(TARGET_DIR)/bin/bashbug + $(INSTALL) -D -m 0755 $(@D)/examples/loadables/sleep $(TARGET_DIR)/usr/lib/bash/sleep $(BASH_DEFAULT_SHELL) $(BASH_RESTRICTED_SHELL) endef @@ -53,6 +59,7 @@ if [ -e $(TARGET_DIR)/bin/sh.prebash ]; then \ mv -f $(TARGET_DIR)/bin/sh.prebash $(TARGET_DIR)/bin/sh; \ fi + rm -rf $(TARGET_DIR)/usr/lib/bash endef $(eval $(call AUTOTARGETS,package,bash)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |