--- apt-mirror-0.4.4.orig/apt-mirror +++ apt-mirror-0.4.4/apt-mirror @@ -68,7 +68,7 @@ use File::Copy; use File::Path; use File::Basename; - + my $config_file; my %config_variables = ( @@ -107,6 +107,46 @@ ###################################################################################### ## Common subroutines +sub round_number +{ + my $n = shift; + my $minus = $n < 0 ? '-' : ''; + $n = abs($n); + $n = int(($n + .05) * 10) / 10; + $n .= '.0' unless $n =~ /\./; + $n .= '0' if substr($n,(length($n) - 1),1) eq '.'; + chop $n if $n =~ /\.\d\d0$/; + return "$minus$n"; +} + +sub format_bytes { + my $bytes = shift; + my $bytes_out = '0'; + my $size_name = 'bytes'; + my $KiB = 1024; + my $MiB = 1024 * 1024; + my $GiB = 1024 * 1024 * 1024; + + if ($bytes >= $KiB) { + $bytes_out = $bytes / $KiB; + $size_name = 'KiB'; + if ($bytes >= $MiB) { + $bytes_out = $bytes / $MiB; + $size_name = 'MiB'; + if ($bytes >= $GiB) { + $bytes_out = $bytes / $GiB; + $size_name = 'GiB'; + } + } + } else { + $bytes_out = $bytes; + $size_name = 'bytes'; + } + + $bytes_out = round_number($bytes_out); + return "$bytes_out $size_name"; +} + sub get_variable { my $value = $config_variables{shift @_}; my $count = 16; @@ -313,8 +353,8 @@ sub proceed_index_gz { my $uri = shift; my $index = shift; - my ($path, $package, $mirror, $files); - + my ($path, $package, $mirror, $files) = ''; + $path = $uri; $path =~ s[^(\w+)://][]; $path =~ s/~/\%7E/g if get_variable("_tilde"); @@ -406,7 +446,10 @@ foreach (values %urls_to_download) { $need_bytes += $_; } -print "$need_bytes bytes will be downloaded into archive.\n"; + +my $size_output = format_bytes($need_bytes); + +print "$size_output will be downloaded into archive.\n"; download_urls("archive", sort keys %urls_to_download); @@ -481,7 +524,8 @@ if(get_variable("_autoclean")) { - print "$unnecessary_bytes bytes in $total files and " . scalar(@rm_dirs) . " directories will be freed..."; + my $size_output = format_bytes($unnecessary_bytes); + print "$size_output in $total files and " . scalar(@rm_dirs) . " directories will be freed..."; chdir get_variable("mirror_path") or die("apt-mirror: can't chdir to mirror"); @@ -490,7 +534,8 @@ } else { - print "$unnecessary_bytes bytes in $total files and " . scalar(@rm_dirs) . " directories can be freed.\n"; + my $size_output = format_bytes($unnecessary_bytes); + print "$size_output in $total files and " . scalar(@rm_dirs) . " directories can be freed.\n"; print "Run " . get_variable("cleanscript") . " for this purpose.\n\n"; print CLEAN "cd " . get_variable("mirror_path") . " || exit 1\n\n"; --- apt-mirror-0.4.4.orig/mirror.list +++ apt-mirror-0.4.4/mirror.list @@ -1,69 +1,30 @@ -# apt-mirror configuration file - -## -## The default configuration options (uncomment and change to override) -## -# -# set base_path /var/spool/apt-mirror -# set mirror_path $base_path/mirror -# set skel_path $base_path/skel -# set var_path $base_path/var +############# config ################## # -# set defaultarch -# set nthreads 20 +# set base_path /var/spool/apt-mirror # - - -## -## Example sources -## - -# sarge's section -deb http://ftp.fi.debian.org/debian sarge main contrib non-free -deb-src http://ftp.fi.debian.org/debian sarge main contrib non-free - -deb http://security.debian.org/debian-security sarge/updates main contrib non-free -deb-src http://security.debian.org/debian-security sarge/updates main contrib non-free - -deb http://ftp.fi.debian.org/debian sarge main/debian-installer - - -# sarge-proposed-updates's section -deb http://ftp.fi.debian.org/debian sarge-proposed-updates main contrib non-free -deb-src http://ftp.fi.debian.org/debian sarge-proposed-updates main contrib non-free - - -# sid's section -deb http://ftp.fi.debian.org/debian sid main contrib non-free -deb-src http://ftp.fi.debian.org/debian sid main contrib non-free - -deb http://ftp.fi.debian.org/debian sid main/debian-installer - - -# experimental section -deb http://ftp.fi.debian.org/debian ../project/experimental main contrib non-free -deb-src http://ftp.fi.debian.org/debian ../project/experimental main contrib non-free - - -## -## Cleaner configuration example -## +# if you change the base path you must create the directories below with write privlages # +# set mirror_path $base_path/mirror +# set skel_path $base_path/skel +# set var_path $base_path/var # set cleanscript $var_path/clean.sh +# set defaultarch +set nthreads 20 +set tilde 0 # +############# end config ############## -# Cleaning section -clean http://security.debian.org/ -clean http://ftp.fi.debian.org/ +deb http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse +deb http://archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse +#deb http://archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse +deb http://archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse +#deb http://archive.ubuntu.com/ubuntu edgy-proposed main restricted universe multiverse + +deb-src http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse +#deb-src http://archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse +#deb-src http://archive.ubuntu.com/ubuntu edgy-proposed main restricted universe multiverse +clean http://archive.ubuntu.com/ubuntu -skip-clean http://ftp.fi.debian.org/doc/ -skip-clean http://ftp.fi.debian.org/tools/ -skip-clean http://ftp.fi.debian.org/debian-cd/ -skip-clean http://ftp.fi.debian.org/debian-minicd/ -skip-clean http://ftp.fi.debian.org/debian/dists/sarge/main/installer-i386/ -skip-clean http://ftp.fi.debian.org/debian/dists/sid/main/installer-i386/ -skip-clean http://ftp.fi.debian.org/debian/doc/ -skip-clean http://ftp.fi.debian.org/debian/tools/ -skip-clean http://ftp.fi.debian.org/debian/project/ -skip-clean http://ftp.fi.debian.org/debian-non-US/project/ --- apt-mirror-0.4.4.orig/debian/control +++ apt-mirror-0.4.4/debian/control @@ -1,19 +1,20 @@ Source: apt-mirror Section: net Priority: optional -Maintainer: Dmitry N. Hramtsov -Build-Depends-Indep: debhelper (>> 3.0.0) -Standards-Version: 3.5.2 +Maintainer: Brandon Holtsclaw +Build-Depends: debhelper (>= 5) +Standards-Version: 3.7.2 Package: apt-mirror Architecture: all -Depends: wget, perl, perl-modules +Depends: wget, perl, perl-modules, adduser Description: APT sources mirroring tool - A small and efficient tool that provides ability to mirror any parts (or even all) - of Debian GNU/Linux distribution or any other apt sources which often provided - by debian developers. + A small and efficient tool that provides ability to mirror + any parts (or even all) of Debian GNU/Linux distribution + or any other apt sources which often provided by Debian + developers. . - Projects main goals: + Project's main goals: * It takes config similar to apt's "sources.list" * It is fully pool comply * It supports multithreaded downloading @@ -21,3 +22,6 @@ * It can automatically remove unneeded files * It successfully works on overloaded channel to internet * It never makes inconsistent mirror including while mirroring + . + Homepage: http://apt-mirror.sourceforge.net/ + --- apt-mirror-0.4.4.orig/debian/rules +++ apt-mirror-0.4.4/debian/rules @@ -6,7 +6,7 @@ #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. -export DH_COMPAT=3 +export DH_COMPAT=5 build: build-stamp @@ -20,7 +20,7 @@ dh_testdir dh_testroot rm -f build-stamp - + rm -f debian/conffiles dh_clean install: build --- apt-mirror-0.4.4.orig/debian/watch +++ apt-mirror-0.4.4/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://prdownloads.sourceforge.net/apt-mirror/apt-mirror_(\d+\..+)\.tar.gz --- apt-mirror-0.4.4.orig/debian/changelog +++ apt-mirror-0.4.4/debian/changelog @@ -1,3 +1,21 @@ +apt-mirror (0.4.4-3ubuntu1) edgy; urgency=low + + * Merge with debian unstable + * Modified the mirror.list to reflect the edgy archive not the debian one + + -- Brandon Holtsclaw Fri, 1 Sep 2006 09:31:59 -0500 + +apt-mirror (0.4.4-3) unstable; urgency=low + + * Added the GPL preamble to debian/copyright + * Raised debhelper compat to 5 from 3 + * Changed download and clean.sh size calculations to return human readable output ( KiB,MiB,GiB vs bytes ) + * added clean.sh to postinstall to make it +x on install + * Added debian/watch + * Closes RFP Bug 293048 (Closes: #293048) + + -- Brandon Holtsclaw Wed, 09 Aug 2006 06:08:26 -0500 + apt-mirror (0.4.4-2) unstable; urgency=low * Bugfix: default architecture identification on non-debian systems v2 --- apt-mirror-0.4.4.orig/debian/postinst +++ apt-mirror-0.4.4/debian/postinst @@ -1,4 +1,5 @@ #!/bin/sh -e +#DEBHELPER# action="$1" oldversion="$2" @@ -21,13 +22,19 @@ chown apt-mirror:apt-mirror /var/spool/apt-mirror/var } +setup_aptmirror_clean() { + touch /var/spool/apt-mirror/var/clean.sh + chown apt-mirror:apt-mirror /var/spool/apt-mirror/var/clean.sh + chmod +x /var/spool/apt-mirror/var/clean.sh +} + setup_aptmirror_user set_aptmirror_owner # Automatically added by dh_installdocs -if [ "$1" = "configure" ]; then - if [ -d /usr/doc -a ! -e /usr/doc/apt-mirror -a -d /usr/share/doc/apt-mirror ]; then - ln -sf ../share/doc/apt-mirror /usr/doc/apt-mirror - fi -fi +#if [ "$1" = "configure" ]; then +# if [ -d /usr/doc -a ! -e /usr/doc/apt-mirror -a -d /usr/share/doc/apt-mirror ]; then +# ln -sf ../share/doc/apt-mirror /usr/doc/apt-mirror +# fi +#fi # End automatically added section --- apt-mirror-0.4.4.orig/debian/copyright +++ apt-mirror-0.4.4/debian/copyright @@ -1,8 +1,33 @@ This package was debianized by Dmitry N. Hramtsov on -Sat, 27 Jul 2002 12:44:33 +0700. +Sat, 27 Jul 2002 12:44:33 +0700 +and modified for Debian by Brandon Holtsclaw on +Mon, 10 Jul 2006 12:44:33 -0500. It was downloaded from http://apt-mirror.sourceforge.net/ -Upstream Author(s): Dmitry N. Hramtsov +Copyright (C) 2005 Dmitry N. Hramstov -Copyright: GPLv2 +Upstream Author: + Dmitry N. Hramtsov + +Copyright Holder: + Dmitry N. Hramtsov + +License: + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'.