diff options
author | Rob Savoye <rob.savoye@linaro.org> | 2016-06-10 14:23:02 -0600 |
---|---|---|
committer | Rob Savoye <rob.savoye@linaro.org> | 2016-06-10 14:23:02 -0600 |
commit | 193f944f4881421f71eee31ee8a22befcaf8ea74 (patch) | |
tree | b94b90317d18ea0a78f8b668edde0b94517402d2 | |
parent | 564bf8519ce72a9c5f41be4c11a2d97f3f7d7b16 (diff) |
Handle gdb and gdnserver separetely so revisions for both work. Put revisions back in the manifest file. Bug #2314
Change-Id: I300d9d5a84bdf3d8fdee2d6cb5223baeb37b00d1
-rw-r--r-- | lib/checkout.sh | 17 | ||||
-rw-r--r-- | lib/component.sh | 13 | ||||
-rw-r--r-- | lib/globals.sh | 6 | ||||
-rw-r--r-- | lib/package.sh | 6 |
4 files changed, 35 insertions, 7 deletions
diff --git a/lib/checkout.sh b/lib/checkout.sh index 69ce1068..10a90427 100644 --- a/lib/checkout.sh +++ b/lib/checkout.sh @@ -142,9 +142,16 @@ checkout() local component="$1" - # gdbserver is already checked out in the GDB source tree. + # gdbserver is usually already checked out in the GDB source tree. While gdb + # and gdbserver should be built from the same revision of the source code to + # avoid breaking the remote protocol, it's possible some developer *might* + # want to build these with differing revisions. if test x"${component}" = x"gdbserver"; then - return 0 + if test "`get_component_revision gdb`" = "`get_component_revision gdbserver`"; then + return 0 + else + warning "Building gdb and gdbserver with different revisions is a bad idea!" + fi fi # None of the following should be able to fail with the code as it is @@ -269,8 +276,10 @@ checkout() fi fi -# local newrev="`pushd ${srcdir} 2>&1 > /dev/null && git log --format=format:%H -n 1 ; popd 2>&1 > /dev/null`" -# set_component_revision ${component} ${newrev} + if test x"`get_component_revision ${component}`" = x; then + local newrev="`cd ${srcdir} 2>&1 > /dev/null && git log --format=format:%H -n 1`" + set_component_revision ${component} ${newrev} + fi ;; *) error "proper URL required" diff --git a/lib/component.sh b/lib/component.sh index b4ab605c..56fbee77 100644 --- a/lib/component.sh +++ b/lib/component.sh @@ -568,6 +568,12 @@ collect_data () branch="master" fi local revision="`get_git_revision ${gitinfo}`" + # gdb and gdbserver should always be built from the same revision + # of the sources, but it's possible some developer *might* want + # to build these with differing revisions. + if test x"${component}" = x"gdbserver" -a x"${revision}" = x; then + revision="`get_component_revision gdb`" + fi local search= case ${component} in binutils*|gdb*) search="binutils-gdb.git" ;; @@ -584,6 +590,11 @@ collect_data () # This is unfortunately, as @ is used to deliminate the revision # string. local fixbranch="`echo ${branch} | tr '/' '~' | tr '@' '_'`" + # gdb, gdbserver, and binutils have a shared source tree, so + # make it obvious which component this is. + if test "`echo ${component} | egrep -c 'gdb|binutils'`" -gt 0; then + fixbranch="${component}-${fixbranch}" + fi local dir=${search}${branch:+~${fixbranch}}${revision:+_rev_${revision}} fi @@ -598,7 +609,7 @@ collect_data () gdbserver) local dir="`echo ${dir} | sed -e 's:^.*\.git:binutils-gdb.git:'`" local srcdir=${srcdir}/gdb/gdbserver - local builddir="${builddir}-gdbserver" +# local builddir="${builddir}-gdbserver" ;; eglibc) local srcdir=${srcdir}/libc diff --git a/lib/globals.sh b/lib/globals.sh index 6a620267..0445cf4d 100644 --- a/lib/globals.sh +++ b/lib/globals.sh @@ -146,6 +146,8 @@ import_manifest() { # trace "$*" + warning "If your manifest file has been hand edited, any problems are your own fault." + manifest=$1 if test -f ${manifest} ; then local components="`grep "^# Component data for " ${manifest} | cut -d ' ' -f 5`" @@ -237,5 +239,9 @@ import_manifest() return 1 fi + if test x"`get_component_revision gdb`" != x"`get_component_revision gdbserver`"; then + warning "GDB and GDBSERVER revisions don't match in the manifest file!" + fi + return 0 } diff --git a/lib/package.sh b/lib/package.sh index 43924e76..198a790c 100644 --- a/lib/package.sh +++ b/lib/package.sh @@ -253,8 +253,10 @@ manifest() local component="$i" # ABE build data goes in the documentation sxection if test x"${component}" = x"abe"; then - echo "${component}_url=`get_component_url ${component}`" > ${tmpfile} + echo "# Invoked as: abe.sh ${command_line_arguments}" > ${tmpfile} + echo "${component}_url=`get_component_url ${component}`" >> ${tmpfile} echo "${component}_branch=branch=`get_component_branch ${component}`" >> ${tmpfile} + local revision="`get_component_revision ${component}`" echo "${component}_revision=`get_component_revision ${component}`" >> ${tmpfile} echo "${component}_filespec=`get_component_filespec ${component}`" >> ${tmpfile} local configure="`get_component_configure ${component} | sed -e "s:${local_builds}:\$\{local_builds\}:g" -e "s:${sysroots}:\$\{sysroots\}:g"`" @@ -360,7 +362,7 @@ EOF rm "${tmpfile}" fi - for i in gcc binutils ${clibrary} abe; do + for i in gcc binutils ${clibrary} gdb abe; do if test "`component_is_tar ${i}`" = no; then echo "--------------------- $i ----------------------" >> ${outfile} local srcdir="`get_component_srcdir $i`" |