diff mbox series

[OpenWrt-Devel,v2] build: Unset CDPATH to avoid problems

Message ID 20180820101329.14285-1-hauke.mehrtens@intel.com
State Accepted
Delegated to: Hauke Mehrtens
Headers show
Series [OpenWrt-Devel,v2] build: Unset CDPATH to avoid problems | expand

Commit Message

Hauke Mehrtens Aug. 20, 2018, 10:13 a.m. UTC
From: Thomas Langer <thomas.langer@intel.com>

In some places the output of commands, which include "cd" are used.
In case of CDPATH the new path is printed, which might not be expected.
Disable the variable to avoid these problem.

When CDPATH was set by the user to some value like "export CDPATH=."
the git checkout done by the build system did not work anymore, the
git cloning aborted with such an error message for example:
....
Packing checkout...
tar: /disk/fs1/tmp2/mehrtens/pon-ugw/ugw-haps/openwrt/tmp/dl/ppa-drv-1.0\n@1534240258: Cannot stat: No such file or directory
tar: Date sample file not found
Try 'tar --help' or 'tar --usage' for more information.
.....

To avoid this, this patch makes the build system unset CDPATH inside
the build system, so the build system will still work even when the
user set this variable in his local environment.

Signed-off-by: Thomas Langer <thomas.langer@intel.com>
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

Comments

Hans Dedecker Aug. 20, 2018, 2:16 p.m. UTC | #1
On Mon, Aug 20, 2018 at 12:13 PM Hauke Mehrtens
<hauke.mehrtens@intel.com> wrote:
>
> From: Thomas Langer <thomas.langer@intel.com>
>
> In some places the output of commands, which include "cd" are used.
> In case of CDPATH the new path is printed, which might not be expected.
> Disable the variable to avoid these problem.
>
> When CDPATH was set by the user to some value like "export CDPATH=."
> the git checkout done by the build system did not work anymore, the
> git cloning aborted with such an error message for example:
> ....
> Packing checkout...
> tar: /disk/fs1/tmp2/mehrtens/pon-ugw/ugw-haps/openwrt/tmp/dl/ppa-drv-1.0\n@1534240258: Cannot stat: No such file or directory
> tar: Date sample file not found
> Try 'tar --help' or 'tar --usage' for more information.
> .....
>
> To avoid this, this patch makes the build system unset CDPATH inside
> the build system, so the build system will still work even when the
> user set this variable in his local environment.
>
> Signed-off-by: Thomas Langer <thomas.langer@intel.com>
> Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
> ---
>  Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index e38d44a8..5301883 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -27,6 +27,8 @@ ifneq ($(OPENWRT_BUILD),1)
>    export OPENWRT_BUILD
>    GREP_OPTIONS=
>    export GREP_OPTIONS
> +  CDPATH=
> +  export CDPATH
>    include $(TOPDIR)/include/debug.mk
>    include $(TOPDIR)/include/depends.mk
>    include $(TOPDIR)/include/toplevel.mk
> --
> 2.10.1
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index e38d44a8..5301883 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,8 @@  ifneq ($(OPENWRT_BUILD),1)
   export OPENWRT_BUILD
   GREP_OPTIONS=
   export GREP_OPTIONS
+  CDPATH=
+  export CDPATH
   include $(TOPDIR)/include/debug.mk
   include $(TOPDIR)/include/depends.mk
   include $(TOPDIR)/include/toplevel.mk