~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to tests/libtest/test610.pl

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-06-18 15:21:57 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20080618152157-qq94aiequcq35w6b
Tags: 7.18.2-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop the stunnel build dependency.
  - Drop the build-dependency on libdb4.5-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env perl
2
 
# Create and remove directories and check their existence
3
 
if ( $#ARGV != 1 ) 
 
2
# Perform simple file and directory manipulation in a portable way
 
3
if ( $#ARGV <= 0 ) 
4
4
{
5
 
        print "Usage: $0 mkdir|rmdir|gone path\n";
 
5
        print "Usage: $0 mkdir|rmdir|rm|move|gone path1 [path2] [more commands...]\n";
6
6
        exit 1;
7
7
}
8
 
if ($ARGV[0] eq "mkdir")
9
 
{
10
 
        mkdir $ARGV[1] || die "$!";
11
 
        exit 0;
12
 
}
13
 
elsif ($ARGV[0] eq "rmdir")
14
 
{
15
 
        rmdir $ARGV[1] || die "$!";
16
 
        exit 0;
17
 
}
18
 
elsif ($ARGV[0] eq "gone")
19
 
{
20
 
        ! -e $ARGV[1] || die "Path $ARGV[1] exists";
21
 
        exit 0;
22
 
}
23
 
print "Unsupported command $ARGV[0]\n";
24
 
exit 1;
 
8
 
 
9
use File::Copy;
 
10
while(@ARGV) {
 
11
        my $cmd = shift @ARGV;
 
12
        my $arg = shift @ARGV;
 
13
        if ($cmd eq "mkdir") {
 
14
                mkdir $arg || die "$!";
 
15
        }
 
16
        elsif ($cmd eq "rmdir") {
 
17
                rmdir $arg || die "$!";
 
18
        }
 
19
        elsif ($cmd eq "rm") {
 
20
                unlink $arg || die "$!";
 
21
        }
 
22
        elsif ($cmd eq "move") {
 
23
                my $arg2 = shift @ARGV;
 
24
                move($arg,$arg2) || die "$!";
 
25
        }
 
26
        elsif ($cmd eq "gone") {
 
27
                ! -e $arg || die "Path $arg exists";
 
28
        } else {
 
29
                print "Unsupported command $cmd\n";
 
30
                exit 1;
 
31
        }
 
32
}
 
33
exit 0;