RE: barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns |true| even if there is no "blablablub" partition on "var" volume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






> -----Original Message-----
> From: Sascha Hauer [mailto:s.hauer@xxxxxxxxxxxxxx]
> Sent: Monday, September 2, 2019 2:08 PM
> To: Mainz, Roland <R.Mainz@xxxxxxxxxxxx>
> Cc: customers.eckelmann@xxxxxxxxxxxxxx; barebox@xxxxxxxxxxxxxxxxxxx;
> Arne Wichmann (arne.wichmann@xxxxxxxxxxxxxxx)
> <arne.wichmann@xxxxxxxxxxxxxxx>; Uwe Kleine-König <u.kleine-
> koenig@xxxxxxxxxxxxxx>
> Subject: Re: barebox bug, sh [ -c /dev/nand0.var.ubi.blablablub ] returns
> |true| even if there is no "blablablub" partition on "var" volume
> 
> Hi Roland,
> 
> On Mon, Sep 02, 2019 at 09:40:26AM +0000, Mainz, Roland wrote:
> >
> > Hi!
> >
> > ----
> >
> > Quick&dirty bug report:
> >
> > - Version: barebox 2018.05.0-20190221-1-EAG_3.00-gf70df96 #1 Mon Sep
> 2
> > 09:03:05 CEST 2019
> > - Hardware: Eckelmann/EAG Quantron
> >
> > barebox:/ ls -l /dev/nand0.var.ubi.blablablub
> > ls: /dev/nand0.var.ubi.blablablub: No such file or directory
> > barebox:/ ls -l /dev/nand0.var.ubi.blablablub
> > ls: /dev/nand0.var.ubi.blablablub: No such file or directory barebox:/
> > if [ -c /dev/nand0.var.ubi.blablablub ] ; then echo wrong ; else echo
> > "right" ; fi wrong barebox:/ if [ -f /dev/nand0.var.ubi.blablablub ] ;
> > then echo wrong ; else echo "right" ; fi right
> 
> barebox doesn't implement -c for test. You'll have to use -e or -f to test for
> existence.
> Arguably we should throw an error for this unsupported option rather than
> doing something undefined.

Could you *please* implement test(1) -b/-c ? Since barebox ls(1) is able to distinguish files from devices it shouldn't be hard, and there are cases (like our update script) where telling the difference between file and device is important (the alternative is to write hideous workarounds...).

----

Mfg,
Roland Mainz 
-- 
Roland Mainz, MAA/CAS
Eckelmann AG, Berliner Str. 161, 65205 Wiesbaden
Telefon +49/611/7103-661, Fax +49/611/7103-133
r.mainz@xxxxxxxxxxxx

Eckelmann Group - Source of inspiration

> 
> Sascha
> 
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux