GNU bug report logs - #10837
bug of install program

Previous Next

Package: coreutils;

Reported by: 陈燕潘 <custa <at> 126.com>

Date: Fri, 17 Feb 2012 18:38:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10837 in the body.
You can then email your comments to 10837 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#10837; Package coreutils. (Fri, 17 Feb 2012 18:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 陈燕潘 <custa <at> 126.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 17 Feb 2012 18:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 陈燕潘 <custa <at> 126.com>
To: bug-coreutils <at> gnu.org
Subject: bug of install program
Date: Sat, 18 Feb 2012 01:30:05 +0800 (CST)
[Message part 1 (text/plain, inline)]
Hi, I come across a problem, I don't whether it is a bug.
Version of install is 7.1.
I have something look like this:
opensuse113:/home/test_install # find 1/
1/
1/a
1/a/b
1/a/b/c
1/a/b/c/d.txt
1/a/b/c/d
opensuse113:/home/test_install # find 2/
2/
I want to copy everything in 1/a/b/c to 2/a/b/c. So I use the command with the option -D, but it doesn't work.
opensuse113:/home/test_install # install -D 1/a/b/c/* 2/a/b/c
install: target `2/a/b/c' is not a directory

Wht not create the directory 2/a/b/c, then copy everying?
 
Looking forward to your reply.


--
custa
[Message part 2 (text/html, inline)]

Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Fri, 17 Feb 2012 18:53:01 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Fri, 17 Feb 2012 18:53:02 GMT) Full text and rfc822 format available.

Notification sent to 陈燕潘 <custa <at> 126.com>:
bug acknowledged by developer. (Fri, 17 Feb 2012 18:53:02 GMT) Full text and rfc822 format available.

Message #12 received at 10837-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: 陈燕潘 <custa <at> 126.com>
Cc: 10837-done <at> debbugs.gnu.org
Subject: Re: bug#10837: bug of install program
Date: Fri, 17 Feb 2012 11:50:17 -0700
[Message part 1 (text/plain, inline)]
tag 10837 notabug
thanks

On 02/17/2012 10:30 AM, 陈燕潘 wrote:
> Hi, I come across a problem, I don't whether it is a bug.
> Version of install is 7.1.

Thanks for the report.  Your install is a bit old; right now, the
current version is 8.15.  However, the behavior you are reporting is
intentional, and has not changed in the meantime.

> I have something look like this:
> opensuse113:/home/test_install # find 1/
> 1/
> 1/a
> 1/a/b
> 1/a/b/c
> 1/a/b/c/d.txt
> 1/a/b/c/d
> opensuse113:/home/test_install # find 2/
> 2/
> I want to copy everything in 1/a/b/c to 2/a/b/c. So I use the command with the option -D, but it doesn't work.
> opensuse113:/home/test_install # install -D 1/a/b/c/* 2/a/b/c
> install: target `2/a/b/c' is not a directory

Let's revisit the 'install --help' output, and see why:

Usage: install [OPTION]... [-T] SOURCE DEST
  or:  install [OPTION]... SOURCE... DIRECTORY
  or:  install [OPTION]... -t DIRECTORY SOURCE...
  or:  install [OPTION]... -d DIRECTORY...
...
In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to
the existing DIRECTORY, while setting permission modes and owner/group.
...
  -D                  create all leading components of DEST except the last,
                        then copy SOURCE to DEST

> 
> Wht not create the directory 2/a/b/c, then copy everying?

Note that you ended up invoking the second form (multiple source files,
to an existing directory), but that -D is only useful with the first
form (single source file, and a DEST that gets created with the same
contents as the single source).  That is, we intentionally treat the
DEST of form 1 differently than the DIRECTORY of form 2.

>  
> Looking forward to your reply.

I'd recommend that you split this into two steps, which will work now:

install -d 2/a/b/c && install 1/a/b/c/* 2/a/b/c

Or, you can propose a patch to make -D work with the second form (that
is, have it interact with a DIRECTORY by creating all elements, compared
to its current documentation of interacting only with a DEST where only
the leading directories, but not the last element, are created).  But
I'm not sure if such a patch would make matters more confusing.  Maybe
it's better to just propose a patch that rejects -D when using form 2,
rather than the current behavior of accepting -D only to fail because it
would create 2/a/b but not 2/a/b/c, and needs 2/a/b/c to exist as a
target directory.

But since such a patch is a wishlist for a minor improvement, rather
than an actual bug fix, I'm closing this bug for now.  We can reopen it
if needed, and you can feel free to add further comments even while the
bug is closed.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Message #13 received at 10837-done <at> debbugs.gnu.org (full text, mbox):

From: 陈燕潘 <custa <at> 126.com>
To: "Eric Blake" <eblake <at> redhat.com>
Cc: 10837-done <at> debbugs.gnu.org
Subject: Re:Re: bug#10837: bug of install program
Date: Sun, 19 Feb 2012 23:07:19 +0800 (CST)
[Message part 1 (text/plain, inline)]
Thank you for yourreply, but I'mstilla little trouble.
Because there is a directory d in 1/a/b/c.  So the command you recommend did not work well.
 
opensuse113:/home/test_install # install -d 2/a/b/c && install 1/a/b/c/* 2/a/b/c
install: omitting directory `1/a/b/c/d'

How can I do please?
Thanks.
 
--
custa



在 2012-02-18 02:50:17,"Eric Blake" <eblake <at> redhat.com> 写道:
>tag 10837 notabug
>thanks
>
>On 02/17/2012 10:30 AM, 陈燕潘 wrote:
>> Hi, I come across a problem, I don't whether it is a bug.
>> Version of install is 7.1.
>
>Thanks for the report.  Your install is a bit old; right now, the
>current version is 8.15.  However, the behavior you are reporting is
>intentional, and has not changed in the meantime.
>
>> I have something look like this:
>> opensuse113:/home/test_install # find 1/
>> 1/
>> 1/a
>> 1/a/b
>> 1/a/b/c
>> 1/a/b/c/d.txt
>> 1/a/b/c/d
>> opensuse113:/home/test_install # find 2/
>> 2/
>> I want to copy everything in 1/a/b/c to 2/a/b/c. So I use the command with the option -D, but it doesn't work.
>> opensuse113:/home/test_install # install -D 1/a/b/c/* 2/a/b/c
>> install: target `2/a/b/c' is not a directory
>
>Let's revisit the 'install --help' output, and see why:
>
>Usage: install [OPTION]... [-T] SOURCE DEST
>  or:  install [OPTION]... SOURCE... DIRECTORY
>  or:  install [OPTION]... -t DIRECTORY SOURCE...
>  or:  install [OPTION]... -d DIRECTORY...
>...
>In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to
>the existing DIRECTORY, while setting permission modes and owner/group.
>...
>  -D                  create all leading components of DEST except the last,
>                        then copy SOURCE to DEST
>
>> 
>> Wht not create the directory 2/a/b/c, then copy everying?
>
>Note that you ended up invoking the second form (multiple source files,
>to an existing directory), but that -D is only useful with the first
>form (single source file, and a DEST that gets created with the same
>contents as the single source).  That is, we intentionally treat the
>DEST of form 1 differently than the DIRECTORY of form 2.
>
>>  
>> Looking forward to your reply.
>
>I'd recommend that you split this into two steps, which will work now:
>
>install -d 2/a/b/c && install 1/a/b/c/* 2/a/b/c
>
>Or, you can propose a patch to make -D work with the second form (that
>is, have it interact with a DIRECTORY by creating all elements, compared
>to its current documentation of interacting only with a DEST where only
>the leading directories, but not the last element, are created).  But
>I'm not sure if such a patch would make matters more confusing.  Maybe
>it's better to just propose a patch that rejects -D when using form 2,
>rather than the current behavior of accepting -D only to fail because it
>would create 2/a/b but not 2/a/b/c, and needs 2/a/b/c to exist as a
>target directory.
>
>But since such a patch is a wishlist for a minor improvement, rather
>than an actual bug fix, I'm closing this bug for now.  We can reopen it
>if needed, and you can feel free to add further comments even while the
>bug is closed.
>
>-- 
>Eric Blake   eblake <at> redhat.com    +1-919-301-3266
>Libvirt virtualization library http://libvirt.org
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#10837; Package coreutils. (Tue, 21 Feb 2012 18:07:01 GMT) Full text and rfc822 format available.

Message #16 received at 10837 <at> debbugs.gnu.org (full text, mbox):

From: 陈燕潘 <custa <at> 126.com>
To: 10837 <at> debbugs.gnu.org
Subject: Fw:Re:Re: bug#10837: bug of install program
Date: Wed, 22 Feb 2012 02:03:58 +0800 (CST)
[Message part 1 (text/plain, inline)]




-------- Forwarding messages --------
From: "陈燕潘" <custa <at> 126.com>
Date: 2012-02-19 23:07:19
To: "Eric Blake" <eblake <at> redhat.com>
Cc: 10837-done <at> debbugs.gnu.org
Subject: Re:Re: bug#10837: bug of install program

Thank you for yourreply, but I'mstilla little trouble.
Because there is a directory d in 1/a/b/c.  So the command you recommend did not work well.
 
opensuse113:/home/test_install # install -d 2/a/b/c && install 1/a/b/c/* 2/a/b/c
install: omitting directory `1/a/b/c/d'

How can I do please?
Thanks.
 
--
custa



在 2012-02-18 02:50:17,"Eric Blake" <eblake <at> redhat.com> 写道:
>tag 10837 notabug
>thanks
>
>On 02/17/2012 10:30 AM, 陈燕潘 wrote:
>> Hi, I come across a problem, I don't whether it is a bug.
>> Version of install is 7.1.
>
>Thanks for the report.  Your install is a bit old; right now, the
>current version is 8.15.  However, the behavior you are reporting is
>intentional, and has not changed in the meantime.
>
>> I have something look like this:
>> opensuse113:/home/test_install # find 1/
>> 1/
>> 1/a
>> 1/a/b
>> 1/a/b/c
>> 1/a/b/c/d.txt
>> 1/a/b/c/d
>> opensuse113:/home/test_install # find 2/
>> 2/
>> I want to copy everything in 1/a/b/c to 2/a/b/c. So I use the command with the option -D, but it doesn't work.
>> opensuse113:/home/test_install # install -D 1/a/b/c/* 2/a/b/c
>> install: target `2/a/b/c' is not a directory
>
>Let's revisit the 'install --help' output, and see why:
>
>Usage: install [OPTION]... [-T] SOURCE DEST
>  or:  install [OPTION]... SOURCE... DIRECTORY
>  or:  install [OPTION]... -t DIRECTORY SOURCE...
>  or:  install [OPTION]... -d DIRECTORY...
>...
>In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to
>the existing DIRECTORY, while setting permission modes and owner/group.
>...
>  -D                  create all leading components of DEST except the last,
>                        then copy SOURCE to DEST
>
>> 
>> Wht not create the directory 2/a/b/c, then copy everying?
>
>Note that you ended up invoking the second form (multiple source files,
>to an existing directory), but that -D is only useful with the first
>form (single source file, and a DEST that gets created with the same
>contents as the single source).  That is, we intentionally treat the
>DEST of form 1 differently than the DIRECTORY of form 2.
>
>>  
>> Looking forward to your reply.
>
>I'd recommend that you split this into two steps, which will work now:
>
>install -d 2/a/b/c && install 1/a/b/c/* 2/a/b/c
>
>Or, you can propose a patch to make -D work with the second form (that
>is, have it interact with a DIRECTORY by creating all elements, compared
>to its current documentation of interacting only with a DEST where only
>the leading directories, but not the last element, are created).  But
>I'm not sure if such a patch would make matters more confusing.  Maybe
>it's better to just propose a patch that rejects -D when using form 2,
>rather than the current behavior of accepting -D only to fail because it
>would create 2/a/b but not 2/a/b/c, and needs 2/a/b/c to exist as a
>target directory.
>
>But since such a patch is a wishlist for a minor improvement, rather
>than an actual bug fix, I'm closing this bug for now.  We can reopen it
>if needed, and you can feel free to add further comments even while the
>bug is closed.
>
>-- 
>Eric Blake   eblake <at> redhat.com    +1-919-301-3266
>Libvirt virtualization library http://libvirt.org
>



[Message part 2 (text/html, inline)]

Message #17 received at 10837-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: 陈燕潘 <custa <at> 126.com>
Cc: 10837-done <at> debbugs.gnu.org
Subject: Re: bug#10837: bug of install program
Date: Tue, 21 Feb 2012 11:43:08 -0700
[Message part 1 (text/plain, inline)]
[top-posting on technical lists makes it difficult to respond]

On 02/19/2012 08:07 AM, 陈燕潘 wrote:
> Thank you for yourreply, but I'mstilla little trouble.
> Because there is a directory d in 1/a/b/c.  So the command you recommend did not work well.
>  
> opensuse113:/home/test_install # install -d 2/a/b/c && install 1/a/b/c/* 2/a/b/c
> install: omitting directory `1/a/b/c/d'
> 
> How can I do please?

install was not originally designed for directory hierarchies, as
evidenced by the fact that you are running into issues when trying to
install both a directory and a regular file by the same install command.
 Maybe you are better off looking for alternatives like 'cp -R'?  Beyond
that, all I can suggest is breaking things into multiple steps; a first
step that installs the directories, and a second step that then installs
files within those directories.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Mar 2012 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.