BryanDavis has submitted this change and it was merged.

Change subject: checks/virtualenv.sh: Handle initial venv creation properly
......................................................................


checks/virtualenv.sh: Handle initial venv creation properly

When initially created, the virtualenv will be empty. Blindly calling
php uninstall with an empty arg list will fail. Instead collect the
installed packages and loop over them to uninstall.

Change-Id: Ib43166fa361e8edaac2916205bdc170704e91d85
---
M scap/checks/virtualenv.sh
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  BryanDavis: Verified; Looks good to me, approved



diff --git a/scap/checks/virtualenv.sh b/scap/checks/virtualenv.sh
index f6ab7e8..419213b 100755
--- a/scap/checks/virtualenv.sh
+++ b/scap/checks/virtualenv.sh
@@ -14,7 +14,10 @@
 virtualenv --python python3 $VENV || /bin/true
 
 # Remove all existing packages from the venv
-$PIP freeze | xargs $PIP uninstall -y
+INSTALLED=$($PIP freeze --local)
+for p in $INSTALLED; do
+    $PIP uninstall -y $p
+done
 
 # Install all of the packaged wheels
 $PIP install --use-wheel --no-deps ${DEPLOY_DIR}/wheels/*.whl

-- 
To view, visit https://gerrit.wikimedia.org/r/301872
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib43166fa361e8edaac2916205bdc170704e91d85
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker/deploy
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>
Gerrit-Reviewer: BryanDavis <bda...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to