Add support to set automatic install flag for srcpkgs.
--HG-- extra : convert_revision : fa0e103ce44a4758858124ecd63aea0dec400720
This commit is contained in:
parent
a2e9f7de29
commit
028cacdd2a
5 changed files with 31 additions and 13 deletions
|
@ -65,6 +65,9 @@ usage(void)
|
|||
" Options shared by all actions:\n"
|
||||
" -r\t\t\t<rootdir>\n"
|
||||
"\n"
|
||||
" Options used by the register action:\n"
|
||||
" -a\t\t\tSet automatic installation flag.\n"
|
||||
"\n"
|
||||
" Examples:\n"
|
||||
" $ xbps-pkgdb getpkgname foo-2.0\n"
|
||||
" $ xbps-pkgdb getpkgversion foo-2.0\n"
|
||||
|
@ -82,11 +85,15 @@ main(int argc, char **argv)
|
|||
prop_dictionary_t dict;
|
||||
const char *version;
|
||||
char *plist, *pkgname, *in_chroot_env, *root = NULL;
|
||||
bool in_chroot = false;
|
||||
bool automatic = false, in_chroot = false;
|
||||
int c, rv = 0;
|
||||
|
||||
while ((c = getopt(argc, argv, "r:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "ar:")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
/* Set automatic install flag */
|
||||
automatic = true;
|
||||
break;
|
||||
case 'r':
|
||||
/* To specify the root directory */
|
||||
root = strdup(optarg);
|
||||
|
@ -123,7 +130,7 @@ main(int argc, char **argv)
|
|||
usage();
|
||||
|
||||
rv = xbps_register_pkg(NULL, argv[1], argv[2],
|
||||
argv[3], false);
|
||||
argv[3], automatic);
|
||||
if (rv == EEXIST) {
|
||||
printf("%s=> %s-%s already registered.\n",
|
||||
in_chroot ? "[chroot] " : "", argv[1], argv[2]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue