Re: Offline use of apt-cacher

2006-01-23 Thread Anuradha Ratnaweera
On 1/24/06, Eduard Bloch <[EMAIL PROTECTED]> wrote:
>
> # Set the following value to the maximum age (in hours) for method A or to 0
> # for method B
> expire_hours=0

It seems that if a file is not found, i.e., apt-get update prints an
`Ign', isn't it a good idea to cache, or rather negative cache, that
as well?

Anuradha
--
http://www.linux.lk/~anuradha/
http://anuradha-ratnaweera.blogspot.com


Re: Offline use of apt-cacher

2006-01-23 Thread Anuradha Ratnaweera
On 1/24/06, Eduard Bloch <[EMAIL PROTECTED]> wrote:
> #include 

Hi again,

> * Anuradha Ratnaweera [Mon, Jan 23 2006, 06:24:08PM]:
>
> > - Lazy online: we like apt-cacher to fetch a Packages/Release file
> > only if it old as set by a timeout.  So if one runs apt-get update
> > many times during a short period, only the first one will need to make
> > a HEAD/GET request.  (Lazy online has one tricky case if Packages file
> > does get update before timeout, but that can be handled neatly and
> > transparently as we are online).
>
> Fine... but don't you describe what is said in the comments in
> apt-cacher.conf?

Oops...  Please forgive my ignorance.  I think I rushed into check the
files in /usr/share/apt-cacher/ without reading the config file...

> So you basically want it to detect whether it's online and deliever the
> old version if it's offline? That would be a bit uncomfortable in the
> code because I would like to know up-front whether the file needs to be
> refreshed or not. And how to detect the off-line status quick enough,
> and not be confused with a timeout/slow server?

This means case 2 is also handled with apt-cacher as is, perfect! :-)

Having a small external program that sets expire_hours automatically
is fine with us.  I created this very crude sudo script which is run
just before Saegiri:

#!/bin/bash

cd /etc/apt-cacher/
cp -f apt-cacher.conf.orig apt-cacher.conf
num_interfaces=$(grep ':' /proc/net/dev | egrep -v 'lo:|:[[:space:]]*0' | wc -l)
[ $num_interfaces -ge 1 ] && \
sed -i 's/^[[:space:]]*expire_hours[[:space:]]*=.*/expire_hours=10/' \
/etc/apt-cacher/apt-cacher.conf

To complete this discussion, we need to clarify a couple of scenarios.
 Let's start with one.  I'll use an example to ease the explaination,
and let's assume expire_hours is set to 12.

- apt-get update is run at 09:00, and Packages/Release/Sources files
are actually fetched; the lists include version 1.0.1 of package x.
- package x is not in the cache.
- package x is upgraded to version 1.0.2 in the repository at 10:00.
- apt-get install x is run at 11:00 which will look for versin 1.0.1
and apt-cacher will get a 404.

Does apt-cacher mark the related Packages/Sources file(s) as `expired'
at that point, so that someone can correct the situation by running
apt-get update next time without waiting until 21:00?

Thanks in advance.

Anuradha
--
http://www.linux.lk/~anuradha/
http://anuradha-ratnaweera.blogspot.com


Offline use of apt-cacher

2006-01-23 Thread Anuradha Ratnaweera
[Couldn't find any list related to apt-cacher or apt-cacher2, and I
noticed some discussions of them on debian-devel, so I am CCing debian
devel.  But if there is a better place to discuss this, please point
me to it, thanks!]

Hi Eduard and Jonathan,

Recently we started using apt-cacher2 extensively and are very happy
with it, great piece of work!  In fact, we standardize Saegiri, our
automated live CD build script, on apt-cacher
(http://taprobane.org/saegiri.php).

We found two cases where it could be a little better.  Before getting
hands dirty implementing any changes, I am very keen to hear some
feedback / suggestions.

We want to use apt-cacher in three different ways; the first one is
how it behaves now, and we are looking for ways to get the other two
behaviours. (I am just inventing some terminology here, just because
we need names. :-) )

- Online: good for system updates.  Looks like apt-cacher is making a
HEAD request to see if Packages/Release files are out of date, which
is the right thing.

- Lazy online: we like apt-cacher to fetch a Packages/Release file
only if it old as set by a timeout.  So if one runs apt-get update
many times during a short period, only the first one will need to make
a HEAD/GET request.  (Lazy online has one tricky case if Packages file
does get update before timeout, but that can be handled neatly and
transparently as we are online).

  This mode is going to be very useful when:
  - upgrading a large number of machines
  - running a script which _needs_ to run apt-get update many times
(and it can't be rewritten to do it otherwise)

- Offline: apt-cacher is totally offline.  Files (Packages/Release
files as well as DEBs) are served if available, and returns 503 if not
available.

  This mode is very useful for laptop users without 100% internet
connectivity, but want to play around with installer programs etc.

Looking forward for feedback.  Thanks in advance!

Anuradha
--
http://www.linux.lk/~anuradha/
http://anuradha-ratnaweera.blogspot.com


New locale si_LK

2005-10-18 Thread Anuradha Ratnaweera
Hi all,

The locale si_LK was recently added to glibc (after a long stay in the
Bugzilla).  Please consider including it in the Debain glibc as it
will take some time before it will appear in mainstream glibc.  Thanks
in advance.

http://sourceware.org/bugzilla/show_bug.cgi?id=367

Anuradha

--
http://anuradha-ratnaweera.blogspot.com
http://www.linux.lk/~anuradha/