} elsif ($step->[0] eq 'rmsymlink') {
my $abslinkname =
File::Spec->catfile($Public_dir, @directory, $step->[1]);
+ throw processing_error => command => $step,
+ summary => "symlink $step->[1] was not found"
+ unless -e $abslinkname;
throw processing_error => command => $step,
summary => "refusing to remove a non-symlink file"
unless -l $abslinkname;
foo@example.org foo@example.gnu.org foo@example.net
}
+check_loose_directive "error: remove non-existent symlink" {
+ directive {
+ version 1.2
+ directory foo
+ rmsymlink foo-latest.bin
+ } dsig { good 13 1000 }
+} initial-files {
+ pub { foo/foo-1.0.bin { good 05 1000 } }
+} file-tree {
+ { incoming stage archive } empty {}
+ { in-stage } files { .foo.directive.asc }
+ { pub } files { foo/foo-1.0.bin }
+} log {
+ action,rm-symlink-failure,not-found \
+ "rmsymlink command targeting non-existent file rejected"
+} email-to {
+ ftp-upload-script@gnu.org ftp-upload-report@gnu.org
+ foo@example.org foo@example.gnu.org foo@example.net
+}
+
check_loose_directive "error: remove file as if symlink" {
directive {
version 1.2
# include a file name relative to the test base
exp_continue
}
+ -re {^gatekeeper\[[0-9]+\]: \(Test\) \[EX\]\
+ symlink [^ ]+ was not found} {
+ # from execute_commands, when an item to be removed is
+ # not a symlink after all
+ set A(action,rm-symlink-failure,not-found) 1
+ exp_continue
+ }
-re {^gatekeeper\[[0-9]+\]: \(Test\) \[EX\]\
refusing to remove a non-symlink file} {
# from execute_commands, when an item to be removed is