summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2007-08-16 11:59:09 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2007-08-16 11:59:09 +0000
commite09c8b93d4866bcda67090e60d60b0178e81dac2 (patch)
tree7068bc9619a2ee1c1ff200bc94a81270778310c0
parent26f80af0c0bc70d5c9ecc57c218b60a164296147 (diff)
downloadMPC-e09c8b93d4866bcda67090e60d60b0178e81dac2.tar.gz
ChangeLogTag: Thu Aug 16 12:01:28 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog8
-rwxr-xr-xprj_install.pl27
2 files changed, 31 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index cccf01a5..553023f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Thu Aug 16 12:01:28 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
+
+ * prj_install.pl:
+
+ Fixed a bug where copying an executable didn't set the execute
+ permissions on the new file. Also, unnecessary intermediate
+ directories are no longer made during installation.
+
Fri Aug 10 18:15:22 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
* docs/USAGE:
diff --git a/prj_install.pl b/prj_install.pl
index 1e73c677..e9f27e6e 100755
--- a/prj_install.pl
+++ b/prj_install.pl
@@ -23,7 +23,7 @@ use File::Basename;
# ******************************************************************
my($insext) = 'ins';
-my($version) = '1.7';
+my($version) = '1.8';
my(%defaults) = ('header_files' => 1,
'idl_files' => 1,
'inline_files' => 1,
@@ -48,6 +48,21 @@ my($hasSymlink) = ($@ eq '');
# Subroutine Section
# ******************************************************************
+sub rm_updirs {
+ my($path) = shift;
+ my(@parts) = split(/[\/\\]/, $path);
+
+ ## Split the path into parts and check for '..'. If we find one
+ ## and the previous entry wasn't one, then we can remove them both.
+ for(my $i = 0; $i <= $#parts; $i++) {
+ if ($i > 0 && $parts[$i] eq '..' && $parts[$i - 1] ne '..') {
+ splice(@parts, $i - 1, 2);
+ $i -= 2;
+ }
+ }
+ return join('/', @parts);
+}
+
sub copyFiles {
my($files) = shift;
my($insdir) = shift;
@@ -57,9 +72,10 @@ sub copyFiles {
my($cwd) = getcwd();
foreach my $file (@$files) {
- my($dest) = $insdir . '/' .
- (defined $actual{$file} ?
- "$actual{$file}/" . basename($file) : $file);
+ my($dest) = rm_updirs($insdir . '/' .
+ (defined $actual{$file} ?
+ "$actual{$file}/" .
+ basename($file) : $file));
my($fulldir) = dirname($dest);
if (! -d $fulldir) {
my($tmp) = '';
@@ -80,6 +96,9 @@ sub copyFiles {
}
else {
$status = copy($file, $dest);
+ if ($status && -x $file) {
+ chmod(0755, $dest);
+ }
}
if (!$status) {
print STDERR "ERROR: Unable to $type $file to $dest\n";