Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > cdf3204072325f4a06a79f420e013079 > files > 144

howto-text-ja-9.0-1mdk.noarch.rpm

  Bzip2 Howto
  David Fetter, dfetter@best.com <mailto:dfetter@best.com>
  v1.1, 5 February 1998
  ˆÉ²Ž¡  “N, isaji@mxu.meshnet.or.jp
  Wed Feb 25 22:36:00 1998

  ‚±‚̃hƒLƒ…ƒƒ“ƒg‚Íbzip2ˆ³kƒvƒƒOƒ‰ƒ€‚ÌŽg‚¢•û‚ɂ‚¢‚ĉðà‚µ‚Ä‚¢‚Ü‚·B
  ______________________________________________________________________

  –ÚŽŸ

  1. ƒCƒ“ƒgƒƒ_ƒNƒVƒ‡ƒ“
  2. bzip2‚Ì“üŽè
     2.1 ƒvƒŒƒRƒ“ƒpƒCƒ‹‚³‚ꂽbzip2ƒoƒCƒiƒŠ‚ð“üŽè‚·‚é
     2.2 bzip2ƒ\[ƒX‚Ì“üŽè
     2.3 ƒ}ƒVƒ“—p‚Ìbzip2‚ðƒRƒ“ƒpƒCƒ‹‚·‚é

  3. ’P“Æ‚Åbzip2‚ðŽg‚¤
  4. bzip2‚ðtar‚ÆŽg‚¤
     4.1 Ý’肵‚È‚­‚Ä‚æ‚¢F
     4.2 Žg‚¢‚â‚·‚¢:

  5. less‚Åbzip2‚ðŽg‚¤
  6. emacs‚Åbzip2‚ðŽg‚¤
  7. xv‚Åbzip2‚ðŽg‚¤
  8. (–óŽÒ’ljÁF)fd,ls‚Åbzip2‚ðŽg‚¤
     8.1 fd
     8.2 ls

  ______________________________________________________________________

  1.  ƒCƒ“ƒgƒƒ_ƒNƒVƒ‡ƒ“

  Bzip2‚̓f[ƒ^‚ðˆ³k‚·‚é"‚¢‚©‚·"V‚µ‚¢ƒAƒ‹ƒSƒŠƒYƒ€‚Å‚·B gzip‚ň³k‚µ‚½
  ƒTƒCƒY‚Ì60-70%‚Ƀtƒ@ƒCƒ‹‚ðˆ³k‚µ‚Ü‚·B

  ‚±‚̃hƒLƒ…ƒƒ“ƒg‚Å‚Íbzip2‚Æ•¹—p‚µ‚ÄŽg‚¦‚é2,3‚Ì‹¤’Ê‚µ‚½ƒAƒvƒŠƒP[ƒVƒ‡ƒ“
  ‚ð’Ê‚µ‚Ęb‚µ‚ði‚ß‚Ä‚¢‚«‚Ü‚·B

  2.  bzip2‚Ì“üŽè

  Bzip2‚̃z[ƒ€ƒy[ƒW‚ÍThe UK home site‚Å‚·BUnited Statesƒ~ƒ‰[ƒTƒCƒg‚Í
  ‚±‚±‚Å‚·B Red Hat‚ÌftpƒTƒCƒg‚Å‚àŒ©‚‚©‚è‚Ü‚·B

  2.1.  ƒvƒŒƒRƒ“ƒpƒCƒ‹‚³‚ꂽbzip2ƒoƒCƒiƒŠ‚ð“üŽè‚·‚é

  UK home site‚ðŽQÆ‚µ‚ĉº‚³‚¢BRed Hat‚̃Cƒ“ƒeƒ‹ƒoƒCƒiƒŠ‚Í‚±‚±‚Å
  ‚·BDebian, Slackware‚È‚Ç‚Í‚Ü‚à‚È‚­o‚Ä‚«‚Ü‚·B

  2.2.  bzip2ƒ\[ƒX‚Ì“üŽè

  ŒöŽ®ƒTƒCƒg‚©‚ço‚Ä‚¢‚Ü‚·(``Bzip2‚Ì“üŽè''‚̏͂ðŽQÆ‚µ‚ĉº‚³‚¢)BRed
  Hat‚Ì‚à‚Ì‚Í‚±‚±‚É‚ ‚è‚Ü‚·B

  (–󒍁Fbzip2 ƒz[ƒ€ƒy[ƒWAhttp://www.muraroa.demon.co.uk/)

  2.3.  ƒ}ƒVƒ“—p‚Ìbzip2‚ðƒRƒ“ƒpƒCƒ‹‚·‚é

  gcc 2.7.2.3‚ðŽ‚Á‚Ä‚¢‚é‚È‚ç

       CFLAGS = -O3 -fomit-frame-pointer -funroll-loops

  ‚±‚̍s‚Å-O3‚ðŠO‚µ‚Ä

       CFLAGS = -fomit-frame-pointer -funroll-loops

  ‚ɕύX‚µ‚Ä‚¨‚¢‚ĉº‚³‚¢B

  ‚±‚Ì‚ ‚Æmake‚µ‚ÄREADME‚ŏ‘‚©‚ê‚Ä‚¢‚é‚悤‚ɃCƒ“ƒXƒg[ƒ‹‚µ‚Ü‚·B

  3.  ’P“Æ‚Åbzip2‚ðŽg‚¤

  ƒ}ƒjƒ…ƒAƒ‹ƒy[ƒW‚ð“Ç‚ñ‚ʼnº‚³‚¢ :)B

  4.  bzip2‚ðtar‚ÆŽg‚¤

  Šî–{“I‚É‚Q‚‚̕û–@‚ª‚ ‚è‚Ü‚·F

  4.1.  Ý’肵‚È‚­‚Ä‚æ‚¢F

  ‚±‚Ì•û–@‚Ȃ牽‚àÝ’肵‚È‚­‚Ä‚·‚Ý‚Ü‚·Bbzip2‚µ‚½tarƒA[ƒJƒC
  ƒufoo.tar.bz2‚ð un-tar‚·‚é‚ɂ̓JƒŒƒ“ƒgƒfƒBƒŒƒNƒgƒŠ‚ŁA

       /path/to/bzip2 -cd foo.tar.bz2 | tar xf -

  ‚Æ‚µ‚Ü‚·B‚±‚ê‚Å“®ì‚µ‚Ü‚·‚ªA‚¢‚¿‚¢‚¿“ü—Í‚·‚é‚Ì‚Í–Ê“|(PITA)‚Å‚·B

  4.2.  Žg‚¢‚â‚·‚¢:

  ˆÈ‰º‚̃pƒbƒ`‚ðGNU tar 1.12‚𓖂ĂăRƒ“ƒpƒCƒ‹/ƒCƒ“ƒXƒg[ƒ‹‚µ‚ĉº‚³‚¢B
  ‚±‚ê‚Å‚æ‚¢‚Å‚·Btar‚Æbzip2‚ª("which tar"A"which bzip2"‚ÆŽÀs‚µ‚Ä)
  $PATH‚É‚ ‚é‚©‚Ç‚¤‚©Šm”F‚µ‚Ä‚¨‚«‚Ü‚·Bƒtƒ@ƒCƒ‹‚ð“WŠJ‚·‚é‚É‚Í

        tar xyf foo.tar.bz2

  ‚Æ‚µ‚Ü‚·B

  V‚µ‚¢ƒA[ƒJƒCƒu‚ðì‚鎞‚à“¯‚¶‚悤‚É‚µ‚Ä

   tar cyf foo.tar.bz2 file1 file2 file3...directory1 directory2...

  ‚Æ‚µ‚Ü‚·B

  ˆÈ‰º‚̓pƒbƒ`‚Å‚· :) (–󒍁Fpatch -p1 < tar.c.diff‚Æ‚µ‚Ä‚ ‚Ăĉº‚³‚¢)

  ______________________________________________________________________
  *** tar.c.orig  Sat Feb 28 14:55:45 1998
  --- tar.c       Sat Feb 28 15:01:54 1998
  ***************
  *** 16,21 ****
  --- 16,24 ----
       with this program; if not, write to the Free Software Foundation, Inc.,
       59 Place - Suite 330, Boston, MA 02111-1307, USA.  */

  + /* Feb 2 98: patched by David Fetter to use bzip2 as a
  +              filter (option -y) */
  +
    #include "system.h"

    #include <getopt.h>
  ***************
  *** 196,201 ****
  --- 199,206 ----
      {"block-number", no_argument, NULL, 'R'},
      {"block-size", required_argument, NULL, OBSOLETE_BLOCKING_FACTOR},
      {"blocking-factor", required_argument, NULL, 'b'},
  +   {"bzip2", required_argument, NULL, 'y'},
  +   {"bunzip2", required_argument, NULL, 'y'},
      {"catenate", no_argument, NULL, 'A'},
      {"checkpoint", no_argument, &checkpoint_option, 1},
      {"compare", no_argument, NULL, 'd'},
  ***************
  *** 372,377 ****
  --- 377,383 ----
                  PATTERN                at list/extract time, a globbing PATTERN\
  n\
      -o, --old-archive, --portability   write a V7 format archive\n\
          --posix                        write a POSIX conformant archive\n\
  +   -y, --bzip2, --bunzip2             filter the archive through bzip2\n\
      -z, --gzip, --ungzip               filter the archive through gzip\n\
      -Z, --compress, --uncompress       filter the archive through compress\n\
          --use-compress-program=PROG    filter through PROG (must accept -d)\n"),
  ***************
  *** 448,455 ****
       Y  per-block gzip compression */

    #define OPTION_STRING \
  !   "-01234567ABC:F:GK:L:MN:OPRST:UV:WX:Zb:cdf:g:hiklmoprstuvwxz"
  !
    static void
    set_subcommand_option (enum subcommand subcommand)
    {
  --- 454,460 ----
       Y  per-block gzip compression */

    #define OPTION_STRING \
  !   "-01234567ABC:F:GK:L:MN:OPRST:UV:WX:Zb:cdf:g:hiklmoprstuvwxyz"
    static void
    set_subcommand_option (enum subcommand subcommand)
    {
  ***************
  *** 806,811 ****
  --- 811,820 ----
          exclude_option = 1;
          add_exclude_file (optarg);
          break;
  +
  +       case 'y':
  +         set_use_compress_program_option ("bzip2");
  +         break;

          case 'z':
          set_use_compress_program_option ("gzip");
  ______________________________________________________________________

  5.  less‚Åbzip2‚ðŽg‚¤

  bzip2ƒtƒ@ƒCƒ‹‚ð‚·‚®‚É“WŠJ‚·‚邽‚߂ɁA—Ⴆ‚΂͂¶‚ß‚Ébunzip2‚ðŽg‚킸
  "less"‚ðŽg‚¤‚½‚߂ɁA"lesspipe.sh"‚ðì‚è‚Ü‚·(less‚Ìmanƒy[ƒWŽQÆ)F

  ______________________________________________________________________
  #!/bin/sh
  # This is a preprocessor for 'less'.  It is used when this environment
  # variable is set:   LESSOPEN="|lesspipe.sh %s"
    case "$1" in
    *.tar) tar tvvf $1 2>/dev/null ;; # View contents of .tar and .tgz files
    *.tgz) tar tzvvf $1 2>/dev/null ;;
    *.tar.gz) tar tzvvf $1 2>/dev/null ;;
    *.tar.Z) tar tzvvf $1 2>/dev/null ;;
    *.tar.z) tar tzvvf $1 2>/dev/null ;;
    *.bz2) bzip2 -dc $1  2>/dev/null ;; # View compressed files correctly
    *.Z) gzip -dc $1  2>/dev/null ;;
    *.z) gzip -dc $1  2>/dev/null ;;
    *.gz) gzip -dc $1  2>/dev/null ;;
    *.zip) unzip -l $1 2>/dev/null ;;
    *.1|*.2|*.3|*.4|*.5|*.6|*.7|*.8|*.9|*.n|*.man) FILE=`file -L $1` ; # groff src
      FILE=`echo $FILE | cut -d ' ' -f 2`
      if [ "$FILE" = "troff" ]; then
        groff -s -p -t -e -Tascii -mandoc $1
      fi ;;
    *) cat $1 2>/dev/null ;;
  #  *) FILE=`file -L $1` ; # Check to see if binary, if so -- view with 'strings'
  #    FILE1=`echo $FILE | cut -d ' ' -f 2`
  #    FILE2=`echo $FILE | cut -d ' ' -f 3`
  #    if [ "$FILE1" = "Linux/i386" -o "$FILE2" = "Linux/i386" \
  #         -o "$FILE1" = "ELF" -o "$FILE2" = "ELF" ]; then
  #      strings $1
  #    fi ;;
    esac
  ______________________________________________________________________

  (–󒍁FŠÂ‹«•Ï”LESSOPEN‚ðÝ’肵‚Ä‚¨‚«‚Ü‚·)

  6.  emacs‚Åbzip2‚ðŽg‚¤

  ’˜ŽÒ‚Íjka-compr.el‚É“–‚Ä‚éˆÈ‰º‚̃pƒbƒ`‚ð‘‚«‚Ü‚µ‚½B
  auto-compression-mode‚Ébzip2‚ð’ljÁ‚·‚é‚à‚Ì‚Å‚·B

  –Ɛӎ–€Femacs-20.2‚ŃeƒXƒg‚µ‚½‚¾‚¯‚Å‚·‚ªA‘¼‚̃o[ƒWƒ‡ƒ“‚Å“®ì‚µ‚È‚¢
  ‚Æ‚¢‚¤‚±‚Æ‚Í‚È‚¢‚ÆŽv‚¢‚Ü‚·

  1. emacs-20.2/lispƒ\[ƒXƒfƒBƒŒƒNƒgƒŠ‚Ɉړ®‚µ‚Ü‚·(untar‚µ‚½êŠ‚ª‚Ç‚±‚Å
     ‚ ‚ê)B

  2. ‰º‹L‚Ìjka-compr.el.diffƒpƒbƒ`ƒtƒ@ƒCƒ‹‚ð’u‚«‚Ü‚·(‚»‚ê‚Æ“¯‚¶–¼‘O‚Ì
     ƒtƒ@ƒCƒ‹‚Í‚ ‚è‚Ü‚¹‚ñ ;)B

  3.

        patch < jka-compr.el.diff

  ‚ÆŽÀs‚µ‚Ü‚·B

  4. emacs‚𗧂¿ã‚°‚Ä

        M-x byte-compile-file jka-compr.el

  ‚Æ‚µ‚Ü‚·B

  5. emasc‚ðI—¹‚µ‚Ü‚·B

  6. ƒoƒO‚ª‚ ‚Á‚½‚Æ‚«‚Ì‚½‚߂ɃIƒŠƒWƒiƒ‹‚Ìjka-compr.elc‚ðˆÀ‘S‚ȏꏊ‚Ɉړ®
     ‚µ‚Ä‚¨‚«‚Ü‚·B

  7. V‚µ‚¢jka-compr.elc‚Æ’u‚«Š·‚¦‚Ü‚·B

  8. Have fun!

  ______________________________________________________________________
  --- jka-compr.el        Sat Jul 26 17:02:39 1997
  +++ jka-compr.el.new    Thu Feb  5 17:44:35 1998
  @@ -44,7 +44,7 @@
   ;; The variable, jka-compr-compression-info-list can be used to
   ;; customize jka-compr to work with other compression programs.
   ;; The default value of this variable allows jka-compr to work with
  -;; Unix compress and gzip.
  +;; Unix compress and gzip.  David Fetter added bzip2 support :)
   ;;
   ;; If you are concerned about the stderr output of gzip and other
   ;; compression/decompression programs showing up in your buffers, you
  @@ -121,7 +121,9 @@

   ;;; I have this defined so that .Z files are assumed to be in unix
  -;;; compress format; and .gz files, in gzip format.
  +;;; compress format; and .gz files, in gzip format, and .bz2 files,
  +;;; in the snappy new bzip2 format from http://www.muraroa.demon.co.uk.
  +;;; Keep up the good work, people!
   (defcustom jka-compr-compression-info-list
     ;;[regexp
     ;; compr-message  compr-prog  compr-args
  @@ -131,6 +133,10 @@
        "compressing"    "compress"     ("-c")
        "uncompressing"  "uncompress"   ("-c")
        nil t]
  +    ["\\.bz2\\'"
  +     "bzip2ing"        "bzip2"         ("")
  +     "bunzip2ing"      "bzip2"         ("-d")
  +     nil nil]
       ["\\.tgz\\'"
        "zipping"        "gzip"         ("-c" "-q")
        "unzipping"      "gzip"         ("-c" "-q" "-d")
  ______________________________________________________________________

  7.  xv‚Åbzip2‚ðŽg‚¤

  xv‚Åbzip2ƒtƒ@ƒCƒ‹‚ÌŽ©“®“WŠJ(auto-decompress)‚ð‚·‚éƒpƒbƒ`‚ðŽg‚Á‚Ä“®ì‚³
  ‚¹‚Ä‚¢‚Ü‚·Bcompress‚âgzip‚ōs‚¦‚é•û–@‚ɂ‚¢‚Ä‚¾‚ê‚©•‚¯‚Ä‚­‚ê‚Ü‚¹‚ñ
  ‚©H

  8.  (–óŽÒ’ljÁF)fd,ls‚Åbzip2‚ðŽg‚¤

  8.1.  fd

  fd‚Å‚·‚łɐݒ肳‚ê‚Ä‚¢‚égzip'd tarƒA[ƒJƒCƒu‚Æ“¯‚¶‚Å‚·Bƒ\[ƒX‚ð•ÏX‚·
  ‚éê‡‚Í

  ______________________________________________________________________
  --- orig/archive.c      Thu Feb 26 06:33:27 1998
  +++ archive.c   Thu Feb 26 04:19:35 1998
  @@ -117,6 +117,7 @@
          {" ^.*\\.tar$",         "tar tvf",              PM_TAR},
          {" ^.*\\.tar\\.Z$",     "zcat %C | tar tvf -",  PM_TAR},
          {" ^.*\\.tar\\.gz$",    "gzip -cd %C | tar tvf -",      PM_TAR},
  +       {" ^.*\\.tar\\.bz2$",   "bzip2 -cd %C | tar tvf -",     PM_TAR},
          {NULL,                  NULL,           255, 0, "", "", "", "", 1}
   };
   archivetable archivelist[MAXARCHIVETABLE] = {
  @@ -130,8 +131,6 @@
                                                  "zcat %C | tar xf - %TA"},
          {" ^.*\\.tar\\.gz$",    "tar cf %X %T; gzip %X",
                                                  "gzip -cd %C | tar xf - %TA"},
  -       {" ^.*\\.tar\\.bz2$",   "tar cf %X %T; bzip2 %X",
  -                                               "bzip2 -cd %C | tar xf - %TA"},
          {NULL,                  NULL,                   NULL}
   };
  ______________________________________________________________________

  ‚ðfdƒ\[ƒX“WŠJƒfƒBƒŒƒNƒgƒŠ‚Åpatch -p1 < archive.diff‚Æ‚ ‚Ä‚Ä (‚ ‚é‚¢‚Í
  Žè‚Å’¼Ú•ÏX‚µ‚Ä)Amake‚µ‚Ü‚·B

  ‚Ü‚½~/.fdrc‚Őݒ肷‚éê‡‚́A# launcher definition‚Å

  ______________________________________________________________________
  launch ".tar.bz2"\
                  "tar tvfy"      0,0:1,2-'/',2'/',3,4-'-',4'-'-'-',4[9],5,6
  ______________________________________________________________________

  ‚ƒljÁ‚·‚邾‚¯‚Å‚·(# examples for GNU tar >=1.12)B“¯—l‚É# archiver
  definition‚É

  ______________________________________________________________________
  arch ".tar.bz2" "tar cf %X %T; bzip2 %X"        "bzip2 -cd %C|tar xf - %TA"
  ______________________________________________________________________

  ‚à’ljÁ‚µ‚Ä‚¨‚«‚Ü‚·Bgzip‚Æ“¯‚¶‚È‚Ì‚ÅgzipŽž‚̐ݒ肪A–¼‘O‚ð•Ï‚¦‚邾‚¯‚Å
  ‚»‚Ì‚Ü‚ÜŽg‚¦‚Ü‚·BŠÈ’P‚Å‚·‚ˁB

  ``less‚ÆŽg‚¤''Ílesspipe.sh ƒtƒ@ƒCƒ‹‚É

  ______________________________________________________________________
    *.tar.bz2) tar tyvvf $1 2>/dev/null ;;
  ______________________________________________________________________

  ‚à’ljÁ‚µ‚Ü‚·Btar‚Ågzip—p‚ÌzƒIƒvƒVƒ‡ƒ“‚ª‚ ‚é‚Ì‚Æ“¯‚¶‚悤‚Ébzip2—pƒIƒv
  ƒVƒ‡ƒ“y‚ðtar‚ɒljÁ‚µ‚Ä‚¨‚¢‚ĉº‚³‚¢ (``bzip2‚ðtar‚ÆŽg‚¤''Í)B

  8.2.  ls

  xterm(kterm)‚ł̃A[ƒJƒCƒuƒtƒ@ƒCƒ‹F‚ɒljÁ‚·‚邱‚Ƃɂ‚¢‚Ä‚Í JF‚©‚ç˜a
  –ó‚ào‚Ä‚¢‚éuColour-lsv"3.  ls ‚̃Jƒ‰[Ý’è–@"‚ðŽQl‚É‚µ‚ĉº‚³‚¢B

  —Ⴆ‚΁A/etc/DIR_COLORSƒtƒ@ƒCƒ‹‚ðˆÈ‰º‚̂悤‚ɕύX‚µ‚Ü‚· (ˆê•”ˆø—p)B

  ______________________________________________________________________

   .Z   01;31
   .gz  01;31
   .bz2 01;31       <--- ‚±‚±
   .jpg 01;35 # image formats
   .gif 01;35
   .bmp 01;35
  ______________________________________________________________________