Skip to content

Commit

Permalink
CTT-303 Add version to IPF Quick Install
Browse files Browse the repository at this point in the history
fixes #15
update FAQ
  • Loading branch information
andylytical committed Nov 13, 2024
1 parent e84d333 commit 4cabdce
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
4 changes: 4 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Yes!
* ```bash
bash ~/ipf/bin/wfm stop
```
1. Make backups of any config files
* ```bash
bash ~/ipf/bin/save_configs.sh
```
1. Remove the install directory
* ```bash
rm -rf ~/ipf
Expand Down
21 changes: 21 additions & 0 deletions ipf/bin/prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ restore_config_links() {
}


set_version() {
# Create a setuptools style METADATA file with the current version string
[[ $DEBUG -eq $YES ]] && set -x
local _version=$( cat "$INSTALL_DIR"/version )
local _site_pkgs=$( "$V_PYTHON" -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])' )
local _fn_metadata="$_site_pkgs"/ipf-"${_version}".dist-info/METADATA
local _dn_metadata=$( dirname "$_fn_metadata" )
mkdir -p "$_dn_metadata" || die "Failed to make IPF metadata directory"
>"$_fn_metadata" cat <<ENDHERE
Metadata-Version: 2.1
Name: ipf
Version: $_version
ENDHERE
[[ -f "$_fn_metadata" ]] || die "Failed to make IPF metadata file"
grep '^Version' "$_fn_metadata" || die "Failed to set version"
success "Version set successfully"
}


[[ $DEBUG -eq $YES ]] && set -x

assert_python_minimum_version
Expand All @@ -51,3 +70,5 @@ mk_venv
install_dependencies

restore_config_links

set_version
14 changes: 12 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT RUN THIS BY HAND
# This file is for use by https://github.com/andylytical/quickstart

INSTALL_DIR="$(pwd)" #this is the directory the user invoked quickstart
INSTALL_DIR="$(pwd)" #this is the directory from which the user invoked quickstart
BASE=$(readlink -e $( dirname $0 ) )
IPF_SRC="$BASE/ipf"
TS=$(date +%s)
Expand Down Expand Up @@ -64,10 +64,20 @@ install_special() {
"$INSTALL_DIR"
}


install_version() {
[[ $DEBUG -eq $YES ]] && set -x
local _version=$( awk -F '"' '/version=/ {print $2; exit;}' "$BASE"/setup.py )
log "VERSION = $_version"
echo "$_version" > "$INSTALL_DIR"/ipf/version
}

[[ $DEBUG -eq $YES ]] && set -x

update_files

install_common

install_special
# install_special

install_version

0 comments on commit 4cabdce

Please sign in to comment.