From 1d1454ba984eca2e08a67585bc311407105d7697 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Wed, 26 Mar 2008 21:10:05 +0000 Subject: [PATCH] Removed perl scripts cp.pl mkdir.pl mv.pl rm.pl. --- src/tools/Makefile | 6 ---- src/tools/cp.pl | 50 ----------------------------- src/tools/mkdir.pl | 32 ------------------- src/tools/mv.pl | 78 ---------------------------------------------- src/tools/rm.pl | 45 -------------------------- 5 files changed, 211 deletions(-) delete mode 100644 src/tools/cp.pl delete mode 100644 src/tools/mkdir.pl delete mode 100644 src/tools/mv.pl delete mode 100644 src/tools/rm.pl diff --git a/src/tools/Makefile b/src/tools/Makefile index 9b53da962..98ee1ba88 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -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 diff --git a/src/tools/cp.pl b/src/tools/cp.pl deleted file mode 100644 index 6562d92f7..000000000 --- a/src/tools/cp.pl +++ /dev/null @@ -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 diff --git a/src/tools/mkdir.pl b/src/tools/mkdir.pl deleted file mode 100644 index 7d268ae07..000000000 --- a/src/tools/mkdir.pl +++ /dev/null @@ -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 diff --git a/src/tools/mv.pl b/src/tools/mv.pl deleted file mode 100644 index 2ccf5105d..000000000 --- a/src/tools/mv.pl +++ /dev/null @@ -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 diff --git a/src/tools/rm.pl b/src/tools/rm.pl deleted file mode 100644 index f5fa70ef7..000000000 --- a/src/tools/rm.pl +++ /dev/null @@ -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