Skip to content

Commit

Permalink
Attempt to fix the random "will not create hard link" errors on Win32…
Browse files Browse the repository at this point in the history
…; this also turns out to be a win on other platforms for the source code copy case, where we don't want to copy the svn directories. r=mook

git-svn-id: http://publicsvn.songbirdnest.com/vendor/trunk@10527 37441250-4157-47a9-a2c9-f9fe3212d2d3
  • Loading branch information
preed committed Apr 16, 2009
1 parent 52aad17 commit 7d68461
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gst-plugins-bad/Makefile.songbird
Expand Up @@ -112,7 +112,7 @@ endif
directshow-libs:
ifeq (Msys,$(SB_VENDOR_ARCH))
$(MKDIR) $(DIRECTSHOW_LIBS_ROOT)
$(CP) $(CP_RECURSE_FLAGS) $(WINDOWS_SDK_ROOT)/Samples/MultiMedia/DirectShow/BaseClasses/* $(DIRECTSHOW_LIBS_ROOT)
$(MSYS_CP) $(WINDOWS_SDK_ROOT)/Samples/MultiMedia/DirectShow/BaseClasses $(DIRECTSHOW_LIBS_ROOT)
patch -d $(DIRECTSHOW_LIBS_ROOT) -p0 < $(CURDIR)/sb-directshow-baseclasses.patch
ifeq (debug,$(SB_BUILD_TYPE))
cd $(DIRECTSHOW_LIBS_ROOT) && \
Expand Down
38 changes: 38 additions & 0 deletions msys-recursive-cp
@@ -0,0 +1,38 @@
#!/bin/bash
#
# This seems like a really stupid script, but it is a replacement for MSYS's
# wonky and anemic "cp" command; on large recursive copies, it is common
# to get errors about "will not create hard link `foo' to directory `bar'",
# when foo and bar aren't even related. Mook gave the idea that using tar
# for large copies like this is a workaround that proves to be reliable.
#
# It still makes me cry, though.
#

SRCDIR="$1"
DESTDIR="$2"
SRCTARARGS="$3"
DESTTARARGS="$4"

MKDIR=${MKDIR:=mkdir -p}
TAR=${TAR:=tar}

if test -z "$SRCDIR"; then
echo Source directory missing
echo $0 [source dir] [dest dir] [src tar cmd args] [dest tar cmd args]
exit 1
fi

if test -z "$DESTDIR"; then
echo Destination directory missing
echo $0 [source dir] [dest dir] [src tar cmd args] [dest tar cmd args]
exit 1
fi

if ! test -d "$DESTDIR"; then
echo Creating $DESTDIR...
$MKDIR "$DESTDIR"
fi

echo Running $TAR c $SRCTARARGS -C "$SRCDIR" . \| $TAR x $DESTTARARGS -C "$DESTDIR"
$TAR c $SRCTARARGS -C "$SRCDIR" . | $TAR x $DESTTARARGS -C "$DESTDIR"
6 changes: 1 addition & 5 deletions songbird-vendor-defs.mk
Expand Up @@ -129,11 +129,7 @@ CHMOD ?= chmod
CMAKE ?= cmake
CONFIGURE ?= ./configure
CP ?= cp
ifeq (Msys,$(SB_VENDOR_ARCH))
CP_RECURSE_FLAGS ?= -dpr
else
CP_RECURSE_FLAGS ?= -R
endif
MSYS_CP ?= $(SB_VENDOR_CHECKOUT)/msys-recursive-cp
FIND ?= find
LN ?= ln
MKDIR ?= mkdir -p
Expand Down
9 changes: 5 additions & 4 deletions songbird-vendor-rules.mk
Expand Up @@ -296,8 +296,8 @@ ifeq (Msys,$(SB_VENDOR_ARCH))
$(foreach tgt, \
$(SB_VENDOR_BINARIES_TARGETS), \
$(if $(wildcard $(SB_VENDOR_BINARIES_DIR)/$(tgt)),, \
$(CP) -dpr $(SB_VENDOR_BINARIES_CHECKOUT)/$(tgt) \
$(SB_VENDOR_BINARIES_DIR); ))
$(MSYS_CP) $(SB_VENDOR_BINARIES_CHECKOUT)/$(tgt) \
$(SB_VENDOR_BINARIES_DIR)/$(tgt) --exclude=.svn ; ))
else
$(foreach tgt, \
$(SB_VENDOR_BINARIES_TARGETS), \
Expand Down Expand Up @@ -394,8 +394,9 @@ endif
@echo
@echo
$(MKDIR) $(SB_VENDOR_BUILD_DIR)
# TODO: this kinda sucks; fix this
$(CP) $(CP_RECURSE_FLAGS) $(SB_TARGET_SRC_DIR)/* $(SB_VENDOR_BUILD_DIR)
# TODO: this kinda sucks; fix this; also, now it sucks with the msys
# stuff in a cross-platform way.
$(MSYS_CP) $(SB_TARGET_SRC_DIR) $(SB_VENDOR_BUILD_DIR)

clean_build_dir:
$(RM) -rf $(SB_VENDOR_BUILD_DIR)
Expand Down

0 comments on commit 7d68461

Please sign in to comment.