[hackers] [sbase] install: treat target as file by default instead of dir || Quentin Rameau

From: <git_AT_suckless.org>
Date: Thu, 18 Feb 2016 11:48:21 +0100 (CET)

commit bd8885485078ce923ccc872dd9c79c74c6f5dc0b
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Thu Feb 18 11:35:22 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Thu Feb 18 10:48:16 2016 +0000

    install: treat target as file by default instead of dir
    
    When using 'install foo bar', bar should be treated as a file copy of
    foo, not a directory to be created and into which install foo.

diff --git a/xinstall.1 b/xinstall.1
index 99eff81..39efee1 100644
--- a/xinstall.1
+++ b/xinstall.1
_AT_@ -31,7 +31,9 @@ If more than one
 .Ar source
 is given
 .Ar dest
-has to be a directory.
+is treated as a directory. Otherwise
+.Ar dest
+is treated as a filename.
 .Nm
 can also change the attributes of the copies.
 .Sh OPTIONS
_AT_@ -43,10 +45,8 @@ Create the directories
 Create missing parent directories to
 .Ar dest .
 If
-.Fl t
-is used, the
 .Ar dest
-itself is also created if missing.
+is to be treated as a directory, it is created too if missing.
 .It Fl g Ar group
 Change the installed files' group to
 .Ar group .
diff --git a/xinstall.c b/xinstall.c
index 1a6be47..f5f6956 100644
--- a/xinstall.c
+++ b/xinstall.c
_AT_@ -247,8 +247,6 @@ main(int argc, char *argv[])
                                         make_dirs(argv[argc - 1], 1);
                                         *p = '/';
                                 }
- } else {
- make_dirs(argv[argc - 1], 1);
                         }
                 }
                 enmasse(argc, argv, install);
Received on Thu Feb 18 2016 - 11:48:21 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 18 2016 - 12:00:14 CET