From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 423381F461 for ; Sun, 12 May 2019 14:13:13 +0000 (UTC) Received: from localhost ([127.0.0.1]:43658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPpDz-0002ls-LN for normalperson@yhbt.net; Sun, 12 May 2019 10:13:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPpDv-0002ll-5W for bug-gnulib@gnu.org; Sun, 12 May 2019 10:13:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPpDt-00034O-AC for bug-gnulib@gnu.org; Sun, 12 May 2019 10:13:07 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::3]:14351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hPpDk-0002xe-Eh; Sun, 12 May 2019 10:13:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1557670369; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=Na8tJpO4zKESsvfvrLwItia63gNPnXCBqEJm68uz1iw=; b=T+QFVBTh8OPj/4ROSti4aoHf6GzzW+pK4Pi879frUk/UHT+3OQoO1Vg3+TjPE6b+a4 7kK/fkT8ISS0uzxbZfo7y1Iuu/gWaAGEDFs8I0y0DPid10r/fU52huHbLQYaxmSjSkp2 /tuxKoMqEUi0/yEQjXCO6pEzLT4db279QZhqtQG4fWtuVQztjq7VWfG9THItrfLCgeW9 unsQ7YQ3wSB8pxkB4QKHq7QVky6edzFmiDmaXqWqNwpMbu0M6E86qzlPwdy02UDgc8kr Q6T5nob3VUEWY5OJRhSsk75fhqRZgIzPHPtMOG0RxLsFwHWbNnIW1koDsYaPIAi5Qn4L bjPw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGaf0y5RW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 44.18 DYNA|AUTH) with ESMTPSA id m03afev4CECmOG3 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 12 May 2019 16:12:48 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: libtool-next-version: new program Date: Sun, 12 May 2019 16:12:47 +0200 Message-ID: <1969933.8QeS2cXeqt@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-145-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::3 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libtool@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Bumping the libtool version of a shared library according to seems to be harder than expected: Both the gettext-0.19.8 and gettext-0.20 release suffer from a wrongly computed triple (mistakes done by different maintainers!). Let me try to make this procedure less prone to mistakes, through a wizard program. I'm committing this in gnulib for now, since libtool currently has a low release frequency. But please include this script in the next libtool release as an installable program. 2019-05-12 Bruno Haible libtool-next-version: New program. * build-aux/libtool-next-version: New file. ======================== build-aux/libtool-next-version ======================== #! /bin/sh # # Copyright (C) 2019 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # This program is a wizard that helps a maintainer update the libtool # version of a shared library, according to the documentation section # 'Updating version info' # . # # Let's call the three parts of the version # LTV_CURRENT # LTV_REVISION # LTV_AGE # # The list of steps given in this documentation section # - If the library source code has changed at all since the last update, # then increment LTV_REVISION. # - If any interfaces have been added, removed, or changed since the last # update, increment LTV_CURRENT and set LTV_REVISION to 0. # - If any interfaces have been added since the last public release, then # increment LTV_AGE. # - If any interfaces have been removed or changed since the last public # release, then set LTV_AGE to 0. # leads to mistakes, because # - It does not say what "interfaces" are. # - It does not enforce that applying the second, third, or fourth rule # is only possible after applying the first rule. # - It does not enforce that applying the third or fourth rule is only # possible after applying the second rule. # func_usage # outputs to stdout the --help usage message. func_usage () { echo "\ Usage: libtool-next-version [OPTION]... PREVIOUS-LIBRARY CURRENT-LIBRARY Determines the next version to use for a libtool library. PREVIOUS-LIBRARY is the installed library (in .a or .so format) of the previous release. CURRENT-LIBRARY is the installed library (in .a or .so format) of the current release candidate. Options: --help print this help and exit --version print version information and exit Report bugs to ." } # func_version # outputs to stdout the --version message. func_version () { echo "libtool-next-version (GNU gnulib)" echo "Copyright (C) 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law." echo "Written by" "Bruno Haible" } # func_fatal_error message # outputs to stderr a fatal error message, and terminates the program. func_fatal_error () { echo "declared.sh: *** $1" 1>&2 echo "declared.sh: *** Stop." 1>&2 exit 1 } # func_tmpdir # creates a temporary directory. # Sets variable # - tmp pathname of freshly created temporary directory func_tmpdir () { # Use the environment variable TMPDIR, falling back to /tmp. This allows # users to specify a different temporary directory, for example, if their # /tmp is filled up or too small. : ${TMPDIR=/tmp} { # Use the mktemp program if available. If not available, hide the error # message. tmp=`(umask 077 && mktemp -d -q "$TMPDIR/gtXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { # Use a simple mkdir command. It is guaranteed to fail if the directory # already exists. $RANDOM is bash specific and expands to empty in shells # other than bash, ksh and zsh. Its use does not increase security; # rather, it minimizes the probability of failure in a very cluttered /tmp # directory. tmp=$TMPDIR/gt$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$0: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } } # func_read_yesno # reads an answer (yes or no). # Sets variable # - ans yes or no func_read_yesno () { while true; do read ans if test yes = "$ans" || test no = "$ans"; then break fi echo "Invalid answer. Please answer yes or no." done } # Command-line option processing. while test $# -gt 0; do case "$1" in --help | --hel | --he | --h ) func_usage exit 0 ;; --version | --versio | --versi | --vers | --ver | --ve | --v ) func_version exit 0 ;; -- ) # Stop option processing shift; break ;; -* ) func_fatal_error "unrecognized option: $option" ;; * ) break ;; esac done test $# = 2 || { if test $# -gt 2; then func_fatal_error "too many arguments" else func_fatal_error "Usage: libtool-next-version [OPTION]... PREVIOUS-LIBRARY CURRENT-LIBRARY" fi } test -f "$1" || func_fatal_error "file $1 not found" test -f "$2" || func_fatal_error "file $2 not found" (type nm) >/dev/null || func_fatal_error "program 'nm' not found" # Determine how to extract a symbol list from the 'nm' output. case `uname -s` in Linux | FreeBSD | NetBSD | OpenBSD) nm_filter="sed -n -e 's/^.* [TWDRB] //p'" ;; Darwin) nm_filter="sed -n -e 's/^.* [TWDRB] _//p'" ;; Minix) nm_filter="sed -n -e 's/^.* [TDC] _//p'" ;; AIX) nm_filter="sed -n -e 's/ *[UD] .*//p' | sed -e 's/^\\.//'" ;; HP-UX) nm_filter="grep '|extern|\\(code\\|data\\) |' | sed -e 's/|.*//' | sed -e 's/ *$//'" ;; IRIX) nm_filter="grep '|\\(GLOB\\|WEAK\\)' | sed -e 's/^.*|//'" ;; SunOS) case `uname -r` in 5.10) nm_filter="sed -n -e 's/^.* [ATWDRBV] //p'" ;; *) nm_filter="grep '|\\(GLOB\\|WEAK\\)' | grep -v '|UNDEF' | grep -v '|SUNW' | sed -e 's/^.*|//'" ;; esac ;; CYGWIN*) nm_filter="sed -n -e 's/^.* T _//p'" ;; *) func_fatal_error "unknown OS - don't know how to interpret the 'nm' output" ;; esac nm_filter="$nm_filter | LC_ALL=C sort -u" func_tmpdir eval "nm '$1' | $nm_filter > '$tmp/symlist1'" eval "nm '$2' | $nm_filter > '$tmp/symlist2'" echo "Please enter the libtool version of the library in the previous release." printf "LTV_CURRENT="; read current nondigits=`echo "$current" | tr -d '0123456789'` { test -n "$current" && test -z "$nondigits"; } \ || func_fatal_error "LTV_CURRENT is invalid. It should be a nonnegative integer." printf "LTV_REVISION="; read revision nondigits=`echo "$revision" | tr -d '0123456789'` { test -n "$revision" && test -z "$nondigits"; } \ || func_fatal_error "LTV_REVISION is invalid. It should be a nonnegative integer." printf "LTV_AGE="; read age nondigits=`echo "$age" | tr -d '0123456789'` { test -n "$age" && test -z "$nondigits"; } \ || func_fatal_error "LTV_AGE is invalid. It should be a nonnegative integer." echo echo "-------------------------------------------------------------------------------" echo "Did the library's code change at all since the previous version?" echo "You can usually detect this by looking at the source code changes in git;" echo "don't forget source code that is imported from other projects." if cmp "$tmp/symlist1" "$tmp/symlist2" >/dev/null; then echo "Please answer yes or no." else echo "The symbol list changed. Here are the differences:" (cd "$tmp" && diff symlist1 symlist2 | grep '^[<>]' | sed -e 's/^/ /') echo "Please answer yes or no (probably yes)." fi func_read_yesno if test "$ans" = yes; then revision=`expr $revision + 1` echo echo "-------------------------------------------------------------------------------" echo "Have any interfaces (functions, variables, classes) been removed since the" echo "previous release? What matters here are interfaces at the linker level;" echo "whether macros have been removed from the include files does not matter." if diff "$tmp/symlist1" "$tmp/symlist2" | grep '^< ' >/dev/null; then echo "Some symbols have been removed:" diff "$tmp/symlist1" "$tmp/symlist2" | grep '^< ' | sed -e 's/^< / /' echo "Please answer yes or no (probably yes)." else echo "Please answer yes or no." fi func_read_yesno if test "$ans" = yes; then current=`expr $current + 1` revision=0 age=0 else echo echo "-------------------------------------------------------------------------------" echo "Have any interfaces (functions, variables, classes) been changed since the" echo "previous release? This includes signature changes. It includes also details of" echo "how functions produce their results and the values of variables, IF AND ONLY IF" echo "users of the library are likely use these details in their test suite." echo "Please answer yes or no." func_read_yesno if test "$ans" = yes; then current=`expr $current + 1` revision=0 age=0 else echo echo "-------------------------------------------------------------------------------" echo "Have any interfaces (functions, variables, classes) been added since the" echo "previous release? What matters here are interfaces at the linker level;" echo "whether macros have been added to the include files does not matter." if diff "$tmp/symlist1" "$tmp/symlist2" | grep '^> ' >/dev/null; then echo "Some symbols have been added:" diff "$tmp/symlist1" "$tmp/symlist2" | grep '^> ' | sed -e 's/^> / /' echo "Please answer yes or no (probably yes)." else echo "Please answer yes or no." fi func_read_yesno if test "$ans" = yes; then current=`expr $current + 1` revision=0 age=`expr $age + 1` fi fi fi fi echo echo "-------------------------------------------------------------------------------" echo "This is the libtool version of the library for the new release:" echo "LTV_CURRENT=$current" echo "LTV_REVISION=$revision" echo "LTV_AGE=$age"