On Wed, Jun 23, 2021 at 8:49 AM Nishanth Menon <n...@ti.com> wrote: > > On 19:14-20210622, Priya N S wrote: > > From: Priya N S <priya...@ti.com> > > > > From: Priya N S <priya...@ti.com> > > > > * Validate user input of rootfs tarball selection. > > * This will not allow the user to proceed with wrong rootfs > > tarball selection. > > > > Signed-off-by: Priya N S <priya...@ti.com> > > Signed-off-by: Sekhar Nori <nsek...@ti.com> > > --- > > create-sdcard.sh | 16 +++++++++++++--- > > 1 file changed, 13 insertions(+), 3 deletions(-) > > > > diff --git a/create-sdcard.sh b/create-sdcard.sh > > index 264095a..8f99687 100644 > > --- a/create-sdcard.sh > > +++ b/create-sdcard.sh > > @@ -767,9 +767,19 @@ cat << EOM > > > > EOM > > ls --sort=size $ROOTFILEPARTH | grep "tisdk.*image" | grep > > 'tar.xz' | grep -n '' | awk {'print " " , $1'} > > Do you want to move this inside the while loop? Moved inside the while loop in the V3 patch.
> > > - echo "" > > - read -p "Enter Number of rootfs Tarball: " TARNUMBER > > - echo " " > > + COUNT=`ls $ROOTFILEPARTH | grep "tisdk.*image" | grep > > 'tar.xz' | grep -n '' | awk {'print $1'} | wc -l` > > + ENTERCORRECTLY="0" > > + while [ $ENTERCORRECTLY -ne 1 ] > > + do > > + read -p "Enter Number of rootfs Tarball: " TARNUMBER > > + echo " " > > just echo? > > > + if [ -z "${TARNUMBER//[0-$COUNT]}" ] && [ -n > > "$TARNUMBER" ] ; then > > if COUNT=2 is '0' a valid entry? While the above might be a smart code, > I wonder if we could simplify for readability? > > > > + ENTERCORRECTLY=1 > 'break' should simplify this loop? > > + else > > + echo "Invalid selection!" > Could we articulate this to be "Invalid selection: '$TARNUMBER'. Please use > values from 1 to $COUNT" > > + fi > > + echo "" > "" is redundant. > > I don't think the following is proper - does'nt handle 0 case, but.. > maybe? The '0' input error is handled and updated in the V3 patch along with the other review comments. _______________________________________________ meta-arago mailing list meta-arago@arago-project.org http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago