2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Test that a readonly files are distributed as such, and not make
18 # writable while being copied in the $(distdir).
23 cat >> configure.ac << 'END'
28 cat > Makefile.am << 'END'
35 test -f $(srcdir)/foo.c && test ! -w $(srcdir)/foo.c
36 if (echo x > $(srcdir)/foo.c); then exit 1; else :; fi
37 grep 'main (void)' $(srcdir)/foo.c
38 test -f $(srcdir)/bar.txt && test ! -w $(srcdir)/bar.txt
39 if (echo x > $(srcdir)/bar.txt); then exit 1; else :; fi
40 grep 'To be, or not to be' $(srcdir)/bar.txt
43 echo 'int main (void) { return 0; }' > foo.c
44 echo To be, or not to be ... > bar.txt
45 chmod a-w foo.c bar.txt
53 ls -l $distdir # For debugging.
54 test -f foo.c && test ! -w foo.c || Exit 1
55 (echo x > foo.c) && Exit 1
56 test -f bar.txt && test ! -w bar.txt || Exit 1
57 (echo x > bar.txt) && Exit 1