Another tar option compatibility trick when installing bundles

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@11784 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2001-12-17 11:24:40 +00:00
parent 543bc51f19
commit c267a62b33
2 changed files with 28 additions and 14 deletions

View file

@ -1,3 +1,9 @@
Mon Dec 17 11:10:23 2001 Nicola Pero <nicola@brainstorm.co.uk>
* bundle.make (internal-bundle-install): Another tar option update
for portability: create a temporary exclude file and use X old
option instead of --exclude option.
2001-12-15 Richard Frith-Macdonald <rfm@gnu.org> 2001-12-15 Richard Frith-Macdonald <rfm@gnu.org>
* documentation.make: added basic support for building documentation * documentation.make: added basic support for building documentation

View file

@ -268,19 +268,25 @@ $(BUNDLE_DIR_NAME)/Resources/Info-gnustep.plist: $(BUNDLE_DIR_NAME)/Resources
# Comment on the tar options used in the rule below - # Comment on the tar options used in the rule below -
# The `h' option to tar makes sure the bundle can contain symbolic # The h option to tar makes sure the bundle can contain symbolic links
# links to external files (for example templates), and when you # to external files (for example templates), and when you install the
# install the bundle, the symbolic links are replaced with the actual # bundle, the symbolic links are replaced with the actual files. The
# files. The --exclude Contents/Resources is used because otherwise # X option is used because otherwise the -h option would dereference
# the `h' option would dereference the Contents/Resources-->Resources # the Contents/Resources-->Resources symbolic link, and install the
# symbolic link, and install the Resources directory twice. Instead, # Resources directory twice. Instead, we exclude the symbolic link
# we exclude the symbolic link from the tar file, then rebuild the # from the tar file, then rebuild the link by hand in the installation
# link by hand in the installation directory. # directory.
# When rebuilding the link, we need to make sure that we can manage # Because of compatibility issues with older versions of GNU tar (not
# the case that tar was actually broken and didn't honour the # to speak of non-GNU tars), we use the X option rather than the
# --exclude option (and/or the h option). This was reported to have # --exclude= option. The X option requires as argument a file listing
# happened. To manage this, we simply do not build the link if # files to exclude. We create a temporary file for this, then remove
# it immediately afterwards.
# When rebuilding the link, just as yet another compatibility safety
# measure, we need to make sure that we can manage the case that tar
# was actually broken and didn't honour the X option (and/or the h
# option). To manage this, we simply do not build the link if
# Resources already exists and is a directory (either a real one or a # Resources already exists and is a directory (either a real one or a
# symbolic link, we don't care). # symbolic link, we don't care).
@ -296,10 +302,12 @@ ifneq ($(HEADER_FILES),)
done; done;
endif endif
endif endif
rm -f .tmp.gnustep.exclude; \
echo "$(BUNDLE_DIR_NAME)/Contents/Resources" > .tmp.gnustep.exclude;\
rm -rf $(BUNDLE_INSTALL_DIR)/$(BUNDLE_DIR_NAME); \ rm -rf $(BUNDLE_INSTALL_DIR)/$(BUNDLE_DIR_NAME); \
$(TAR) -chf - --exclude=$(BUNDLE_DIR_NAME)/Contents/Resources \ $(TAR) chfX - .tmp.gnustep.exclude $(BUNDLE_DIR_NAME) \
$(BUNDLE_DIR_NAME) \
| (cd $(BUNDLE_INSTALL_DIR); $(TAR) xf -); \ | (cd $(BUNDLE_INSTALL_DIR); $(TAR) xf -); \
rm -f .tmp.gnustep.exclude; \
(cd $(BUNDLE_INSTALL_DIR)/$(BUNDLE_DIR_NAME)/Contents; \ (cd $(BUNDLE_INSTALL_DIR)/$(BUNDLE_DIR_NAME)/Contents; \
if [ ! -d Resources ]; then \ if [ ! -d Resources ]; then \
rm -f Resources; $(LN_S) ../Resources .; \ rm -f Resources; $(LN_S) ../Resources .; \