From f7c19cb7ece4df531bf8a9ec5e7ca07860378722 Mon Sep 17 00:00:00 2001 From: ivarne Date: Fri, 3 Jan 2014 21:06:03 +0100 Subject: [PATCH 1/4] Take git info out of BUILD_INFO, prepare for tarball export --- DISTRIBUTING.md | 27 +++++++++----- Make.inc | 11 ++++++ Makefile | 4 ++ base/.gitignore | 1 + base/Makefile | 88 +++++++++++++++----------------------------- base/pkg/generate.jl | 2 +- base/sysimg.jl | 1 + base/util.jl | 4 +- base/version.jl | 20 +++++----- base/version_git.sh | 61 ++++++++++++++++++++++++++++++ 10 files changed, 138 insertions(+), 81 deletions(-) create mode 100644 base/version_git.sh diff --git a/DISTRIBUTING.md b/DISTRIBUTING.md index edd2e31544000..795698b1b9348 100644 --- a/DISTRIBUTING.md +++ b/DISTRIBUTING.md @@ -16,6 +16,23 @@ GPL licensed, as various dependent libraries such as `FFTW`, `Rmath`, `SuiteSparse`, and `git` are GPL licensed. We do hope to have a non-GPL distribution of Julia in the future. +Versioning and Git +------------------ +The Makefile uses both the `VERSION` file and commit hashes and tags from the +git repository to generate the `base/version_git.jl` with information we use to +fill the splash screen and the `versioninfo()` output. If you for some reason +don't want to have the git repository availible when building you should +pregenerate the `base/version_git.jl` file with: + + make -C base version_git.jl.phony + +For some dependencies we use patched versions that will be fetched via +`git submodules`. Those might be prefetched by: + + git submodule update --init + +See example for how this is done for building nigtlies at [the debian build servers](https://github.com/staticfloat/julia-nightly-packaging/blob/master/build_ubuntu.sh) + When compiling a tagged release in the git repository, we don't display the branch/commit hash info in the splash screen. You can use this line to show a release description of up to 45 characters. To set this line you have @@ -36,16 +53,6 @@ for Debian and Ubuntu-based systems. Although we have not yet experimented with it, [Alien](https://wiki.debian.org/Alien) could be used to generate Julia packages for various Linux distributions. -Julia looks for git versioning information when building. If it does -not find the git executable or the `.git/` directory is unreadable, -the build process will continue, however all versioning information -will be unavailable. This is the case, for instance, on Canonical's -build servers where the [Ubuntu -nightlies](https://launchpad.net/~staticfloat/+archive/julianightlies) -are built. Therefore, a workaround must be enacted, where the git -versioning information [is encoded into the -source](https://github.com/staticfloat/julia-nightly-packaging/blob/master/build_ubuntu.sh#L76-78) before upload for building, and the source is modified to [not attempt to look for it](https://github.com/staticfloat/julia-nightly-packaging/blob/master/nogit-workaround.patch) when building. - By default, Julia loads `$PREFIX/etc/julia/juliarc.jl` as an installation-wide initialization file. This file can be used by distribution managers to provide paths to various binaries such as a diff --git a/Make.inc b/Make.inc index 66a80fce18fca..026493c07ecf6 100644 --- a/Make.inc +++ b/Make.inc @@ -50,8 +50,19 @@ endif # disable automatic Makefile rules .SUFFIXES: +# find out if git repository is availible +ifeq ($(shell [ -e $(JULIAHOME)/.git ] && echo true || echo "Warning: git information unavailable; versioning information limited" >&2), true) +NO_GIT = 0 +else +NO_GIT = 1 +endif + JULIA_VERSION = $(shell cat $(JULIAHOME)/VERSION) +ifneq ($(NO_GIT), 1) JULIA_COMMIT = $(shell git rev-parse --short=10 HEAD) +else +JULIA_COMMIT = $JULIA_VERSION +endif # LLVM Options LLVMROOT = $(BUILD) diff --git a/Makefile b/Makefile index 365914ceeef02..7ac9afc9cd964 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,12 @@ julia-release-symlink: @ln -sf $(BUILD)/bin/julia-$(DEFAULT_REPL) julia julia-debug julia-release: +ifneq ($(NO_GIT), 1) @-git submodule init --quiet @-git submodule update +else + $(warn "Submodules could not be updated because git is unavailible") +endif @$(MAKE) $(QUIET_MAKE) -C deps @$(MAKE) $(QUIET_MAKE) -C src lib$@ @$(MAKE) $(QUIET_MAKE) -C base diff --git a/base/.gitignore b/base/.gitignore index fd5e9b3ee9f4d..e67c778a43638 100644 --- a/base/.gitignore +++ b/base/.gitignore @@ -4,3 +4,4 @@ /fenv_constants.jl /file_constants.jl /uv_constants.jl +/version_git.jl diff --git a/base/Makefile b/base/Makefile index e6f859ed6ae08..8f46ce5d519b8 100644 --- a/base/Makefile +++ b/base/Makefile @@ -3,38 +3,9 @@ include ../Make.inc PCRE_CONST = 0x[0-9a-fA-F]+|[-+]?\s*[0-9]+ -# These are all the values needed for the BUILD_INFO struct in build_h.jl -version_string = $(shell cat ../VERSION) -commit = $(shell git rev-parse HEAD 2>/dev/null) -commit_short = $(shell git rev-parse --short HEAD 2>/dev/null) -git_branch = $(shell git branch 2>/dev/null | sed -n '/\* /s///p') - -last_tag = $(shell git describe --tags --abbrev=0 2>/dev/null) -tagged_commit = $(shell [ $$(git describe --tags --exact-match 2>/dev/null) ] && echo true || echo false) - -origin = $(shell [ -d ../.git/refs/remotes/origin ] && echo "origin/") - -build_number = $(shell git rev-list --count HEAD ^"$(last_tag)" 2>/dev/null || echo 0) -fork_master_distance = $(shell git rev-list --count HEAD ^"$(origin)master" 2>/dev/null || echo 0) -fork_master_timestamp = $(shell git show -s $$(git merge-base HEAD $(origin)master 2>/dev/null) --format=format:"%ct" 2>/dev/null || echo 0) - -git_time = $(shell git log -1 --pretty=format:%ct 2>/dev/null) -ifneq ($(git_time), ) - ifneq (,$(filter $(OS), Darwin FreeBSD)) - date_string = "$(shell /bin/date -jr $(git_time) -u '+%Y-%m-%d %H:%M %Z')" - else - date_string = "$(shell /bin/date --date=@$(git_time) -u '+%Y-%m-%d %H:%M %Z')" - endif -else - date_string = "" -endif - -dirty = $(shell [ -z "$(shell git status --porcelain 2>/dev/null)" ] && echo "" || echo "*" ) - TAGGED_RELEASE_BANNER = "" - -all: pcre_h.jl errno_h.jl build_h.jl.phony fenv_constants.jl file_constants.jl uv_constants.jl +all: pcre_h.jl errno_h.jl build_h.jl.phony fenv_constants.jl file_constants.jl uv_constants.jl version_git.jl.phony pcre_h.jl: @$(call PRINT_PERL, $(CPP) -dM $(shell $(PCRE_CONFIG) --prefix)/include/pcre.h | perl -nle '/^\s*#define\s+PCRE_(\w*)\s*\(?($(PCRE_CONST))\)?\s*$$/ and print "const $$1 = uint32($$2)"' | sort > $@) @@ -69,33 +40,8 @@ else @echo "const USE_BLAS64 = false" >> $@ endif @echo "const SYSCONFDIR = \"$(SYSCONFDIR)\"" >> $@ - - @echo "immutable BuildInfo" >> $@ - @echo " version_string::String" >> $@ - @echo " commit::String" >> $@ - @echo " commit_short::String" >> $@ - @echo " branch::String" >> $@ - @echo " build_number::Int" >> $@ - @echo " date_string::String" >> $@ - @echo " tagged_commit::Bool" >> $@ - @echo " fork_master_distance::Int" >> $@ - @echo " fork_master_timestamp::Float64" >> $@ - @echo " TAGGED_RELEASE_BANNER::String" >> $@ - @echo "end" >> $@ - - - @echo "const BUILD_INFO = BuildInfo( \ - '\"$(version_string)\"', \ - '\"$(commit)\"', \ - '\"$(commit_short)$(dirty)\"', \ - '\"$(git_branch)\"', \ - $(build_number), \ - '\"$(date_string)\"', \ - $(tagged_commit), \ - $(fork_master_distance), \ - $(fork_master_timestamp)., \ - '\"$(TAGGED_RELEASE_BANNER)\"' \ - )" | xargs >> $@ + @echo "const VERSION_STRING = \"$(JULIA_VERSION)\"" >> $@ + @echo "const TAGGED_RELEASE_BANNER = \"$(TAGGED_RELEASE_BANNER)\"" >> $@ @# This to ensure that we always rebuild this file, but only when it is modified do we touch build_h.jl, @# ensuring we rebuild the system image as infrequently as possible @@ -106,7 +52,30 @@ endif rm -f $@; \ fi -.PHONY: build_h.jl.phony +version_git.jl.phony: +ifneq ($(NO_GIT), 1) + @sh version_git.sh > $@ + @# This to avoid touching git_version.jl when it is not modified, + @# so that the system image does not need to be rebuilt. + @if ! cmp -s $@ version_git.jl; then \ + $(call PRINT_PERL,) \ + mv $@ version_git.jl; \ + else \ + rm -f $@; \ + fi +else +ifeq ($(shell [ -f version_git.jl ] && echo "true"), true) + @# Give warning if boilerplate git is used + @if grep -q "Default output if git is not available" version_git.jl; then \ + echo "WARNING: Using boilerplate git version info" >&2; \ + fi +else + $(warning "WARNING: Using boilerplate git version info") + @sh version_git.sh NO_GIT > version_git.jl +endif +endif + +.PHONY: build_h.jl.phony version_git.jl.phony @@ -115,6 +84,9 @@ clean: rm -f pcre_h.jl rm -f errno_h.jl rm -f build_h.jl + rm -f build_h.jl.phony rm -f fenv_constants.jl rm -f uv_constants.jl rm -f file_constants.jl + rm -f version_git.jl + rm -f version_git.jl.phony diff --git a/base/pkg/generate.jl b/base/pkg/generate.jl index 396af5619de88..818a0d9b3fc92 100644 --- a/base/pkg/generate.jl +++ b/base/pkg/generate.jl @@ -60,7 +60,7 @@ function package( years: $years user: $user - Julia Version $VERSION [$(Base.BUILD_INFO.commit[1:10])] + Julia Version $VERSION [$(Base.GIT_VERSION_INFO.short_commit)] """ if isnew diff --git a/base/sysimg.jl b/base/sysimg.jl index 4af1b2e9191ed..e376840e52ed4 100644 --- a/base/sysimg.jl +++ b/base/sysimg.jl @@ -23,6 +23,7 @@ end include("base.jl") include("reflection.jl") include("build_h.jl") +include("version_git.jl") include("c.jl") # core operations & types diff --git a/base/util.jl b/base/util.jl index 0b2bc78aa4a29..0083e1b2ef685 100644 --- a/base/util.jl +++ b/base/util.jl @@ -359,8 +359,8 @@ end function versioninfo(io::IO=STDOUT, verbose::Bool=false) println(io, "Julia Version $VERSION") - if !isempty(BUILD_INFO.commit_short) - println(io, "Commit $(BUILD_INFO.commit_short) ($(BUILD_INFO.date_string))") + if !isempty(GIT_VERSION_INFO.commit_short) + println(io, "Commit $(GIT_VERSION_INFO.commit_short) ($(GIT_VERSION_INFO.date_string))") end if ccall(:jl_is_debugbuild, Bool, ()) println(io, "DEBUG build") diff --git a/base/version.jl b/base/version.jl index 79f7dc1cb3653..e74336b034535 100644 --- a/base/version.jl +++ b/base/version.jl @@ -181,28 +181,28 @@ end ## julia version info # Include build number if we've got at least some distance from a tag (e.g. a release) -build_number = BUILD_INFO.build_number != 0 ? "+$(BUILD_INFO.build_number)" : "" try - global const VERSION = convert(VersionNumber, "$(BUILD_INFO.version_string)$(build_number)") + build_number = GIT_VERSION_INFO.build_number != 0 ? "+$(GIT_VERSION_INFO.build_number)" : "" + global const VERSION = convert(VersionNumber, "$(VERSION_STRING)$(build_number)") catch e println("while creating Base.VERSION, ignoring error $e") global const VERSION = VersionNumber(0) end function banner(io::IO = STDOUT) - if BUILD_INFO.tagged_commit - commit_string = BUILD_INFO.TAGGED_RELEASE_BANNER - elseif BUILD_INFO.commit == "" + if GIT_VERSION_INFO.tagged_commit + commit_string = TAGGED_RELEASE_BANNER + elseif GIT_VERSION_INFO.commit == "" commit_string = "" else - days = int(floor((ccall(:clock_now, Float64, ()) - BUILD_INFO.fork_master_timestamp) / (60 * 60 * 24))) - if BUILD_INFO.fork_master_distance == 0 - commit_string = "Commit $(BUILD_INFO.commit_short) ($(days) days old master)" + days = int(floor((ccall(:clock_now, Float64, ()) - GIT_VERSION_INFO.fork_master_timestamp) / (60 * 60 * 24))) + if GIT_VERSION_INFO.fork_master_distance == 0 + commit_string = "Commit $(GIT_VERSION_INFO.commit_short) ($(days) days old master)" else - commit_string = "$(BUILD_INFO.branch)/$(BUILD_INFO.commit_short) (fork: $(BUILD_INFO.fork_master_distance) commits, $(days) days)" + commit_string = "$(GIT_VERSION_INFO.branch)/$(GIT_VERSION_INFO.commit_short) (fork: $(GIT_VERSION_INFO.fork_master_distance) commits, $(days) days)" end end - commit_date = BUILD_INFO.date_string != "" ? " ($(BUILD_INFO.date_string))": "" + commit_date = GIT_VERSION_INFO.date_string != "" ? " ($(GIT_VERSION_INFO.date_string))": "" if have_color tx = "\033[0m\033[1m" # text diff --git a/base/version_git.sh b/base/version_git.sh new file mode 100644 index 0000000000000..e240b88240e18 --- /dev/null +++ b/base/version_git.sh @@ -0,0 +1,61 @@ +# This file collects git info and create a julia file with the GIT_VERSION_INFO struct + +echo "# This file was autogenerated in base/version_git.sh" +echo "immutable GitVersionInfo" +echo " commit::String" +echo " commit_short::String" +echo " branch::String" +echo " build_number::Int" +echo " date_string::String" +echo " tagged_commit::Bool" +echo " fork_master_distance::Int" +echo " fork_master_timestamp::Float64" +echo "end" +echo "" + +# If the script didn't ask not to use git info +if [ "$#" = "1" -a "$1" = "NO_GIT" ]; then + # this comment is used in base/Makefile to distinguish boilerplate + echo "# Default output if git is not available." + echo "const GIT_VERSION_INFO = GitVersionInfo(\"\" ,\"\" ,\"\" ,0 ,\"\" ,true ,0 ,0.)" + exit 0 +fi +# Collect temporary variables +origin=$(git config -l 2>/dev/null | grep 'remote\.\w*\.url.*JuliaLang/julia.git' | sed -n 's/remote\.\([a-zA-Z]*\)\..*/\1\//p') +last_tag=$(git describe --tags --abbrev=0) +git_time=$(git log -1 --pretty=format:%ct) + +#collect the contents +commit=$(git rev-parse HEAD) +commit_short=$(git rev-parse --short HEAD) +if [ -n "$(git status --porcelain)" ]; then + # append dirty mark '*' if the repository has uncommited changes + commit_short="$commit_short"* +fi +branch=$(git branch | sed -n '/\* /s///p') +build_number=$(git rev-list --count HEAD ^$last_tag) + +date_string=$git_time +if [ "$(uname)" = "Darwin" ] || [ "$(uname)" = "FreeBSD" ]; then + date_string="$(/bin/date -jr $git_time -u '+%Y-%m-%d %H:%M %Z')" +else + date_string="$(/bin/date --date="@$git_time" -u '+%Y-%m-%d %H:%M %Z')" +fi +if [ $(git describe --tags --exact-match 2> /dev/null) ]; then + tagged_commit="true" +else + tagged_commit="false" +fi +fork_master_distance=$(git rev-list --count HEAD ^"$(echo $origin)master") +fork_master_timestamp=$(git show -s $(git merge-base HEAD $(echo $origin)master) --format=format:"%ct") + +echo "const GIT_VERSION_INFO = GitVersionInfo(" +echo " \"$commit\"," +echo " \"$commit_short\"," +echo " \"$branch\"," +echo " $build_number," +echo " \"$date_string\"," +echo " $tagged_commit," +echo " $fork_master_distance," +echo " $fork_master_timestamp." +echo ")" From 178a720873b1d859ef8a2a6ff319b9aa94b97ec2 Mon Sep 17 00:00:00 2001 From: ivarne Date: Fri, 10 Jan 2014 21:51:29 +0100 Subject: [PATCH 2/4] Added source-dist make target source-dist is a make target for creating a standalone tarball that can be compilled on a system with the requisit external dependencies without internet access to download the internal dependencies. --- .gitignore | 2 ++ DISTRIBUTING.md | 13 ++++++++----- Makefile | 39 +++++++++++++++++++++++++++++++-------- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 3d171ffd6fe59..f323f35ec6b43 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ /usr /Make.user /julia-* +/source-dist.tmp +/source-dist.tmp1 *.exe *.dll diff --git a/DISTRIBUTING.md b/DISTRIBUTING.md index 795698b1b9348..8030b95b05881 100644 --- a/DISTRIBUTING.md +++ b/DISTRIBUTING.md @@ -21,17 +21,20 @@ Versioning and Git The Makefile uses both the `VERSION` file and commit hashes and tags from the git repository to generate the `base/version_git.jl` with information we use to fill the splash screen and the `versioninfo()` output. If you for some reason -don't want to have the git repository availible when building you should +don't want to have the git repository available when building you should pregenerate the `base/version_git.jl` file with: make -C base version_git.jl.phony -For some dependencies we use patched versions that will be fetched via -`git submodules`. Those might be prefetched by: +Juila has lots of build dependencies where we use patched versions that has not +yet been included by the popular package managers. These dependencies will usually +be automatically downloaded when you build, but if you want to be able to build +Julia on a computer without internet access you should create a source-dist archive +with the special make targed - git submodule update --init + make source-dist -See example for how this is done for building nigtlies at [the debian build servers](https://github.com/staticfloat/julia-nightly-packaging/blob/master/build_ubuntu.sh) +that creates a julia-version-commit.tar.gz archive with all required dependencies. When compiling a tagged release in the git repository, we don't display the branch/commit hash info in the splash screen. You can use this line to show diff --git a/Makefile b/Makefile index 7ac9afc9cd964..532e432ec6ffa 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,13 @@ endif $(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir)))) $(foreach link,base test doc examples,$(eval $(call symlink_target,$(link),$(BUILD)/share/julia))) +git-submodules: +ifneq ($(NO_GIT), 1) + @-git submodule update --init +else + $(warn "Submodules could not be updated because git is unavailible") +endif + debug release: | $(DIRS) $(BUILD)/share/julia/base $(BUILD)/share/julia/test $(BUILD)/share/julia/doc $(BUILD)/share/julia/examples $(BUILD)/etc/julia/juliarc.jl @$(MAKE) $(QUIET_MAKE) julia-$@ @export JL_PRIVATE_LIBDIR=$(JL_PRIVATE_LIBDIR) && \ @@ -43,13 +50,7 @@ julia-debug-symlink: julia-release-symlink: @ln -sf $(BUILD)/bin/julia-$(DEFAULT_REPL) julia -julia-debug julia-release: -ifneq ($(NO_GIT), 1) - @-git submodule init --quiet - @-git submodule update -else - $(warn "Submodules could not be updated because git is unavailible") -endif +julia-debug julia-release: git-submodules @$(MAKE) $(QUIET_MAKE) -C deps @$(MAKE) $(QUIET_MAKE) -C src lib$@ @$(MAKE) $(QUIET_MAKE) -C base @@ -264,6 +265,27 @@ else endif rm -fr julia-$(JULIA_COMMIT) + +source-dist: git-submodules + # Save git information + -@$(MAKE) -C base version_git.jl.phony + # Get all the dependencies downloaded + @$(MAKE) -C deps getall + + # Create file source-dist.tmp to hold all the filenames that goes into the tarball + echo "base/version_git.jl" > source-dist.tmp + git ls-files >> source-dist.tmp + ls deps/*.tar.gz deps/*.tar.bz2 deps/*.tgz deps/random/*.tar.gz >> source-dist.tmp + git submodule --quiet foreach 'git ls-files | sed "s&^&$$path/&"' >> source-dist.tmp + + # Remove unwanted files + sed '/\.git/d' source-dist.tmp > source-dist.tmp1 + sed '/\.travis/d' source-dist.tmp1 > source-dist.tmp + + # Create tarball + tar -cz -T source-dist.tmp --no-recursion -f julia-$(JULIA_VERSION)_$(JULIA_COMMIT).tar.gz + rm -f source-dist.tmp source-dist.tmp1 + clean: | $(CLEAN_TARGETS) @$(MAKE) -C base clean @$(MAKE) -C src clean @@ -275,6 +297,7 @@ clean: | $(CLEAN_TARGETS) @rm -f julia @rm -f *~ *# *.tar.gz @rm -fr $(BUILD)/$(JL_PRIVATE_LIBDIR) + @rm -f source-dist.tmp source-dist.tmp1 # Temporarily add this line to the Makefile to remove extras @rm -fr $(BUILD)/share/julia/extras @@ -294,7 +317,7 @@ distclean: cleanall .PHONY: default debug release julia-debug julia-release \ test testall testall1 test-* clean distclean cleanall \ run-julia run-julia-debug run-julia-release run \ - install dist + install dist source-dist git-submodules ifeq ($(VERBOSE),1) .SILENT: From 9317487805157c5757cbd4189e6b85fe89afb392 Mon Sep 17 00:00:00 2001 From: ivarne Date: Sat, 25 Jan 2014 12:40:05 +0100 Subject: [PATCH 3/4] Changed BUILD_INFO to GIT_VERSION_INFO in methodsshow --- base/methodshow.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/methodshow.jl b/base/methodshow.jl index 154a79d849924..be703cf36c9b2 100644 --- a/base/methodshow.jl +++ b/base/methodshow.jl @@ -80,7 +80,7 @@ function url(m::Method) line = m.func.code.line line <= 0 || ismatch(r"In\[[0-9]+\]", file) && return "" if inbase(M) - return "https://github.com/JuliaLang/julia/tree/$(Base.BUILD_INFO.commit)/base/$file#L$line" + return "https://github.com/JuliaLang/julia/tree/$(Base.GIT_VERSION_INFO.commit)/base/$file#L$line" else try d = dirname(file) From 63cb6f40bee3546a4f319dfde9ef5489161cca3d Mon Sep 17 00:00:00 2001 From: ivarne Date: Sun, 26 Jan 2014 08:42:17 +0100 Subject: [PATCH 4/4] Checked inn readline patches, instad of downloading them I can not see why we download the readline patches, and it requires somewhat ugly code in the make rule for the source-dist target. --- deps/.gitignore | 1 - deps/Makefile | 4 -- deps/readline62-001 | 46 +++++++++++++++++++ deps/readline62-003 | 76 +++++++++++++++++++++++++++++++ deps/readline62-004 | 108 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 230 insertions(+), 5 deletions(-) create mode 100644 deps/readline62-001 create mode 100644 deps/readline62-003 create mode 100644 deps/readline62-004 diff --git a/deps/.gitignore b/deps/.gitignore index 9af766adae14d..aba15f6131584 100644 --- a/deps/.gitignore +++ b/deps/.gitignore @@ -23,7 +23,6 @@ /patchelf-* /pcre-* /readline-* -/readline62-* !readline-win.h /root /SuiteSparse-* diff --git a/deps/Makefile b/deps/Makefile index eb3a90647375a..883a167489117 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -436,10 +436,6 @@ READLINE_URL = ftp://ftp.gnu.org/gnu/readline/readline-$(READLINE_VER).tar.gz READLINE_OPTS = --enable-shared --enable-static --with-curses READLINE_CFLAGS = readline-$(READLINE_VER).tar.gz: - $(JLDOWNLOAD) readline62-001 http://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-001 - #$(JLDOWNLOAD) readline62-002 http://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-002 - $(JLDOWNLOAD) readline62-003 http://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-003 - $(JLDOWNLOAD) readline62-004 http://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-004 $(JLDOWNLOAD) $@ http://ftp.gnu.org/gnu/readline/$@ touch -c $@ readline-$(READLINE_VER)/configure: readline-$(READLINE_VER).tar.gz diff --git a/deps/readline62-001 b/deps/readline62-001 new file mode 100644 index 0000000000000..d4563c3b1130d --- /dev/null +++ b/deps/readline62-001 @@ -0,0 +1,46 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 6.2 +Patch-ID: readline62-001 + +Bug-Reported-by: Clark J. Wang +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00157.html + +Bug-Description: + +The readline vi-mode `cc', `dd', and `yy' commands failed to modify the +entire line. + +[This patch intentionally does not modify patchlevel] + +Patch (apply with `patch -p0'): + +*** ../readline-6.2-patched/vi_mode.c 2010-11-20 19:51:39.000000000 -0500 +--- vi_mode.c 2011-02-17 20:24:25.000000000 -0500 +*************** +*** 1115,1119 **** + _rl_vi_last_motion = c; + RL_UNSETSTATE (RL_STATE_VIMOTION); +! return (0); + } + #if defined (READLINE_CALLBACKS) +--- 1115,1119 ---- + _rl_vi_last_motion = c; + RL_UNSETSTATE (RL_STATE_VIMOTION); +! return (vidomove_dispatch (m)); + } + #if defined (READLINE_CALLBACKS) +*** ../readline-6.2-patched/callback.c 2010-06-06 12:18:58.000000000 -0400 +--- callback.c 2011-02-17 20:43:28.000000000 -0500 +*************** +*** 149,152 **** +--- 149,155 ---- + /* Should handle everything, including cleanup, numeric arguments, + and turning off RL_STATE_VIMOTION */ ++ if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) ++ _rl_internal_char_cleanup (); ++ + return; + } diff --git a/deps/readline62-003 b/deps/readline62-003 new file mode 100644 index 0000000000000..0462242e0c0d5 --- /dev/null +++ b/deps/readline62-003 @@ -0,0 +1,76 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 6.2 +Patch-ID: readline62-003 + +Bug-Reported-by: Max Horn +Bug-Reference-ID: <20CC5C60-07C3-4E41-9817-741E48D407C5@quendi.de> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2012-06/msg00005.html + +Bug-Description: + +A change between readline-6.1 and readline-6.2 to prevent the readline input +hook from being called too frequently had the side effect of causing delays +when reading pasted input on systems such as Mac OS X. This patch fixes +those delays while retaining the readline-6.2 behavior. + +Patch (apply with `patch -p0'): + +*** ../readline-6.2-patched/input.c 2010-05-30 18:33:01.000000000 -0400 +--- input.c 2012-06-25 21:08:42.000000000 -0400 +*************** +*** 410,414 **** + rl_read_key () + { +! int c; + + rl_key_sequence_length++; +--- 412,416 ---- + rl_read_key () + { +! int c, r; + + rl_key_sequence_length++; +*************** +*** 430,441 **** + while (rl_event_hook) + { +! if (rl_gather_tyi () < 0) /* XXX - EIO */ + { + rl_done = 1; + return ('\n'); + } + RL_CHECK_SIGNALS (); +- if (rl_get_char (&c) != 0) +- break; + if (rl_done) /* XXX - experimental */ + return ('\n'); +--- 432,447 ---- + while (rl_event_hook) + { +! if (rl_get_char (&c) != 0) +! break; +! +! if ((r = rl_gather_tyi ()) < 0) /* XXX - EIO */ + { + rl_done = 1; + return ('\n'); + } ++ else if (r == 1) /* read something */ ++ continue; ++ + RL_CHECK_SIGNALS (); + if (rl_done) /* XXX - experimental */ + return ('\n'); +*** ../readline-6.2-patched/patchlevel 2010-01-14 10:15:52.000000000 -0500 +--- patchlevel 2011-11-17 11:09:35.000000000 -0500 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 2 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 3 diff --git a/deps/readline62-004 b/deps/readline62-004 new file mode 100644 index 0000000000000..5f3ba9bb322f1 --- /dev/null +++ b/deps/readline62-004 @@ -0,0 +1,108 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 6.2 +Patch-ID: readline62-004 + +Bug-Reported-by: Jakub Filak +Bug-Reference-ID: +Bug-Reference-URL: https://bugzilla.redhat.com/show_bug.cgi?id=813289 + +Bug-Description: + +Attempting to redo (using `.') the vi editing mode `cc', `dd', or `yy' +commands leads to an infinite loop. + +Patch (apply with `patch -p0'): + +*** ../readline-6.2-patched/vi_mode.c 2011-02-25 11:17:02.000000000 -0500 +--- vi_mode.c 2012-06-02 12:24:47.000000000 -0400 +*************** +*** 1235,1243 **** + r = rl_domove_motion_callback (_rl_vimvcxt); + } +! else if (vi_redoing) + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + #if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) +--- 1297,1313 ---- + r = rl_domove_motion_callback (_rl_vimvcxt); + } +! else if (vi_redoing && _rl_vi_last_motion != 'd') /* `dd' is special */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } ++ else if (vi_redoing) /* handle redoing `dd' here */ ++ { ++ _rl_vimvcxt->motion = _rl_vi_last_motion; ++ rl_mark = rl_end; ++ rl_beg_of_line (1, key); ++ RL_UNSETSTATE (RL_STATE_VIMOTION); ++ r = vidomove_dispatch (_rl_vimvcxt); ++ } + #if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) +*************** +*** 1317,1325 **** + r = rl_domove_motion_callback (_rl_vimvcxt); + } +! else if (vi_redoing) + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + #if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) +--- 1387,1403 ---- + r = rl_domove_motion_callback (_rl_vimvcxt); + } +! else if (vi_redoing && _rl_vi_last_motion != 'c') /* `cc' is special */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } ++ else if (vi_redoing) /* handle redoing `cc' here */ ++ { ++ _rl_vimvcxt->motion = _rl_vi_last_motion; ++ rl_mark = rl_end; ++ rl_beg_of_line (1, key); ++ RL_UNSETSTATE (RL_STATE_VIMOTION); ++ r = vidomove_dispatch (_rl_vimvcxt); ++ } + #if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) +*************** +*** 1378,1381 **** +--- 1456,1472 ---- + r = rl_domove_motion_callback (_rl_vimvcxt); + } ++ else if (vi_redoing && _rl_vi_last_motion != 'y') /* `yy' is special */ ++ { ++ _rl_vimvcxt->motion = _rl_vi_last_motion; ++ r = rl_domove_motion_callback (_rl_vimvcxt); ++ } ++ else if (vi_redoing) /* handle redoing `yy' here */ ++ { ++ _rl_vimvcxt->motion = _rl_vi_last_motion; ++ rl_mark = rl_end; ++ rl_beg_of_line (1, key); ++ RL_UNSETSTATE (RL_STATE_VIMOTION); ++ r = vidomove_dispatch (_rl_vimvcxt); ++ } + #if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) +*** ../readline-6.2-patched/patchlevel 2010-01-14 10:15:52.000000000 -0500 +--- patchlevel 2011-11-17 11:09:35.000000000 -0500 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 3 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 4