Ajout scripts utilitaires pour VCS vd et vs
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 15 Sep 2011 04:07:34 +0000 (04:07 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 15 Sep 2011 04:07:34 +0000 (04:07 +0000)
stage2/hv-utilities/vd [new file with mode: 0755]
stage2/hv-utilities/vs [new file with mode: 0755]
stage2/install-hv-utilities

diff --git a/stage2/hv-utilities/vd b/stage2/hv-utilities/vd
new file mode 100755 (executable)
index 0000000..6d7cb5a
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+print_usage()
+{
+    echo "$(basename $0) -- diff for version control (svn or git) with color output."
+    echo "Usage: $(basename $0) [OPTIONS...]"
+}
+
+if [ "x${1}" = "x--help" ]; then
+    print_usage
+    exit 1
+fi
+
+if git diff 1> /dev/null 2>&1; then
+    git diff "$@"
+elif [ -d .svn ]; then
+    svn diff --diff-cmd colordiff -x "-u -w -p" "$@" | less -RFX
+else
+    echo "Not a GIT or Subversion repository"
+    exit 1
+fi
diff --git a/stage2/hv-utilities/vs b/stage2/hv-utilities/vs
new file mode 100755 (executable)
index 0000000..e34a780
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+print_usage()
+{
+    echo "$(basename $0) -- status for version control (svn or git)."
+    echo "Usage: $(basename $0) [OPTIONS...]"
+}
+
+if [ "x${1}" = "x--help" ]; then
+    print_usage
+    exit 1
+fi
+
+if git diff 1> /dev/null 2>&1; then
+    git status "$@"
+elif [ -d .svn ]; then
+    svn status "$@"
+else
+    echo "Not a GIT or Subversion repository"
+    exit 1
+fi
index 78608ac..bd6a3d3 100755 (executable)
@@ -10,7 +10,7 @@ BIN_UTILITIES="camera-download cd-erase cd-copy cgrep pstopdf distro-backup \
                dos2unix dvd-ram-format fix-avi gztobz2 hv-backup hv-video-dvd \
                mail-files mail-if-fail mail-statistics media-write pstopdf \
                replace.pl rotatelogs setdate strip-debug-symbols tarbz2 \
-               tildes-clean"
+               tildes-clean vd vs"
 
 for program in ${BIN_UTILITIES}; do
     install -v ${SRCDIR}/${program} ${BINDIR}