| 382 | + f \.gz$ | f \.tgz$ | f \.tpz$ | f \.Z$ | f \.z$ | f \.xz$ & t r & ! t t |
| 383 | k Convert gz<->xz, tar.gz<->tar.xz & tgz->tar.xz |
| 384 | unset D |
| 385 | unset EXT |
| 386 | case %f in |
| 387 | *.tgz) EXT=tgz;; |
| 388 | *.tpz) EXT=tpz;; |
| 389 | *.Z) EXT=Z;; |
| 390 | *.z) EXT=z;; |
| 391 | *.gz) EXT=gz;; |
| 392 | *.xz) EXT=xz;; |
| 393 | esac |
| 394 | case $EXT in |
| 395 | tgz|tpz) D="`basename %f .$EXT`.tar";; |
| 396 | gz|Z|z) D="`basename %f .$EXT`";; |
| 397 | xz) D="`basename %f .xz`";; |
| 398 | esac |
| 399 | if [ "$EXT" = "xz" ]; then |
| 400 | unxz -v %f ; gzip -f9 -v "$D" |
| 401 | else |
| 402 | gunzip -v %f ; xz -v "$D" |
| 403 | fi |
| 404 | |
| 405 | + t t |
| 406 | K Convert gz<->xz, tar.gz<->tar.xz & tgz->tar.xz |
| 407 | set %t |
| 408 | while [ -n "$1" ] |
| 409 | do |
| 410 | unset D |
| 411 | unset EXT |
| 412 | case "$1" in |
| 413 | *.tgz) EXT=tgz;; |
| 414 | *.tpz) EXT=tpz;; |
| 415 | *.Z) EXT=Z;; |
| 416 | *.z) EXT=z;; |
| 417 | *.gz) EXT=gz;; |
| 418 | *.xz) EXT=xz;; |
| 419 | esac |
| 420 | case $EXT in |
| 421 | tgz) D="`basename $1 .tgz`.tar";; |
| 422 | tpz) D="`basename $1 .tpz`.tar";; |
| 423 | gz|Z|z) D="`basename $1 .$EXT`";; |
| 424 | xz) D="`basename $1 .xz`";; |
| 425 | esac |
| 426 | if [ "$EXT" = "xz" ]; then |
| 427 | unxz -v "$1" |
| 428 | gzip -f9 -v "$D" |
| 429 | else |
| 430 | gunzip -v "$1" |
| 431 | xz -v "$D" |
| 432 | fi |
| 433 | shift |
| 434 | done |
| 435 | |
| 436 | + f \.bz2$ | f \.xz$ & t r & ! t t |
| 437 | l Convert bz2<->xz & tar.bz2<->tar.xz |
| 438 | unset D |
| 439 | unset EXT |
| 440 | case %f in |
| 441 | *.bz2) EXT=bz2;; |
| 442 | *.xz) EXT=xz;; |
| 443 | esac |
| 444 | case $EXT in |
| 445 | bz2) D="`basename %f .bz2`";; |
| 446 | xz) D="`basename %f .xz`";; |
| 447 | esac |
| 448 | if [ "$EXT" = "xz" ]; then |
| 449 | unxz -v %f ; bzip2 -f9 -v "$D" |
| 450 | else |
| 451 | bunzip2 -v %f ; xz -v "$D" |
| 452 | fi |
| 453 | |
| 454 | + t t |
| 455 | L Convert bz2<->xz& tar.bz2<->tar.xz |
| 456 | set %t |
| 457 | while [ -n "$1" ] |
| 458 | do |
| 459 | unset D |
| 460 | unset EXT |
| 461 | case "$1" in |
| 462 | *.bz2) EXT=bz2;; |
| 463 | *.xz) EXT=xz;; |
| 464 | esac |
| 465 | case $EXT in |
| 466 | bz2) D="`basename $1 .bz2`";; |
| 467 | xz) D="`basename $1 .xz`";; |
| 468 | esac |
| 469 | if [ "$EXT" = "xz" ]; then |
| 470 | unxz -v "$1" |
| 471 | bzip2 -f9 -v "$D" |
| 472 | else |
| 473 | bunzip -v "$1" |
| 474 | xz -v "$D" |
| 475 | fi |
| 476 | shift |
| 477 | done |
| 478 | |