#! /bin/sh
## toolbox for the VLC media player
-## $Id: toolbox,v 1.20 2003/04/06 23:21:13 massiot Exp $
+## $Id: toolbox,v 1.23 2003/04/14 23:10:20 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
--update-glade generate and fix Glade code
--update-glade2 generate and fix Glade 2 code
--update-flexml generate and fix flexml and flex code
+ --distclean "make distclean"
EOF
exit 1
}
--update-glade2|--update-glade-2|--fix-glade2)
action=glade2
;;
+ --distclean)
+ action=distclean
+ ;;
--help)
help
;;
echo '#ifdef __PLUGIN__' >> ${file}.in
cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' >> ${file}.in
echo '#endif /* __PLUGIN__ */' >> ${file}.in
- if ! diff -q ${file} ${file}.in
+ if diff 2>&1 >/dev/null ${file} ${file}.in
then
- mv -f ${file}.in ${file}
- else
rm -f ${file}.in
+ else
+ mv -f ${file}.in ${file}
fi
file=src/misc/modules_plugin.h
echo '#define STORE_SYMBOLS( p_symbols ) \' >> ${file}.tmp
cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> ${file}.tmp
echo '' >> ${file}.tmp
- if ! diff -q ${file} ${file}.tmp
+ if diff 2>&1 >/dev/null ${file} ${file}.tmp
then
- mv -f ${file}.tmp ${file}
- else
rm -f ${file}.tmp
+ else
+ mv -f ${file}.tmp ${file}
fi
file=src/misc/modules_builtin.h
fi
echo " } while( 0 );" >> ${file}.tmp
echo "" >> ${file}.tmp
- if ! diff -q ${file} ${file}.tmp
+ if diff 2>&1 >/dev/null ${file} ${file}.tmp
then
- mv -f ${file}.tmp ${file}
- else
rm -f ${file}.tmp
+ else
+ mv -f ${file}.tmp ${file}
fi
exit 0
flex -oflex.c -BLs skin.l
fi
+##
+## Make distclean
+##
+if test "${action}" = "distclean"
+then
+ set -x
+ # a naive sanity check to make sure we are in a VLC tree
+ test -f vlc.spec -a -f debian/rules || exit 1
+ # let's rock!
+ find . -type f '(' -name '*.[oa]' -o -name '*.so' -o -name '*.sl' -o -name '*.dylib' -o -name '*.dll' -o -name .dirstamp -o -name Makefile.in -o -name 'stamp-h*' -o -name '*~' -o -name '*.bak' -o -name '*.moc.cpp' ')' -exec rm -f '{}' ';'
+ (cd autotools && find . -name '[a-z]*' -exec rm -f '{}' ';')
+ (cd debian && find . -type d -name '[a-z]*' -maxdepth 1 -exec rm -Rf '{}' ';')
+ find msvc -type f -name '*.dsp' -exec rm -f '{}' ';'
+ find evc -type f -name '*.vcp' -exec rm -f '{}' ';'
+ #find . -type d -name '.deps' -exec rm -Rf '{}' ';'
+ # there's some more cruft all around
+ rm -f configure.ac config.h config.log config.status
+ rm -f vlc vlc-config Makefile Modules.am
+ rm -Rf autom4te.cache
+ rm -f mozilla/vlcintf.h mozilla/vlcintf.xpt
+ # FIXME: a lot of Makefiles are still there
+fi
+