~ubuntu-branches/ubuntu/oneiric/dpkg/oneiric-proposed

« back to all changes in this revision

Viewing changes to src/select.c

  • Committer: Steve Langasek
  • Date: 2011-03-15 00:11:56 UTC
  • Revision ID: steve.langasek@linaro.org-20110315001156-uyrlgh501d69seku
Merge newer snapshot from Raphael, to keep us in tune with mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include <dpkg/myopt.h>
38
38
 
39
39
#include "filesdb.h"
 
40
#include "infodb.h"
40
41
#include "main.h"
41
42
 
42
43
static void getsel1package(struct pkginfo *pkg) {
58
59
  struct pkginfo *pkg;
59
60
  const char *thisarg;
60
61
  int i, found;
 
62
  enum modstatdb_rw msdb_status;
61
63
  struct pkg_spec pkgspec = PKG_SPEC_INIT(psf_def_native | psf_patterns);
62
64
 
63
 
  modstatdb_init(admindir,msdbrw_readonly);
 
65
  msdb_status = modstatdb_open(msdbrw_readonly);
 
66
  pkg_infodb_init(msdb_status);
64
67
 
65
68
  pkg_array_init_from_db(&array);
66
69
  pkg_array_sort(&array, pkg_sorter_by_name);
100
103
  int c, lno;
101
104
  struct varbuf namevb = VARBUF_INIT;
102
105
  struct varbuf selvb = VARBUF_INIT;
 
106
  enum modstatdb_rw msdb_status;
103
107
  struct pkg_spec pkgspec = PKG_SPEC_INIT(psf_def_native | psf_no_check);
104
108
 
105
109
  if (*argv)
106
110
    badusage(_("--%s takes no arguments"), cipaction->olong);
107
111
 
108
 
  modstatdb_init(admindir,msdbrw_write);
 
112
  msdb_status = modstatdb_open(msdbrw_write | msdbrw_available_readonly);
 
113
  pkg_infodb_init(msdb_status);
109
114
 
110
115
  lno= 1;
111
116
  for (;;) {
166
171
{
167
172
  struct pkgiterator *it;
168
173
  struct pkginfo *pkg;
 
174
  enum modstatdb_rw msdb_status;
169
175
 
170
176
  if (*argv)
171
177
    badusage(_("--%s takes no arguments"), cipaction->olong);
172
178
 
173
 
  modstatdb_init(admindir, msdbrw_write);
 
179
  msdb_status = modstatdb_open(msdbrw_write);
 
180
  pkg_infodb_init(msdb_status);
174
181
 
175
182
  it = pkg_db_iter_new();
176
183
  while ((pkg = pkg_db_iter_next_pkg(it))) {