]> git.sesse.net Git - vlc/blobdiff - toolbox
* modules/demux/livedotcom.cpp: fixed small leak.
[vlc] / toolbox
diff --git a/toolbox b/toolbox
index b488003d129191237b3ba5b2b7d037e213b09432..5fc742046613c2ec41859de316dd06e929d1c05b 100755 (executable)
--- a/toolbox
+++ b/toolbox
@@ -28,6 +28,7 @@ recognized flags are:
   --update-vc             update Microsoft Visual Studio files
   --update-po             update translation files
   --update-includes       generate various include files
+  --update-version        generate src/misc/version.c
   --update-glade          generate and fix Glade code
   --update-glade2         generate and fix Glade 2 code
   --update-flexml         generate and fix flexml and flex code
@@ -71,6 +72,9 @@ case "$1" in
   --update-includes)
     action=includes
     ;;
+  --update-version)
+    action=version
+    ;;
   --update-flexml)
     action=flexml
     ;;
@@ -370,27 +374,9 @@ fi
 if test "${action}" = "po"
 then
   # find out the source files
-  rm -f po/POTFILES.in
-  echo "# automatically created by toolbox --update-po" > po/POTFILES.in
-  echo "" >> po/POTFILES.in
-  echo "# main sources" >> po/POTFILES.in
-  find include src -name '*.[chm]' -o -name '*.[ch]pp' \
-    | grep -v '\(vlc_symbols\|misc/modules_\)' \
-    | sort >> po/POTFILES.in
-  echo "" >> po/POTFILES.in
-  echo "# modules" >> po/POTFILES.in
-  find modules -name '*.[chm]' -o -name '*.[ch]pp' \
-    | grep -v '\(\.moc\.\|gui/gtk2/\)' \
-    | sort >> po/POTFILES.in
-  # clean old potfiles
-  cd po
-  rm -f vlc.pot
-  # update
-  make vlc.pot || exit 1
-  make update-po || exit 1
-  cd ..
-
-  exit 0
+  echo "WARNING: you should run \"make update-po\" instead!" >&2
+  make update-po
+  exit $?
 fi
 
 ##
@@ -442,6 +428,49 @@ then
   exit 0
 fi
 
+##
+##  Create version file
+##
+if test "${action}" = "version"
+then
+  if test -z "${srcdir}"; then
+    srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
+  fi
+  if test -z "${builddir}"; then
+    builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
+  fi
+  if test -z "${CC}"; then
+    CC="`sed -ne 's/^CC *= *//p' < Makefile`"
+  fi
+
+  file="${builddir}/src/misc/version.c"
+  if which svnversion 2>&1 >/dev/null; then
+    VLC_CHANGESET=`svnversion $srcdir`
+  else
+    VLC_CHANGESET='exported'
+  fi
+
+  rm -f ${file}.tmp
+  cat > ${file}.tmp << EOF
+/* DO NOT EDIT THIS FILE - IT IS REGENERATED AT EVERY COMPILE -
+ * IT GIVES BETTER TRACKING OF VLC STABLE AND DEVELOPMENT VERSIONS
+ * WHETHER THEY ARE BUILT BY OTHERS OR DURING DEVELOPMENT OR FOR THE
+ * OFFICIAL VLC STABLE RELEASES.
+ */
+const char psz_vlc_changeset[] = "${VLC_CHANGESET}";
+
+EOF
+  if diff >/dev/null 2>&1 ${file} ${file}.tmp
+  then
+    rm -f ${file}.tmp
+  else
+    echo "creating new ${file}"
+    mv -f ${file}.tmp ${file}
+  fi
+
+  exit 0
+fi
+
 ##
 ##  Fix glade-generated files
 ##