From patchwork Fri Mar 12 08:23:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 42489 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3A24D3939C31; Fri, 12 Mar 2021 08:23:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A24D3939C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615537421; bh=bKliSBSf80aSsrdK/QXXn4i7HLnoiUfc6yZTXGiSBcE=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=V8YvRmbnTSVzRHcxKiBdjz1g3HnaSbdaaqV5KNmdlxtiicclYNnUVMxbPs9oD4cDl ZW4VoWbnQWZ9M12yx/B7OAKaymS+O7OoyrN6VIK+Lu5tLd/nUA9he/EUdsqXukDin3 udMTmdWpaycIXmf13UkfeBtEiMhgb0GpXqbdlYOw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 7C36D3851C17 for ; Fri, 12 Mar 2021 08:23:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7C36D3851C17 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-rF9vWHi3OTiYHBMf406naA-1; Fri, 12 Mar 2021 03:23:35 -0500 X-MC-Unique: rF9vWHi3OTiYHBMf406naA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3003210866A0 for ; Fri, 12 Mar 2021 08:23:34 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 532215D6BA for ; Fri, 12 Mar 2021 08:23:33 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 1/3] scripts/glibcsymbols.py: Extract from scripts/move-symbol-to-libc.py In-Reply-To: References: Message-Id: <2272b75c513d692065d2263089089e01b87ef8a0.1615537262.git.fweimer@redhat.com> Date: Fri, 12 Mar 2021 09:23:44 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --- scripts/glibcsymbols.py | 80 ++++++++++++++++++++++++++++++++++ scripts/move-symbol-to-libc.py | 75 ++++++------------------------- 2 files changed, 93 insertions(+), 62 deletions(-) create mode 100644 scripts/glibcsymbols.py Reviewed-by: Adhemerval Zanella diff --git a/scripts/glibcsymbols.py b/scripts/glibcsymbols.py new file mode 100644 index 0000000000..e329ead7f2 --- /dev/null +++ b/scripts/glibcsymbols.py @@ -0,0 +1,80 @@ +#!/usr/bin/python3 +# Processing of symbols and abilist files. +# Copyright (C) 2020-2021 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# The GNU C Library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# . + +"""Symbol processing for glibc.""" + +import os + +def replace_file(path, new_contents): + """Atomically replace PATH with lines from NEW_CONTENTS. + + NEW_CONTENTS must be a sequence of strings. + + """ + temppath = path + 'T' + with open(temppath, 'w') as out: + for line in new_contents: + out.write(line) + os.rename(temppath, path) + +class VersionedSymbol: + """A combination of a symbol and its version.""" + + def __init__(self, symbol, version): + """Construct a new versioned symbol.""" + assert symbol + assert version + self.symbol = symbol + self.version = version + + def __str__(self): + return self.symbol + '@' + self.version + + def __eq__(self, other): + return self.symbol == other.symbol and self.version == other.version + + def __hash__(self): + return hash(self.symbol) ^ hash(self.version) + +def read_abilist(path): + """Read the abilist file at PATH. + + Return a dictionary from VersionedSymbols to their flags (as + strings). + + """ + result = {} + with open(path) as inp: + for line in inp: + version, symbol, flags = line.strip().split(' ', 2) + result[VersionedSymbol(symbol, version)] = flags + return result + +def abilist_lines(symbols): + """Build the abilist file contents (as a list of lines). + + SYMBOLS is a dictionary from VersionedSymbols to their flags. + + """ + result = [] + for versym, flags in symbols.items(): + result.append('{} {} {}\n'.format( + versym.version, versym.symbol, flags)) + result.sort() + return result diff --git a/scripts/move-symbol-to-libc.py b/scripts/move-symbol-to-libc.py index f6b55edeb1..41cc357763 100644 --- a/scripts/move-symbol-to-libc.py +++ b/scripts/move-symbol-to-libc.py @@ -29,76 +29,25 @@ import argparse import os.path import sys -def replace_file(path, new_contents): - """Atomically replace PATH with lines from NEW_CONTENTS. +# Make available glibc Python modules. +sys.path.append(os.path.dirname(os.path.realpath(__file__))) - NEW_CONTENTS must be a sequence of strings. - - """ - temppath = path + 'T' - with open(temppath, 'w') as out: - for line in new_contents: - out.write(line) - os.rename(temppath, path) - -class VersionedSymbol: - """A combination of a symbol and its version.""" - - def __init__(self, symbol, version): - """Construct a new versioned symbol.""" - assert symbol - assert version - self.symbol = symbol - self.version = version - - def __str__(self): - return self.symbol + '@' + self.version - - def __eq__(self, other): - return self.symbol == other.symbol and self.version == other.version - - def __hash__(self): - return hash(self.symbol) ^ hash(self.version) - -def read_abilist(path): - """Read the abilist file at PATH. - - Return a dictionary from VersionedSymbols to their flags (as - strings). - - """ - result = {} - with open(path) as inp: - for line in inp: - version, symbol, flags = line.strip().split(' ', 2) - result[VersionedSymbol(symbol, version)] = flags - return result - -def abilist_lines(symbols): - """Build the abilist file contents (as a list of lines). - - SYMBOLS is a dictionary from VersionedSymbols to their flags. - - """ - result = [] - for versym, flags in symbols.items(): - result.append('{} {} {}\n'.format( - versym.version, versym.symbol, flags)) - result.sort() - return result +import glibcsymbols def add_to_libc_path(path, new_symbols): """Add SYMBOLS to the abilist file PATH. - NEW_SYMBOLS is a dictionary from VersionedSymbols to their flags. + NEW_SYMBOLS is a dictionary from glibcsymbols.VersionedSymbol + objects to their flags. """ - original_symbols = read_abilist(path) + original_symbols = glibcsymbols.read_abilist(path) updated_symbols = original_symbols.copy() updated_symbols.update(new_symbols) if updated_symbols != original_symbols: sys.stdout.write('updating libc abilist {}\n'.format(path)) - replace_file(path, abilist_lines(updated_symbols)) + glibcsymbols.replace_file( + path, glibcsymbols.abilist_lines(updated_symbols)) # The name of the libc.so abilist file. libc_abilist = 'libc.abilist' @@ -156,7 +105,7 @@ def move_symbols_1(path, to_move, moved_symbols): new_lines = [] changed = False - old_symbols = read_abilist(path) + old_symbols = glibcsymbols.read_abilist(path) old_versions = set(versym.version for versym in old_symbols.keys()) matching_symbols = dict(e for e in old_symbols.items() if e[0].symbol in to_move) @@ -169,9 +118,11 @@ def move_symbols_1(path, to_move, moved_symbols): # going away completely. new_versions = set(versym.version for versym in new_symbols.keys()) for missing_version in old_versions - new_versions: - new_symbols[VersionedSymbol(placeholder, missing_version)] = 'F' + new_symbols[glibcsymbols.VersionedSymbol( + placeholder, missing_version)] = 'F' - replace_file(path, abilist_lines(new_symbols)) + glibcsymbols.replace_file( + path, glibcsymbols.abilist_lines(new_symbols)) moved_symbols.update(matching_symbols) From patchwork Fri Mar 12 08:23:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 42490 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C8CCE3939C36; Fri, 12 Mar 2021 08:23:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8CCE3939C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615537431; bh=0tPf3UjjN6+zEdWZPvbBCiLlcLCQcbWUAd3umaAS35M=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=E3+Dx1ZEQop+0y/tG76hiAjIWYrs/QGGSxK69gzINZfS2Lq2L+IIp/+OvFuaUP2kw eCeFV3dy7AJUgl8aT6IyUNX5EcOYDKPkNunwk7w8poffJeK/BTFqp3LtG4x+a0OHdU wM/kcIDtSIZMFLM7VeLRpy5sUyXr3vI6jzjkQ99o= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 7CD343938C24 for ; Fri, 12 Mar 2021 08:23:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7CD343938C24 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-439-y2sDY9HVMQy-0TCdEi_utw-1; Fri, 12 Mar 2021 03:23:46 -0500 X-MC-Unique: y2sDY9HVMQy-0TCdEi_utw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6DB0A1898280 for ; Fri, 12 Mar 2021 08:23:45 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6A835D9F2 for ; Fri, 12 Mar 2021 08:23:44 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 2/3] glibcymbols.read_abilist: Add check for duplicate symbols In-Reply-To: References: Message-Id: Date: Fri, 12 Mar 2021 09:23:56 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This detects some bogus abilist files. Reviewed-by: Adhemerval Zanella --- scripts/glibcsymbols.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/glibcsymbols.py b/scripts/glibcsymbols.py index e329ead7f2..1bdd19e51e 100644 --- a/scripts/glibcsymbols.py +++ b/scripts/glibcsymbols.py @@ -63,7 +63,10 @@ def read_abilist(path): with open(path) as inp: for line in inp: version, symbol, flags = line.strip().split(' ', 2) - result[VersionedSymbol(symbol, version)] = flags + versym = VersionedSymbol(symbol, version) + if versym in result: + raise IOError("{}: duplicate symbol {}".format(path, versym)) + result[versym] = flags return result def abilist_lines(symbols): From patchwork Fri Mar 12 08:24:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 42491 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 76106393A405; Fri, 12 Mar 2021 08:24:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76106393A405 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615537442; bh=gXWpN0B+kCagIf+09u8OCv0knt9up+O0hL5wbJC8qGc=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=O+d2OP/IfgZWWAL6ugjibVV0KeEgIQNbpTnh0tLVnUHZjxEF5SG08qo2WC8DNZQwP TePAdrjszAsF9W6pjC9nfcIx+O6lFkGGjOvOHiOhpB23iUItgxOgDGuN4Hkf+2KGTy TlIYp7PwZrYx1+uucstintMZ++XnRl//5oH0Zwps= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id DE9093938C24 for ; Fri, 12 Mar 2021 08:23:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DE9093938C24 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-411-IUyoCOBxMJSEwI3MkGkrFA-1; Fri, 12 Mar 2021 03:23:56 -0500 X-MC-Unique: IUyoCOBxMJSEwI3MkGkrFA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7661A800D62 for ; Fri, 12 Mar 2021 08:23:55 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A11745D6BA for ; Fri, 12 Mar 2021 08:23:54 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 3/3] scripts/merge-abilist.py: New script to merge abilist files In-Reply-To: References: Message-Id: Date: Fri, 12 Mar 2021 09:24:06 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --- .gitattributes | 1 + scripts/merge-abilist.py | 112 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 scripts/merge-abilist.py diff --git a/.gitattributes b/.gitattributes index 06b553db80..859638588b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ ChangeLog merge=merge-changelog +**.abilist merge=merge-abilist timezone/* -whitespace diff --git a/scripts/merge-abilist.py b/scripts/merge-abilist.py new file mode 100644 index 0000000000..ad2bae2b8a --- /dev/null +++ b/scripts/merge-abilist.py @@ -0,0 +1,112 @@ +#!/usr/bin/python3 +# Automatic merging of abilist updates for Git. +# Copyright (C) 2021 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# The GNU C Library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# . + +"""Merge helper for consolidating changes in abilist files. + +To active, copy glibcsymbols.py and this file to a separate directory, +make merge-abilist.py executable, and add this to .git/config: + +[merge "merge-abilist"] + name = Merger for abilists + driver = /path/to/merge-abilist.py %O %A %B %P +""" + +import argparse +import os +import sys + +# Make available glibc Python modules. +sys.path.append(os.path.dirname(os.path.realpath(__file__))) + +import glibcsymbols + +def get_parser(): + """Return an argument parser for this module.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('ancestor', + help='path to the file with the merge ancestor') + parser.add_argument('current', + help='path to the file with the current version') + parser.add_argument('other', + help='path to the file with the other branch version') + parser.add_argument('path', help='path name in the source tree') + return parser + +def main(argv): + parser = get_parser() + opts = parser.parse_args(argv) + + if not opts.path.endswith(".abilist"): + # Not an abilist file. + sys.exit(3) + + ancestor = glibcsymbols.read_abilist(opts.ancestor) + current = glibcsymbols.read_abilist(opts.current) + other = glibcsymbols.read_abilist(opts.other) + + added_symbols_current = current.keys() - ancestor.keys() + deleted_symbols_current = ancestor.keys() - current.keys() + added_symbols_other = other.keys() - ancestor.keys() + deleted_symbols_other = ancestor.keys() - other.keys() + + # Check that the symbols have the same value if present in both inputs. + ok = True + for common_symbol in current.keys() & other.keys(): + if current[common_symbol] != other[common_symbol]: + print('{}: mismatch for {}: {!r} != {!r}'.format( + opts.path, common_symbol, + current[common_symbol], other[common_symbol])) + ok = False + # Check that there are no add/delete conflicts. + for common_symbol in added_symbols_current & deleted_symbols_other: + print('{}: added in current branch, deleted in other'.format( + common_symbol)) + ok = False + for common_symbol in added_symbols_other & deleted_symbols_current: + print('{}: added in other other branch, deleted in current'.format( + common_symbol)) + ok = False + if not ok: + sys.exit(2) + + # Apply the updates from the other branch. + result = current.copy() + for symbol in added_symbols_other: + result[symbol] = other[symbol] + for symbol in deleted_symbols_other: + del result[symbol] + + # Introduce placeholder symbols if a symbol set was completely + # deleted. + placeholder = "__{}_version_placeholder".format( + os.path.basename(opts.path)[:-len(".abilist")]) + old_versions = set(versym.version for versym in current.keys()) + new_versions = set(versym.version for versym in result.keys()) + for missing_version in old_versions - new_versions: + result[glibcsymbols.VersionedSymbol( + placeholder, missing_version)] = 'F' + + # Write out the merged abilist. Do not use replace_file because + # of the file system race due to the ...T name. + with open(opts.current, 'w') as out: + for line in glibcsymbols.abilist_lines(result): + out.write(line) + +if __name__ == '__main__': + main(sys.argv[1:])