From c7a924a0732bd2aefe9af1411da629ccc3f34811 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 28 Jun 2017 22:19:33 -0700 Subject: 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 diff --git a/TODO b/TODO index ee4979c..386ad14 100644 --- a/TODO +++ b/TODO @@ -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 27ac6c3..29d6351 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 7400a0f..0191968 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 2568f09..7338f84 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 73d781b..5941f29 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 f0d62ce..6615cdc 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 8485d3e..9eb9d07 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 e260df8..7b035c2 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 719c385..24cc667 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}" -- -- cgit v0.10.2-6-g49f6