Bug#37999: marked as done ([OLD PROPOSAL]: A pre-install required space checking mechanism for Debian packages)
Your message dated Sun, 28 Mar 2004 17:45:26 +0200
with message-id <20040328154526.GD25294@mails.so.argh.org>
and subject line Has been fixed for more than six month
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 19 May 1999 16:21:53 +0000
Received: (qmail 2847 invoked from network); 19 May 1999 16:21:53 -0000
Received: from murphy.debian.org (209.176.56.6)
by master.debian.org with SMTP; 19 May 1999 16:21:53 -0000
Received: (qmail 17055 invoked from network); 19 May 1999 16:21:46 -0000
Received: from tiamat.ametro.net (HELO glaurung.green-gryphon.com) (@209.102.187.57)
by murphy.debian.org with SMTP; 19 May 1999 16:21:46 -0000
Received: (from srivasta@localhost)
by glaurung.green-gryphon.com (8.9.3/8.9.3/Debian/GNU) id LAA07682;
Wed, 19 May 1999 11:16:55 -0500
Sender: srivasta@golden-gryphon.com
X-Time: Wed May 19 11:16:53 1999
Mail-Copies-To: never
Organization: Manoj Srivastava's Home
To: submit@bugs.debian.org
Subject: [PROPOSED]: A pre-install required space checking mechanism for Debian packages
X-URL: http://www.datasync.com/%7Esrivasta/
From: Manoj Srivastava <srivasta@debian.org>
Date: 19 May 1999 11:16:54 -0500
Message-ID: <873e0t3uh5.fsf@glaurung.green-gryphon.com>
Lines: 130
User-Agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Package: debian-policy
Version: 2.5.0.0
Hi,
At several times during the last year or so, there have been
proposals about making it possible to do a preinstall space
check. This proposal includes a mechanism for doing just that.
This requires that we include size information; either in the
package .deb file or in ftp.debian.org/debian/indices/, or both, that
contain the du -S information for each package. I think that putting
the information into the Packages file is a bad idea -- especially
for large packages. We need a line per directory and there is no
reason to inflate the packages files for packages we ain't even
updating.
I personally tend to lean towards putting in a du file in each
package; since we only need a line per dir in the package, this file
should not be too big at all.
Any sheme, which calculates whether there is enough space at
hand, shall need information about each package; since we do not know
mount schemes a priori [my /usr/lib/ is a separate partition from
/usr]; we need information about each dir (since the a mount point is
a dir). a compressed du -S format is about as compact as the
information can get. So, I think, from what I remember about my info
theory casses, this scheme is as optimal as we can reasonably
expect. (embedding the information in packages files. downloaded over
and over by apt, seems a horrible waste of bandwidth; at least, apt
only downloades packages we are going to install).
The following script, to be run by the likes of apt on the
target system, looks at the du -S output for the package, and assigns
each dir to the correct device_no -- VOILA, no matter how you have
partitioned stuff, checkdu can tell exactly how much space is needed
on each partion. There were some comments about patitions mounted
via exotic methods may not be visible in /etc/mtab; in which case we
can make the checkdu script additionally read /etc/apt/extra-partitions
or something foe sites that use such partitions, and still work
automagically for the most common case of simpler sites (which use
local disks and NFS).
I can even make checkdu warn if there is not enough space; all
that is needed for this functionality is that the package maintainer
provide the du -S data.
This requires no retooling of dpkg, which I think is critical
for any scheme ;-). This method seems to be simple enough, and I
think meets our requirements.
I think this is important enough to warrant that the data be
collected; we can easily write dh_sizeinfo or whatever to create the
properly formatted du -S file;
manoj
----------------------------------------------------------------------
#! /usr/bin/perl -w
package Check_DU;
use strict;
use diagnostics;
use Carp;
require 5.001;
sub check_du {
my %data;
# find out the mount points of the devices
open DF, "df |" or die "Could not run df:$!" ;
while (<DF>) {
m!/dev.*\s(/\S*)! or next;
my $device_no = (stat($1))[0];
$data{$device_no}{'Name'} = $1;
}
close DF or die "Could not close pipe from df:$!" ;
# read all the du -S files given on the command line
while (<>) {
my ($size, $dir_name) = split /\s+/, $_;
my $device_no = (stat("/$dir_name"))[0];
$data{$device_no}{'Size'} += $size;
}
return \%data;
}
sub print_du {
my %params = @_;
croak("Need argument 'Size Data'") unless defined $params{'Size Data'};
for (sort keys %{$params{'Size Data'}}) {
next unless $params{'Size Data'}{$_}{'Size'};
printf "%10d %s\n", $params{'Size Data'}{$_}{'Size'},
$params{'Size Data'}{$_}{'Name'};
}
}
sub test_du {
my $data = &check_du();
&print_du('Size Data' => $data);
}
{ # Execute simple test if run as a script
package main; no strict;
eval join('',<main::DATA>) || die "$@ $main::DATA" unless caller();
}
1;
__END__
# Test the library
&Check_DU::test_du();
1;
----------------------------------------------------------------------
--
Visit[1] the beautiful Smoky Mountains! [1] visit, v.: Come for a
week, spend too much money and pay lots of hidden taxes, then leave.
We'll be happy to see your money again next year. You can save time
by simply sending the money, if you're too busy.
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/%7Esrivasta/>
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
---------------------------------------
Received: (at 37999-done) by bugs.debian.org; 28 Mar 2004 15:45:29 +0000
>From aba@not.so.argh.org Sun Mar 28 07:45:29 2004
Return-path: <aba@not.so.argh.org>
Received: from mail-in.m-online.net [62.245.150.237]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1B7cTY-0007Po-00; Sun, 28 Mar 2004 07:45:28 -0800
Received: from mail.m-online.net (svr14.m-online.net [192.168.3.144])
by svr8.m-online.net (Postfix) with ESMTP id 6FA634BF4E;
Sun, 28 Mar 2004 17:45:27 +0200 (CEST)
Received: from sol.so.argh.org (ppp-82-135-4-50.mnet-online.de [82.135.4.50])
by mail.m-online.net (Postfix) with ESMTP id 2A8636AA10;
Sun, 28 Mar 2004 17:45:27 +0200 (CEST)
Received: from aba by sol.so.argh.org with local (Exim 4.22 #1 (Debian) [+prerelease])
id 1B7cTW-00076R-AV; Sun, 28 Mar 2004 17:45:26 +0200
Date: Sun, 28 Mar 2004 17:45:26 +0200
From: Andreas Barth <aba@not.so.argh.org>
To: 23661-done@bugs.debian.org, 27205-done@bugs.debian.org,
33251-done@bugs.debian.org, 36151-done@bugs.debian.org,
37999-done@bugs.debian.org, 39125-done@bugs.debian.org,
42870-done@bugs.debian.org, 43724-done@bugs.debian.org,
51473-done@bugs.debian.org, 54985-done@bugs.debian.org,
62768-done@bugs.debian.org, 63598-done@bugs.debian.org,
65578-done@bugs.debian.org, 71805-done@bugs.debian.org,
78014-done@bugs.debian.org, 79541-done@bugs.debian.org,
82595-done@bugs.debian.org, 83669-done@bugs.debian.org,
85500-done@bugs.debian.org, 88058-done@bugs.debian.org,
100586-done@bugs.debian.org, 101162-done@bugs.debian.org,
102917-done@bugs.debian.org, 109171-done@bugs.debian.org,
119559-done@bugs.debian.org, 191036-done@bugs.debian.org,
197835-done@bugs.debian.org
Subject: Has been fixed for more than six month
Message-ID: <20040328154526.GD25294@mails.so.argh.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
X-Editor: Vim http://www.vim.org/
Delivered-To: 37999-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-2.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level:
Hi,
this bug was set to the status "fixed" more than six month ago, so I'm
closing it now. For an announcement of this, see
http://lists.debian.org/debian-policy/2004/debian-policy-200403/msg00042.html
Cheers,
Andi
--
http://home.arcor.de/andreas-barth/
PGP 1024/89FB5CE5 DC F1 85 6D A6 45 9C 0F 3B BE F1 D0 C5 D1 D9 0C
Reply to: