Revert "Patch #1386: make bsdtar the default archive handler"

This reverts commit e104b749be.
This commit is contained in:
Arun Prakash Jana 2022-07-29 22:14:00 +05:30
parent 83825a7d11
commit b76cea3a34
1 changed files with 9 additions and 10 deletions

View File

@ -728,7 +728,7 @@ static char mv[] = "mv -i";
#endif
/* Archive commands */
static const char * const archive_cmd[] = {"bsdtar -acvf", "atool -a", "zip -r", "tar -acvf"};
static const char * const archive_cmd[] = {"atool -a", "bsdtar -acvf", "zip -r", "tar -acvf"};
/* Tokens used for path creation */
#define TOK_BM 0
@ -2670,9 +2670,9 @@ static void get_archive_cmd(char *cmd, const char *archive)
{
uchar_t i = 3;
if (getutil(utils[UTIL_BSDTAR]))
if (getutil(utils[UTIL_ATOOL]))
i = 0;
else if (getutil(utils[UTIL_ATOOL]))
else if (getutil(utils[UTIL_BSDTAR]))
i = 1;
else if (is_suffix(archive, ".zip"))
i = 2;
@ -4573,8 +4573,7 @@ static bool handle_archive(char *fpath /* in-out param */, char op)
char arg[] = "-tvf"; /* options for tar/bsdtar to list files */
char *util, *outdir = NULL;
bool x_to = FALSE;
bool is_bsdtar = getutil(utils[UTIL_BSDTAR]);
bool is_atool = !is_bsdtar && getutil(utils[UTIL_ATOOL]);
bool is_atool = getutil(utils[UTIL_ATOOL]);
if (op == 'x') {
outdir = xreadline(is_atool ? "." : xbasename(fpath), messages[MSG_NEW_PATH]);
@ -4594,14 +4593,14 @@ static bool handle_archive(char *fpath /* in-out param */, char op)
}
}
if (is_bsdtar) {
util = utils[UTIL_BSDTAR];
if (op == 'x')
arg[1] = op;
} else if (is_atool) {
if (is_atool) {
util = utils[UTIL_ATOOL];
arg[1] = op;
arg[2] = '\0';
} else if (getutil(utils[UTIL_BSDTAR])) {
util = utils[UTIL_BSDTAR];
if (op == 'x')
arg[1] = op;
} else if (is_suffix(fpath, ".zip")) {
util = utils[UTIL_UNZIP];
arg[1] = (op == 'l') ? 'v' /* verbose listing */ : '\0';