use $mirror instead of $path in calling system(gunzip)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt-mirror (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I am getting the following errors when running
sudo -u apt-mirror apt-mirror
Processing indexes: [
Psh: 1: cannot create archive.
sh: 1: cannot create archive.
Psh: 1: cannot create archive.
sh: 1: cannot create archive.
Psh: 1: cannot create archive.
sh: 1: cannot create archive.
Psh: 1: cannot create archive.
sh: 1: cannot create archive.
]
After looking at the source code, I believe the following code fragment inside "process_index_gz" should be the following:
if ( $index =~ s/\.gz$// )
{
print "done!\n";
}
instead of the original:
if ( $index =~ s/\.gz$// )
{
print "done!\n";
}
Since $path despite its name came from:
$path = sanitise_uri($uri);
and $mirror came from:
$mirror = get_variable(
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: apt-mirror 0.5.1-1ubuntu1 [modified: usr/bin/apt-mirror]
ProcVersionSign
Uname: Linux 4.4.0-98-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: amd64
Date: Sun Nov 5 22:11:54 2017
InstallationDate: Installed on 2017-11-04 (1 days ago)
InstallationMedia: Ubuntu-Server 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
PackageArchitec
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: apt-mirror
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
#
# Regular cron jobs for the apt-mirror package
#
0 4 * * * apt-mirror /usr/bin/apt-mirror > /var/spool/
mtime.conffile.
mtime.conffile.
I am also having this exact bug.