Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
deltup - экономия трафика при скачивании distfiles
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Russian
View previous topic :: View next topic  
Author Message
chernousov
Tux's lil' helper
Tux's lil' helper


Joined: 30 May 2004
Posts: 117

PostPosted: Thu Sep 23, 2004 9:45 am    Post subject: deltup - экономия трафика при скачив Reply with quote

Есть такая штука - deltup. Сам пользую её около месяца и чрезвычайно доволен ;).
В общем, всячески рекомендую.

Подробности здесь: https://forums.gentoo.org/viewtopic.php?t=215262.
Back to top
View user's profile Send private message
ZmiyGorinich
Guru
Guru


Joined: 27 Feb 2004
Posts: 369
Location: Zaporizhzhe, Ukraine

PostPosted: Fri Sep 24, 2004 9:33 am    Post subject: Reply with quote

А можешь расказать как эту штуку ставить и настраивать?
Back to top
View user's profile Send private message
icedank
Apprentice
Apprentice


Joined: 15 Apr 2004
Posts: 190

PostPosted: Fri Sep 24, 2004 11:44 am    Post subject: Reply with quote

Тама всё написано :)
Back to top
View user's profile Send private message
chernousov
Tux's lil' helper
Tux's lil' helper


Joined: 30 May 2004
Posts: 117

PostPosted: Fri Sep 24, 2004 11:59 am    Post subject: Reply with quote

icedank как всегда в своём репертуре...

Ок, разжую попунктно.

1. Стать рутом:
Code:
su -


2. Открыть /etc/make.conf и убедиться в наличии строки:
Code:
PORTDIR_OVERLAY="/usr/local/portage"
Если нет такой строки - добавить.

3. Создать соответствующую директорию для deltup'а и зайти туда:
Code:
mkdir -p /usr/local/portage/app-portage/deltup
cd /usr/local/portage/app-portage/deltup


4. Скачать туда ебилд:
Code:
wget http://linux01.gwdg.de/~nlissne/deltup-0.4.0.ebuild


5. Создать для него дайджест:
Code:
ebuild deltup-0.4.0.ebuild digest


6. Скачать в соответсвующее место getdelta.sh и дать ему (ей? ;)) права на выполнение:
Code:
cd /usr/local/bin
wget http://linux01.gwdg.de/~nlissne/getdelta.sh
chmod 755 getdelta.sh


7. Создать если не существует, или дописать в существующий специальный файлик информацию о том, что этот пакет у нас по жизни помеченый как ~x86:
Code:
mkdir -p /etc/portage
echo "app-portage/deltup ~x86" >> /etc/portage/package.keywords


8. Ну всё, пора емержить:
Code:
emerge deltup


9. Скажем портежам, что мы будем использовать getdelta.sh для скачивания наших дистфайлов. Для этого убедимся в том, что в /etc/make.conf есть такая строка:
Code:
FETCHCOMMAND="/usr/local/bin/getdelta.sh \${URI}"


Успехов!


Last edited by chernousov on Mon Oct 04, 2004 3:04 am; edited 1 time in total
Back to top
View user's profile Send private message
ZmiyGorinich
Guru
Guru


Joined: 27 Feb 2004
Posts: 369
Location: Zaporizhzhe, Ukraine

PostPosted: Fri Sep 24, 2004 1:04 pm    Post subject: Reply with quote

Спасибо... сейчас попробую :)
Back to top
View user's profile Send private message
LinuxMan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2004
Posts: 83
Location: Ukraine / Ternopil

PostPosted: Fri Sep 24, 2004 4:13 pm    Post subject: Reply with quote

Не работает на GCC3.4! Как пофиксить?
Back to top
View user's profile Send private message
icedank
Apprentice
Apprentice


Joined: 15 Apr 2004
Posts: 190

PostPosted: Sat Sep 25, 2004 7:01 am    Post subject: Reply with quote

Quote:

Не работает на GCC3.4! Как пофиксить?


1. Сделать патч

2. Ждать новой версии (я пару недель назад мылил автору и он сказал что возобновляет работу над deltup)

Quote:

icedank как всегда в своём репертуре...


Но там же действительно написано всё то что ты написал!!!
Back to top
View user's profile Send private message
ABVGD
n00b
n00b


Joined: 17 Sep 2003
Posts: 41
Location: Russia, St.-Petersburg

PostPosted: Sun Sep 26, 2004 7:39 pm    Post subject: Reply with quote

LinuxMan wrote:
Не работает на GCC3.4! Как пофиксить?

Кладем патч deltup-0.4.0-gcc34.patch в ${PORDIR_OVERLAY}/app-portage/deltup/files. Сам патч:
Code:
--- deltup-0.4.0/file.h 2003-07-20 07:33:05.000000000 +0400                                                                                                           
+++ deltup-modified-0.4.0/file.h        2004-09-26 23:12:00.100396288 +0400                                                                                           
@@ -129,7 +129,7 @@                                                                                                                                                   
     while (!list.empty() && num >= list.first->obj->num) {                                                                                                           
       unsigned numbuf = list.first->obj->num;                                                                                                                       
       memcpy(data, list.first->obj->buf, numbuf);                                                                                                                   
-      (char*)data+=numbuf;                                                                                                                                           
+      data=(char*)data+numbuf;                                                                                                                                       
               num-=numbuf;                                                                                                                                           
           numread+=numbuf;                                                                                                                                           
       delete (char*)list.first->obj->start;                                                                                                                         
@@ -139,7 +139,7 @@                                                                                                                                                   
     if (!list.empty()) {                                                                                                                                             
       memcpy(data, list.first->obj->buf, num);                                                                                                                       
       list.first->obj->num-=num;                                                                                                                                     
-      (char*)list.first->obj->buf+=num;                                                                                                                             
+      list.first->obj->buf=(char*)list.first->obj->buf+num;                                                                                                         
       numread+=num;                                                                                                                                                 
     } else {                                                                                                                                                         
       numread+=f.read(data, num);

deltup-0.4.0.ebuild теперь выглядит так:
Code:
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2                                                                                                             
# $Header: $
                                                                                                                                                                     
inherit eutils                                                                                                                                                       
                                                                                                                                                                     
S=${WORKDIR}/${P}                                                                                                                                                     
DESCRIPTION="Patch system for Gentoo sources.  Retains MD5 codes"                                                                                                     
HOMEPAGE="http://deltup.sourceforge.net"                                                                                                                             
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"                                                                                                                     
                                                                                                                                                                     
SLOT="0"                                                                                                                                                             
LICENSE="GPL-2"                                                                                                                                                       
KEYWORDS="~x86 ~ppc ~sparc"                                                                                                                                           
                                                                                                                                                                     
DEPEND=">=dev-util/xdelta-1.1.3                                                                                                                                       
        >=app-arch/bzip2-1.0.0"                                                                                                                                       
                                                                                                                                                                     
pkg_setup() {                                                                                                                                                         
        echo                                                                                                                                                         
        einfo ""                                                                                                                                                     
        einfo "Please note that deltup will be removed from portage "                                                                                                 
        einfo "in the near future.  Development on deltup has stopped, although "                                                                                     
        einfo "patches are being generated in the interim until another distfile "                                                                                   
        einfo "patching system is ready for testing."                                                                                                                 
        einfo ""                                                                                                                                                     
        einfo "further info will be available at "                                                                                                                   
        einfo "http://www.gentoo.org/proj/en/glep/glep-0009.html"                                                                                                     
        einfo ""                                                                                                                                                     
        echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null                                                                                                 
        echo -ne "\a" ; sleep 1                                                                                                                                       
        echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null                                                                                                 
        echo -ne "\a" ; sleep 1                                                                                                                                       
        sleep 3                                                                                                                                                       
}                                                                                                                                                                     
                                                                                                                                                                     
src_unpack () {                                                                                                                                                       
        unpack ${A}                                                                                                                                                   
        cd ${S}                                                                                                                                                                             
        GCC_MAJOR_VER=$(gcc-config -c | awk -F- '{print $NF}' | cut -d"." -f1)                                                                                                               
        GCC_MINOR_VER=$(gcc-config -c | awk -F- '{print $NF}' | cut -d"." -f2)
        if [[ "$GCC_MAJOR_VER" -eq "3" && "$GCC_MINOR_VER" -ge "4" ]]; then                                                                                                       
            epatch ${FILESDIR}/${P}-gcc34.patch                                                                                                                                   
        fi
}                                                                                                                                                                     
                                                                                                                                                                     
src_install () {                                                                                                                                                     
        make DESTDIR=${D} install || die                                                                                                                             
        dodoc README ChangeLog GENTOO                                                                                                                                 
        doman deltup.1                                                                                                                                               
}

Edited: Добавил проверку версии gcc. ebuild накладывает патч только для gcc-3.>=4.


Last edited by ABVGD on Mon Sep 27, 2004 6:00 am; edited 2 times in total
Back to top
View user's profile Send private message
chiko
n00b
n00b


Joined: 22 Jan 2004
Posts: 52
Location: Achinsk, Krasnoyarsky kray, Russia

PostPosted: Mon Sep 27, 2004 12:22 am    Post subject: Reply with quote

Кто-нибудь считал реальную экономию входящего трафика? В среднем, в процентах...
_________________
Athlon-XP 1900+
Fluxbox 0.99
Back to top
View user's profile Send private message
chernousov
Tux's lil' helper
Tux's lil' helper


Joined: 30 May 2004
Posts: 117

PostPosted: Mon Sep 27, 2004 1:53 am    Post subject: Reply with quote

На http://linux01.gwdg.de/~nlissne/ пишут следующее:
Quote:
How much traffic can be saved using the dynamic deltup server?

This depends on how much a source-archive changed between versions – some updates save a lot (for example updating firefox from version 0.9.1 to version 0.9.3 saves 98.77% of traffic - that means you would have to download 408 kB instead of >32MB) others are less efficient (for example updating wxGTK from version 2.4.2 to version 2.5.1 saves 57% only – but that still means you save more than 3MB of download, downloading 2.6 MB instead of 6MB) – Typically we save about 70-80% of traffic. Have a look at our cache-status-page which shows the current cache-content and some stats about filesizes and efficiency:

http://linux01.gwdg.de/~nlissne/deltup-status.atime.html (warning: this page is large)
Back to top
View user's profile Send private message
Balancer
Guru
Guru


Joined: 04 Jun 2004
Posts: 465

PostPosted: Mon Sep 27, 2004 5:59 pm    Post subject: Reply with quote

chernousov wrote:

2. Открыть /etc/make.conf и убедиться в наличии строки:
Code:
PORTDIR_OVERLAY="/usr/local/portage"
Если нет такой строки - добавить.


/usr/local/portage или /usr/portage? Это общая директория портежей или для своих нужд?

У меня при каждом ebuild выдаётся
Code:

Checking if a Thirdparty-Mirror is used ...

/usr/local/bin/getdelta.sh: eval: line 1: syntax error near unexpected token `)'
/usr/local/bin/getdelta.sh: eval: line 1: `echo )'
basename: too few arguments
Try `basename --help' for more information.
No third-party mirror.


Вот и думаю, где грабли... :)
Back to top
View user's profile Send private message
chernousov
Tux's lil' helper
Tux's lil' helper


Joined: 30 May 2004
Posts: 117

PostPosted: Tue Sep 28, 2004 2:48 am    Post subject: Reply with quote

Balancer wrote:
/usr/local/portage или /usr/portage? Это общая директория портежей или для своих нужд?

Именно local - для "своих" нужд.
Balancer wrote:
У меня при каждом ebuild выдаётся
Code:

Checking if a Thirdparty-Mirror is used ...

/usr/local/bin/getdelta.sh: eval: line 1: syntax error near unexpected token `)'
/usr/local/bin/getdelta.sh: eval: line 1: `echo )'
basename: too few arguments
Try `basename --help' for more information.
No third-party mirror.


Вот и думаю, где грабли... :)

Ммм... интересно.. попробую разобраться. По идее он из ебилда вытаскивает mirror:// и складывает их в /tmp/getdelta.tmp. Потом парсит этот файлик. Вот тут-то и затык.. Разберусь на досуге...
Back to top
View user's profile Send private message
Balancer
Guru
Guru


Joined: 04 Jun 2004
Posts: 465

PostPosted: Tue Sep 28, 2004 6:24 am    Post subject: Reply with quote

Именно 0.5.3
Я только вчера всё поставил.

В общем, после всех emerge sync и переноса оверлея в /usr/local/ такая ругань пропала (м.б. и ещё чего-то делал, в т.ч. точно несколько системных либ перекомпилял - я систему с майского компакта ставил, несколько устаревшая уже), но те несколько пакетов, что уже ставил (вот, сейчас alsa-headers качается) все ставятся выкачиваясь целиком. Либо эта система у меня не работает, либо слишком старые версии в моём distfiles :)
Back to top
View user's profile Send private message
chernousov
Tux's lil' helper
Tux's lil' helper


Joined: 30 May 2004
Posts: 117

PostPosted: Tue Sep 28, 2004 6:52 am    Post subject: Reply with quote

Досуга ждать пришлось не долго ;)
Вот патчик сбацал:
Code:
283,284c283,284
< grep "mirror://" $EBUILD | awk -F"mirror://" '{ print $2 }' | tr -d \" >/tmp/getdelta.tmp
< if [ -s /tmp/getdelta.tmp ]
---
>
> if [ ${EBUILD} <> "" ]
286,297c286,301
<       for mirrorline in $(cat /tmp/getdelta.tmp)
<       do
<               mline=$(eval echo $mirrorline)
<               mfile=$(basename ${mline})
<               if [ "${mfile}" = "${NEW_FILE}" ]
<               then
<                       mirror=$(cut -d/ -f1 <<< $mline)
<                       path=$(cut -d/ -f2- <<< $mline)
<                       let len=$(wc -c <<< $NEW_FILE)+1
<                       path=/$(echo $path | rev | cut -c ${len}- | rev)
<               fi
<       done
---
>       grep "mirror://" $EBUILD | awk -F"mirror://" '{ print $2 }' | tr -d \" >/tmp/getdelta.tmp
>       if [ -s /tmp/getdelta.tmp ]
>       then
>               for mirrorline in $(cat /tmp/getdelta.tmp)
>               do
>                       mline=$(eval echo $mirrorline)
>                       mfile=$(basename ${mline})
>                       if [ "${mfile}" = "${NEW_FILE}" ]
>                       then
>                               mirror=$(cut -d/ -f1 <<< $mline)
>                               path=$(cut -d/ -f2- <<< $mline)
>                               let len=$(wc -c <<< $NEW_FILE)+1
>                               path=/$(echo $path | rev | cut -c ${len}- | rev)
>                       fi
>               done
>       fi

Засунь это в какой-нить файлик типа getdelta.sh.patch и выполни:
Code:
patch /usr/local/bin/getdelta.sh getdelta.sh.patch
Back to top
View user's profile Send private message
LinuxMan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2004
Posts: 83
Location: Ukraine / Ternopil

PostPosted: Wed Sep 29, 2004 12:28 pm    Post subject: Reply with quote

Патч от ABVGD не работает через некоректность записи. От 100% работоющие файлы:

deltup-0.4.0.ebuild

Code:

# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/app-portage/deltup/deltup-0.4.0.ebuild,v 1.5 2004/02/21 10:56:55 ferringb Exp $

S=${WORKDIR}/${P}
DESCRIPTION="Patch system for Gentoo sources.  Retains MD5 codes"
HOMEPAGE="http://deltup.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86 ~ppc ~sparc"

DEPEND=">=dev-util/xdelta-1.1.3
   >=app-arch/bzip2-1.0.0"

pkg_setup() {
   echo
   einfo ""
   einfo "Please note that deltup will be removed from portage "
   einfo "in the near future.  Development on deltup has stopped, although "
   einfo "patches are being generated in the interim until another distfile "
   einfo "patching system is ready for testing."
   einfo ""
   einfo "further info will be available at "
   einfo "http://www.gentoo.org/proj/en/glep/glep-0009.html"
   einfo ""
   echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null
   echo -ne "\a" ; sleep 1
   echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null
   echo -ne "\a" ; sleep 1
   sleep 3
}
src_unpack () {
   unpack ${A}
   cd ${S}
   GCC_MAJOR_VER=$(gcc-config -c | awk -F- '{print $NF}' | cut -d"." -f1)
   GCC_MINOR_VER=$(gcc-config -c | awk -F- '{print $NF}' | cut -d"." -f2)
   if [[ "$GCC_MAJOR_VER" -eq "3" && "$GCC_MINOR_VER" -ge "4" ]]; then
      epatch ${FILESDIR}/${P}-gcc34.patch
   fi
}
src_install () {
   make DESTDIR=${D} install || die
   dodoc README ChangeLog GENTOO
   doman deltup.1
}


deltup-0.4.0-gcc34.patch

Code:

--- deltup-0.4.0/file.h   2003-07-20 06:33:05.000000000 +0300
+++ deltup-0.4.0-mod/file.h   2004-09-28 18:37:42.000000000 +0300
@@ -129,7 +129,7 @@
     while (!list.empty() && num >= list.first->obj->num) {
       unsigned numbuf = list.first->obj->num;
       memcpy(data, list.first->obj->buf, numbuf);
-      (char*)data+=numbuf;
+      data=(char*)data+numbuf;
               num-=numbuf;
           numread+=numbuf;
       delete (char*)list.first->obj->start;
@@ -139,7 +139,7 @@
     if (!list.empty()) {
       memcpy(data, list.first->obj->buf, num);
       list.first->obj->num-=num;
-      (char*)list.first->obj->buf+=num;
+      list.first->obj->buf=(char*)list.first->obj->buf+num;
       numread+=num;
     } else {
       numread+=f.read(data, num);
Back to top
View user's profile Send private message
ABVGD
n00b
n00b


Joined: 17 Sep 2003
Posts: 41
Location: Russia, St.-Petersburg

PostPosted: Wed Sep 29, 2004 1:28 pm    Post subject: Reply with quote

Ух уж эти copy-paste. Спасибо за поправку. Желательно в ebuild первой строкой добавить "inherit eutils". Без нее функция "epatch" может не сработать.
Back to top
View user's profile Send private message
LinuxMan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2004
Posts: 83
Location: Ukraine / Ternopil

PostPosted: Sat Oct 02, 2004 2:50 pm    Post subject: Reply with quote

ABVGD wrote:
Ух уж эти copy-paste. Спасибо за поправку. Желательно в ebuild первой строкой добавить "inherit eutils". Без нее функция "epatch" может не сработать.

Точно! Спасибо за попраку :D
Back to top
View user's profile Send private message
ZmiyGorinich
Guru
Guru


Joined: 27 Feb 2004
Posts: 369
Location: Zaporizhzhe, Ukraine

PostPosted: Thu Oct 14, 2004 3:40 pm    Post subject: Reply with quote

Сегодня при обновлении получил вот это:
Code:
A new version of getdelta.sh is available (0.6)
 
getdelta-0.6
 
please update.
 
The new version drop mirror-detection on client-side and the
query-format changed - therefor you *have to* update to keep it working.
 
There is an ebuild and a gensync-source available.
 
check http://linux01.gwdg.de/~nlissne/ for details

На сайте есть ebuild.... но вот как эго поставить чего то не догоняю...
Back to top
View user's profile Send private message
plisk
n00b
n00b


Joined: 03 Oct 2004
Posts: 19
Location: Minsk, Belarus

PostPosted: Thu Oct 14, 2004 3:52 pm    Post subject: Reply with quote

угу, вчера тож в непонятках был. после недолгого подбора урла таки слил новый getdelta.sh
http://linux01.gwdg.de/~nlissne/getdelta-0.6.tar.bz2
Back to top
View user's profile Send private message
chernousov
Tux's lil' helper
Tux's lil' helper


Joined: 30 May 2004
Posts: 117

PostPosted: Thu Oct 14, 2004 3:57 pm    Post subject: Reply with quote

RI-VVM wrote:
На сайте есть ebuild.... но вот как эго поставить чего то не догоняю...

Code:
su -
cd /usr/portage/distfiles/
wget http://linux01.gwdg.de/~nlissne/getdelta-0.6.tar.bz2
mkdir /usr/local/portage/app-portage/getdelta
cd /usr/local/portage/app-portage/getdelta/
wget http://linux01.gwdg.de/~nlissne/getdelta-0.6.ebuild
ebuild getdelta-0.6.ebuild digest
emerge getdelta
rm /usr/local/bin/getdelta.sh #удалим старый

Не забыть поправить в /etc/make.conf путь к getdelta.sh (поменять /usr/local/bin/getdelta.sh на /usr/bin/getdelta.sh)!
Back to top
View user's profile Send private message
ZmiyGorinich
Guru
Guru


Joined: 27 Feb 2004
Posts: 369
Location: Zaporizhzhe, Ukraine

PostPosted: Thu Oct 14, 2004 4:53 pm    Post subject: Reply with quote

Спасибо... я так и думал что на сайте чего-то не хватает :)
Back to top
View user's profile Send private message
ShadowK
n00b
n00b


Joined: 27 Feb 2004
Posts: 4

PostPosted: Sat Oct 16, 2004 10:00 am    Post subject: Reply with quote

Да, кстати, сразу поставить с ходу 0.6 не вышло, так как он зависить по RDEPEND от deltup. Так что пришлось ставить сначала 0.4 а потом 0.6.
Хотя, мне не понятно, почему бы в getdelta-0.6.ebuild нельзя было сразу добавить
Code:

DEPEND=">=dev-util/xdelta-1.1.3
                  >=app-arch/bzip2-1.0.0"

вместо
Code:

RDEPEND="app-portage/deltup"


может я чего-то не понимаю?
Back to top
View user's profile Send private message
chernousov
Tux's lil' helper
Tux's lil' helper


Joined: 30 May 2004
Posts: 117

PostPosted: Sat Oct 16, 2004 11:19 am    Post subject: Reply with quote

ShadowK wrote:
Да, кстати, сразу поставить с ходу 0.6 не вышло, так как он зависить по RDEPEND от deltup. Так что пришлось ставить сначала 0.4 а потом 0.6.
Хотя, мне не понятно, почему бы в getdelta-0.6.ebuild нельзя было сразу добавить
Code:

DEPEND=">=dev-util/xdelta-1.1.3
                  >=app-arch/bzip2-1.0.0"

вместо
Code:

RDEPEND="app-portage/deltup"
Хотя бы потому что xdelta и bzip2 - это ещё не deltup.
Back to top
View user's profile Send private message
ShadowK
n00b
n00b


Joined: 27 Feb 2004
Posts: 4

PostPosted: Mon Oct 18, 2004 12:21 pm    Post subject: Reply with quote

Ну хорошо, я понимаю, но все-таки, если кто-то просто ставит getdelta-0.6 то он и знать не будет, что такое deltup если не прочитает этот топик ... ну да ладно, черт с ним, главное что работает :)
Back to top
View user's profile Send private message
Apexman
Tux's lil' helper
Tux's lil' helper


Joined: 07 Apr 2004
Posts: 141

PostPosted: Tue Oct 19, 2004 2:23 pm    Post subject: Reply with quote

BTW, на sourceforge лежит deltup-0.4.2, ebuild имеется
http://sourceforge.net/project/showfiles.php?group_id=77305&package_id=78210
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Russian All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum