Skip to content

Commit

Permalink
* added TODO file
Browse files Browse the repository at this point in the history
* updated sidmirror to handle multiple architectures simultaneously
* updated .conf to reflect architecture changes
* NOTE: this entry should probably be backdated, as most of this was originally done 2006-05-27 13:28.
* bumping up version to 0.10


git-svn-id: file:///var/lib/svn/sidmirror/trunk@5 a5708ca9-3ca5-466d-bfd8-a0b0b83e70ac
  • Loading branch information
demonbane committed Mar 10, 2007
1 parent 28ffe12 commit 369a13f
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 32 deletions.
5 changes: 5 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* document the static-includes bit
* document in general. A man page would be good.
* provide a Makefile to handle installation
* optimize the damn search code... that's been bugging me for YEARS...
* add a -v option to use $version for something...
4 changes: 2 additions & 2 deletions cleanup/cleanold.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl

# cleanold.pl - delete old debs in local mirror
# (c) 2003-2005 Alex Malinovich (demonbane@the-love-shack.net)
# (c) 2003-2007 Alex Malinovich (demonbane@the-love-shack.net)
# Released under the GPL
# See www.fsf.org for a full copy of the GPL.

Expand All @@ -20,7 +20,7 @@
foreach (@filenames) {
chomp;
if (++$cnt < 20) {
$delline = $delline." ".$_;
$delline = $delline." \"".$_."\"";
}else {
`rm $delline`;
$delline = $_;
Expand Down
22 changes: 12 additions & 10 deletions cleanup/dupesearch.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl

# dupesearch.pl - delete old debs in local mirror
# (c) 2003-2005 Alex Malinovich (demonbane@the-love-shack.net)
# (c) 2003-2007 Alex Malinovich (demonbane@the-love-shack.net)
# Released under the GPL
# See www.fsf.org for a full copy of the GPL.

Expand All @@ -22,9 +22,9 @@
die ("Invalid local repository path! Check sidmirror.conf");
}
if ($config_hash->{"Architecture"}) {
$arch = $config_hash->{"Architecture"};
@arch = split(/\,/, $config_hash->{"Architecture"});
}else{
die ("Invalid architecture specified! Check sidmirror.conf");
$arch[0] = "i386";
}

if ($ARGV[0] eq "-a") {
Expand All @@ -39,13 +39,15 @@
@dirlist = grep {!/^\./ && -d "$rootdir/dists/sid/$_"} readdir (DISTDIR);
closedir DISTDIR;

foreach (@dirlist) {
my $packname = "$rootdir/dists/sid/$_/binary-$arch/Packages.gz";
if (-s $packname) {
print "Reading records from $_ Packages.gz...\n";
$oldcount = $#packfile;
push (@packfile, `gunzip --to-stdout $packname`);
print ((++$#packfile - $oldcount), " records read from $_\n\n");
foreach $packagearch (@arch) {
foreach (@dirlist) {
my $packname = "$rootdir/dists/sid/$_/binary-$packagearch/Packages.gz";
if (-s $packname) {
print "Reading records from $_ ($packagearch) Packages.gz...\n";
$oldcount = $#packfile;
push (@packfile, `gunzip --to-stdout $packname`);
print ((++$#packfile - $oldcount), " records read from $_\n\n");
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion cleanup/parseoldsize.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl

# parseoldsize.pl - calculate size of old debs
# (c) 2003 Alex Malinovich (demonbane@the-love-shack.net)
# (c) 2003-2007 Alex Malinovich (demonbane@the-love-shack.net)
# Released under the GPL
# See www.fsf.org for a full copy of the GPL.

Expand Down
15 changes: 8 additions & 7 deletions sidmirror.conf
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# The server to be mirrored
Mirror=http.us.debian.org
Mirror=debian.oregonstate.edu

# The path to the archive on the server
RepositoryPath=/debian

# The local path to mirror to
LocalPath=/home/demonbane/apt/debian
LocalPath=/mirrors/debian

# Architecture to be mirrored. Defaults to i386.
# If set to * will mirror all currently available architectures.
Architecture=i386
# Architecture(s) to be mirrored. Defaults to i386.
# You may specify multiple architectures by separating them
# with commas (,). You may also use * to mirror ALL architectures.
Architecture=i386,amd64

# Directory to place logs into. Defaults to ./logs.
# Note that depending on how sidmirror is run, a relative path
# can appear in different places, so you should specify a full
# path here.
LogDir=/home/demonbane/sidmirror/logs
LogDir=/var/log/sidmirror

# Directory where sidmirror is installed
InstallPath=/home/demonbane/sidmirror
InstallPath=/usr/local/lib/sidmirror
36 changes: 24 additions & 12 deletions sidmirror.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl

# sidmirror.pl - Sid mirroring script
# (c) 2003-2005 Alex Malinovich (demonbane@the-love-shack.net)
# (c) 2003-2007 Alex Malinovich (demonbane@the-love-shack.net)
# Released under the GPL
# See www.fsf.org for a full copy of the GPL.
#
Expand All @@ -23,6 +23,8 @@
# amd64. All other architectures SHOULD work but they have not been
# tested.

$version="0.10"

use Term::ProgressBar 2.00;
use Fcntl;
use ConfigFile;
Expand Down Expand Up @@ -53,9 +55,10 @@
}

if ($config_hash->{"Architecture"}) {
$arch = $config_hash->{"Architecture"};
# $arch = $config_hash->{"Architecture"};
@arch = split(/\,/, $config_hash->{"Architecture"});
}else {
$arch = "i386";
$arch[0] = "i386";
}

if ($config_hash->{"LogDir"}) {
Expand Down Expand Up @@ -130,8 +133,15 @@
################################################
do {
print "Retrieving newest Packages.gz from $server...\n";
# Generate our include string
foreach $includearch (@arch) {
$includestring .= " --include \"/main/binary-$includearch/Packages.gz\"";
$includestring .= " --include \"/contrib/binary-$includearch/Packages.gz\"";
$includestring .= " --include \"/non-free/binary-$includearch/Packages.gz\"";
$includestring .= " --include \"/main/debian-installer/binary-$includearch/Packages.gz\"";
}
$errcode = system(
"rsync -P --recursive --times --verbose --compress --delete-excluded --include \"/main/binary-$arch/Packages.gz\" --include \"/contrib/binary-$arch/Packages.gz\" --include \"/non-free/binary-$arch/Packages.gz\" --include \"/main/debian-installer/binary-$arch/Packages.gz\" --include \"*/\" --exclude \"*\" $server\:\:$serverpath/dists/sid/ $rootdir/dists/sid/ 1> Package.output 2> Package.error"
"rsync -P --recursive --times --verbose --compress --delete-excluded".$includestring." --include \"*/\" --exclude \"*\" $server\:\:$serverpath/dists/sid/ $rootdir/dists/sid/ 1> Package.output 2> Package.error"
);
$errcode /= 256;
$retry = "false";
Expand Down Expand Up @@ -162,14 +172,16 @@
# Dirty hack, but necessary to include debian installer.
push (@dirlist, "main/debian-installer");

foreach (@dirlist) {
my $packname = "$rootdir/dists/sid/$_/binary-$arch/Packages.gz";
if (-s $packname) {
print "Reading records from $_ Packages.gz...\n";
$oldcount = $#packfile;
push (@packfile, `gunzip --to-stdout $packname`);
print (($#packfile + 1 - $oldcount), " records read from $_\n\n");
push (@modch, "$packname");
foreach $packagearch (@arch) {
foreach (@dirlist) {
my $packname = "$rootdir/dists/sid/$_/binary-$packagearch/Packages.gz";
if (-s $packname) {
print "Reading records from ($packagearch) $_ Packages.gz...\n";
$oldcount = $#packfile;
push (@packfile, `gunzip --to-stdout $packname`);
print (($#packfile + 1 - $oldcount), " records read from $_\n\n");
push (@modch, "$packname");
}
}
}

Expand Down

0 comments on commit 369a13f

Please sign in to comment.