All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target
@ 2016-09-30 19:53 Peter Kjellerstedt
  2016-09-30 19:53 ` [PATCH 1/1] devtool: deploy-target: Avoid unnecessary dependency on awk on the target Peter Kjellerstedt
  2016-10-02 23:46 ` [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target Khem Raj
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2016-09-30 19:53 UTC (permalink / raw)
  To: openembedded-core

After updating to Krogoth, our developers were faced with the
following error message when using devtool deploy-target:

/tmp/devtool_deploy.sh: line 23: awk: not found

This is of course due to the fact that we do not have awk installed in
our products. However, the use of awk in devtool deploy-target is
completely unnecessary. It is already using sed, and sed is fully
capable of extracting the information that awk was used for.

//Peter

The following changes since commit a75b79a9e9d76db8f75af64c3792c7a1bbfd15b8:

  genericx86-64.conf: Add SERIAL_CONSOLES_CHECK = "ttyS0" (2016-09-30 16:52:22 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib pkj/devtool-minus-awk
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=pkj/devtool-minus-awk

Peter Kjellerstedt (1):
  devtool: deploy-target: Avoid unnecessary dependency on awk on the
    target

 scripts/lib/devtool/deploy.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.0



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

* [PATCH 1/1] devtool: deploy-target: Avoid unnecessary dependency on awk on the target
  2016-09-30 19:53 [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target Peter Kjellerstedt
@ 2016-09-30 19:53 ` Peter Kjellerstedt
  2016-10-02 23:46 ` [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target Khem Raj
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2016-09-30 19:53 UTC (permalink / raw)
  To: openembedded-core

Relying on that awk is installed on the target just to extract the
fourth column (i.e., the free volume size) from `df -P` is an
unnecessary dependency for devtool deploy-target. As it is already
using sed to mangle the output from `df -P`, this can easily be
modified to only extract the free volume size.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 scripts/lib/devtool/deploy.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py
index fb84f2d..c4c7bf6 100644
--- a/scripts/lib/devtool/deploy.py
+++ b/scripts/lib/devtool/deploy.py
@@ -85,7 +85,7 @@ def _prepare_remote_script(deploy, verbose=False, dryrun=False, undeployall=Fals
             lines.append('do')
             lines.append('    checkpath=`dirname "$checkpath"`')
             lines.append('done')
-            lines.append('freespace=`df -P $checkpath | sed "1d" | awk \'{ print $4 }\'`')
+            lines.append(r'freespace=$(df -P $checkpath | sed -nre "s/^(\S+\s+){3}([0-9]+).*/\2/p")')
             # First line of the file is the total space
             lines.append('total=`head -n1 $3`')
             lines.append('if [ $total -gt $freespace ] ; then')
-- 
2.9.0



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

* Re: [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target
  2016-09-30 19:53 [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target Peter Kjellerstedt
  2016-09-30 19:53 ` [PATCH 1/1] devtool: deploy-target: Avoid unnecessary dependency on awk on the target Peter Kjellerstedt
@ 2016-10-02 23:46 ` Khem Raj
  2016-10-03  9:53   ` Peter Kjellerstedt
  1 sibling, 1 reply; 4+ messages in thread
From: Khem Raj @ 2016-10-02 23:46 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]


> On Sep 30, 2016, at 12:53 PM, Peter Kjellerstedt <peter.kjellerstedt@axis.com> wrote:
> 
> After updating to Krogoth, our developers were faced with the
> following error message when using devtool deploy-target:
> 
> /tmp/devtool_deploy.sh: line 23: awk: not found
> 
> This is of course due to the fact that we do not have awk installed in
> our products. However, the use of awk in devtool deploy-target is
> completely unnecessary. It is already using sed, and sed is fully
> capable of extracting the information that awk was used for.

sed or awk both are individual packages, some other user may complain they don't
have sed installed. it would be good to know if we document this dependency for
using devtool.

> 
> //Peter
> 
> The following changes since commit a75b79a9e9d76db8f75af64c3792c7a1bbfd15b8:
> 
>  genericx86-64.conf: Add SERIAL_CONSOLES_CHECK = "ttyS0" (2016-09-30 16:52:22 +0100)
> 
> are available in the git repository at:
> 
>  git://git.yoctoproject.org/poky-contrib pkj/devtool-minus-awk
>  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=pkj/devtool-minus-awk
> 
> Peter Kjellerstedt (1):
>  devtool: deploy-target: Avoid unnecessary dependency on awk on the
>    target
> 
> scripts/lib/devtool/deploy.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --
> 2.9.0
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

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

* Re: [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target
  2016-10-02 23:46 ` [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target Khem Raj
@ 2016-10-03  9:53   ` Peter Kjellerstedt
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2016-10-03  9:53 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

> -----Original Message-----
> From: Khem Raj [mailto:raj.khem@gmail.com]
> Sent: den 3 oktober 2016 01:47
> To: Peter Kjellerstedt
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 0/1] Avoid unnecessary dependency on awk
> in devtool deploy-target
> 
> > On Sep 30, 2016, at 12:53 PM, Peter Kjellerstedt
> > <peter.kjellerstedt@axis.com> wrote:
> >
> > After updating to Krogoth, our developers were faced with the
> > following error message when using devtool deploy-target:
> >
> > /tmp/devtool_deploy.sh: line 23: awk: not found
> >
> > This is of course due to the fact that we do not have awk installed
> > in our products. However, the use of awk in devtool deploy-target is
> > completely unnecessary. It is already using sed, and sed is fully
> > capable of extracting the information that awk was used for.
> 
> sed or awk both are individual packages, some other user may complain
> they don't have sed installed. it would be good to know if we document 
> this dependency for using devtool.
> 
> > //Peter

I find it much less likely to have a system without sed than awk, but 
you are right that the dependencies should be documented somewhere, 
unless they already are... After my fix, devtool deploy requires the 
following commands: cat (can be replaced by letting sed read the file 
itself), df, dirname (can be replaced with a parameter expansion), find, 
head (can be replaced with sed), mkdir, mv, rm, rmdir, sed, sh and tar.

//Peter



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

end of thread, other threads:[~2016-10-03  9:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30 19:53 [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target Peter Kjellerstedt
2016-09-30 19:53 ` [PATCH 1/1] devtool: deploy-target: Avoid unnecessary dependency on awk on the target Peter Kjellerstedt
2016-10-02 23:46 ` [PATCH 0/1] Avoid unnecessary dependency on awk in devtool deploy-target Khem Raj
2016-10-03  9:53   ` Peter Kjellerstedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.