summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-06-29 05:19:33 (GMT)
committerAlexey Neyman <stilor@att.net>2017-07-08 17:57:56 (GMT)
commitc7a924a0732bd2aefe9af1411da629ccc3f34811 (patch)
treed65e21574b33c2f51f4b446651d721aa0e0894ba
parentf672e3df8973d87b5542ee3f30d1b9ceacab6dca (diff)
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--TODO14
-rw-r--r--packages/autoconf/package.desc1
-rw-r--r--packages/automake/package.desc1
-rw-r--r--packages/libtool/package.desc1
-rw-r--r--packages/ltrace/package.desc1
-rw-r--r--packages/m4/package.desc1
-rw-r--r--packages/make/package.desc1
-rw-r--r--packages/strace/package.desc1
-rw-r--r--scripts/functions19
9 files changed, 36 insertions, 4 deletions
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}" --