Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F10664447
copy-header.pl
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
929 B
Subscribers
None
copy-header.pl
View Options
#!/usr/bin/env perl
#
# copy a header into the temporary CLHEP header tree if
# a) the header is not already there
# b) the source is newer
#
if
(
$
#
ARGV
!
=
1
)
{
print
"mungeit requires two arguments - exit\n"
;
exit
;
}
else
{
$
source_header=
$
ARGV
[
0
];
$
dest_header=
$
ARGV
[
1
];
&check_header
;
}
exit
;
sub
check_header
{
#
make
sure
source
exists
if
(
!
-
e
$
source_header
)
{
print
"$source_header does not exist - exit\n"
;
exit
;
}
#
copy
if
not
already
there
-
otherwise
,
check
the
time
stamp
if
(
!
-
e
$
dest_header
)
{
$
cmd
=
"cp -p "
.
$
source_header
.
" "
.
$
dest_header
;
print
"$cmd\n"
;
system
(
$
cmd
);
}
else
{
$
source_header_time
=
-
M
$
source_header
;
$
dest_header_time
=
-
M
$
dest_header
;
#
copy
only
if
source
is
newer
if
(
$
source_header_time
<
$
dest_header_time
)
{
$
cmd
=
"cp -p "
.
$
source_header
.
" "
.
$
dest_header
;
print
"$cmd\n"
;
system
(
$
cmd
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-perl
Expires
Thu, Apr 24, 6:40 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4842611
Default Alt Text
copy-header.pl (929 B)
Attached To
rSPARTYJETSVN spartyjetsvn
Event Timeline
Log In to Comment