diff options
Diffstat (limited to 'coreutils/install.c')
-rw-r--r-- | coreutils/install.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/coreutils/install.c b/coreutils/install.c index a1342bb13..c01750f81 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
@@ -55,12 +55,17 @@ static const char install_longopts[] ALIGN1 = | |||
55 | "target-directory\0" Required_argument "t" | 55 | "target-directory\0" Required_argument "t" |
56 | /* autofs build insists of using -b --suffix=.orig */ | 56 | /* autofs build insists of using -b --suffix=.orig */ |
57 | /* TODO? (short option for --suffix is -S) */ | 57 | /* TODO? (short option for --suffix is -S) */ |
58 | #if ENABLE_SELINUX | 58 | # if ENABLE_SELINUX |
59 | "context\0" Required_argument "Z" | 59 | "context\0" Required_argument "Z" |
60 | "preserve_context\0" No_argument "\xff" | 60 | "preserve_context\0" No_argument "\xff" |
61 | "preserve-context\0" No_argument "\xff" | 61 | "preserve-context\0" No_argument "\xff" |
62 | #endif | 62 | # endif |
63 | ; | 63 | ; |
64 | # define GETOPT32 getopt32long | ||
65 | # define LONGOPTS install_longopts, | ||
66 | #else | ||
67 | # define GETOPT32 getopt32 | ||
68 | # define LONGOPTS | ||
64 | #endif | 69 | #endif |
65 | 70 | ||
66 | 71 | ||
@@ -135,15 +140,14 @@ int install_main(int argc, char **argv) | |||
135 | #endif | 140 | #endif |
136 | }; | 141 | }; |
137 | 142 | ||
138 | #if ENABLE_FEATURE_INSTALL_LONG_OPTIONS | ||
139 | applet_long_options = install_longopts; | ||
140 | #endif | ||
141 | opt_complementary = "t--d:d--t:s--d:d--s" IF_FEATURE_INSTALL_LONG_OPTIONS(IF_SELINUX(":Z--\xff:\xff--Z")); | 143 | opt_complementary = "t--d:d--t:s--d:d--s" IF_FEATURE_INSTALL_LONG_OPTIONS(IF_SELINUX(":Z--\xff:\xff--Z")); |
142 | /* -c exists for backwards compatibility, it's needed */ | 144 | /* -c exists for backwards compatibility, it's needed */ |
143 | /* -b is ignored ("make a backup of each existing destination file") */ | 145 | /* -b is ignored ("make a backup of each existing destination file") */ |
144 | opts = getopt32(argv, "cvb" "Ddpsg:m:o:t:" IF_SELINUX("Z:"), | 146 | opts = GETOPT32(argv, "cvb" "Ddpsg:m:o:t:" IF_SELINUX("Z:"), |
147 | LONGOPTS | ||
145 | &gid_str, &mode_str, &uid_str, &last | 148 | &gid_str, &mode_str, &uid_str, &last |
146 | IF_SELINUX(, &scontext)); | 149 | IF_SELINUX(, &scontext) |
150 | ); | ||
147 | argc -= optind; | 151 | argc -= optind; |
148 | argv += optind; | 152 | argv += optind; |
149 | 153 | ||