diff options
author | Alexey Neyman <stilor@att.net> | 2017-06-28 22:19:33 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-07-08 10:57:56 -0700 |
commit | c7a924a0732bd2aefe9af1411da629ccc3f34811 (patch) | |
tree | d65e21574b33c2f51f4b446651d721aa0e0894ba | |
parent | f672e3df8973d87b5542ee3f30d1b9ceacab6dca (diff) | |
download | crosstool-ng-c7a924a0732bd2aefe9af1411da629ccc3f34811.tar.gz crosstool-ng-c7a924a0732bd2aefe9af1411da629ccc3f34811.tar.bz2 crosstool-ng-c7a924a0732bd2aefe9af1411da629ccc3f34811.zip |
Fix printing the branch used in Git
... and prefer exact specified name, if it exists.
More bootstrap script specifications for packages.
Signed-off-by: Alexey Neyman <stilor@att.net>
-rw-r--r-- | TODO | 14 | ||||
-rw-r--r-- | packages/autoconf/package.desc | 1 | ||||
-rw-r--r-- | packages/automake/package.desc | 1 | ||||
-rw-r--r-- | packages/libtool/package.desc | 1 | ||||
-rw-r--r-- | packages/ltrace/package.desc | 1 | ||||
-rw-r--r-- | packages/m4/package.desc | 1 | ||||
-rw-r--r-- | packages/make/package.desc | 1 | ||||
-rw-r--r-- | packages/strace/package.desc | 1 | ||||
-rw-r--r-- | scripts/functions | 19 |
9 files changed, 36 insertions, 4 deletions
@@ -2,8 +2,18 @@ TBD packages todo [ ] mention custom glibc addons are no longer handled (even though they never fully were, ct-ng would be unable to fetch them unless they were secretly placed into the download area) [ ] mention incompatibility of sample options -[ ] version-locked packages - [ ] make glibc-ports package for glibc <2.17 (it has its own repo) +[X] version-locked packages + [X] make glibc-ports package for glibc <2.17 (it has its own repo) +[ ] convert gen-kconfig to use templates +[ ] switch to checked in generated files (config/versions, config/gen) - take too long to generate +[ ] new packages + [ ] config.guess + [ ] gnulib + [ ] use gnulib in m4, gettext, libiconv, libtool + [ ] autoconf-archive + [ ] use to retrieve ax_pthread.m4 (gettext?) +[ ] some way of patching development sources - version based? or just directory with "apply-to-any-revision" patches. +[ ] dependencies like cloog A (slightly) ordered set of tasks for crosstool-NG. Written in a cryptic language; contact me if you want to help with any of these :) diff --git a/packages/autoconf/package.desc b/packages/autoconf/package.desc index 27ac6c3a..29d6351c 100644 --- a/packages/autoconf/package.desc +++ b/packages/autoconf/package.desc @@ -1,2 +1,3 @@ repository='git git://git.sv.gnu.org/autoconf' +bootstrap='autoreconf -vi' mirrors='$(CT_Mirrors GNU autoconf)' diff --git a/packages/automake/package.desc b/packages/automake/package.desc index 7400a0fc..01919684 100644 --- a/packages/automake/package.desc +++ b/packages/automake/package.desc @@ -1,2 +1,3 @@ repository='git https://git.savannah.gnu.org/git/automake.git' +bootstrap='./bootstrap' mirrors='$(CT_Mirrors GNU automake)' diff --git a/packages/libtool/package.desc b/packages/libtool/package.desc index 2568f097..7338f843 100644 --- a/packages/libtool/package.desc +++ b/packages/libtool/package.desc @@ -1,2 +1,3 @@ repository='git git://git.savannah.gnu.org/libtool.git' +bootstrap='./bootstrap' mirrors='$(CT_Mirrors GNU libtool)' diff --git a/packages/ltrace/package.desc b/packages/ltrace/package.desc index 73d781b7..5941f299 100644 --- a/packages/ltrace/package.desc +++ b/packages/ltrace/package.desc @@ -1,2 +1,3 @@ repository='git git://git.debian.org/git/collab-maint/ltrace.git' +bootstrap='./autogen.sh' mirrors='http://ftp.debian.org/debian/pool/main/l/ltrace ftp:://ftp.debian.org/debian/pool/main/l/ltrace' diff --git a/packages/m4/package.desc b/packages/m4/package.desc index f0d62cee..6615cdca 100644 --- a/packages/m4/package.desc +++ b/packages/m4/package.desc @@ -1,2 +1,3 @@ repository='git git://git.sv.gnu.org/m4' +bootstrap='./bootstrap' mirrors='$(CT_Mirrors GNU m4)' diff --git a/packages/make/package.desc b/packages/make/package.desc index 8485d3e6..9eb9d078 100644 --- a/packages/make/package.desc +++ b/packages/make/package.desc @@ -1,2 +1,3 @@ repository='git https://git.savannah.gnu.org/git/make.git' +bootstrap='autoreconf -i' mirrors='$(CT_Mirrors GNU make)' diff --git a/packages/strace/package.desc b/packages/strace/package.desc index e260df8e..7b035c24 100644 --- a/packages/strace/package.desc +++ b/packages/strace/package.desc @@ -1,2 +1,3 @@ repository='git https://git.code.sf.net/p/strace/code' +bootstrap='./bootstrap' mirrors='http://downloads.sourceforge.net/project/strace/strace/${CT_STRACE_VERSION}' diff --git a/scripts/functions b/scripts/functions index 719c3857..24cc6679 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1629,6 +1629,7 @@ CT_GetVersion_git() if [ -z "${devel_revision}" ]; then local matches=`git ls-remote --exit-code "${devel_url}" --refs "${devel_branch}" \ || echo "not found"` + local best using ref # Cannot test $?, setting a trap on ERR prevents bash from returning the # status code. @@ -1636,9 +1637,22 @@ CT_GetVersion_git() CT_Abort "Failed to find git ref ${devel_branch} at ${devel_url}" fi if [ `echo "${matches}" | wc -l` -gt 1 ]; then - CT_DoLog WARN "Ambiguous ref ${devel_branch} at ${devel_url}, using first" + if echo "${matches}" | grep '[[:space:]]\(refs/heads/\)\?'"${devel_branch}\$" >/dev/null; then + # Try exact match, or prepended with "refs/heads". Some projects (e.g. binutils) + # have refs/original/refs/heads/master as well as refs/heads/master, and + # `git ls-remote refs/heads/master` prints both. + best=`echo "${matches}" | grep '[[:space:]]\(refs/heads/\)\?'"${devel_branch}\$"` + using="best match" + else + best=`echo "${matches}" | head -n1` + using="first" + fi + ref=`echo "${best}" | sed 's/.*[[:space:]]//'` + CT_DoLog WARN "Ambiguous ref ${devel_branch} at ${devel_url}, using ${using} (${ref})" + else + best="${matches}" fi - devel_revision=`echo "$matches" | head -n1 | cut -c1-8` + devel_revision=`echo "${best}" | cut -c1-8` CT_DoLog DEBUG "ref ${devel_branch} at ${devel_url} has cset of ${devel_revision}" fi basename="${pkg_name}-${devel_revision}" @@ -1647,6 +1661,7 @@ CT_GetVersion_git() # Retrieve sources from Git. CT_Download_git() { + # Git does not allow making a shallow clone of a specific commit. CT_DoExecLog ALL git clone "${devel_url}" "${pkg_name}" CT_Pushd "${pkg_name}" CT_DoExecLog ALL git checkout "${devel_revision}" -- |