mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* cp: incorrect behaviour when copying recursively
@ 2017-04-14 10:10 Peter Mamonov
  2017-04-19  8:07 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Mamonov @ 2017-04-14 10:10 UTC (permalink / raw)
  To: barebox

Hi,

The "cp -r <src> <dst>" command omits top directory, when the trailing "/" is 
present in the <src> string. Here is the test case:

	barebox@barebox sandbox:/test mkdir d1
	barebox@barebox sandbox:/test echo -o d1/f1 1
	barebox@barebox sandbox:/test mkdir d2       
	barebox@barebox sandbox:/test cd d2
	barebox@barebox sandbox:/test/d2 cp -r ../d1/ . 
	barebox@barebox sandbox:/test/d2 ls
	.     ..    f1    
	barebox@barebox sandbox:/test/d2 cp -r ../d1 . 
	barebox@barebox sandbox:/test/d2 ls
	.     ..    d1    f1    

	barebox@barebox sandbox:/test/d2 version 
	
	barebox 2017.04.0-00169-g90e7a35e6 #1 Fri Apr 14 12:46:09 MSK 2017

Regards,
Peter

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

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

* Re: cp: incorrect behaviour when copying recursively
  2017-04-14 10:10 cp: incorrect behaviour when copying recursively Peter Mamonov
@ 2017-04-19  8:07 ` Sascha Hauer
  2017-04-21 16:53   ` Peter Mamonov
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2017-04-19  8:07 UTC (permalink / raw)
  To: Peter Mamonov; +Cc: barebox

Hi Peter,

On Fri, Apr 14, 2017 at 01:10:51PM +0300, Peter Mamonov wrote:
> Hi,
> 
> The "cp -r <src> <dst>" command omits top directory, when the trailing "/" is 
> present in the <src> string. Here is the test case:

I can confirm that. It turned out this is because we used GNU basename
in barebox, but we should use POSIX basename. Please check the series
I just sent out.

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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: cp: incorrect behaviour when copying recursively
  2017-04-19  8:07 ` Sascha Hauer
@ 2017-04-21 16:53   ` Peter Mamonov
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Mamonov @ 2017-04-21 16:53 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi Sasha,

On Wed, Apr 19, 2017 at 10:07:23AM +0200, Sascha Hauer wrote:
> Hi Peter,
> 
> On Fri, Apr 14, 2017 at 01:10:51PM +0300, Peter Mamonov wrote:
> > Hi,
> > 
> > The "cp -r <src> <dst>" command omits top directory, when the trailing "/" is 
> > present in the <src> string. Here is the test case:
> 
> I can confirm that. It turned out this is because we used GNU basename
> in barebox, but we should use POSIX basename. Please check the series
> I just sent out.

Tested the `next` branch: everything works as expected.

Thanks!
Peter

> 
> 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2017-04-21 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14 10:10 cp: incorrect behaviour when copying recursively Peter Mamonov
2017-04-19  8:07 ` Sascha Hauer
2017-04-21 16:53   ` Peter Mamonov

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