mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] ptxdist: Don't assume that we have a bashrc
@ 2012-03-20 19:46 Bernhard Walle
  2012-03-20 22:15 ` Alexander Dahl
  0 siblings, 1 reply; 5+ messages in thread
From: Bernhard Walle @ 2012-03-20 19:46 UTC (permalink / raw)
  To: ptxdist

Usually there is one, but don't print an error if there is no one.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
 bin/ptxdist |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ptxdist b/bin/ptxdist
index 440a7aa..37ab098 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -1656,8 +1656,8 @@ parse_second()
 			if [ ${#} -eq 0 ]; then
 				local bashrc="${PTXDIST_TEMPDIR}/bashrc"
 				cat > "${bashrc}" <<EOF
-. /etc/bash.bashrc
-. ~/.bashrc
+[ -r /etc/bash.bashrc ] && . /etc/bash.bashrc
+[ -r ~/.bashrc ] && . ~/.bashrc
 PS1="[ptx] \${PS1}"
 PATH="${PATH}"
 EOF
-- 
1.7.9.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] ptxdist: Don't assume that we have a bashrc
  2012-03-20 19:46 [ptxdist] [PATCH] ptxdist: Don't assume that we have a bashrc Bernhard Walle
@ 2012-03-20 22:15 ` Alexander Dahl
  2012-03-21  6:17   ` Bernhard Walle
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Dahl @ 2012-03-20 22:15 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 577 bytes --]

Hei hei,

Am 20.03.2012 20:46, schrieb Bernhard Walle:
> Usually there is one, but don't print an error if there is no one.

I'm using zsh, not bash, but still have ~/.bashrc … what does this code
try to do in the first place and how does this affect users of other shells?

Greets
Alex

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] ptxdist: Don't assume that we have a bashrc
  2012-03-20 22:15 ` Alexander Dahl
@ 2012-03-21  6:17   ` Bernhard Walle
  2012-03-21  8:40     ` Alexander Dahl
  0 siblings, 1 reply; 5+ messages in thread
From: Bernhard Walle @ 2012-03-21  6:17 UTC (permalink / raw)
  To: ptxdist

Am 20.03.12 23:15, schrieb Alexander Dahl:
> 
> Am 20.03.2012 20:46, schrieb Bernhard Walle:
>> Usually there is one, but don't print an error if there is no one.
> 
> I'm using zsh, not bash, but still have ~/.bashrc … what does this code
> try to do in the first place and how does this affect users of other shells?

It only avoids two error messages when running "ptxdist bash" when the
files are not present. You can also use bash and have no ~/.bashrc
although that might be seldom.


Regards,
Bernhard

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] ptxdist: Don't assume that we have a bashrc
  2012-03-21  6:17   ` Bernhard Walle
@ 2012-03-21  8:40     ` Alexander Dahl
  2012-03-21  8:43       ` Bernhard Walle
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Dahl @ 2012-03-21  8:40 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 996 bytes --]

Hei hei,

Am 21.03.2012 07:17, schrieb Bernhard Walle:
>> I'm using zsh, not bash, but still have ~/.bashrc … what does this code
>> try to do in the first place and how does this affect users of other shells?
> 
> It only avoids two error messages when running "ptxdist bash" when the
> files are not present. You can also use bash and have no ~/.bashrc
> although that might be seldom.

Okay, then let's rephrase this. From `ptxdist help` I got:

  bash                          enter a ptxdist environment bash shell
  bash <cmd> [args...]          execute <cmd> in ptxdist environment

What is this environment useful for or what advantages has `ptxdist
bash` over my own shell?

Greets
Alex

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] ptxdist: Don't assume that we have a bashrc
  2012-03-21  8:40     ` Alexander Dahl
@ 2012-03-21  8:43       ` Bernhard Walle
  0 siblings, 0 replies; 5+ messages in thread
From: Bernhard Walle @ 2012-03-21  8:43 UTC (permalink / raw)
  To: ptxdist

* Alexander Dahl <post@lespocky.de> [2012-03-21 09:40]:
> Am 21.03.2012 07:17, schrieb Bernhard Walle:
> >> I'm using zsh, not bash, but still have ~/.bashrc … what does this code
> >> try to do in the first place and how does this affect users of other shells?
> > 
> > It only avoids two error messages when running "ptxdist bash" when the
> > files are not present. You can also use bash and have no ~/.bashrc
> > although that might be seldom.
> 
> Okay, then let's rephrase this. From `ptxdist help` I got:
> 
>   bash                          enter a ptxdist environment bash shell
>   bash <cmd> [args...]          execute <cmd> in ptxdist environment
> 
> What is this environment useful for or what advantages has `ptxdist
> bash` over my own shell?

Well, I sometimes use it for debugging. For example you have the
selected toolchain automatically in $PATH.


Regards,
Bernhard

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-21  8:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 19:46 [ptxdist] [PATCH] ptxdist: Don't assume that we have a bashrc Bernhard Walle
2012-03-20 22:15 ` Alexander Dahl
2012-03-21  6:17   ` Bernhard Walle
2012-03-21  8:40     ` Alexander Dahl
2012-03-21  8:43       ` Bernhard Walle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox