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

2022-08-31 Thread Elan Ruusamäe


> On 31. Aug 2022, at 13:21, Jan Rękorajski  wrote:
> 
> On Wed, Aug 31, 2022 at 11:41 AM Arkadiusz Miśkiewicz via pld-devel-en
>  wrote:
>> 
>> On 31.08.2022 11:27, Jan Rękorajski wrote:
>>> 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.
>> 
>> Do you include (via source/dot) this script in some other script?
> 
> No, command line.
> My common workflow is cd $package; hack spec; builder ... (often with
> --short-circuit) and back to hacking.

So the working dir restore is irrelevant. As it’s in builder script, doesn’t 
affect any external shell.
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


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

2022-08-31 Thread Jan Rękorajski
On Wed, Aug 31, 2022 at 11:41 AM Arkadiusz Miśkiewicz via pld-devel-en
 wrote:
>
> On 31.08.2022 11:27, Jan Rękorajski wrote:
> > 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.
>
> Do you include (via source/dot) this script in some other script?

No, command line.
My common workflow is cd $package; hack spec; builder ... (often with
--short-circuit) and back to hacking.

-- 
Jan Rękorajski | SysAdm | PLD/Linux | http://www.pld-linux.org/
bagginspld-linux.org
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


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

2022-08-31 Thread Arkadiusz Miśkiewicz via pld-devel-en

On 31.08.2022 11:27, Jan Rękorajski wrote:

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.


Do you include (via source/dot) this script in some other script?

--
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )

___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


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

2022-08-31 Thread Jan Palus
On 31.08.2022 11:27, Jan Rękorajski wrote:
> 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.

I considered doing `test -d` but since this new old $PWD doesn't affect
any other command I've just dropped it entirely. I will bring it back
with test then.

> On Wed, Aug 31, 2022 at 12:59 AM atler  wrote:
> >
> > commit b1e8c12b2d66e7aadd9bb2c0d1acfc612d50aa22
> > Author: Jan Palus 
> > 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-com...@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/
> bagginspld-linux.org
> ___
> pld-devel-pl mailing list
> pld-devel...@lists.pld-linux.org
> http://lists.pld-linux.org/mailman/listinfo/pld-devel-pl
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


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

2022-08-31 Thread Jan Rękorajski
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  wrote:
>
> commit b1e8c12b2d66e7aadd9bb2c0d1acfc612d50aa22
> Author: Jan Palus 
> 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-com...@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/
bagginspld-linux.org
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en