Ä¿ÇǴнº, ½Ã½ºÅÛ ¿£Áö´Ï¾îÀÇ ½°ÅÍ
  FreeBSD portsnap ¹Ì·¯¸µ(?) ¼­¹ö ¸¸µé±â ÀÛ¼ºÀÏ : 2013/05/07 18:45
 
  • ±Û¾´ÀÌ : ÁÁÀºÁøÈ£ ( http://coffeenix.net/ )
  • Á¶È¸¼ö : 10406
     
    Á¦  ¸ñ : FreeBSD portsnap ¹Ì·¯¸µ(?) ¼­¹ö ¸¸µé±â
    ÀÛ¼ºÀÚ : ÁÁÀºÁøÈ£(truefeel, http://coffeenix.net/ )
    ÀÛ¼ºÀÏ : 2013.5.6(¿ù)

    cvsupÀ» »ç¿ëÇÑ FreeBSDÀÇ ports tree ¾÷µ¥ÀÌÆ®¸¦ 2013³â 3¿ùºÎÅÍ ´õÀÌ»ó Áö¿øÇÏÁö ¾Ê´Â´Ù.

    Announcing the end of port CVS
    http://lists.freebsd.org/pipermail/freebsd-ports/2012-September/078099.html

     
    For those reasons by February 28th 2013 the FreeBSD ports tree will no longer be exported to CVS. Therefore ports tree updates via CVS or CVSup will no longer available after that date. All users who use CVS or CVSup to update the ports tree are encouraged to switch to portsnap(8) [1] or for users which need more control over their ports collection checkout use Subversion directly:
     



    1. portsnap »ç¿ë

    ports¸¦ °¡Á®¿À´Â ¹æ¹ýÀº cvsup(ÀÌÁ¦ ¹ÌÁö¿ø), portsnap, SVN µîÀÌ ÀÖ´Ù.
    portsnap »ç¿ëÀº °£´ÜÇÏ´Ù. fetch, extract, update ¸í·É 3°¡Áö¸¸ ±â¾ïÇÏ¸é µÈ´Ù.

    fetch   : ports tree¸¦ °¡Á®¿Â´Ù. /var/db/portsnap¿¡ ¾ÐÃàµÈ snapshotÀÌ ÀúÀåµÈ´Ù.
    extract : °¡Á®¿Â ports tree¸¦ /usr/ports¿¡ Ǭ´Ù.
    update  : °¡Á®¿Â ports tree¸¦ updateÇÑ´Ù.

    portsnap óÀ½¿¡´Â fetch¿Í extract ¸í·ÉÀ» ½ÇÇàÇÏ°í, ÀÌÈĺÎÅÍ´Â fetch¿Í update¸¦ ½ÇÇàÇÏ¸é µÈ´Ù.

     
    óÀ½¿¡¸¸
    # portsnap fetch extract
    ÀÌÈĺÎÅÍ
    # portsnap fetch update
     



    2. portsnap ¹Ì·¯¸µ ¼­¹ö ¼³Á¤

    cvsupÀ¸·Î ports Æ®¸®(tree¸¦ °¡Á®¿Ô´Ù¸é cvsup-mirrorÅøÀ» »ç¿ëÇؼ­ ¹Ì·¯¸µ(mirroring) ¼­¹ö¸¦ ½±°Ô ±¸ÃàÇÒ ¼ö ÀÖ¾ú´Ù. ÀÌÁ¦ ´õÀÌ»ó cvsup¿ë ports Æ®¸®¸¦ Áö¿øÇÏÁö ¾Ê´Â´Ù.

    portsnap´Â ¹Ì·¯¸µ ¼­¹ö¸¦ Á¦°øÇÏÁö ¾Ê´Â´Ù. ·ÎÄÿ¡ portsnap fetch¿ë ¼­¹ö¸¦ ±¸ÃàÇÏ·Á¸é ²Ä¼ö(?)°¡ ÇÊ¿äÇÏ´Ù.
    1) ¸ÕÀú portsnap fetch·Î ports Æ®¸® ½º³À¼¦À» °¡Á®¿Â ´ÙÀ½¿¡ -> 2) À̸¦ rsyncd·Î ´Ù¸¥ ¼­¹ö¿¡ Á¦°øÇÑ´Ù.

    portsnap ¹Ì·¯¸µ¿ëÀ¸·Î »ç¿ëÇÒ ¼­¹ö¿¡ ´ÙÀ½°ú °°Àº ½ºÅ©¸³Æ®¸¦ ¸¸µç´Ù. ±×¸®°í, ÁÖ±âÀûÀ¸·Î fetchÇϵµ·Ï crontab¿¡ µî·ÏÇØÁØ´Ù. cron¿¡¼­ fetch¸í·ÉÀ» ÇÒ ¶§´Â portsnap fetch ´ë½Å portsnap cronÀ¸·Î ÇØ¾ß ÇÑ´Ù.

    [ portsnap_fetch.sh ]
     
    #!/bin/sh

    DIR=/data/portsnap
    RESULT_FILE="/data/LOG/portsnap_fetch.txt"

    #
    date                    >> $RESULT_FILE
    portsnap -d $DIR  cron  >> $RESULT_FILE
    echo                    >> $RESULT_FILE
    echo                    >> $RESULT_FILE
     


     
    # ls -l /data/portsnap/
    total 4188
    -rw-r--r--  1 root  wheel  2110580 May  6 18:43 INDEX
    drwxr-xr-x  2 root  wheel  2123776 May  6 18:43 files
    -rw-r--r--  1 root  wheel      451 Apr  3 14:13 pub.ssl
    -rw-r--r--  1 root  wheel      235 May  6 18:43 serverlist
    -rw-r--r--  1 root  wheel      235 May  6 18:43 serverlist_full
    -rw-r--r--  1 root  wheel       45 May  6 18:43 serverlist_tried
    -rw-r--r--  1 root  wheel      527 May  6 18:43 tINDEX
    -rw-r--r--  1 root  wheel       85 May  6 18:43 tag
     


    ´Ù¸¥ ¼­¹ö¿¡¼­ portsnap fetchÇÑ ½º³À¼¦À» ¹Þ¾Æ°¥ ¼ö ÀÖµµ·Ï rsyncd.conf¸¦ ¼³Á¤ÇÑ´Ù.

    [ /usr/local/etc/rsyncd.conf ]
     
    pid file = /var/run/rsyncd.pid

    # global section
    uid             = root
    gid             = wheel
    use chroot      = yes
    max connections = 10
    hosts allow     = 192.168.123.0/24
    timeout         = 600

    [portsnap]
    path            = /data/portsnap
    read only       = yes
     



    3. portsnap Ŭ¶óÀ̾ðÆ®

    portsnap fetch ¸í·É ´ë½Å¿¡ rsync·Î ports Æ®¸® ½º³À¼¦À» ¹Þ¾Æ¿Â ÈÄ portsnap extract ¶Ç´Â update¸¦ ÇÏ¸é µÈ´Ù.

     
    # cd /var/db/portsnap
    # rsync -av --delete $INST::portsnap/ .
    #
    # portsnap update
     


    À§ÀÇ ¸í·ÉÀ» ½ÇÇàÇÏ´Â ½ºÅ©¸³Æ®´Â portsnap.sh¸¦ »ìÆ캼 °Í.

    ¡Ø portsnap ¹Ì·¯¸µ ¼­¹ö¸¦ ±¸ÃàÇÏÁö ¾Ê°í ³»ºÎ¼­¹ö ÅëÇؼ­ fetch¸¦ ¹Þ°í ½Í´Ù¸é, HTTP proxy ¼­¹ö¸¦ »ç¿ëÇÏ¸é µÈ´Ù.
       1) ³»ºÎ ¼­¹ö¿¡ HTTP proxy ¼­¹ö¸¦ ÇÑ´ë ¼³Á¤ÇÏ°í,
       2) ´Ù¸¥ ¼­¹ö¿¡¼­ setenv HTTP_PROXY http://³»ºÎ_proxy_¼­¹ö_IP ȯ°æº¯¼ö ¼³Á¤À» ÇÑ ÈÄ
       3) portsnap fetch ¸í·ÉÀ» ½ÇÇàÇϸé proxy ¼­¹ö ÅëÇؼ­ ports Æ®¸® ½º³À¼¦À» ¹Þ¾Æ¿Â´Ù.



    Ä¿ÇǴнº, ½Ã½ºÅÛ ¿£Áö´Ï¾îÀÇ ½°ÅÍ / URL : http://coffeenix.net/board_view.php?bd_code=1744