1999-06-07 Alexandre Oliva <oliva@dcc.unicamp.br>
+ * automake.in (dist_header): Avoid changing permissions of files
+ in the source tree, trying a complex `find/chmod' command before
+ falling back to plain chmod.
+ (handle_dist_worker): Do not create directories with mode 777, the
+ find above will take care of that.
+ * m4/init.m4: Set install_sh for find/chmod above.
+
* THANKS: Added Shuhei Amakawa.
1999-06-07 Shuhei Amakawa <sa264@cam.ac.uk>
# Create dist directory.
$output_rules .= ("\t-rm -rf \$(distdir)\n"
- . "\tmkdir \$(distdir)\n"
- . "\t-chmod 777 \$(distdir)\n");
+ . "\tmkdir \$(distdir)\n");
}
# Only run automake in `dist' target if --include-deps and
. "\t" . ' test -d $(distdir)/$$subdir ' . "\\\n"
. "\t" . ' || mkdir $(distdir)/$$subdir ' . "\\\n"
. "\t" . ' || exit 1; ' . "\\\n"
- . "\t" . ' chmod 777 $(distdir)/$$subdir; ' . "\\\n"
. "\t" . ' (cd $$subdir'
. ' && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$('
. (($relative_dir eq '.') ? 'distdir' : 'top_distdir')
# PARTICULAR PURPOSE.
";
+ # This complex find command will try to avoid changing the modes of
+ # links into the source tree, in case they're hard-linked. It will
+ # also make directories writable by everybody, because some
+ # brain-dead tar implementations change ownership and permissions of
+ # a directory before extracting the files, thus becoming unable to
+ # extract them.
# Ignore return result from chmod, because it might give an error
# if we chmod a symlink.
- $dist_header = "\t" . '-chmod -R a+r $(distdir)' . "\n";
+ $dist_header = ' -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \\
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \\
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \\
+ || chmod -R a+r $(distdir)
+';
$dist{'dist-bzip2'} = ("\t"
. '$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | bzip --best -c > $(distdir).bz2'
. "\n");
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+dnl Set install_sh for make dist
+install_sh="$missing_dir/install-sh"
+test -f "$install_sh" || install_sh="$missing_dir/install.sh"
+AC_SUBST(install_sh)
dnl We check for tar when the user configures the end package.
dnl This is sad, since we only need this for "dist". However,
dnl there's no other good way to do it. We prefer GNU tar if