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

Re: [XEN PATCH 1/2] tools/python: Fix install-wrap


  • To: Wei Liu <wl@xxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 19 May 2020 10:42:22 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 19 May 2020 09:42:35 +0000
  • Ironport-sdr: +/BYSCIfvq6nw29ir08rVcq6LLiA3pX7CRye5gBnQTvShJ6RsbCE7b+w4fliC8pmGKv1y5T3F7 fmDRt4ITy2qzx8VaQQ8t3WXmrfN5nNsO91aTsiwkBgvXhGS8b34h/fpU3eafCnOoiMXZuUSvm+ DS/TbzfH1WgSHjzUNn4BEr/n/gs+HIToPLN0WuOZ1egtlevIQztconL5IcncaDzDk91UGcnDNi 2y8XkDxEqVXzi0QvMdDwuE8VWTpkV2xYQYhP2N55sFpZflbqnj9fx/B4ACO+5BowON9Njka2Us WC8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, May 19, 2020 at 09:58:15AM +0100, Wei Liu wrote:
> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments 
> unless you have verified the sender and know the content is safe.
> 
> On Wed, Mar 11, 2020 at 05:59:32PM +0000, Anthony PERARD wrote:
> > This allows to use install-wrap when the source scripts is in a
> > subdirectory.
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> > ---
> >  tools/python/install-wrap | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/python/install-wrap b/tools/python/install-wrap
> > index 00e2014016f9..fef24e01708d 100755
> > --- a/tools/python/install-wrap
> > +++ b/tools/python/install-wrap
> > @@ -44,7 +44,7 @@ shift
> >  destf="$dest"
> >  for srcf in ${srcs}; do
> >     if test -d "$dest"; then
> > -           destf="$dest/${srcf%%*/}"
> > +           destf="$dest/${srcf##*/}"
> 
> This seems to have changed the pattern from "Remove Largest Suffix" to
> "Remove Largest Prefix".
> 
> What does it do in practice?
> 
> For POSIX sh
> 
> x=posix/src/std
> echo ${x%%*/} -> posix/src/std
> echo ${x##*/} -> std
> 
> I would think the former is what you want. But I could be missing
> something obvious.

The former is a noop. It's the same as not doing anything.

Unless x="dir/dir/" and in that case, the %% would remove everything,
resulting in an empty string.

$srcf contains the path to where the script which we want to install is,
which is a relative path from where the ./install-wrap is executed from.
$destf is the final destination of the script, but if $dest is a
directory, then ./install-wrap wants to install the script in $dest, not
in some sub-directory of it. ./install-wrap doesn't handle this
sub-directory it fails to execute when there is one. (It's probably the
$install that failed to copy $srcf in a non-existing directory.)

This from the next patch is probably where things fails
    $(INSTALL_PYTHON_PROG) scripts/convert-legacy-stream 
$(DESTDIR)$(LIBEXEC_BIN)

-- 
Anthony PERARD



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.