int do_extract(const char *const *argv) { const char *debar, *dir; enum dpkg_tar_options options = DPKG_TAR_EXTRACT | DPKG_TAR_PERMS; if (opt_verbose) options |= DPKG_TAR_LIST; debar = *argv++; if (debar == NULL) badusage(_("--%s needs .deb filename and directory arguments"), cipaction->olong); dir = *argv++; if (dir == NULL) badusage(_("--%s needs a target directory.\n" "Perhaps you should be using dpkg --install ?"), cipaction->olong); else if (*argv) badusage(_("--%s takes at most two arguments (.deb and directory)"), cipaction->olong); extracthalf(debar, dir, options, 0); return 0; }
void do_fsystarfile(const char *const *argv) { const char *debar; if (!(debar= *argv++)) badusage(_("--%s needs a .deb filename argument"),cipaction->olong); if (*argv) badusage(_("--%s takes only one argument (.deb filename)"),cipaction->olong); extracthalf(debar, NULL, NULL, 0); }
int do_contents(const char *const *argv) { const char *debar; if (!(debar= *argv++) || *argv) badusage(_("--contents takes exactly one argument")); extracthalf(debar, NULL, "tv", 0); return 0; }
int do_contents(const char *const *argv) { const char *debar = *argv++; if (debar == NULL || *argv) badusage(_("--%s takes exactly one argument"), cipaction->olong); extracthalf(debar, NULL, DPKG_TAR_LIST, 0); return 0; }
int do_fsystarfile(const char *const *argv) { const char *debar; debar = *argv++; if (debar == NULL) badusage(_("--%s needs a .deb filename argument"),cipaction->olong); if (*argv) badusage(_("--%s takes only one argument (.deb filename)"),cipaction->olong); extracthalf(debar, NULL, DPKG_TAR_PASSTHROUGH, 0); return 0; }
int do_raw_extract(const char *const *argv) { enum dpkg_tar_options data_options; const char *debar, *dir; char *control_dir; debar = *argv++; if (debar == NULL) badusage(_("--%s needs .deb filename and directory arguments"), cipaction->olong); else if (strcmp(debar, "-") == 0) badusage(_("--%s does not support (yet) reading the .deb from standard input"), cipaction->olong); dir = *argv++; if (dir == NULL) badusage(_("--%s needs a target directory.\n" "Perhaps you should be using dpkg --install ?"), cipaction->olong); else if (*argv) badusage(_("--%s takes at most two arguments (.deb and directory)"), cipaction->olong); control_dir = str_fmt("%s/%s", dir, EXTRACTCONTROLDIR); data_options = DPKG_TAR_EXTRACT | DPKG_TAR_PERMS; if (opt_verbose) data_options |= DPKG_TAR_LIST; extracthalf(debar, dir, data_options, 0); extracthalf(debar, control_dir, DPKG_TAR_EXTRACT, 1); free(control_dir); return 0; }
static void controlextractvextract(int admin, const char *taroptions, const char *const *argv) { const char *debar, *directory; if (!(debar= *argv++)) badusage(_("--%s needs a .deb filename argument"),cipaction->olong); if (!(directory= *argv++)) { if (admin) directory= EXTRACTCONTROLDIR; else ohshit(_("--%s needs a target directory.\n" "Perhaps you should be using dpkg --install ?"),cipaction->olong); } else if (*argv) { badusage(_("--%s takes at most two arguments (.deb and directory)"),cipaction->olong); } extracthalf(debar, directory, taroptions, admin); }
static void info_prepare(const char *const **argvp, const char **debarp, const char **dirp, int admininfo) { char *dbuf; *debarp= *(*argvp)++; if (!*debarp) badusage(_("--%s needs a .deb filename argument"),cipaction->olong); dbuf = mkdtemp(path_make_temp_template("dpkg-deb")); if (!dbuf) ohshite(_("unable to create temporary directory")); *dirp = dbuf; push_cleanup(cu_info_prepare, -1, NULL, 0, 1, (void *)dbuf); extracthalf(*debarp, dbuf, DPKG_TAR_EXTRACT | DPKG_TAR_NOMTIME, admininfo); }
int do_control(const char *const *argv) { const char *debar, *dir; debar = *argv++; if (debar == NULL) badusage(_("--%s needs a .deb filename argument"), cipaction->olong); dir = *argv++; if (dir == NULL) dir = EXTRACTCONTROLDIR; else if (*argv) badusage(_("--%s takes at most two arguments (.deb and directory)"), cipaction->olong); extracthalf(debar, dir, DPKG_TAR_EXTRACT, 1); return 0; }