my @keyrings = keyring_file ($op_header->{package},$op_header->{directory});
fatal("no keyring for package $op_header->{package}",0) if ($#keyrings < 0);
+ # Check that we actually have at least one command in the directive
+ unless ($#$ops > 0) {
+ if ($directive_only) {
+ fatal("nothing to do - no commands in directive file",1);
+ } else {
+ # Provide a different message if this looks like an upload packet.
+ fatal("no filename directive specified in $directive_file. "
+ ."Upgrade to the latest version! "
+ ."See http://www.gnu.org/prep/maintain/maintain.html",1)
+ }
+ }
+
# If there is a command in the directive that doesn't require an actual
# file to work on, we won't require the filename line in the directive
# file. This will allow people to upload a directive file only to
# don't require a filename - currently symlink, rmsymlink, and
# archive - and only the directive file was uploaded
if (!exists($info{filename})) {
- my $directory_command_only = 1;
- foreach (keys %info) {
- $directory_command_only = 0
- if (($_ ne 'directory') && ($_ ne 'package') && ($_ ne 'email')
- && ($_ 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
- # that only the directive file was uploaded
-
- if (!$directive_only) {
- # We have three files
- # 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?
- fatal("nothing to do - no commands in directive file",1)
- if ($directory_command_only == 1);
- }
$filename_required = 0;
}