Package: winetricks / 0.0+20170101-1

remove-self-update.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
Description: Remove winetricks built-in update functionality.
Author: Joseph Bisch <joseph.bisch@gmail.com>
Forwarded: not-needed
Last-Update: 2017-01-16
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/winetricks
+++ b/src/winetricks
@@ -684,84 +684,6 @@ w_dotnet_verify()
             w_info ".Net Verifier returned $dn_status"
 }
 
-# Checks if the user can run the self-update/rollback commands
-winetricks_check_update_availability()
-{
-    # Prevents the development file overwrite:
-    if test -d "../.git"
-    then
-        w_warn "You're running in a dev environment. Please make a copy of the file before running this command."
-        exit;
-    fi
-
-    # Checks read/write permissions on update directories
-    if ! (test -r "$0" && test -w "$0" && test -w "${0%/*}" && test -x "${0%/*}")
-    then
-        w_warn "You don't have the proper permissions to run this command. Try again with sudo or as root."
-        exit;
-    fi
-}
-
-winetricks_selfupdate()
-{
-    winetricks_check_update_availability
-
-    _W_filename="${0##*/}"
-    _W_rollback_file="${0}.bak"
-    _W_update_file="${0}.update"
-
-    _W_tmpdir=${TMPDIR:-/tmp}
-    _W_tmpdir="$(mktemp -d "$_W_tmpdir/$_W_filename.XXXXXXXX")"
-
-    w_download_to "$_W_tmpdir" https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
-
-    # 2016/10/26: now file is uncompressed? Handle both cases:
-    update_file_type="$(file "$_W_tmpdir/$_W_filename")"
-    case "$update_file_type" in
-        *"POSIX shell script"*)
-            #echo "already decompressed!"
-            w_try mv "$_W_tmpdir/$_W_filename" "${_W_update_file}"
-            ;;
-        *"gzip compressed data"*)
-            w_try mv "$_W_tmpdir/$_W_filename" "${_W_update_file}.gz"
-            w_try gunzip "${_W_update_file}.gz"
-            ;;
-         *)
-            echo "Unknown file type: $update_file_type"
-            exit 1
-            ;;
-    esac
-
-    w_try rmdir "$_W_tmpdir"
-
-    w_try cp "$0" "$_W_rollback_file"
-    w_try chmod -x "$_W_rollback_file"
-
-    w_try mv "$_W_update_file" "$0"
-    w_try chmod +x "$0"
-
-    w_warn "Update finished! The current version is $($0 -V). Use 'winetricks --update-rollback' to return to the previous version."
-
-    exit
-}
-
-winetricks_selfupdate_rollback()
-{
-    winetricks_check_update_availability
-
-    _W_rollback_file="${0}.bak"
-
-    if test -f "$_W_rollback_file"
-    then
-        w_try mv "$_W_rollback_file" "$0"
-        w_try chmod +x "$0"
-        w_warn "Rollback finished! The current version is $($0 -V)."
-    else
-        w_warn "Nothing to rollback."
-    fi
-    exit;
-}
-
 # Download a file
 # Usage: w_download_to (packagename|path to download file) url [sha1sum [filename [cookie jar]]]
 # Caches downloads in winetrickscache/$packagename
@@ -2704,31 +2626,6 @@ winetricks_get_platform()
     fi
 }
 
-winetricks_latest_version_check()
-{
-    if [ "$WINETRICKS_LATEST_VERSION_CHECK" = 'disabled' ] || [ -f "${WINETRICKS_CONFIG}/disable-latest-version-check" ] ; then
-        w_info "winetricks latest version check update disabled"
-        return
-    fi
-
-    latest_version="$(winetricks_dl_url_to_stdout https://raw.githubusercontent.com/Winetricks/winetricks/master/files/LATEST)"
-
-    # Also check that $latest_version is an actual number in case github is down
-    if [ ! -z "${latest_version}" ] && [ ! "$WINETRICKS_VERSION" = "${latest_version}" ] && \
-        echo "${latest_version}" | grep -E "[0-9]{8}" ; then
-
-        if [ -f "${WINETRICKS_CONFIG}/enable-auto-update" ] ; then
-            w_info "You are running winetricks-${WINETRICKS_VERSION}."
-            w_info "New upstream release winetricks-${latest_version} is available."
-            w_info "auto-update enabled: running winetricks_selfupdate"
-            winetricks_selfupdate
-        else
-            w_warn "You are running winetricks-${WINETRICKS_VERSION}, latest upstream is winetricks-${latest_version}!"
-            w_warn "You should update using your distribution's package manager, --self-update, or manually."
-        fi
-    fi
-}
-
 winetricks_print_version()
 {
     # Normally done by winetricks_init, but we don't want to set up the WINEPREFIX
@@ -4619,7 +4516,6 @@ winetricks_init()
         echo "Using winetricks $(winetricks_print_version) with ${WINETRICKS_WINE_VERSION} and WINEARCH=${W_ARCH}"
     fi
 
-    winetricks_latest_version_check
 }
 
 winetricks_usage()
@@ -4690,8 +4586,6 @@ Options:
     --force           Don't check whether packages were already installed
     --gui             Show gui diagnostics even when driven by commandline
     --isolate         Install each app or game in its own bottle (WINEPREFIX)
-    --self-update     Update this application to the last version
-    --update-rollback Rollback the last self update
 -k, --keep_isos       Cache isos (allows later installation without disc)
     --no-clean        Don't delete temp directories (useful during debugging)
 -q, --unattended      Don't ask any questions, just install automatically
@@ -4735,10 +4629,8 @@ winetricks_handle_option()
     --optout) WINETRICKS_STATS_REPORT=0;;
     -q|--unattended) winetricks_set_unattended 1 ;;
     -r|--ddrescue) WINETRICKS_OPT_DD=ddrescue ;;
-    --self-update) winetricks_selfupdate;;
     --showbroken) W_OPT_SHOWBROKEN=1 ;;
     -t|--torify)  WINETRICKS_OPT_TORIFY=1 ;;
-    --update-rollback) winetricks_selfupdate_rollback;;
     -v|--verbose) WINETRICKS_OPT_VERBOSE=1 ; set -x;;
     -V|--version) winetricks_print_version ; exit 0;;
     --verify) WINETRICKS_VERIFY=1 ;;