~ubuntu-branches/debian/wheezy/dpkg/wheezy

« back to all changes in this revision

Viewing changes to dpkg-deb/extract.c

  • Committer: Bazaar Package Importer
  • Author(s): Guillem Jover, Guillem Jover, Raphaël Hertzog, Jonathan Nieder, Steve Langasek, Mark Hymers, Updated programs translations, Updated man page translations, Updated scripts translations, Updated dselect translations
  • Date: 2011-04-01 23:56:54 UTC
  • Revision ID: james.westby@ubuntu.com-20110401235654-8y800dtb75skfrh7
Tags: 1.16.0
[ Guillem Jover ]
* Use DPKG_MAINTSCRIPT_PACKAGE environment variable as package name on
  dpkg-divert when no --package or --local options have been specified.
* Do not allow versions starting with non-digit when doing strict parsing,
  warn otherwise.
* Update dpkg(1) to note that --status-fd output does not contain newlines
  in error messages anymore (this was fixed in 1.15.0).
* Add a new --status-logger option to dpkg, similar to --status-fd but
  instead invoke the command ourselves and feed the status information
  to its standard input. Suggested by Raphaël Hertzog.
* Add missing space in update-alternative --set-selections output.
* Add missing options to update-alternative --help output.
* Count “conffile name is duplicated” for dpkg-deb warning count summary.
* Improve and clarify strings for translation. Closes: #604914
* Prefix all fatal error messages with “error: ”.
* Do not check presence of update-rc.d in the PATH in dpkg, as it's not
  a program needed for dpkg correct operation.
* Fix dpkg -GEO options on multiple versions of the same packages.
  Closes: #31141
* Propagate --admindir to programs run from maintainer scritpts.
  Closes: #97076
* Do not fail when trying to remove the root directory. This will only
  happen either on distributions where dpkg is a foreign package manager,
  or on artificial dpkg databases.
* Always warn when parsing any package control data which does not have
  an Architecture field except for status and status log files when
  packages are not-installed or half-installed.
* By default reject installing packages w/o an Architecture field. They
  now need --force-architecture, dpkg will still warn about them though.
* Fix build failure when passing --disable-nls to configure.
* Do not segfault on “dpkg -i --no-act”.
* Add missing semicolon to the vsnprintf() compat declaration.
  Thanks to Robert Millan. Closes: #612203
* On install for Ubuntu adjust the i386 GNU cpu name in cputable.
  Thanks to Colin Watson <cjwatson@ubuntu.com>. Closes: #611741
* Sync the info database directory on unpack instead of the temporary
  control information directory, and print the correct pathname on error
  instead of the last file acted on that directory.
* Document in dpkg-query --help output and man page that --list and --show
  arguments are optional.
* Do not read and write the available file unnecessarily.
  Thanks to Michel Lespinasse <walken@zoy.org>. Closes: #397121
* Fix typo in «dpkg-name --overwrite» argument parsing so that it actually
  works at all. Thanks to Ivan Gagis <igagis@gmail.com>. LP: #728708
* Add armhf support to ostable and triplettable. Closes: #594179
* Set the modification time for unpacked symlinks on supported systems.
* Fix undefined value useage in dpkg-genchanges when adding files w/o a
  matching architecture, because they are not present in debian/control,
  this is most commonly the case due to dpkg-distaddfile.
* Terminate immediately on dpkg-divert rename errors instead of propagating
  up the error codes, this improves error reporting and avoids triggering
  leak detectors. Closes: #620380
* When moving a diverted file across filesystems in dpkg-divert, remove
  the source file.

[ Raphaël Hertzog ]
* Fail properly when debian/source/format is empty. Closes: #600854
* Add new deb-src-control(5) manual page documenting the debian/control
  file contained in source packages.
  - it documents the X[SBC]- prefix. Closes: #476335
  - it documents the VCS-* fields too. Closes: #483119
  Thanks to Oxan van Leeuwen <oxan@oxanvanleeuwen.nl> who wrote it
  as part of the Google Code In program.
* Enhance dpkg-shlibdeps to not fail immediatly when a library is not found.
  Instead continue and fail after all problems have been reported. Thanks
  to Chris Baines <cbaines8@gmail.com> for the patch. Closes: #596841
* Fix dpkg-source to not list Debian packaging files as modified
  upstream files in Format "1.0" when unpacking to a non-standard
  directory.
* Apply patch from Colin Watson to let dpkg-buildflags return -O3
  instead of -O2 when building ppc64 packages on Ubuntu. Closes: #612472
* Add new function get_control_path() to Dpkg::Path, it wraps dpkg-query
  --control-path.
* Update dpkg-shlibdeps to be multiarch-ready:
  - use get_control_path() to find symbols/shlibs files
  - parse correctly the output of dpkg --search
* Small fix to support files >2GB in .deb on 64-bit systems. Closes: #616502
  Thanks to Martin Dorey <mdorey@bluearc.com> for the patch.
* dpkg-source now keeps the file ordering in the autogenerated patch when
  regenerating it. Closes: #606080
  Thanks to Colin Watson for the patch.
* dpkg-source now uses a timestamp retrieved from the filesystem when
  resetting the timestamp of patched files so that a time skew when using
  NFS doesn't introduce any inconsistency. Closes: #613023
  Thanks to Jonathan Nieder <jrnieder@gmail.com> for the patch and the
  diagnosis.
* dpkg-source will now remove quilt's .pc directory when --unapply-patches
  is in use. Closes: #591858
* dpkg-source is now a bit less strict when parsing patches:
  - it accepts seeing the same file twice; Closes: #608829
  - it doesn't match on the English text "No newline at end of file" as it
    might be translated in some cases. Closes: #612465
* Improve parser in Dpkg::Control::Hash to not require an empty line
  before the PGP signature. Closes: #617923
  Thanks to Roger Leigh for the initial patch.
* Fix a regression in dpkg-divert where using --rename led to a failure when
  the rename implies crossing file systems. Thanks to Durk Strooisma for
  spotting it.
* Use the correct mtime when installing a file with statoverrides.
  Regression introduced in 1.16.0. LP: #739179
* Remove duplicate word in german translation of dpkg(1). Closes: #616096
* Strip repeated non-significant spaces before and after newlines
  in Uploaders. Closes: #598922
* Ignore whitespaces after options in headers of changelog entries.
  Closes: #605719
* Fix dpkg-source's regression with empty patches (introduced while fixing
  #613023). Closes: #619541

[ Jonathan Nieder ]
* Remove support for use of synchronous sync(2), due to its pernicious
  side-effects and to ease maintenance.
* Clarify that an up-to-date dpkg only needs to be unpacked for
  dpkg-maintscript-helper to work.

[ Steve Langasek ]
* Add new variables to dpkg-architecture, DEB_HOST_MULTIARCH and
  DEB_BUILD_MULTIARCH, that return the "ideal" GNU triplet for each
  architecture which should be used as the path component for library
  installation.

[ Mark Hymers ]
* Add support for Built-Using field. Closes: #619311

[ Updated programs translations ]
* German (Sven Joachim).
* Portuguese (Miguel Figueiredo).
* Spanish (Javier Fernandez-Sanguino).
* Swedish (Peter Krefting).

[ Updated man page translations ]
* German (Helge Kreutzmann).
* Swedish (Peter Krefting).

[ Updated scripts translations ]
* German (Helge Kreutzmann).
* Swedish (Peter Krefting).

[ Updated dselect translations ]
* Spanish (Javier Fernandez-Sanguino).

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <ctype.h>
32
32
#include <string.h>
33
33
#include <dirent.h>
 
34
#include <fcntl.h>
34
35
#include <unistd.h>
35
36
#include <ar.h>
36
37
#include <stdbool.h>
 
38
#include <stdint.h>
37
39
#include <stdlib.h>
38
40
#include <stdio.h>
39
41
 
40
42
#include <dpkg/i18n.h>
41
43
#include <dpkg/dpkg.h>
 
44
#include <dpkg/fdio.h>
42
45
#include <dpkg/buffer.h>
43
46
#include <dpkg/subproc.h>
 
47
#include <dpkg/command.h>
44
48
#include <dpkg/compress.h>
45
49
#include <dpkg/ar.h>
46
50
#include <dpkg/myopt.h>
49
53
 
50
54
static void movecontrolfiles(const char *thing) {
51
55
  char buf[200];
52
 
  pid_t c1;
53
 
  
 
56
  pid_t pid;
 
57
 
54
58
  sprintf(buf, "mv %s/* . && rmdir %s", thing, thing);
55
 
  c1 = subproc_fork();
56
 
  if (!c1) {
57
 
    execlp("sh", "sh", "-c", buf, NULL);
58
 
    ohshite(_("failed to exec sh -c mv foo/* &c"));
 
59
  pid = subproc_fork();
 
60
  if (pid == 0) {
 
61
    command_shell(buf, _("shell command to move files"));
59
62
  }
60
 
  subproc_wait_check(c1, "sh -c mv foo/* &c", 0);
 
63
  subproc_wait_check(pid, _("shell command to move files"), 0);
61
64
}
62
65
 
63
66
static void DPKG_ATTR_NORET
64
 
readfail(FILE *a, const char *filename, const char *what)
 
67
read_fail(int rc, const char *filename, const char *what)
65
68
{
66
 
  if (ferror(a)) {
 
69
  if (rc == 0)
 
70
    ohshit(_("unexpected end of file in %s in %.255s"),what,filename);
 
71
  else
67
72
    ohshite(_("error reading %s from file %.255s"), what, filename);
68
 
  } else {
69
 
    ohshit(_("unexpected end of file in %s in %.255s"),what,filename);
 
73
}
 
74
 
 
75
static ssize_t
 
76
read_line(int fd, char *buf, size_t min_size, size_t max_size)
 
77
{
 
78
  ssize_t line_size = 0;
 
79
  size_t n = min_size;
 
80
 
 
81
  while (line_size < (ssize_t)max_size) {
 
82
    ssize_t r;
 
83
    char *nl;
 
84
 
 
85
    r = fd_read(fd, buf + line_size, n);
 
86
    if (r <= 0)
 
87
      return r;
 
88
 
 
89
    nl = strchr(buf + line_size, '\n');
 
90
    line_size += r;
 
91
 
 
92
    if (nl != NULL) {
 
93
      nl[1] = '\0';
 
94
      return line_size;
 
95
    }
 
96
 
 
97
    n = 1;
70
98
  }
71
 
}
72
 
 
73
 
static size_t
74
 
parseheaderlength(const char *inh, size_t len,
75
 
                  const char *fn, const char *what)
76
 
{
77
 
  char lintbuf[15];
78
 
  ssize_t r;
79
 
  char *endp;
80
 
 
81
 
  if (memchr(inh,0,len))
82
 
    ohshit(_("file `%.250s' is corrupt - %.250s length contains nulls"),fn,what);
83
 
  assert(sizeof(lintbuf) > len);
84
 
  memcpy(lintbuf,inh,len);
85
 
  lintbuf[len]= ' ';
86
 
  *strchr(lintbuf, ' ') = '\0';
87
 
  r = strtol(lintbuf, &endp, 10);
88
 
  if (r < 0)
89
 
    ohshit(_("file `%.250s' is corrupt - negative member length %zi"), fn, r);
90
 
  if (*endp)
91
 
    ohshit(_("file `%.250s' is corrupt - bad digit (code %d) in %s"),fn,*endp,what);
92
 
  return (size_t)r;
93
 
}
94
 
 
95
 
static void
96
 
safe_fflush(FILE *f)
97
 
{
98
 
#if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ > 0)
99
 
  /* XXX: Glibc 2.1 and some versions of Linux want to make fflush()
100
 
   * move the current fpos. Remove this code some time. */
101
 
  fpos_t fpos;
102
 
 
103
 
  if (fgetpos(f, &fpos))
104
 
    ohshit(_("failed getting the current file position"));
105
 
  fflush(f);
106
 
  if (fsetpos(f, &fpos))
107
 
    ohshit(_("failed setting the current file position"));
108
 
#else
109
 
  fflush(f);
110
 
#endif
111
 
}
112
 
 
113
 
void extracthalf(const char *debar, const char *directory,
114
 
                 const char *taroption, int admininfo) {
 
99
 
 
100
  buf[line_size] = '\0';
 
101
  return line_size;
 
102
}
 
103
 
 
104
void
 
105
extracthalf(const char *debar, const char *dir, const char *taroption,
 
106
            int admininfo)
 
107
{
115
108
  char versionbuf[40];
116
109
  float versionnum;
117
 
  size_t ctrllennum, memberlen= 0;
 
110
  off_t ctrllennum, memberlen = 0;
 
111
  ssize_t r;
118
112
  int dummy;
119
113
  pid_t c1=0,c2,c3;
120
114
  int p1[2], p2[2];
121
 
  FILE *ar;
 
115
  int arfd;
122
116
  struct stat stab;
123
117
  char nlc;
124
118
  int adminmember;
125
119
  bool oldformat, header_done;
126
120
  struct compressor *decompressor = &compressor_gzip;
127
 
  
128
 
  ar= fopen(debar,"r"); if (!ar) ohshite(_("failed to read archive `%.255s'"),debar);
129
 
  if (fstat(fileno(ar),&stab)) ohshite(_("failed to fstat archive"));
130
 
  if (!fgets(versionbuf,sizeof(versionbuf),ar)) readfail(ar,debar,_("version number"));
 
121
 
 
122
  arfd = open(debar, O_RDONLY);
 
123
  if (arfd < 0)
 
124
    ohshite(_("failed to read archive `%.255s'"), debar);
 
125
  if (fstat(arfd, &stab))
 
126
    ohshite(_("failed to fstat archive"));
 
127
 
 
128
  r = read_line(arfd, versionbuf, strlen(DPKG_AR_MAGIC), sizeof(versionbuf));
 
129
  if (r < 0)
 
130
    read_fail(r, debar, _("archive magic version number"));
131
131
 
132
132
  if (!strcmp(versionbuf, DPKG_AR_MAGIC)) {
133
133
    oldformat = false;
137
137
    for (;;) {
138
138
      struct ar_hdr arh;
139
139
 
140
 
      if (fread(&arh,1,sizeof(arh),ar) != sizeof(arh))
141
 
        readfail(ar,debar,_("between members"));
 
140
      r = fd_read(arfd, &arh, sizeof(arh));
 
141
      if (r != sizeof(arh))
 
142
        read_fail(r, debar, _("archive member header"));
142
143
 
143
144
      dpkg_ar_normalize_name(&arh);
144
145
 
145
146
      if (memcmp(arh.ar_fmag,ARFMAG,sizeof(arh.ar_fmag)))
146
 
        ohshit(_("file `%.250s' is corrupt - bad magic at end of first header"),debar);
147
 
      memberlen= parseheaderlength(arh.ar_size,sizeof(arh.ar_size),
148
 
                                   debar, _("member length"));
 
147
        ohshit(_("file '%.250s' is corrupt - bad archive header magic"), debar);
 
148
      memberlen = dpkg_ar_member_get_size(debar, &arh);
149
149
      if (!header_done) {
150
150
        char *infobuf;
151
151
        char *cur;
153
153
        if (strncmp(arh.ar_name, DEBMAGIC, sizeof(arh.ar_name)) != 0)
154
154
          ohshit(_("file `%.250s' is not a debian binary archive (try dpkg-split?)"),debar);
155
155
        infobuf= m_malloc(memberlen+1);
156
 
        if (fread(infobuf,1, memberlen + (memberlen&1), ar) != memberlen + (memberlen&1))
157
 
          readfail(ar,debar,_("header info member"));
 
156
        r = fd_read(arfd, infobuf, memberlen + (memberlen & 1));
 
157
        if (r != (memberlen + (memberlen & 1)))
 
158
          read_fail(r, debar, _("archive information header member"));
158
159
        infobuf[memberlen] = '\0';
159
160
        cur= strchr(infobuf,'\n');
160
161
        if (!cur) ohshit(_("archive has no newlines in header"));
171
172
 
172
173
        header_done = true;
173
174
      } else if (arh.ar_name[0] == '_') {
174
 
          /* Members with `_' are noncritical, and if we don't understand them
175
 
           * we skip them.
176
 
           */
177
 
        stream_null_copy(ar, memberlen + (memberlen&1),_("skipped member data from %s"), debar);
 
175
        /* Members with ‘_’ are noncritical, and if we don't understand
 
176
         * them we skip them. */
 
177
        fd_null_copy(arfd, memberlen + (memberlen & 1),
 
178
                     _("skipped archive member data from %s"), debar);
178
179
      } else {
179
180
        if (strncmp(arh.ar_name, ADMINMEMBER, sizeof(arh.ar_name)) == 0)
180
181
          adminmember = 1;
189
190
          }
190
191
 
191
192
          if (adminmember == -1 || decompressor == NULL)
192
 
            ohshit(_("file `%.250s' contains ununderstood data member %.*s, giving up"),
 
193
            ohshit(_("archive '%.250s' contains not understood data member %.*s, giving up"),
193
194
                   debar, (int)sizeof(arh.ar_name), arh.ar_name);
194
195
        }
195
196
        if (adminmember == 1) {
196
197
          if (ctrllennum != 0)
197
 
            ohshit(_("file `%.250s' contains two control members, giving up"), debar);
 
198
            ohshit(_("archive '%.250s' contains two control members, giving up"),
 
199
                   debar);
198
200
          ctrllennum= memberlen;
199
201
        }
200
202
        if (!adminmember != !admininfo) {
201
 
          stream_null_copy(ar, memberlen + (memberlen&1),_("skipped member data from %s"), debar);
 
203
          fd_null_copy(arfd, memberlen + (memberlen & 1),
 
204
                       _("skipped archive member data from %s"), debar);
202
205
        } else {
203
 
          break; /* Yes ! - found it. */
 
206
          /* Yes! - found it. */
 
207
          break;
204
208
        }
205
209
      }
206
210
    }
207
211
 
208
212
    if (admininfo >= 2) {
209
213
      printf(_(" new debian package, version %s.\n"
210
 
               " size %ld bytes: control archive= %zi bytes.\n"),
211
 
             versionbuf, (long)stab.st_size, ctrllennum);
 
214
               " size %jd bytes: control archive= %jd bytes.\n"),
 
215
             versionbuf, (intmax_t)stab.st_size, (intmax_t)ctrllennum);
212
216
      m_output(stdout, _("<standard output>"));
213
217
    }
214
218
  } else if (!strncmp(versionbuf,"0.93",4) &&
221
225
    l = strlen(versionbuf);
222
226
    if (l && versionbuf[l - 1] == '\n')
223
227
      versionbuf[l - 1] = '\0';
224
 
    if (!fgets(ctrllenbuf,sizeof(ctrllenbuf),ar))
225
 
      readfail(ar, debar, _("control information length"));
226
 
    if (sscanf(ctrllenbuf,"%zi%c%d",&ctrllennum,&nlc,&dummy) !=2 || nlc != '\n')
227
 
      ohshit(_("archive has malformatted control length `%s'"), ctrllenbuf);
 
228
 
 
229
    r = read_line(arfd, ctrllenbuf, 1, sizeof(ctrllenbuf));
 
230
    if (r < 0)
 
231
      read_fail(r, debar, _("archive control member size"));
 
232
    if (sscanf(ctrllenbuf, "%jd%c%d", &ctrllennum, &nlc, &dummy) != 2 ||
 
233
        nlc != '\n')
 
234
      ohshit(_("archive has malformatted control member size '%s'"), ctrllenbuf);
228
235
 
229
236
    if (admininfo) {
230
237
      memberlen = ctrllennum;
231
238
    } else {
232
239
      memberlen = stab.st_size - ctrllennum - strlen(ctrllenbuf) - l;
233
 
      stream_null_copy(ar, ctrllennum, _("skipped control area from %s"), debar);
 
240
      fd_null_copy(arfd, ctrllennum,
 
241
                   _("skipped archive control member data from %s"), debar);
234
242
    }
235
243
 
236
244
    if (admininfo >= 2) {
237
245
      printf(_(" old debian package, version %s.\n"
238
 
               " size %ld bytes: control archive= %zi, main archive= %ld.\n"),
239
 
             versionbuf, (long)stab.st_size, ctrllennum,
240
 
             (long) (stab.st_size - ctrllennum - strlen(ctrllenbuf) - l));
 
246
               " size %jd bytes: control archive= %jd, main archive= %jd.\n"),
 
247
             versionbuf, (intmax_t)stab.st_size, (intmax_t)ctrllennum,
 
248
             (intmax_t)(stab.st_size - ctrllennum - strlen(ctrllenbuf) - l));
241
249
      m_output(stdout, _("<standard output>"));
242
250
    }
243
251
  } else {
244
 
    
245
252
    if (!strncmp(versionbuf,"!<arch>",7)) {
246
253
      fprintf(stderr,
247
254
              _("dpkg-deb: file looks like it might be an archive which has been\n"
249
256
    }
250
257
 
251
258
    ohshit(_("`%.255s' is not a debian format archive"),debar);
252
 
 
253
259
  }
254
260
 
255
 
  safe_fflush(ar);
256
 
 
257
261
  m_pipe(p1);
258
262
  c1 = subproc_fork();
259
263
  if (!c1) {
260
264
    close(p1[0]);
261
 
    stream_fd_copy(ar, p1[1], memberlen, _("failed to write to pipe in copy"));
 
265
    fd_fd_copy(arfd, p1[1], memberlen, _("failed to write to pipe in copy"));
262
266
    if (close(p1[1]))
263
267
      ohshite(_("failed to close pipe in copy"));
264
268
    exit(0);
266
270
  close(p1[1]);
267
271
 
268
272
  if (taroption) m_pipe(p2);
269
 
  
 
273
 
270
274
  c2 = subproc_fork();
271
275
  if (!c2) {
272
276
    m_dup2(p1[0], 0);
275
279
    decompress_filter(decompressor, 0, 1, _("data"));
276
280
  }
277
281
  close(p1[0]);
278
 
  fclose(ar);
 
282
  close(arfd);
279
283
  if (taroption) close(p2[1]);
280
284
 
281
 
  if (taroption && directory) {
282
 
    if (chdir(directory)) {
 
285
  if (taroption && dir) {
 
286
    if (chdir(dir)) {
283
287
      if (errno == ENOENT) {
284
 
        if (mkdir(directory,0777)) ohshite(_("failed to create directory"));
285
 
        if (chdir(directory)) ohshite(_("failed to chdir to directory after creating it"));
 
288
        if (mkdir(dir, 0777))
 
289
          ohshite(_("failed to create directory"));
 
290
        if (chdir(dir))
 
291
          ohshite(_("failed to chdir to directory after creating it"));
286
292
      } else {
287
293
        ohshite(_("failed to chdir to directory"));
288
294
      }
303
309
      unsetenv("TAR_OPTIONS");
304
310
 
305
311
      execlp(TAR, "tar", buffer, "-", NULL);
306
 
      ohshite(_("failed to exec tar"));
 
312
      ohshite(_("unable to execute %s (%s)"), "tar", TAR);
307
313
    }
308
314
    close(p2[0]);
309
315
    subproc_wait_check(c3, "tar", 0);
310
316
  }
311
 
  
 
317
 
312
318
  subproc_wait_check(c2, _("<decompress>"), PROCPIPE);
313
319
  if (c1 != -1)
314
320
    subproc_wait_check(c1, _("paste"), 0);
321
327
  }
322
328
}
323
329
 
324
 
static void controlextractvextract(int admin,
325
 
                                   const char *taroptions,
326
 
                                   const char *const *argv) {
327
 
  const char *debar, *directory;
328
 
  
 
330
static int
 
331
controlextractvextract(int admin, const char *taroptions,
 
332
                       const char *const *argv)
 
333
{
 
334
  const char *debar, *dir;
 
335
 
329
336
  if (!(debar= *argv++))
330
337
    badusage(_("--%s needs a .deb filename argument"),cipaction->olong);
331
 
  if (!(directory= *argv++)) {
332
 
    if (admin) directory= EXTRACTCONTROLDIR;
 
338
  dir = *argv++;
 
339
  if (!dir) {
 
340
    if (admin)
 
341
      dir = EXTRACTCONTROLDIR;
333
342
    else ohshit(_("--%s needs a target directory.\n"
334
343
                "Perhaps you should be using dpkg --install ?"),cipaction->olong);
335
344
  } else if (*argv) {
336
345
    badusage(_("--%s takes at most two arguments (.deb and directory)"),cipaction->olong);
337
346
  }
338
 
  extracthalf(debar, directory, taroptions, admin);
 
347
  extracthalf(debar, dir, taroptions, admin);
 
348
 
 
349
  return 0;
339
350
}
340
351
 
341
 
void do_fsystarfile(const char *const *argv) {
 
352
int
 
353
do_fsystarfile(const char *const *argv)
 
354
{
342
355
  const char *debar;
343
 
  
 
356
 
344
357
  if (!(debar= *argv++))
345
358
    badusage(_("--%s needs a .deb filename argument"),cipaction->olong);
346
359
  if (*argv)
347
360
    badusage(_("--%s takes only one argument (.deb filename)"),cipaction->olong);
348
361
  extracthalf(debar, NULL, NULL, 0);
349
 
}
350
 
   
351
 
void do_control(const char *const *argv) { controlextractvextract(1, "x", argv); }
352
 
void do_extract(const char *const *argv) { controlextractvextract(0, "xp", argv); }
353
 
void do_vextract(const char *const *argv) { controlextractvextract(0, "xpv", argv); }
354
 
 
355
 
 
356
 
 
 
362
 
 
363
  return 0;
 
364
}
 
365
 
 
366
int
 
367
do_control(const char *const *argv)
 
368
{
 
369
  return controlextractvextract(1, "x", argv);
 
370
}
 
371
 
 
372
int
 
373
do_extract(const char *const *argv)
 
374
{
 
375
  return controlextractvextract(0, "xp", argv);
 
376
}
 
377
 
 
378
int
 
379
do_vextract(const char *const *argv)
 
380
{
 
381
  return controlextractvextract(0, "xpv", argv);
 
382
}