main.c
changeset 136 eef2b734f2cc
parent 109 313b0a615c14
child 137 4722cd3437cb
     1.1 --- a/main.c	Mon Feb 04 14:25:45 2008 -0500
     1.2 +++ b/main.c	Fri Feb 29 11:51:58 2008 -0500
     1.3 @@ -339,6 +339,22 @@
     1.4  	return 0;
     1.5  }
     1.6  
     1.7 +static int
     1.8 +command_remove(int argc, const char *argv[])
     1.9 +{
    1.10 +	struct razor_set *set;
    1.11 +
    1.12 +	set = razor_set_open(repo_filename);
    1.13 +	if (set == NULL)
    1.14 +		return 1;
    1.15 +	set = razor_set_remove(set, argc, argv);
    1.16 +	razor_set_write(set, updated_repo_filename);
    1.17 +	razor_set_destroy(set);
    1.18 +	printf("wrote system-updated.repo\n");
    1.19 +
    1.20 +	return 0;
    1.21 +}
    1.22 +
    1.23  static void
    1.24  print_diff(const char *name,
    1.25  	   const char *old_version, const char *new_version, void *data)
    1.26 @@ -483,6 +499,7 @@
    1.27  	{ "import-rpms", "import rpms from the given directory", command_import_rpms },
    1.28  	{ "validate", "validate a package set", command_validate },
    1.29  	{ "update", "update all or specified packages", command_update },
    1.30 +	{ "remove", "remove specified packages", command_remove },
    1.31  	{ "diff", "show diff between two package sets", command_diff },
    1.32  	{ "install", "install rpm", command_install }
    1.33  };