Browse code

Remove TRACK_DEPENDS

This was added in 2012 with I89677fd54635e82b10ab674ddeb9ffb3f1a755f0,
but I can not see it being used anywhere currently.

It's use of virtualenv's has become problematic in a python2
deprecated world, but since it is not used, remove it to avoid further
confusion.

Change-Id: I65d44d24f449436ca6229928eee2c5a021793055

Ian Wienand authored on 2020/01/13 14:31:20
Showing 3 changed files
... ...
@@ -27,7 +27,6 @@
27 27
 # - ``RECLONE``
28 28
 # - ``REQUIREMENTS_DIR``
29 29
 # - ``STACK_USER``
30
-# - ``TRACK_DEPENDS``
31 30
 # - ``http_proxy``, ``https_proxy``, ``no_proxy``
32 31
 #
33 32
 
... ...
@@ -44,7 +43,6 @@ declare -A -g GITREPO
44 44
 declare -A -g GITBRANCH
45 45
 declare -A -g GITDIR
46 46
 
47
-TRACK_DEPENDS=${TRACK_DEPENDS:-False}
48 47
 KILL_PATH="$(which kill)"
49 48
 
50 49
 # Save these variables to .stackenv
... ...
@@ -2075,11 +2073,7 @@ function _safe_permission_operation {
2075 2075
         return 0
2076 2076
     fi
2077 2077
 
2078
-    if [[ $TRACK_DEPENDS = True ]]; then
2079
-        sudo_cmd="env"
2080
-    else
2081
-        sudo_cmd="sudo"
2082
-    fi
2078
+    sudo_cmd="sudo"
2083 2079
 
2084 2080
     $xtrace
2085 2081
     $sudo_cmd $@
... ...
@@ -175,7 +175,7 @@ function disable_python3_package {
175 175
 
176 176
 # Wrapper for ``pip install`` to set cache and proxy environment variables
177 177
 # Uses globals ``OFFLINE``, ``PIP_VIRTUAL_ENV``,
178
-# ``PIP_UPGRADE``, ``TRACK_DEPENDS``, ``*_proxy``,
178
+# ``PIP_UPGRADE``, ``*_proxy``,
179 179
 # Usage:
180 180
 #  pip_install pip_arguments
181 181
 function pip_install {
... ...
@@ -219,37 +219,28 @@ function pip_install {
219 219
     # this works (for now...)
220 220
     local package_dir=${!#%\[*\]}
221 221
 
222
-    if [[ $TRACK_DEPENDS = True && ! "$@" =~ virtualenv ]]; then
223
-        # TRACK_DEPENDS=True installation creates a circular dependency when
224
-        # we attempt to install virtualenv into a virtualenv, so we must global
225
-        # that installation.
226
-        source $DEST/.venv/bin/activate
227
-        local cmd_pip=$DEST/.venv/bin/pip
222
+    if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then
223
+        local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip
228 224
         local sudo_pip="env"
229 225
     else
230
-        if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then
231
-            local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip
232
-            local sudo_pip="env"
233
-        else
234
-            local cmd_pip
235
-            cmd_pip=$(get_pip_command $PYTHON2_VERSION)
236
-            local sudo_pip="sudo -H"
237
-            if python3_enabled; then
238
-                # Special case some services that have experimental
239
-                # support for python3 in progress, but don't claim support
240
-                # in their classifier
241
-                echo "Check python version for : $package_dir"
242
-                if python3_disabled_for ${package_dir##*/}; then
243
-                    echo "Explicitly using $PYTHON2_VERSION version to install $package_dir based on DISABLED_PYTHON3_PACKAGES"
244
-                else
245
-                    # For everything that is not explicitly blacklisted with
246
-                    # DISABLED_PYTHON3_PACKAGES, assume it supports python3
247
-                    # and we will let pip sort out the install, regardless of
248
-                    # the package being local or remote.
249
-                    echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior"
250
-                    sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
251
-                    cmd_pip=$(get_pip_command $PYTHON3_VERSION)
252
-                fi
226
+        local cmd_pip
227
+        cmd_pip=$(get_pip_command $PYTHON2_VERSION)
228
+        local sudo_pip="sudo -H"
229
+        if python3_enabled; then
230
+            # Special case some services that have experimental
231
+            # support for python3 in progress, but don't claim support
232
+            # in their classifier
233
+            echo "Check python version for : $package_dir"
234
+            if python3_disabled_for ${package_dir##*/}; then
235
+                echo "Explicitly using $PYTHON2_VERSION version to install $package_dir based on DISABLED_PYTHON3_PACKAGES"
236
+            else
237
+                # For everything that is not explicitly blacklisted with
238
+                # DISABLED_PYTHON3_PACKAGES, assume it supports python3
239
+                # and we will let pip sort out the install, regardless of
240
+                # the package being local or remote.
241
+                echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior"
242
+                sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
243
+                cmd_pip=$(get_pip_command $PYTHON3_VERSION)
253 244
             fi
254 245
         fi
255 246
     fi
... ...
@@ -796,19 +796,6 @@ if [[ "$OFFLINE" != "True" ]]; then
796 796
     PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh
797 797
 fi
798 798
 
799
-TRACK_DEPENDS=${TRACK_DEPENDS:-False}
800
-
801
-# Install Python packages into a virtualenv so that we can track them
802
-if [[ $TRACK_DEPENDS = True ]]; then
803
-    echo_summary "Installing Python packages into a virtualenv $DEST/.venv"
804
-    pip_install -U virtualenv
805
-
806
-    rm -rf $DEST/.venv
807
-    virtualenv --system-site-packages $DEST/.venv
808
-    source $DEST/.venv/bin/activate
809
-    $DEST/.venv/bin/pip freeze > $DEST/requires-pre-pip
810
-fi
811
-
812 799
 # Do the ugly hacks for broken packages and distros
813 800
 source $TOP_DIR/tools/fixup_stuff.sh
814 801
 fixup_all
... ...
@@ -997,17 +984,6 @@ fi
997 997
 # osc commands. Alias dies with stack.sh.
998 998
 install_oscwrap
999 999
 
1000
-if [[ $TRACK_DEPENDS = True ]]; then
1001
-    $DEST/.venv/bin/pip freeze > $DEST/requires-post-pip
1002
-    if ! diff -Nru $DEST/requires-pre-pip $DEST/requires-post-pip > $DEST/requires.diff; then
1003
-        echo "Detect some changes for installed packages of pip, in depend tracking mode"
1004
-        cat $DEST/requires.diff
1005
-    fi
1006
-    echo "Ran stack.sh in depend tracking mode, bailing out now"
1007
-    exit 0
1008
-fi
1009
-
1010
-
1011 1000
 # Syslog
1012 1001
 # ------
1013 1002