Wireshark-dev: [Wireshark-dev] win32 setup/build problem

From: Neil Piercy <Neil.Piercy@xxxxxxxxxxxx>
Date: Thu, 11 Jan 2007 14:58:03 +0000
I've had a build failure under Windows since the move to glib 2.12.6, which I traced to a setup problem: the unzip of the packages in tools/win32-setup.sh uses "unzip -nq" - the -n prevents it updating existing files at all, ending up with a mix of original package and new package for those packages which reuse a non-versioned directory for the unpacked files.

Proposed fix:
a) change the makefile so all unversioned package directories are deleted during setup (looks like somebody else noticed similar as this is already done for gtk2 for 2.12, but it should be wider) - it is slower but safer to maybe always delete the destination dir and create it afresh ?

b) change win32-setup.sh to use -uo in place of -n - at least then you get all the new package, possibly with remnants of the old package if it wasnt deleted first and the files are no longer in the new package.

Patches attached.

Neil
Index: win32-setup.sh
===================================================================
--- win32-setup.sh	(revision 20392)
+++ win32-setup.sh	(working copy)
@@ -78,7 +78,7 @@
 		err_exit "Can't download $DOWNLOAD_PREFIX/$PACKAGE_PATH"
 	cd "$DEST_SUBDIR" || err_exit "Can't find $DEST_SUBDIR"
 	echo "Extracting $DEST_PATH/$PACKAGE into $DEST_PATH/$DEST_SUBDIR"
-	unzip -nq "$DEST_PATH/$PACKAGE" ||
+	unzip -uoq "$DEST_PATH/$PACKAGE" ||
 		err_exit "Couldn't unpack $DEST_PATH/$PACKAGE"
 	echo "Verifying that the DLLs in $DEST_PATH/$DEST_SUBDIR are executable."
 	for i in `/usr/bin/find $DEST_PATH/$DEST_SUBDIR -name \*\.dll` ; do
Index: Makefile.nmake
===================================================================
--- Makefile.nmake	(revision 20392)
+++ Makefile.nmake	(working copy)
@@ -534,9 +534,13 @@
 # If you used this setup target before, consider doing a clean_setup.
 setup: verify_tools
     if not exist $(WIRESHARK_LIBS) md $(WIRESHARK_LIBS)
+# build problems due to stuff left in these dirs, remove them 
+	rm -rf $(WIRESHARK_LIBS)/gtk2
+	rm -rf $(WIRESHARK_LIBS)/gtk+
+	rm -rf $(WIRESHARK_LIBS)/gtk-wimp
+	rm -rf $(WIRESHARK_LIBS)/glib
+	rm -rf $(WIRESHARK_LIBS)/WpdPack
 !IF "$(GTK2_INST_VERSION)" == "2.10"
-# ran into problems probably due to stuff left in gtk dir, remove it 
-	rm -rf $(WIRESHARK_LIBS)/gtk2
 	@$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
 		glib gtk2.10/glib-2.12.6.zip
 	@$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \