Skip to content

Commit

Permalink
Fix #146, fix #148, fix #151 and --quit
Browse files Browse the repository at this point in the history
  • Loading branch information
genotrance committed Jun 14, 2022
1 parent 92ce257 commit de4090d
Show file tree
Hide file tree
Showing 11 changed files with 630 additions and 375 deletions.
8 changes: 8 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v0.7.1 - 2022-06-13
- Fixed #146 - px --install was broken when run in cmd.exe, also when
run as `python -m px`
- Fixed #148 - 407 proxy required was not being detected generically
- Fixed #151 - handle older versions of libcurl gracefully
- Fixed issues with --quit not exiting child processes or working correctly
in binary mode

v0.7.0 - 2022-05-12
- Switched to using libcurl for all outbound HTTP connections and proxy auth
- Removed dependency on ntlm-auth, pywin32 and winkerberos
Expand Down
94 changes: 94 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#! /bin/sh

if [ -f "/.dockerenv" ]; then
# Running inside container
DISTRO=`cat /etc/os-release | grep ^ID | head -n 1 | cut -d"=" -f2 | sed 's/"//g'`
SHELL="bash"

export PROXY="$1"
export USERNAME="$2"

# build or test
COMMAND="test"
if [ ! -z "$3" ]; then
COMMAND="$3"
fi

MUSL=`ldd /bin/ls | grep musl`
if [ -z "$MUSL" ]; then
PXBIN="/px/px.dist-linux-glibc-x86_64/px.dist/px"
else
PXBIN="/px/px.dist-linux-musl-x86_64/px.dist/px"
fi

if [ "$DISTRO" = "alpine" ]; then

apk update && apk upgrade
apk add curl dbus gcc gnome-keyring linux-headers musl-dev psmisc python3 python3-dev
python3 -m ensurepip
if [ "$COMMAND" = "build" ]; then
apk add ccache libffi-dev patchelf py3-dbus upx
fi

SHELL="sh"

elif [ "$DISTRO" = "centos" ]; then

yum update -y
yum install -y gnome-keyring psmisc
if [ "$COMMAND" = "build" ]; then
yum install -y ccache dbus-devel libffi-devel patchelf python36-cryptography upx
fi

elif [ "$DISTRO" = "ubuntu" ] || [ "$DISTRO" = "debian" ]; then

apt update -y && apt upgrade -y
apt install -y curl dbus gnome-keyring psmisc python3 python3-dev python3-pip
if [ "$COMMAND" = "build" ]; then
apt install -y ccache patchelf python3-dbus python3-secretstorage upx zlib1g zlib1g-dev
fi

elif [ "$DISTRO" = "opensuse-tumbleweed" ] || [ "$DISTRO" = "opensuse-leap" ]; then

zypper -n update
zypper -n install curl dbus-1 gnome-keyring psmisc python3 python3-pip
if [ "$DISTRO" = "opensuse-leap" ]; then
zypper -n install gcc
fi

else
echo "Unknown distro $DISTRO"
$SHELL
exit
fi

dbus-run-session -- $SHELL -c 'echo "abc" | gnome-keyring-daemon --unlock'

cd /px
if [ "$COMMAND" = "build" ]; then
python3 -m pip install --upgrade pip setuptools jeepney==0.7.1

python3 tools.py --setup

python3 px.py --username=$USERNAME --password
else
python3 -m pip install --upgrade pip setuptools netifaces psutil requests

$PXBIN --username=$USERNAME --password
fi

$SHELL
else
# Start container
if [ -z "$PROXY" ]; then
echo "PROXY not configured"
exit
fi

if [ -z "$USERNAME" ]; then
echo "USERNAME not configured"
exit
fi

docker run -it --rm --network host --privileged -v `pwd`:/px $1 /px/build.sh "$PROXY" "$USERNAME" $2
fi
Loading

0 comments on commit de4090d

Please sign in to comment.