Removed perl scripts cp.pl mkdir.pl mv.pl rm.pl.
This commit is contained in:
@@ -11,8 +11,6 @@ TOP=../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
#EXPANDFLAGS = -t $(TOP) -D ARCH=$(T_A)
|
||||
|
||||
# Bootstrap resolution: tools not installed yet
|
||||
TOOLS = $(TOP)/src/tools
|
||||
|
||||
@@ -25,7 +23,6 @@ PERL_MODULES += Ctlsys/Utils.pm
|
||||
PERL_MODULES += Ctlsys/Getopts.pm
|
||||
|
||||
PERL_SCRIPTS += convertRelease.pl*
|
||||
PERL_SCRIPTS += cp.pl*
|
||||
PERL_SCRIPTS += cvsclean.pl*
|
||||
PERL_SCRIPTS += dos2unix.pl
|
||||
PERL_SCRIPTS += expandVars.pl
|
||||
@@ -36,12 +33,9 @@ PERL_SCRIPTS += makeDbDepends.pl
|
||||
PERL_SCRIPTS += makeIncludeDbd.pl
|
||||
PERL_SCRIPTS += makeMakefile.pl*
|
||||
PERL_SCRIPTS += makeMakefileInclude.pl*
|
||||
PERL_SCRIPTS += mkdir.pl*
|
||||
PERL_SCRIPTS += mkmf.pl*
|
||||
PERL_SCRIPTS += munch.pl*
|
||||
PERL_SCRIPTS += mv.pl*
|
||||
PERL_SCRIPTS += replaceVAR.pl*
|
||||
PERL_SCRIPTS += rm.pl*
|
||||
PERL_SCRIPTS += useManifestTool.pl*
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
#
|
||||
# UNIX-cp in Perl
|
||||
|
||||
use File::Copy;
|
||||
use File::Basename;
|
||||
|
||||
sub Usage
|
||||
{
|
||||
my ($txt) = @_;
|
||||
|
||||
print "Usage:\n";
|
||||
print "\tcp file1 file2\n";
|
||||
print "\tcp file [ file2 file3 ...] directory\n";
|
||||
print "\nError: $txt\n" if $txt;
|
||||
|
||||
exit 2;
|
||||
}
|
||||
|
||||
# need at least two args: ARGV[0] and ARGV[1]
|
||||
Usage("need more args") if $#ARGV < 1;
|
||||
|
||||
$target=$ARGV[$#ARGV];
|
||||
@sources=@ARGV[0..$#ARGV-1];
|
||||
|
||||
if (-d $target)
|
||||
{
|
||||
foreach $file ( @sources )
|
||||
{
|
||||
$base=basename($file);
|
||||
copy ($file, "$target/$base");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Usage("Cannot copy more than one source into a single target")
|
||||
if ($#sources != 0);
|
||||
copy ($sources[0], $target);
|
||||
}
|
||||
|
||||
# EOF cp.pl
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
#
|
||||
# UNIX-mkdir in Perl
|
||||
#
|
||||
# -p option generates full path to given dir
|
||||
|
||||
use File::Path;
|
||||
use Getopt::Std;
|
||||
getopt "";
|
||||
|
||||
foreach $dir ( @ARGV )
|
||||
{
|
||||
if ($opt_p)
|
||||
{
|
||||
mkpath ($dir) or die "Cannot make directory $dir";
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ($dir, 0777) or die "Cannot make directory $dir";
|
||||
}
|
||||
}
|
||||
|
||||
# EOF mkdir.pl
|
||||
@@ -1,78 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
#
|
||||
# UNIX-mv in Perl
|
||||
|
||||
use File::Copy;
|
||||
|
||||
sub Usage
|
||||
{
|
||||
my ($txt) = @_;
|
||||
|
||||
print "Usage:\n";
|
||||
print "\tmv oldname newname\n";
|
||||
print "\tmv file [ file2 file3 ...] directory\n";
|
||||
print "\nError: $txt\n" if $txt;
|
||||
|
||||
exit 2;
|
||||
}
|
||||
|
||||
sub Move
|
||||
{
|
||||
my ($src, $dest) = @_;
|
||||
|
||||
print "Move($src, $dest)\n";
|
||||
|
||||
copy ($src, $dest) or die "Cannot copy $src to $dest";
|
||||
unlink ($src) or die "Cannot remove $src";
|
||||
}
|
||||
|
||||
# return filename.ext from Drive:/path/a/b/c/filename.ext
|
||||
sub Filename
|
||||
{
|
||||
my ($file) = @_;
|
||||
|
||||
$file =~ s'.*[/\\]'';
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
# need at least two args: ARGV[0] and ARGV[1]
|
||||
Usage("need more args") if $#ARGV < 1;
|
||||
|
||||
$target=$ARGV[$#ARGV];
|
||||
@sources=@ARGV[0..$#ARGV-1];
|
||||
|
||||
print "move @sources into $target\n";
|
||||
|
||||
# If target is (already existent) directory,
|
||||
# move files into it:
|
||||
if (-d $target)
|
||||
{
|
||||
foreach $file ( @sources )
|
||||
{
|
||||
Move ($file, "$target/" . Filename($file));
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
||||
# Otherwise the target is a filename.
|
||||
# Now 'mv' may be either a 'move' or a 'rename',
|
||||
# in any case it requires exactly two args: old and new name.
|
||||
|
||||
Usage("Need exactly one source") if $#sources != 0;
|
||||
$source = @sources[0];
|
||||
|
||||
# Move only if a simple rename
|
||||
# fails (e.g. across file systems):
|
||||
Move ($source, $target) unless (rename $source, $target);
|
||||
|
||||
# EOF mv.pl
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
#
|
||||
# UNIX-rm in Perl
|
||||
|
||||
use File::Path;
|
||||
use File::Find;
|
||||
use Getopt::Std;
|
||||
|
||||
getopt "";
|
||||
|
||||
foreach $arg ( @ARGV )
|
||||
{
|
||||
next unless -e $arg;
|
||||
|
||||
if (-d $arg)
|
||||
{
|
||||
if ($opt_r and $opt_f)
|
||||
{
|
||||
rmtree $arg;
|
||||
}
|
||||
else
|
||||
{
|
||||
rmdir ($arg) or die "Cannot delete $arg";
|
||||
}
|
||||
if (-d $arg)
|
||||
{
|
||||
die "Failed to delete $arg";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink ($arg) or die "Cannot delete $arg";
|
||||
}
|
||||
}
|
||||
|
||||
# EOF rm.pl
|
||||
Reference in New Issue
Block a user