File: cvsupdate.sh

package info (click to toggle)
tcng 10b-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,632 kB
  • ctags: 2,515
  • sloc: ansic: 19,038; pascal: 4,640; yacc: 2,619; sh: 1,908; perl: 1,546; lex: 772; makefile: 755
file content (42 lines) | stat: -rwxr-xr-x 790 bytes parent folder | download | duplicates (5)
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
41
42
#!/bin/sh
#
# cvsupdate.sh - Run "cvs update" and eliminate emphemeral files from list
#
# Written 2001 by Werner Almesberger
#
# Copyright 2001 Network Robots
#

vim_files()
{
    find . -name '.*.sw?' -print | sed 's|\./|? |'
}


emacs_files()
{
    find . -name '*~' -print | sed 's|\./|? |'
}


#
# cvs update outputs
# stdout: list of files
# stderr: directories
#

#
# Note: "make ephemeral" outputs more files than CVS knows about. E.g. it
# includes also symbolic links, and object files CVS would ignore anyway.
# This is not a problem, and it may be handy when implementing a global
# "make spotless" in some distant future.
#

(
    cvs -n update | sort -u
    make -s ephemeral | tr ' ' '\012' | sort -u | sed 's/^/? /p'
    vim_files
    emacs_files
) | sort | uniq -u

exit 0