From 63db197e48dcdd866d89a2590577a94687424828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Mon, 29 Nov 1999 20:54:43 +0100 Subject: [PATCH] Now only installs executable files with mode 0755. Rev: bin/install.pike:1.38 --- bin/install.pike | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/bin/install.pike b/bin/install.pike index f7ba94ce98..ca555265a2 100644 --- a/bin/install.pike +++ b/bin/install.pike @@ -180,24 +180,27 @@ void install_dir(string from, string to,int dump) mkdirhier(to); foreach(get_dir(from),string file) - { - if(file=="CVS") continue; - if(file[..1]==".#") continue; - if(file[0]=='#' && file[-1]=='#') continue; - if(file[-1]=='~') continue; - mixed stat=file_stat(combine_path(from,file)); - if (stat) { - if(stat[1]==-2) - { - install_dir(combine_path(from,file),combine_path(to,file),dump); - }else{ - install_file(combine_path(from,file),combine_path(to,file),0755,dump); - } + { + if(file=="CVS") continue; + if(file[..1]==".#") continue; + if(file[0]=='#' && file[-1]=='#') continue; + if(file[-1]=='~') continue; + mixed stat=file_stat(combine_path(from,file)); + if (stat) { + if(stat[1]==-2) { + install_dir(combine_path(from,file),combine_path(to,file),dump); + } else if (stat[0] & 0111) { + // Executable + install_file(combine_path(from,file),combine_path(to,file),0755,dump); } else { - werror(sprintf("\nstat:0, from:%O, file:%O, combined:%O\n", - from, file, combine_path(from, file))); + // Not executable + install_file(combine_path(from,file),combine_path(to,file),0644,dump); } + } else { + werror(sprintf("\nstat:0, from:%O, file:%O, combined:%O\n", + from, file, combine_path(from, file))); } + } } void install_header_files(string from, string to) -- GitLab