Index: args.c
===================================================================
RCS file: /cvs/ipkg/args.c,v
retrieving revision 1.27
diff -u -r1.27 args.c
--- args.c	23 Jun 2003 17:58:29 -0000	1.27
+++ args.c	29 Jun 2003 16:03:17 -0000
@@ -218,6 +218,7 @@
      fprintf(stderr, "\tupgrade			Upgrade all installed packages to latest version\n");
      fprintf(stderr, "\tinstall <pkg>		Download and install <pkg> (and dependencies)\n");
      fprintf(stderr, "\tinstall <file.ipk>	Install package <file.ipk>\n");
+     fprintf(stderr, "\tconfigure [<pkg>]	Configure unpacked packages\n");
      fprintf(stderr, "\tremove <pkg>		Remove package <pkg>\n");
      fprintf(stderr, "\tflag <flags> <pkg> ...	Flag package(s) <pkg>\n");
      fprintf(stderr, "\t <flags>=hold,noprune	\n");
Index: ipkg_cmd.c
===================================================================
RCS file: /cvs/ipkg/ipkg_cmd.c,v
retrieving revision 1.41
diff -u -r1.41 ipkg_cmd.c
--- ipkg_cmd.c	23 Jun 2003 17:58:29 -0000	1.41
+++ ipkg_cmd.c	29 Jun 2003 16:03:19 -0000
@@ -63,6 +63,7 @@
 static int ipkg_whatreplaces_cmd(ipkg_conf_t *conf, int argc, char *argv[]);
 static int ipkg_compare_versions_cmd(ipkg_conf_t *conf, int argc, char *argv[]);
 static int ipkg_print_architecture_cmd(ipkg_conf_t *conf, int argc, char *argv[]);
+static int ipkg_configure_cmd(ipkg_conf_t *conf, int argc, char *argv[]);
 
 /* XXX: CLEANUP: The usage strings should be incorporated into this
    array for easier maintenance */
@@ -77,6 +78,7 @@
      {"install", 1, ipkg_install_cmd},
      {"remove", 1, ipkg_remove_cmd},
      {"purge", 1, ipkg_purge_cmd},
+     {"configure", 0, ipkg_configure_cmd},
      {"files", 1, ipkg_files_cmd},
      {"search", 1, ipkg_search_cmd},
      {"download", 1, ipkg_download_cmd},
@@ -227,7 +229,7 @@
      return 0;
 }
 
-int ipkg_configure_packages(ipkg_conf_t *conf)
+int ipkg_configure_packages(ipkg_conf_t *conf, regex_t *re)
 {
      pkg_vec_t *all;
      int i;
@@ -242,6 +244,10 @@
 
      for(i = 0; i < all->len; i++) {
 	  pkg = all->pkgs[i];
+
+	  if (re && xregexec(re, pkg->name, 0, 0, 0)) 
+	       continue;
+
 	  if (pkg->state_status == SS_UNPACKED) {
 	       ipkg_message(conf, IPKG_INFO,
 			    "  configuring %s\n", pkg->name);
@@ -306,7 +312,7 @@
      /* recheck to verify that all dependences are satisfied */
      if (0) ipkg_satisfy_all_dependences(conf);
 
-     ipkg_configure_packages(conf);
+     ipkg_configure_packages(conf, NULL);
 
      ipkg_message(conf, IPKG_INFO,
 		  "  writing status file\n");
@@ -372,7 +378,7 @@
      /* recheck to verify that all dependences are satisfied */
      if (0) ipkg_satisfy_all_dependences(conf);
 
-     ipkg_configure_packages(conf);
+     ipkg_configure_packages(conf, NULL);
 
      ipkg_message(conf, IPKG_NOTICE,
 		  "  writing status file\n");
@@ -519,6 +525,28 @@
 static int ipkg_status_cmd(ipkg_conf_t *conf, int argc, char *argv[])
 {
      return ipkg_info_status_cmd(conf, argc, argv, 1);
+}
+
+static int ipkg_configure_cmd(ipkg_conf_t *conf, int argc, char *argv[])
+{
+     char *pkg_name = NULL;
+     regex_t re;
+     int err;
+     
+     if (argc > 0) {
+	  pkg_name = argv[0];
+	  err = xregcomp(&re, pkg_name, REG_EXTENDED);
+	  if (err) {
+	       return err;
+	  }
+     }
+     
+     err = ipkg_configure_packages (conf, &re);
+     
+     if (pkg_name)
+       xregfree(&re);
+
+     return err;
 }
 
 static int ipkg_install_pending_cmd(ipkg_conf_t *conf, int argc, char *argv[])
Index: ipkg_cmd.h
===================================================================
RCS file: /cvs/ipkg/ipkg_cmd.h,v
retrieving revision 1.7
diff -u -r1.7 ipkg_cmd.h
--- ipkg_cmd.h	6 Mar 2003 21:50:59 -0000	1.7
+++ ipkg_cmd.h	29 Jun 2003 16:03:19 -0000
@@ -34,6 +34,6 @@
 /* install any packges with state_want == SW_INSTALL */
 int ipkg_install_wanted_packages(ipkg_conf_t *conf);
 /* ensure that all dependences are satisfied */
-int ipkg_configure_packages(ipkg_conf_t *conf);
+int ipkg_configure_packages(ipkg_conf_t *conf, regex_t *re);
 
 #endif
