| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 #--------------------------------------------- | 2 #--------------------------------------------- |
| 3 # xdg-copy | 3 # xdg-copy |
| 4 # | 4 # |
| 5 # Utility script to copy files specified by URLs, including | 5 # Utility script to copy files specified by URLs, including |
| 6 # downloading and uploading from/to remote sites. | 6 # downloading and uploading from/to remote sites. |
| 7 # | 7 # |
| 8 # Refer to the usage() function below for usage. | 8 # Refer to the usage() function below for usage. |
| 9 # | 9 # |
| 10 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> | 10 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 if [ $? -eq 0 ]; then | 35 if [ $? -eq 0 ]; then |
| 36 exit_success | 36 exit_success |
| 37 else | 37 else |
| 38 exit_failure_operation_failed | 38 exit_failure_operation_failed |
| 39 fi | 39 fi |
| 40 } | 40 } |
| 41 | 41 |
| 42 copy_gnome() | 42 copy_gnome() |
| 43 { | 43 { |
| 44 gnomevfs-copy "$1" "$2" | 44 if gvfs-copy --help 2>/dev/null 1>&2; then |
| 45 gvfs-copy "$1" "$2" |
| 46 else |
| 47 gnomevfs-copy "$1" "$2" |
| 48 fi |
| 45 | 49 |
| 46 if [ $? -eq 0 ]; then | 50 if [ $? -eq 0 ]; then |
| 47 exit_success | 51 exit_success |
| 48 else | 52 else |
| 49 exit_failure_operation_failed | 53 exit_failure_operation_failed |
| 50 fi | 54 fi |
| 51 } | 55 } |
| 52 | 56 |
| 53 [ x"$1" != x"" ] || exit_failure_syntax | 57 [ x"$1" != x"" ] || exit_failure_syntax |
| 54 | 58 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 ;; | 95 ;; |
| 92 | 96 |
| 93 gnome) | 97 gnome) |
| 94 copy_gnome "$source" "$dest" | 98 copy_gnome "$source" "$dest" |
| 95 ;; | 99 ;; |
| 96 | 100 |
| 97 *) | 101 *) |
| 98 exit_failure_operation_impossible "no method available for copying '$source'
to '$dest'" | 102 exit_failure_operation_impossible "no method available for copying '$source'
to '$dest'" |
| 99 ;; | 103 ;; |
| 100 esac | 104 esac |
| OLD | NEW |