[packages/rpm-build-tools] builder: don't bother going back to original $(pwd) at the end of script

Jan Rękorajski j.rekorajski at gmail.com
Wed Aug 31 11:27:46 CEST 2022


Where will it land now? If you want to protect against landing in
non-existing directory you can use '[ -d "$__PWD" ] && cd "$__PWD"'
I really prefer to be staying in the same directory where I launched
the script in.

On Wed, Aug 31, 2022 at 12:59 AM atler <atler at pld-linux.org> wrote:
>
> commit b1e8c12b2d66e7aadd9bb2c0d1acfc612d50aa22
> Author: Jan Palus <atler at pld-linux.org>
> Date:   Wed Aug 31 00:55:46 2022 +0200
>
>     builder: don't bother going back to original $(pwd) at the end of script
>
>     no real use for it as far as I can tell and ditching it avoids error if
>     original working directory does not exist anymore (because ie it
>     happened to be $RPM_BUILD_ROOT)
>
>  builder.sh | 1 -
>  1 file changed, 1 deletion(-)
> ---
> diff --git a/builder.sh b/builder.sh
> index 058d0de..68bb875 100755
> --- a/builder.sh
> +++ b/builder.sh
> @@ -2756,6 +2756,5 @@ esac
>  if [ -f "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES" -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
>         rm "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES"
>  fi
> -cd "$__PWD"
>
>  # vi:syntax=sh:ts=4:sw=4:noet
> ================================================================
>
> ---- gitweb:
>
> http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/b1e8c12b2d66e7aadd9bb2c0d1acfc612d50aa22
>
> _______________________________________________
> pld-cvs-commit mailing list
> pld-cvs-commit at lists.pld-linux.org
> http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit



-- 
Jan Rękorajski | SysAdm | PLD/Linux | http://www.pld-linux.org/
baggins<at>pld-linux.org


More information about the pld-devel-pl mailing list