...
 
Commits (3)
debmirror (1:2.29) UNRELEASED; urgency=medium
[ Stefan Kisdaroczi ]
* Add version string and --version option.
* Add additional trace info (closes: #863194).
[ Colin Watson ]
* Automatically update $version at binary package build time.
-- Stefan Kisdaroczi <skisda@gmail.com> Sun, 11 Feb 2018 21:23:30 +0000
debmirror (1:2.28) unstable; urgency=medium
* Change priority to optional, since "Priority: extra" is now deprecated.
......
#!/usr/bin/make -f
deb_version := $(shell dpkg-parsechangelog | sed -ne "s/^Version: \(.*\)/\1/p")
%:
dh $@
override_dh_auto_install:
dh_auto_install
sed -i 's/^\(our \$$version=\).*/\1"$(deb_version)";/' \
debian/debmirror/usr/bin/debmirror
......@@ -89,6 +89,10 @@ download debs and source files and only simulates cleanup.
Display a usage summary.
=item B<--version>
Print version number and exit.
=item B<-h>, B<--host>=I<remotehost>
Specify the remote host to mirror from. Defaults to I<ftp.debian.org>,
......@@ -592,6 +596,8 @@ use if $] lt "5.022", "Net::INET6Glue";
use Net::FTP;
use LWP::UserAgent;
our $version="1:2.29";
# Yeah, I use too many global variables in this program.
our $mirrordir;
our @config_files;
......@@ -623,6 +629,8 @@ our $doing_meta=1;
our $ignore_missing_release=0;
our $ignore_release_gpg=0;
our $start_time = time;
our $start_date = `LC_ALL=C date -R`;
chomp $start_date;
our $dry_run=0;
our $do_dry_run=0;
our $rsync_options="-aIL --partial";
......@@ -703,6 +711,7 @@ my $state_cache_exptime;
my $files_cache_version = "1.0";
my $help;
my $print_version;
Getopt::Long::Configure qw(no_pass_through);
GetOptions('debug' => \$debug,
'progress|p' => \$progress,
......@@ -757,9 +766,14 @@ GetOptions('debug' => \$debug,
'retry-rsync-packages=s' => \$retry_rsync_packages,
'keyring=s' => \@keyrings,
'help' => \$help,
'version' => \$print_version,
) or usage;
usage if $help;
usage("invalid number of arguments") if $ARGV[1];
if ($print_version) {
print "debmirror $version\n";
exit(0);
}
# This parameter is so important that it is the only required parameter,
# unless specified in a configuration file.
......@@ -1552,8 +1566,23 @@ if (! $omit_suite_symlinks && ! $do_dry_run) {
# Write out trace file.
if (! $do_dry_run) {
make_dir("project/trace");
my $end_date = `LC_ALL=C date -R`;
chomp $end_date;
my $trace_dists = join(' ', @dists);
my $trace_arches = join(' ', @arches);
$trace_arches .= ' source' if $do_source;
open OUT, ">$tracefile" or die "$tracefile: $!";
print OUT `LC_ALL=C date -u`;
print OUT <<EOF;
Date: $end_date
Date-Started: $start_date
Used debmirror version: $version
Creator: debmirror $version
Running on host: $hostname
Suites: $trace_dists
Architectures: $trace_arches
Upstream-Mirror: $host
EOF
close OUT;
}
......