File: incinstall

package info (click to toggle)
mpqc 2.3.1-6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 39,580 kB
  • ctags: 16,804
  • sloc: cpp: 258,686; sh: 8,584; perl: 6,017; ansic: 5,491; makefile: 2,769; fortran: 1,970; lisp: 1,269; yacc: 313; lex: 177; csh: 45
file content (40 lines) | stat: -rwxr-xr-x 639 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/csh -f

set path = (/bin /usr/bin)

foreach i ($*)
  set last=$i
  end

if (X$last:e == X) then
  if (! -d $last) mkdir $last
  endif

set updates = 0
echo -n incinstall:
foreach i ($*)
  if ($i != $last) then
    if (-d $last) then
      set file=$last/`basename $i`
    else
      set file=$last
      endif
    cmp $i $file >& /dev/null
    if ($status != 0) then
      if (-f $file) chmod 644 $file
      cp $i $file
      if ($updates == 0) then
        echo -n " updating"
        set updates = 1
        endif
      echo -n " "$i
      endif
    endif
  end

if ($updates == 0) then
  echo -n " no updates"
  endif

echo ""