Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: third_party/xdg-utils/scripts/xdg-copy.in

Issue 151098: Patch from mdm@google.com... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-copy ('k') | third_party/xdg-utils/scripts/xdg-desktop-icon » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/xdg-utils/scripts/xdg-copy.in
===================================================================
--- third_party/xdg-utils/scripts/xdg-copy.in (revision 0)
+++ third_party/xdg-utils/scripts/xdg-copy.in (revision 0)
@@ -0,0 +1,100 @@
+#!/bin/sh
+#---------------------------------------------
+# xdg-copy
+#
+# Utility script to copy files specified by URLs, including
+# downloading and uploading from/to remote sites.
+#
+# Refer to the usage() function below for usage.
+#
+# Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
+# Copyright 2006, Jeremy White <jwhite@codeweavers.com>
+#
+# LICENSE:
+#
+#---------------------------------------------
+
+manualpage()
+{
+cat << _MANUALPAGE
+_MANUALPAGE
+}
+
+usage()
+{
+cat << _USAGE
+_USAGE
+}
+
+#@xdg-utils-common@
+
+copy_kde()
+{
+ kfmclient copy "$1" "$2"
+
+ if [ $? -eq 0 ]; then
+ exit_success
+ else
+ exit_failure_operation_failed
+ fi
+}
+
+copy_gnome()
+{
+ gnomevfs-copy "$1" "$2"
+
+ if [ $? -eq 0 ]; then
+ exit_success
+ else
+ exit_failure_operation_failed
+ fi
+}
+
+[ x"$1" != x"" ] || exit_failure_syntax
+
+source=
+dest=
+while [ $# -gt 0 ] ; do
+ parm=$1
+ shift
+
+ case $parm in
+ -*)
+ exit_failure_syntax "unexpected option '$parm'"
+ ;;
+
+ *)
+ if [ -n "$dest" ] ; then
+ exit_failure_syntax "unexpected argument '$parm'"
+ fi
+ if [ -n "$source" ] ; then
+ dest=$parm
+ else
+ source=$parm
+ fi
+ ;;
+ esac
+done
+
+if [ -z "${source}" ] ; then
+ exit_failure_syntax "source argument missing"
+fi
+if [ -z "${dest}" ] ; then
+ exit_failure_syntax "destination argument missing"
+fi
+
+detectDE
+
+case "$DE" in
+ kde)
+ copy_kde "$source" "$dest"
+ ;;
+
+ gnome)
+ copy_gnome "$source" "$dest"
+ ;;
+
+ *)
+ exit_failure_operation_impossible "no method available for copying '$source' to '$dest'"
+ ;;
+esac
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-copy ('k') | third_party/xdg-utils/scripts/xdg-desktop-icon » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698