Only use version tag in display

Not in generating install directories, otherwise we end up with loads of
new directories for every patch and the purpose is to make it easy to
see which version you're working with.
This commit is contained in:
Edwin Brady 2020-01-30 18:25:18 +00:00
parent bb6cefc0a9
commit 0cb446dd31
7 changed files with 15 additions and 13 deletions

View File

@ -14,7 +14,8 @@ ifeq ($(shell git status >/dev/null 2>&1; echo $$?), 0)
endif
endif
IDRIS2_VERSION:=${MAJOR}.${MINOR}.${PATCH}${VER_TAG}
IDRIS2_VERSION_TAG:=${MAJOR}.${MINOR}.${PATCH}${VER_TAG}
IDRIS2_VERSION:=${MAJOR}.${MINOR}.${PATCH}
PREFIX ?= ${HOME}/.idris2
export IDRIS2_PATH = ${CURDIR}/libs/prelude/build/ttc:${CURDIR}/libs/base/build/ttc
@ -34,7 +35,7 @@ check_version:
@if [ $(shell expr $(IDRIS_VERSION) : $(VALID_IDRIS_VERSION_REGEXP)) -eq 0 ]; then echo "Wrong idris version, expected version matching $(VALID_IDRIS_VERSION_REGEXP)"; exit 1; fi
idris2: src/YafflePaths.idr check_version
@echo "Building Idris 2 version: $(IDRIS2_VERSION)"
@echo "Building Idris 2 version: $(IDRIS2_VERSION_TAG)"
idris --build idris2.ipkg
src/YafflePaths.idr:

View File

@ -154,7 +154,7 @@ optUsage d
export
versionMsg : String
versionMsg = "Idris 2, version " ++ showVersion version
versionMsg = "Idris 2, version " ++ showVersion True version
export
usage : String

View File

@ -66,9 +66,9 @@ updatePaths
addPkgDir "prelude"
addPkgDir "base"
addDataDir (dir_prefix (dirs (options defs)) ++ dirSep ++
"idris2-" ++ showVersion version ++ dirSep ++ "support")
"idris2-" ++ showVersion False version ++ dirSep ++ "support")
addLibDir (dir_prefix (dirs (options defs)) ++ dirSep ++
"idris2-" ++ showVersion version ++ dirSep ++ "lib")
"idris2-" ++ showVersion False version ++ dirSep ++ "lib")
updateREPLOpts : {auto o : Ref ROpts REPLOpts} ->
Core ()
@ -100,7 +100,7 @@ tryYaffle (c :: cs) = tryYaffle cs
banner : String
banner = " ____ __ _ ___ \n" ++
" / _/___/ /____(_)____ |__ \\ \n" ++
" / // __ / ___/ / ___/ __/ / Version " ++ showVersion version ++ "\n" ++
" / // __ / ___/ / ___/ __/ / Version " ++ showVersion True version ++ "\n" ++
" _/ // /_/ / / / (__ ) / __/ https://www.idris-lang.org \n" ++
" /___/\\__,_/_/ /_/____/ /____/ \n" ++
"\n" ++

View File

@ -287,7 +287,7 @@ install pkg
srcdir <- coreLift currentDir
-- Make the package installation directory
let installPrefix = dir_prefix (dirs (options defs)) ++
dirSep ++ "idris2-" ++ showVersion version
dirSep ++ "idris2-" ++ showVersion False version
True <- coreLift $ changeDir installPrefix
| False => throw (FileErr (name pkg) FileReadError)
Right _ <- coreLift $ mkdirs [name pkg]

View File

@ -730,7 +730,7 @@ mutual
displayResult (FoundHoles xs) = printResult $ show (length xs) ++ " holes: " ++
showSep ", " (map show xs)
displayResult (LogLevelSet k) = printResult $ "Set loglevel to " ++ show k
displayResult (VersionIs x) = printResult $ showVersion x
displayResult (VersionIs x) = printResult $ showVersion True x
displayResult (Edited (DisplayEdit xs)) = printResult $ showSep "\n" xs
displayResult (Edited (EditError x)) = printError x
displayResult (Edited (MadeLemma name pty pappstr)) = printResult (show name ++ " : " ++ show pty ++ "\n" ++ pappstr)

View File

@ -22,12 +22,12 @@ addPkgDir : {auto c : Ref Ctxt Defs} ->
addPkgDir p
= do defs <- get Ctxt
addExtraDir (dir_prefix (dirs (options defs)) ++ dirSep ++
"idris2-" ++ showVersion version ++ dirSep ++ p)
"idris2-" ++ showVersion False version ++ dirSep ++ p)
dirOption : Dirs -> DirCommand -> Core ()
dirOption dirs LibDir
= coreLift $ putStrLn
(dir_prefix dirs ++ dirSep ++ "idris2-" ++ showVersion version ++ dirSep)
(dir_prefix dirs ++ dirSep ++ "idris2-" ++ showVersion False version ++ dirSep)
-- Options to be processed before type checking. Return whether to continue.
export

View File

@ -22,9 +22,10 @@ version with (yversion)
| (s,t) = MkVersion s (Just t)
export
showVersion : Version -> String
showVersion (MkVersion (maj,min,patch) versionTag) =
concat (intersperse "." (map show [ maj, min, patch])) ++ showTag
showVersion : Bool -> Version -> String
showVersion tag (MkVersion (maj,min,patch) versionTag) =
concat (intersperse "." (map show [ maj, min, patch])) ++
if tag then showTag else ""
where
showTag : String
showTag = case versionTag of