xbps-{bin,pkgdb}: use strcasecmp() to parse argv.
--HG-- extra : convert_revision : deb4624c3f6d031925f3fcea0461d68d37703f89
This commit is contained in:
parent
e3a5509442
commit
716d9b9e7c
@ -160,7 +160,7 @@ main(int argc, char **argv)
|
|||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if (strcmp(argv[1], "repo-add") == 0) {
|
if (strcasecmp(argv[1], "repo-add") == 0) {
|
||||||
/* Adds a new repository to the pool. */
|
/* Adds a new repository to the pool. */
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
usage();
|
usage();
|
||||||
@ -205,7 +205,7 @@ main(int argc, char **argv)
|
|||||||
rinfo->total_pkgs);
|
rinfo->total_pkgs);
|
||||||
free(rinfo);
|
free(rinfo);
|
||||||
|
|
||||||
} else if (strcmp(argv[1], "repo-list") == 0) {
|
} else if (strcasecmp(argv[1], "repo-list") == 0) {
|
||||||
/* Lists all repositories registered in pool. */
|
/* Lists all repositories registered in pool. */
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
usage();
|
usage();
|
||||||
@ -213,7 +213,7 @@ main(int argc, char **argv)
|
|||||||
xbps_callback_array_iter_in_dict(getrepolist_dict(),
|
xbps_callback_array_iter_in_dict(getrepolist_dict(),
|
||||||
"repository-list", xbps_list_strings_in_array, NULL);
|
"repository-list", xbps_list_strings_in_array, NULL);
|
||||||
|
|
||||||
} else if (strcmp(argv[1], "repo-rm") == 0) {
|
} else if (strcasecmp(argv[1], "repo-rm") == 0) {
|
||||||
/* Remove a repository from the pool. */
|
/* Remove a repository from the pool. */
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
usage();
|
usage();
|
||||||
@ -232,7 +232,7 @@ main(int argc, char **argv)
|
|||||||
exit(EINVAL);
|
exit(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (strcmp(argv[1], "show") == 0) {
|
} else if (strcasecmp(argv[1], "show") == 0) {
|
||||||
/* Shows info about a binary package. */
|
/* Shows info about a binary package. */
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
usage();
|
usage();
|
||||||
|
@ -192,7 +192,7 @@ main(int argc, char **argv)
|
|||||||
if (in_chroot_env != NULL)
|
if (in_chroot_env != NULL)
|
||||||
in_chroot = true;
|
in_chroot = true;
|
||||||
|
|
||||||
if (strcmp(argv[1], "register") == 0) {
|
if (strcasecmp(argv[1], "register") == 0) {
|
||||||
/* Registers a package into the database */
|
/* Registers a package into the database */
|
||||||
if (argc != 5)
|
if (argc != 5)
|
||||||
usage();
|
usage();
|
||||||
@ -249,7 +249,7 @@ main(int argc, char **argv)
|
|||||||
printf("%s=> %s-%s registered successfully.\n",
|
printf("%s=> %s-%s registered successfully.\n",
|
||||||
in_chroot ? "[chroot] " : "", argv[2], argv[3]);
|
in_chroot ? "[chroot] " : "", argv[2], argv[3]);
|
||||||
|
|
||||||
} else if (strcmp(argv[1], "unregister") == 0) {
|
} else if (strcasecmp(argv[1], "unregister") == 0) {
|
||||||
/* Unregisters a package from the database */
|
/* Unregisters a package from the database */
|
||||||
if (argc != 4)
|
if (argc != 4)
|
||||||
usage();
|
usage();
|
||||||
@ -260,7 +260,7 @@ main(int argc, char **argv)
|
|||||||
printf("%s=> %s-%s unregistered successfully.\n",
|
printf("%s=> %s-%s unregistered successfully.\n",
|
||||||
in_chroot ? "[chroot] " : "", argv[2], argv[3]);
|
in_chroot ? "[chroot] " : "", argv[2], argv[3]);
|
||||||
|
|
||||||
} else if (strcmp(argv[1], "list") == 0) {
|
} else if (strcasecmp(argv[1], "list") == 0) {
|
||||||
/* Lists packages currently registered in database */
|
/* Lists packages currently registered in database */
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
usage();
|
usage();
|
||||||
@ -270,7 +270,7 @@ main(int argc, char **argv)
|
|||||||
"packages", xbps_list_pkgs_in_dict, NULL))
|
"packages", xbps_list_pkgs_in_dict, NULL))
|
||||||
exit(EINVAL);
|
exit(EINVAL);
|
||||||
|
|
||||||
} else if (strcmp(argv[1], "version") == 0) {
|
} else if (strcasecmp(argv[1], "version") == 0) {
|
||||||
/* Prints version of an installed package */
|
/* Prints version of an installed package */
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
usage();
|
usage();
|
||||||
@ -284,7 +284,7 @@ main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
printf("%s\n", version);
|
printf("%s\n", version);
|
||||||
|
|
||||||
} else if (strcmp(argv[1], "sanitize-plist") == 0) {
|
} else if (strcasecmp(argv[1], "sanitize-plist") == 0) {
|
||||||
/* Sanitize a plist file (indent the file properly) */
|
/* Sanitize a plist file (indent the file properly) */
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
usage();
|
usage();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user