summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Polonsky <Eli.polonsky@gmail.com>2019-06-23 00:58:40 +0300
committeriliapolo <eli.polonsky@gmail.com>2019-07-20 21:35:08 +0300
commit3591620f045d1c831362691302e177cc60519676 (patch)
treecef33d5f04e30927cadba307f8f9266a2dd057fc
parent28f776ed464c8c125995485cf40f037128354061 (diff)
Pyci integration
-rw-r--r--.gitignore5
-rw-r--r--.travis.yml151
-rw-r--r--AUTHORS (renamed from doc/AUTHORS)0
-rw-r--r--Makefile35
-rw-r--r--README.md (renamed from README.markdown)9
-rw-r--r--THANKS (renamed from doc/THANKS)0
-rwxr-xr-xbin/__init__.py2
-rw-r--r--bin/q.bat5
l---------bin/qtextasdata.py1
-rwxr-xr-xbuild-deb-builder-container10
-rwxr-xr-xbuild-rpm-builder-container10
-rw-r--r--config/.qrc (renamed from bin/.qrc)0
-rw-r--r--create-windows-setup-instructions76
-rw-r--r--dist/AddToPath.nsh440
-rwxr-xr-xdist/create-deb11
-rwxr-xr-xdist/create-rpm53
-rw-r--r--dist/deb-builder-Dockerfile8
-rw-r--r--dist/q-TextAsData-with-path.nsi182
-rw-r--r--dist/q-text-as-data.spec.template64
-rw-r--r--dist/rpm-builder-Dockerfile12
-rw-r--r--doc/LICENSE674
-rw-r--r--doc/basic-examples.pngbin6635 -> 0 bytes
-rw-r--r--doc/implementation.md (renamed from doc/IMPLEMENTATION.markdown)0
-rw-r--r--doc/rationale.md (renamed from doc/RATIONALE.markdown)0
-rw-r--r--doc/usage.md (renamed from doc/USAGE.markdown)0
-rw-r--r--examples/examples.md (renamed from examples/EXAMPLES.markdown)0
-rwxr-xr-xpackage-release35
-rw-r--r--pytest.ini2
-rw-r--r--q/__init__.py0
-rwxr-xr-xq/q.py (renamed from bin/q)0
-rw-r--r--q/tests/__init__.py0
-rwxr-xr-xq/tests/suite.py (renamed from test/test-suite)298
-rw-r--r--requirements.txt2
-rw-r--r--setup-pyenv.sh134
-rw-r--r--setup.py37
-rw-r--r--test-requirements.txt2
-rwxr-xr-xtest/test-all14
-rw-r--r--test/test-all.bat4
38 files changed, 495 insertions, 1781 deletions
diff --git a/.gitignore b/.gitignore
index a1e0486..45cd514 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,8 @@ packages
.idea/
dist/windows/
dist/
+*.iml
+*.egg-info
+
+# pytest
+.pytest_cache/
diff --git a/.travis.yml b/.travis.yml
index 402d9e1..a4d2680 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,14 +1,139 @@
-language: python
-python:
- - "2.7"
- - "3.6"
-matrix:
+sudo: false
+
+stages:
+ - integration
+ - release
+
+env:
+ global:
+ - CACHE_NAME=${TRAVIS_JOB_NAME}
+
+
+_commands_provider:
+
+ _test: &_test make test
+
+ _lint: &_lint make lint
+
+ _release: &_release make release
+
+ _install_test_requirements: &_install_test_requirements make dep-test
+
+ _install_requirements: &_install_requirements make dep-project
+
+ # https://ttcshelbyville.wordpress.com/2012/12/19/disable-remote-differential-compression-form-the-command-line/
+ _disable_windows_compression: &_disable_windows_compression "powershell Disable-WindowsOptionalFeature -Online -FeatureName MSRDC-Infrastructure"
+
+ # https://travis-ci.community/t/yarn-network-troubles/333/7
+ _disable_windows_defender: &_disable_windows_defender "powershell Set-MpPreference -DisableRealtimeMonitoring \\$true"
+
+
+_steps_provider:
+
+ _test: &_step_test
+
+ install:
+ - *_install_test_requirements
+ - *_install_requirements
+ before_script: *_lint
+ script: *_test
+
+ _release: &_step_release
+
+ install: *_install_requirements
+ script: *_release
+
+
+
+jobs:
include:
- - python: "3.7"
- dist: xenial # Need for python 3.7
- allow_failures:
- - python: "3.6"
- - python: "3.7"
-install: pip install -r requirements.txt
-before_script: flake8 ./bin/q ./test/test-suite --count --select=E901,E999,F821,F822,F823 --show-source --statistics
-script: test/test-all
+
+ - stage: integration
+ name: py27-macos
+ os: osx
+ language: generic
+ osx_image: xcode7.3
+ env:
+ - PYENV_VERSION=2.7.14
+ before_install: source setup-pyenv.sh
+ <<: *_step_test
+ cache:
+ directories:
+ - ${HOME}/.pyenv_cache
+
+ - stage: integration
+ name: py36-macos
+ os: osx
+ language: generic
+ osx_image: xcode7.3
+ env:
+ - PYENV_VERSION=3.6.4
+ before_install: source setup-pyenv.sh
+ <<: *_step_test
+ cache:
+ directories:
+ - ${HOME}/.pyenv_cache
+
+ - stage: integration
+ name: py37-macos
+ os: osx
+ language: generic
+ osx_image: xcode7.3
+ env:
+ - PYENV_VERSION=3.7.3
+ before_install: source setup-pyenv.sh
+ <<: *_step_test
+ cache:
+ directories:
+ - ${HOME}/.pyenv_cache
+
+ - stage: integration
+ name: py27-linux
+ language: python
+ python: "2.7"
+ <<: *_step_test
+
+ - stage: integration
+ name: py36-linux
+ language: python
+ python: "3.6"
+ <<: *_step_test
+
+ - stage: integration
+ name: py37-linux
+ language: python
+ dist: xenial
+ python: "3.7"
+ <<: *_step_test
+
+ - stage: release
+ name: macos
+ os: osx
+ language: generic
+ osx_image: xcode7.3
+ env:
+ - PYENV_VERSION=3.6.4
+ before_install: source setup-pyenv.sh
+ <<: *_step_release
+ cache:
+ directories:
+ - ${HOME}/.pyenv_cache
+
+ - stage: release
+ name: linux
+ language: python
+ python: "3.6"
+ <<: *_step_release
+
+ - stage: release
+ name: windows
+ os: windows
+ language: shell
+ env:
+ - PATH=/c/Python37:/c/Python37/Scripts:$PATH
+ before_install:
+ - *_disable_windows_compression
+ - *_disable_windows_defender
+ - choco install make
+ - choco install python --version 3.7.3
+ <<: *_step_release
diff --git a/doc/AUTHORS b/AUTHORS
index b673360..b673360 100644
--- a/doc/AUTHORS
+++ b/AUTHORS
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e163e85
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+SHELL := /bin/bash
+
+PROJECT_NAME=$(shell dirname "$0")
+ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+
+.PHONY: test help
+.DEFAULT_GOAL := ci
+
+ci: dep lint test ## Equivelant to 'make dep lint test'
+
+help: ## Show this help message.
+
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
+
+dep: dep-test dep-project ## Equivelant to 'make dep-test dep-project'
+
+dep-test: ## Install the dependent libraries needed for tests.
+
+ pip install -r test-requirements.txt
+
+dep-project: ## Install the dependent libraries needed for the project to run.
+
+ pip install -e .
+
+lint: dep ## Run lint validations.
+
+ flake8 ./bin/q ./test/test-suite --count --select=E901,E999,F821,F822,F823 --show-source --statistics
+
+test: dep ## Run the unit tests.
+
+ py.test -rs -c pytest.ini -s -v q/tests/suite.py --rootdir .
+
+release: dep-project ## Run release
+
+ pyci release --no-wheel-publish --wheel-universal
diff --git a/README.markdown b/README.md
index 85863af..d25c463 100644
--- a/README.markdown
+++ b/README.md
@@ -1,9 +1,10 @@
[![Build Status](https://travis-ci.org/harelba/q.svg?branch=master)](https://travis-ci.org/harelba/q)
+[![PyCI release](https://img.shields.io/badge/pyci-release-brightgreen.svg)](https://github.com/iliapolo/q)
# q - Text as Data
q is a command line tool that allows direct execution of SQL-like queries on CSVs/TSVs (and any other tabular text files).
-q treats ordinary files as database tables, and supports all SQL constructs, such as WHERE, GROUP BY, JOINs etc. It supports automatic column name and type detection, and q provides full support for multiple character encodings.
+q treats ordinary files as database tables, and supports all SQL constructs, such as `WHERE`, `GROUP BY`, `JOIN`s, etc. It supports automatic column name and type detection, and q provides full support for multiple character encodings.
q's web site is [http://harelba.github.io/q/](http://harelba.github.io/q/). It contains everything you need to download and use q immediately.
@@ -14,7 +15,11 @@ Instructions for all OSs are [here](http://harelba.github.io/q/install.html).
## Examples
-![blah](doc/basic-examples.png)
+```
+q "SELECT COUNT(*) FROM ./clicks_file.csv WHERE c3 > 32.3"
+
+ps -ef | q -H "SELECT UID, COUNT(*) cnt FROM - GROUP BY UID ORDER BY cnt DESC LIMIT 3"
+```
Go [here](http://harelba.github.io/q/examples.html) for more examples.
diff --git a/doc/THANKS b/THANKS
index 699c6f7..699c6f7 100644
--- a/doc/THANKS
+++ b/THANKS
diff --git a/bin/__init__.py b/bin/__init__.py
deleted file mode 100755
index cf529d7..0000000
--- a/bin/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env python
-
diff --git a/bin/q.bat b/bin/q.bat
deleted file mode 100644
index b832ab2..0000000
--- a/bin/q.bat
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-
-setlocal
-if exist "%~dp0..\python.exe" ( "%~dp0..\python" "%~dp0q" %* ) else ( python "%~dp0q" %* )
-endlocal
diff --git a/bin/qtextasdata.py b/bin/qtextasdata.py
deleted file mode 120000
index ea0c8a8..0000000
--- a/bin/qtextasdata.py
+++ /dev/null
@@ -1 +0,0 @@
-q \ No newline at end of file
diff --git a/build-deb-builder-container b/build-deb-builder-container
deleted file mode 100755
index abd021a..0000000
--- a/build-deb-builder-container
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 1 ];
-then
- echo "Usage: $(basename $0) <version-tag>"
- exit 1
-fi
-VERSION_TAG="$1"
-
-docker build -f dist/deb-builder-Dockerfile -t q-text-as-data-deb-builder:${VERSION_TAG} .
diff --git a/build-rpm-builder-container b/build-rpm-builder-container
deleted file mode 100755
index 4788f19..0000000
--- a/build-rpm-builder-container
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 1 ];
-then
- echo "Usage: $(basename $0) <version-tag>"
- exit 1
-fi
-VERSION_TAG="$1"
-
-docker build -f dist/rpm-builder-Dockerfile -t q-text-as-data-rpm-builder:${VERSION_TAG} .
diff --git a/bin/.qrc b/config/.qrc
index 513452c..513452c 100644
--- a/bin/.qrc
+++ b/config/.qrc
diff --git a/create-windows-setup-instructions b/create-windows-setup-instructions
deleted file mode 100644
index 9ff5fbe..0000000
--- a/create-windows-setup-instructions
+++ /dev/null
@@ -1,76 +0,0 @@
-
-# Alpha version - process is working, instructions not fully tested for minor details yet.
-
-Instructions for creating a windows package for q:
-
-The installation is based on a wine docker container.
-
-mkdir -p dist/windows
-
-pushd dist/windows
-
-fetch all files from https://github.com/harelba/packages-for-q/tree/master/artifactory-for-packaging into that folder.
-
-tar xvzf PyInstaller-2.1.tar.gz
-
-Fix pyinstaller to work around a bug by running the following command (use gsed for osx or sed for linux):
-gsed -i '1587s/^.*$/ if tpl[2] in ["BINARY", "DATA"]:/' ./PyInstaller-2.1/PyInstaller/build.py
-
-popd
-
-
-d=`pwd`
-cid1=`docker run -d -v ${d}:/q -e VNC_PASSWORD=newPW -p 5900:5900 suchja/x11server`
-cid2=`docker run -d --rm -i --link ${cid1}:xserver --volumes-from ${cid1} suchja/wine:latest /bin/bash`
-
-sleep 1
-
-function kill_container {
- tmp=`docker kill ${cid1} ${cid2}`
-}
-trap kill_container EXIT
-
-docker exec -it ${cid2} /bin/bash
-
-
-inside the docker container prompt:
-
- export DISPLAY=xserver:0
-
- wine wineboot --init
-
- cd ~/.wine/dosdevices/
-
- ln -s /q "q:"
-
- wine msiexec /i q:\\dist\\windows\\python-2.7.13.msi /q
-
- wine q:\\dist\\windows\\pywin32-219.win32-py2.7.exe
-
- mkdir ~/.wine/drive_c/q-build-environment
-
- cp -r /q/dist/windows/PyInstaller-2.1 ~/.wine/drive_c/q-build-environment/
-
- cd /q/dist
-
- wine q:\\dist\\windows\\nsis-2.46-setup.exe - install to c:\q-build-environment\nsis
-
-
- wine c:\\python27\\python.exe c:\\q-build-environment\\PyInstaller-2.1\\pyinstaller.py -F --distpath=win_output --workpath=win_build q:\\bin\\q
-
- ### Don't forget to change the version in the command below:
-
- wine c:\\q-build-environment\\nsis\\makensis.exe -DVERSION=1.6.2.0 q:\\dist\\q-TextAsData-with-path.nsi
-
-run the installation file and check that the install works properly:
-
- wine setup.exe
-
-move the installation to the packages folder:
-
- mv /q/dist/setup.exe /q/packages/setup-q-<version>.exe
-
-exit from the docker container
-
-
-
diff --git a/dist/AddToPath.nsh b/dist/AddToPath.nsh
deleted file mode 100644
index b961a1f..0000000
--- a/dist/AddToPath.nsh
+++ /dev/null
@@ -1,440 +0,0 @@
-!ifndef _AddToPath_nsh
-!define _AddToPath_nsh
-
-!verbose 3
-!include "WinMessages.NSH"
-!verbose 4
-
-!ifndef WriteEnvStr_RegKey
- !ifdef ALL_USERS
- !define WriteEnvStr_RegKey \
- 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
- !else
- !define WriteEnvStr_RegKey 'HKCU "Environment"'
- !endif
-!endif
-
-; AddToPath - Adds the given dir to the search path.
-; Input - head of the stack
-; Note - Win9x systems requires reboot
-
-Function AddToPath
- Exch $0
- Push $1
- Push $2
- Push $3
-
- # don't add if the path doesn't exist
- IfFileExists "$0\*.*" "" AddToPath_done
-
- ReadEnvStr $1 PATH
- Push "$1;"
- Push "$0;"
- Call StrStr
- Pop $2
- StrCmp $2 "" "" AddToPath_done
- Push "$1;"
- Push "$0\;"
- Call StrStr
- Pop $2
- StrCmp $2 "" "" AddToPath_done
- GetFullPathName /SHORT $3 $0
- Push "$1;"
- Push "$3;"
- Call StrStr
- Pop $2
- StrCmp $2 "" "" AddToPath_done
- Push "$1;"
- Push "$3\;"
- Call StrStr
- Pop $2
- StrCmp $2 "" "" AddToPath_done
-
- Call IsNT
- Pop $1
- StrCmp $1 1 AddToPath_NT
- ; Not on NT
- StrCpy $1 $WINDIR 2
- FileOpen $1 "$1\autoexec.bat" a
- FileSeek $1 -1 END
- FileReadByte $1 $2
- IntCmp $2 26 0 +2 +2 # DOS EOF
- FileSeek $1 -1 END # write over EOF
- FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
- FileClose $1
- SetRebootFlag true
- Goto AddToPath_done
-
- AddToPath_NT:
- ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
- StrCmp $1 "" AddToPath_NTdoIt
- Push $1
- Call Trim
- Pop $1
- StrCpy $0 "$1;$0"
- AddToPath_NTdoIt:
- WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $0
- SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
- AddToPath_done:
- Pop $3
- Pop $2
- Pop $1
- Pop $0
-FunctionEnd
-
-; RemoveFromPath - Remove a given dir from the path
-; Input: head of the stack
-
-Function un.RemoveFromPath
- Exch $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
-
- IntFmt $6 "%c" 26 # DOS EOF
-
- Call un.IsNT
- Pop $1
- StrCmp $1 1 unRemoveFromPath_NT
- ; Not on NT
- StrCpy $1 $WINDIR 2
- FileOpen $1 "$1\autoexec.bat" r
- GetTempFileName $4
- FileOpen $2 $4 w
- GetFullPathName /SHORT $0 $0
- StrCpy $0 "SET PATH=%PATH%;$0"
- Goto unRemoveFromPath_dosLoop
-
- unRemoveFromPath_dosLoop:
- FileRead $1 $3
- StrCpy $5 $3 1 -1 # read last char
- StrCmp $5 $6 0 +2 # if DOS EOF
- StrCpy $3 $3 -1 # remove DOS EOF so we can compare
- StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
- StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
- StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
- StrCmp $3 "" unRemoveFromPath_dosLoopEnd
- FileWrite $2 $3
- Goto unRemoveFromPath_dosLoop
- unRemoveFromPath_dosLoopRemoveLine:
- SetRebootFlag true
- Goto unRemoveFromPath_dosLoop
-
- unRemoveFromPath_dosLoopEnd:
- FileClose $2
- FileClose $1
- StrCpy $1 $WINDIR 2
- Delete "$1\autoexec.bat"
- CopyFiles /SILENT $4 "$1\autoexec.bat"
- Delete $4
- Goto unRemoveFromPath_done
-
- unRemoveFromPath_NT:
- ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
- StrCpy $5 $1 1 -1 # copy last char
- StrCmp $5 ";" +2 # if last char != ;
- StrCpy $1 "$1;" # append ;
- Push $1
- Push "$0;"
- Call un.StrStr ; Find `$0;` in $1
- Pop $2 ; pos of our dir
- StrCmp $2 "" unRemoveFromPath_done
- ; else, it is in path
- # $0 - path to add
- # $1 - path var
- StrLen $3 "$0;"
- StrLen $4 $2
- StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
- StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
- StrCpy $3 $5$6
-
- StrCpy $5 $3 1 -1 # copy last char
- StrCmp $5 ";" 0 +2 # if last char == ;
- StrCpy $3 $3 -1 # remove last char
-
- WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $3
- SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
- unRemoveFromPath_done:
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
-FunctionEnd
-
-
-
-; AddToEnvVar - Adds the given value to the given environment var
-; Input - head of the stack $0 environement variable $1=value to add
-; Note - Win9x systems requires reboot
-
-Function AddToEnvVar
-
- Exch $1 ; $1 has environment variable value
- Exch
- Exch $0 ; $0 has environment variable name
-
- DetailPrint "Adding $1 to $0"
- Push $2
- Push $3
- Push $4
-
-
- ReadEnvStr $2 $0
- Push "$2;"
- Push "$1;"
- Call StrStr
- Pop $3
- StrCmp $3 "" "" AddToEnvVar_done
-
- Push "$2;"
- Push "$1\;"
- Call StrStr
- Pop $3
- StrCmp $3 "" "" AddToEnvVar_done
-
-
- Call IsNT
- Pop $2
- StrCmp $2 1 AddToEnvVar_NT
- ; Not on NT
- StrCpy $2 $WINDIR 2
- FileOpen $2 "$2\autoexec.bat" a
- FileSeek $2 -1 END
- FileReadByte $2 $3
- IntCmp $3 26 0 +2 +2 # DOS EOF
- FileSeek $2 -1 END # write over EOF
- FileWrite $2 "$\r$\nSET $0=%$0%;$4$\r$\n"
- FileClose $2
- SetRebootFlag true
- Goto AddToEnvVar_done
-
- AddToEnvVar_NT:
- ReadRegStr $2 ${WriteEnvStr_RegKey} $0
- StrCpy $3 $2 1 -1 # copy last char
- StrCmp $3 ";" 0 +2 # if last char == ;
- StrCpy $2 $2 -1 # remove last char
- StrCmp $2 "" AddToEnvVar_NTdoIt
- StrCpy $1 "$2;$1"
- AddToEnvVar_NTdoIt:
- WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $1
- SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
- AddToEnvVar_done:
- Pop $4
- Pop $3
- Pop $2
- Pop $0
- Pop $1
-
-FunctionEnd
-
-; RemoveFromEnvVar - Remove a given value from a environment var
-; Input: head of the stack
-
-Function un.RemoveFromEnvVar
-
- Exch $1 ; $1 has environment variable value
- Exch
- Exch $0 ; $0 has environment variable name
-
- DetailPrint "Removing $1 from $0"
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
-
- IntFmt $7 "%c" 26 # DOS EOF
-
- Call un.IsNT
- Pop $2
- StrCmp $2 1 unRemoveFromEnvVar_NT
- ; Not on NT
- StrCpy $2 $WINDIR 2
- FileOpen $2 "$2\autoexec.bat" r
- GetTempFileName $5
- FileOpen $3 $5 w
- GetFullPathName /SHORT $1 $1
- StrCpy $1 "SET $0=%$0%;$1"
- Goto unRemoveFromEnvVar_dosLoop
-
- unRemoveFromEnvVar_dosLoop:
- FileRead $2 $4
- StrCpy $6 $4 1 -1 # read last char
- StrCmp $6 $7 0 +2 # if DOS EOF
- StrCpy $4 $4 -1 # remove DOS EOF so we can compare
- StrCmp $4 "$1$\r$\n" unRemoveFromEnvVar_dosLoopRemoveLine
- StrCmp $4 "$1$\n" unRemoveFromEnvVar_dosLoopRemoveLine
- StrCmp $4 "$1" unRemoveFromEnvVar_dosLoopRemoveLine
- StrCmp $4 "" unRemoveFromEnvVar_dosLoopEnd
- FileWrite $3 $4
- Goto unRemoveFromEnvVar_dosLoop
- unRemoveFromEnvVar_dosLoopRemoveLine:
- SetRebootFlag true
- Goto unRemoveFromEnvVar_dosLoop
-
- unRemoveFromEnvVar_dosLoopEnd:
- FileClose $3
- FileClose $2
- StrCpy $2 $WINDIR 2
- Delete "$2\autoexec.bat"
- CopyFiles /SILENT $5 "$2\autoexec.bat"
- Delete $5
- Goto unRemoveFromEnvVar_done
-
- unRemoveFromEnvVar_NT:
- ReadRegStr $2 ${WriteEnvStr_RegKey} $0
- StrCpy $6 $2 1 -1 # copy last char
- StrCmp $6 ";" +2 # if last char != ;
- StrCpy $2 "$2;" # append ;
- Push $2
- Push "$1;"
- Call un.StrStr ; Find `$1;` in $2
- Pop $3 ; pos of our dir
- StrCmp $3 "" unRemoveFromEnvVar_done
- ; else, it is in path
- # $1 - path to add
- # $2 - path var
- StrLen $4 "$1;"
- StrLen $5 $3
- StrCpy $6 $2 -$5 # $6 is now the part before the path to remove
- StrCpy $7 $3 "" $4 # $7 is now the part after the path to remove
- StrCpy $4 $6$7
-
- StrCpy $6 $4 1 -1 # copy last char
- StrCmp $6 ";" 0 +2 # if last char == ;
- StrCpy $4 $4 -1 # remove last char
-
- WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $4
-
- ; delete reg value if null
- StrCmp $4 "" 0 +2 # if null delete reg
- DeleteRegValue ${WriteEnvStr_RegKey} $0
-
- SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
- unRemoveFromEnvVar_done:
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
-FunctionEnd
-
-
-
-
-!ifndef IsNT_KiCHiK
-!define IsNT_KiCHiK
-
-###########################################
-# Utility Functions #
-###########################################
-
-; IsNT
-; no input
-; output, top of the stack = 1 if NT or 0 if not
-;
-; Usage:
-; Call IsNT
-; Pop $R0
-; ($R0 at this point is 1 or 0)
-
-!macro IsNT un
-Function ${un}IsNT
- Push $0
- ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
- StrCmp $0 "" 0 IsNT_yes
- ; we are not NT.
- Pop $0
- Push 0
- Return
-
- IsNT_yes:
- ; NT!!!
- Pop $0
- Push 1
-FunctionEnd
-!macroend
-!insertmacro IsNT ""
-!insertmacro IsNT "un."
-
-!endif ; IsNT_KiCHiK
-
-; StrStr
-; input, top of stack = string to search for
-; top of stack-1 = string to search in
-; output, top of stack (replaces with the portion of the string remaining)
-; modifies no other variables.
-;
-; Usage:
-; Push "this is a long ass string"
-; Push "ass"
-; Call StrStr
-; Pop $R0
-; ($R0 at this point is "ass string")
-
-!macro StrStr un
-Function ${un}StrStr
-Exch $R1 ; st=haystack,old$R1, $R1=needle
- Exch ; st=old$R1,haystack
- Exch $R2 ; st=old$R1,old$R2, $R2=haystack
- Push $R3
- Push $R4
- Push $R5
- StrLen $R3 $R1
- StrCpy $R4 0
- ; $R1=needle
- ; $R2=haystack
- ; $R3=len(needle)
- ; $R4=cnt
- ; $R5=tmp
- loop:
- StrCpy $R5 $R2 $R3 $R4
- StrCmp $R5 $R1 done
- StrCmp $R5 "" done
- IntOp $R4 $R4 + 1
- Goto loop
-done:
- StrCpy $R1 $R2 "" $R4
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Exch $R1
-FunctionEnd
-!macroend
-!insertmacro StrStr ""
-!insertmacro StrStr "un."
-
-Function Trim ; Added by Pelaca
- Exch $R1
- Push $R2
-Loop:
- StrCpy $R2 "$R1" 1 -1
- StrCmp "$R2" " " RTrim
- StrCmp "$R2" "$\n" RTrim
- StrCmp "$R2" "$\r" RTrim
- StrCmp "$R2" ";" RTrim
- GoTo Done
-RTrim:
- StrCpy $R1 "$R1" -1
- Goto Loop
-Done:
- Pop $R2
- Exch $R1
-FunctionEnd
-
-!endif ; _AddToPath_nsh
diff --git a/dist/create-deb b/dist/create-deb
deleted file mode 100755
index 0017ff3..0000000
--- a/dist/create-deb
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 1 ];
-then
- echo 'create-deb <rpm-package-filename>'
- exit 1
-fi
-
-command -v alien &>/dev/null || { echo >&2 "alien needs to be installed."; exit 1; }
-
-alien -d -k $1
diff --git a/dist/create-rpm b/dist/create-rpm
deleted file mode 100755
index 7d86661..0000000
--- a/dist/create-rpm
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-#
-# Commit tag and Version number should be provided as input in the command line
-#
-#
-
-if [ $# -ne 1 ];
-then
- echo 'create-rpm <version>'