# foo-1.2.tar.gz, the file to upload (could be anything) with no sig.
# foo-1.2.tar.gz.sig, detached binary signature (gpg -b) for uploaded file.
#
-# The directive file must always contain a 'directory', 'version' and
-# 'filename' directive, unless when run in compatibility mode ($V1_COMPAT_MODE
-# is set), in which case directive files with only a 'directory' directive are
-# allowed.
+# The directive file in a triplet must always contain 'directory',
+# 'version' and 'filename' directives.
#
# Alternatively, we expect to find only a directive file. This file must have
# a name that ends in 'directive.asc', and must contain one or more of these
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
}
-my $V1_COMPAT_ALLOWED = 0;
-
my $NAME = 'gatekeeper.pl';
my $VERSION = '1.2'; # This is the protocol version
my $DATE = '2017/09/14 12:42:38';
my $uploaded_file = shift;
my $directive_only = shift;
- # We default to v1.1
- $info{'v1_compat_mode'} = 0;
-
# For debugging purposes, see below
my $directive_file_contents = '';
my @lines = ();
}
}
- $info{'v1_compat_mode'} = 0;
-
- if (exists($info{"replace"})
- && (($info{'v1_compat_mode'} == 1) || ($info{"version"} eq '1.1'))) {
+ if (exists($info{"replace"}) && ($info{"version"} eq '1.1')) {
fatal("invalid directive 'replace', not supported prior to version 1.2",
1,$directive_file_contents);
}
# 1. It exists in the directive file - there is no problem
# 2. It doesn't exist in the directive file
# In that case, we need to double check a few things.
- # This is permitted IF $V1_COMPAT_ALLOWED is true, AND if the only
- # directive is a 'directory'.
- # (for backwards compatibility with older versions of the script)
- # It is also permitted if the directive file contains commands that
+ # This is permitted if the directive file contains commands that
# don't require a filename - currently symlink, rmsymlink, and
# archive - and only the directive file was uploaded
if (!exists($info{filename})) {
foreach (keys %info) {
$directory_command_only = 0
if (($_ ne 'directory') && ($_ ne 'package') && ($_ ne 'email')
- && ($_ ne 'version') && ($_ ne 'v1_compat_mode'));
+ && ($_ ne 'version'));
}
# This is where we would check for commands that require a file.
# In this version (1.1), there are none, so all we do is check
if (!$directive_only) {
# We have three files
- # Are we in version 1.0 compatibility mode?
- if ($V1_COMPAT_ALLOWED) {
- # We're in backwards compatibility mode which means: three files,
- # and ONLY a directory directive in the directive file
- $info{'v1_compat_mode'} = 1;
- if ($directory_command_only == 0) {
- fatal("no filename directive specified in $directive_file",1)
- } else {
- ftp_syslog('info',"running in legacy v1 compatibility mode");
- }
- } elsif (!$V1_COMPAT_ALLOWED) {
- # This is not allowed - we require a filename directive. No backwards compatibility.
- fatal("no filename directive specified in $directive_file. "
- ."Upgrade to the latest version! "
- ."See http://www.gnu.org/prep/maintain/maintain.html",1)
- }
+ # This is not allowed - we require a filename directive.
+ fatal("no filename directive specified in $directive_file. "
+ ."Upgrade to the latest version! "
+ ."See http://www.gnu.org/prep/maintain/maintain.html",1)
} else {
# We only have a directive file
# Do we have something to do?
}
$filename_required = 0;
}
- ftp_syslog('info',"not running in legacy v1 mode")
- if (!$info{'v1_compat_mode'});
# Configuration must exist for the package
-d $package_config_base . '/' . $info{"package"}
if ($directive_file ne "$info{filename}{value}.directive.asc");
}
- # They have to specify a version unless we're in 1.0 compatibility mode
- if (!$info{'v1_compat_mode'}) {
- fatal("no version directive specified in $directive_file",1)
- if ! $info{"version"};
- }
+ # They have to specify a version
+ fatal("no version directive specified in $directive_file",1)
+ if ! $info{"version"};
my $retval = verify_keyring($directive_file,$directive_file_contents,
@keyrings);
delete($info{email});
delete($info{package});
delete($info{version});
- delete($info{'v1_compat_mode'});
delete($info{'replace'});
my $destdir = "$destfinal/$originfo{directory}";
archive($destdir, $originfo{directory}, $1);
}
}
-
- # We're running in v1 mode.
- if ($originfo{'v1_compat_mode'}) {
- check_files($files,%originfo);
- install_files($files,%originfo);
- }
}
\f