From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 7FB463858D32 for ; Mon, 27 Feb 2023 23:50:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7FB463858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31RIhvnc018707; Mon, 27 Feb 2023 23:50:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2022-7-12; bh=pu72fQJ5r8zRpw3xTQqRnNaihXYaxO5xlVQEucAaFrk=; b=M6myhq9ADHuM6tHb4I9QSMioGrjPcDCtagyPmBwlpwyWR14CM/xnDCzRJptp+2P7QOep ay/nX5jCJy9lSa0IVkR5asnxk4xYB5bYa9YwQ3YhJ6Z4RU5bQA6buo24K85aPt/CI+Hp Fo+CegvuM3Vy+HnVHveK26BSjp04he6bq8Pp9lG4hBB5gdoo3dwh3xpaeIhbuZwspUaJ Ac9ZdXiid0tuVDfnUpyzXnSV1t2ZMWJnBwqbBZ8cAfm6ywRfq+n3YVcv1rguAD3AdSPj djM96qL2MYQf4GFj/rb5eUgv5GlV6uHM5buBna7ugmDJl675wkynPpxyWIora+BeVF1T Ww== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nyba7cvw8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Feb 2023 23:50:32 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 31RMprDF029237; Mon, 27 Feb 2023 23:50:31 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2043.outbound.protection.outlook.com [104.47.73.43]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ny8sc260m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Feb 2023 23:50:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SeVW2a73GzsZ4Npc0N+iOKQthnKoX3O+Fn+CJSD44v8jHI7HkYyRUfzFuncp011iwTj+tDa0N3mM/ITUyz6vfNKeWZH2u1UOpdQFeR7EwSaI2iNAIy0jQAWmWLjm/BsqLkuljJuc0gks3ghnC8aKzrqiFLLYSidf2nTwwRkG4moD26lzSsmseKhuKF4TlUtysMm8hjrF3DlWhlXJaeiyxIRO8FeXlZCXI5aPnXdCH4TrJ40y1D9J5dZCCbcdl1mrFzm3ppyIcUa4r2BzByhHRe94HXMt3m8PLq+ZFQaUWj4etsBm7z0SM9qrrU2Es6GCOAizpUEM6BJc73sDKbV6Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pu72fQJ5r8zRpw3xTQqRnNaihXYaxO5xlVQEucAaFrk=; b=RnRCLooiB+mmSwCXVhTG3FITiXZnBi/wL0hQ5gqD1qX1r/2qn4u7No8k+f9DCrSRGlOM6Gim1vB91GskdQilfmO0Ha3bjjD4Al6Fm+RluHKKnNYTqJzWRlaVN3NKWykHfvEENWutQM0tvDUTWthys+R8fD7raZpbaodCPRITUmLRxcyoTFh830KqLNMX9ZKyZHKwYT3AjHQPve44hyR9HZHFGkvTJa/HD4ZxOQjeJLmYy1BtSXfQ6VNvBJgytQIUVG1JuPFrgqEiZx4vSnVUObbIZvd0AxiK7/2YcZIlgP53VUBiyySFB56Nkx2kJMiFXs/2C19UQgliEe8GkrCq/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pu72fQJ5r8zRpw3xTQqRnNaihXYaxO5xlVQEucAaFrk=; b=bgW4hAoZFdTHgw8SS8g2vtzOnEOqxbM3d38JVP4WWyeoIAP8f/AaYPGmp3X179jvEkb/tWQuSgd/DZbAqjRqfqZMFR/2PFuCRZUCcDLfrvosvUn6U2CoQVxaulCrxto/n4MfbufJnudOHygFqF+q7lU2KhKg1QTwvtRYSzOjyoA= Received: from MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) by PH7PR10MB7011.namprd10.prod.outlook.com (2603:10b6:510:273::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.16; Mon, 27 Feb 2023 23:50:26 +0000 Received: from MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::480f:b0b1:2e28:546e]) by MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::480f:b0b1:2e28:546e%7]) with mapi id 15.20.6156.007; Mon, 27 Feb 2023 23:50:26 +0000 Date: Mon, 27 Feb 2023 17:50:21 -0600 From: "Guillermo E. Martinez" To: Dodji Seketeli Cc: "Guillermo E. Martinez via Libabigail" Subject: Re: [PATCH, RFC] abipkgdiff: Fix kernel package detection when comparing Message-ID: <20230227235021.2qwxmmxx3eek4fqz@kamehouse> References: <20230217005743.2607886-1-guillermo.e.martinez@oracle.com> <87sferrlb7.fsf@seketeli.org> <87o7pfrl5l.fsf_-_@seketeli.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o7pfrl5l.fsf_-_@seketeli.org> X-ClientProxiedBy: BLAPR03CA0172.namprd03.prod.outlook.com (2603:10b6:208:32f::12) To MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR10MB1407:EE_|PH7PR10MB7011:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fba89aa-6b8d-49bd-4249-08db191d663b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Pwc/vIHWUERVuFJ04oIUAWeUtZ0JucBi4pWrR/JkfajO4WN4Vy+gG+AZRfIvTZ436TfXAK3/hqvFpt7P/RgBAWseXxtUl2vPJ+xn43MdztmCfVROyRZFDXP0dOtrzlfm6MH28ldG5qe0tjKzsOffmUUnsiOe2P8jh2gRov0rJti5MrUl2K9uhWrqsOb6/1sBiTsLgQOayB3WJn/u6fn4P3/QSki3jeGj6J6wxk1Ij34hcXNwXP/ulfiMTZCSXrGazTU+dNIM3hA+ybBKubpe7EmBKNU3ldZWgiL8tBhRhyrMuCsYPVDEgUV8F+j8g7GZSbfv3JoQVrYCj+S1gL5KMapO7DmWeoKOWSqAp6HjmwnDOMXVybm7sqPEKTfp2TMkNfnxx//ZeonfdCAeDdhouNqO5Cd3DP3n6yoJ4KSZnv5EZQgw5cq2U3LuLodgC+rlaidf0mUABVQOOpiftSNVXkBAwOD0HdZXTNxNarLpwRT0DNnOeuNs53PvxUpLCniEvWWy+0p5EslmOthB4/2fSQI95N4M/F/34pKgdrmeyhnCxhXk+pqE7Wd5krxhr93ljL3BBieRMMTOxEGdZGXGl9+DCsDoaucP1i+/+uJvUcjHk3JBZhXoFNHDhlJ4q0dCbBo0QsZ/q7IaeGjlPtStw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR10MB1407.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(7916004)(396003)(376002)(366004)(346002)(136003)(39860400002)(451199018)(8936002)(4326008)(6916009)(8676002)(66476007)(66556008)(66946007)(41300700001)(30864003)(5660300002)(83380400001)(38100700002)(6506007)(33716001)(2906002)(6512007)(316002)(86362001)(6486002)(478600001)(1076003)(9686003)(26005)(186003)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?9cqnpbWbq8L0ezJYmYnYKRh3FLoUxUzlhYEWXANs5IrA3jUQImmBjgMKIQzs?= =?us-ascii?Q?g/ATAW1b2uN67BWebQo09v3iCfxWjdIYvu8lx5/ASTcvfxRhM+NNcmt2oY6X?= =?us-ascii?Q?1NmswAd1TZMZJgXSlUe80Z12I/juJofPNvI52tmtI0C66uBLScyCvNRdXLQX?= =?us-ascii?Q?6Fci2HXldO3n8DU3efpAm+pwokEqqHI8wVPNvirEzaXZFvi0qJIvyvqWRH9l?= =?us-ascii?Q?tGv/6Uyvq2otlHOB79AAsoqBrBav6j7TblpB0FV8vPv2hSeCfz10Uy2jcj4Y?= =?us-ascii?Q?WlzJTQYxLWAAuvirUNcBUzrmPNHfID8XeuQ4b/mc3zCYpxx6dRhU2VnjBIKX?= =?us-ascii?Q?7Ao8qmZf2dAzdCjfxDFftOnpWvZxYjmekVbn0xTWR60MlqpxfLTbgWXJVh9H?= =?us-ascii?Q?2jDggtkUK/ldwdeFKX3+WIlQm+ry7o3YJlxoiAK96kw2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6XYuGPwawD9COEt0QPuUSbEZKt/N++HBTufrtCfxJ+dDndnCaPw6B0zJPUygmEF+qopcbIqMUhsQBHVHSPrI3pgOhQtB7Tn7m17RLwDp+bootXHHoSYAWehEOeNsneNR31D7O/ypUeOGAvOK3iAwtPBg4/+/fB6EtJqxylj2oWuZIgm+19D0UGqGu1K04uJ/pAuG4IVfBc7YJTcR4Qhr9NvEsgs1w= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fba89aa-6b8d-49bd-4249-08db191d663b X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1407.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 23:50:26.5462 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Cb5eB7aG1FnsJL/PBQglkkXzjgYBPh47vR3VT0B/zxHMEzW17DGYvrpL/yFsEzbMMVgDwdswwDschXtAPkkN+WGtWJzq8f0DgWDsrkim+Qg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7011 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-27_17,2023-02-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302270192 X-Proofpoint-ORIG-GUID: U6SrmtIk4CiK3WD8NWO6q27SUp8j3-50 X-Proofpoint-GUID: U6SrmtIk4CiK3WD8NWO6q27SUp8j3-50 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Feb 27, 2023 at 07:57:42PM +0100, Dodji Seketeli wrote: > Hello Guillermo, > Hello Dodji, > Here is the amended patch that I am proposing to address the issue you > reported. > > I try to fix the problem of tools_utils::file_is_kernel_package first, > then I added your CTF-specific fixes on top. > Nice. > Can you please tell me what you think about this approach? > I'm agree with your approach!. > Thanks. > Thanks to you, guillermo > > Using abipkgdiff to analyze kABIs from Oracle Linux packages with CTF > debug format, abipkgdiff is not able to identify kernel packages > because the naming of OL kernel packages differs from the naming used > on other RPM-based distributions. > > As abipkgdiff fails to see that it's looking at a Linux kernel > package, the binaries are analyzed as user space binaries and that is > not what we want. > > This patch addresses the issue by looking for the "vmlinuz" binary > inside the package to determine that it's a kernel package. In other > words, tools_utils::file_is_kernel_package is changed to look for > "vmlinuz" inside the package, rather than look for a particular > pattern in the package name of the package. > > Additionally, when the kernel package contains CTF debug information, > the `vmlinux.ctfa' file is not necessarily shipped the debuginfo > package. This patch thus adjusts the search path of that file in that > case. > > * include/abg-tools-utils.h (rpm_contains_file): Declare new > function. > * src/abg-ctf-reader.cc (ctf::reader::find_ctfa_file): Use > `find_file_under_dir' utility function to locate `vmlinux.ctfa' > file. > (ctf::reader::process_ctf_archive): Adjust dictionary name > according to module name, removing characters after dot. > * src/abg-tools-utils.cc (file_has_ctf_debug_info): Use > `find_file_under_dir' utility function to locate `vmlinux.ctfa' > file. > (rpm_contains_file): Define new function. > (file_is_kernel_package): Use the new `rpm_contains_file' to look > for the `vmlinuz' file inside the RPM package. For Debian > packages however, we don't keep looking at the naming pattern as > we don't yet have a deb_contains_file function. Also, this > function now takes the full path to the RPM. > (build_corpus_group_from_kernel_dist_under): for CTF, add the > `root' directory of the extracted package to the set of > directories under which we should look for debug info. > * tools/abipkgdiff.cc (maybe_handle_kabi_whitelist_pkg) > (create_maps_of_package_content, compare_prepared_package, main): > Adjust call to file_is_kernel_package as it now takes the full > path to the package. > > Signed-off-by: Guillermo E. Martinez > Signed-off-by: Dodji Seketeli > --- > include/abg-tools-utils.h | 4 +++ > src/abg-ctf-reader.cc | 16 ++++------- > src/abg-tools-utils.cc | 60 ++++++++++++++++++++++++++++++++------- > tools/abipkgdiff.cc | 19 ++++++------- > 4 files changed, 69 insertions(+), 30 deletions(-) > > diff --git a/include/abg-tools-utils.h b/include/abg-tools-utils.h > index 70745b0f..43bf6a3e 100644 > --- a/include/abg-tools-utils.h > +++ b/include/abg-tools-utils.h > @@ -300,6 +300,10 @@ bool > file_is_kernel_package(const string& file_path, > file_type file_type); > > +bool > +rpm_contains_file(const string& rpm_path, > + const string& file_name); > + > bool > file_is_kernel_debuginfo_package(const string& file_path, > file_type file_type); > diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc > index 54257d11..7db8dbc6 100644 > --- a/src/abg-ctf-reader.cc > +++ b/src/abg-ctf-reader.cc > @@ -336,12 +336,8 @@ public: > // for vmlinux.ctfa should be provided with --debug-info-dir > // option. > for (const auto& path : debug_info_root_paths()) > - { > - ctfa_dirname = *path; > - ctfa_file = ctfa_dirname + "/vmlinux.ctfa"; > - if (file_exists(ctfa_file)) > - return true; > - } > + if (tools_utils::find_file_under_dir(*path, "vmlinux.ctfa", ctfa_file)) > + return true; > > return false; > } > @@ -428,10 +424,10 @@ public: > && corpus_group()) > { > tools_utils::base_name(corpus_path(), dict_name); > - > - if (dict_name != "vmlinux") > - // remove .ko suffix > - dict_name.erase(dict_name.length() - 3, 3); > + // remove .* suffix > + std::size_t pos = dict_name.find("."); > + if (pos != string::npos) > + dict_name.erase(pos); > > std::replace(dict_name.begin(), dict_name.end(), '-', '_'); > } > diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc > index 81f9aa75..85719cdc 100644 > --- a/src/abg-tools-utils.cc > +++ b/src/abg-tools-utils.cc > @@ -501,7 +501,7 @@ file_has_ctf_debug_info(const string& elf_file_path, > > // vmlinux.ctfa could be provided with --debug-info-dir > for (const auto& path : debug_info_root_paths) > - if (dir_contains_ctf_archive(*path, vmlinux)) > + if (find_file_under_dir(*path, "vmlinux.ctfa", vmlinux)) > return true; > > return false; > @@ -1764,34 +1764,64 @@ get_rpm_arch(const string& str, string& arch) > > /// Tests if a given file name designates a kernel package. > /// > -/// @param file_name the file name to consider. > +/// @param file_path the path to the file to consider. > /// > /// @param file_type the type of the file @p file_name. > /// > /// @return true iff @p file_name of kind @p file_type designates a > /// kernel package. > bool > -file_is_kernel_package(const string& file_name, file_type file_type) > +file_is_kernel_package(const string& file_path, file_type file_type) > { > bool result = false; > - string package_name; > > if (file_type == FILE_TYPE_RPM) > { > - if (!get_rpm_name(file_name, package_name)) > - return false; > - result = (package_name == "kernel"); > + if (rpm_contains_file(file_path, "vmlinuz")) > + result = true; > } > else if (file_type == FILE_TYPE_DEB) > { > - if (!get_deb_name(file_name, package_name)) > - return false; > - result = (string_begins_with(package_name, "linux-image")); > + string file_name; > + base_name(file_path, file_name); > + string package_name; > + if (get_deb_name(file_name, package_name)) > + result = (string_begins_with(package_name, "linux-image")); > } > > return result; > } > > +/// Test if an RPM package contains a given file. > +/// > +/// @param rpm_path the path to the RPM package. > +/// > +/// @param file_name the file name to test the presence for in the > +/// rpm. > +/// > +/// @return true iff the file named @file_name is present in the RPM. > +bool > +rpm_contains_file(const string& rpm_path, const string& file_name) > +{ > + vector query_output; > + // We don't check the return value of this command because on some > + // system, the command can issue errors but still emit a valid > + // output. We'll rather rely on the fact that the command emits a > + // valid output or not. > + execute_command_and_get_output("rpm -qlp " > + + rpm_path + " 2> /dev/null", > + query_output); > + > + for (auto& line : query_output) > + { > + line = trim_white_space(line); > + if (string_ends_with(line, file_name)) > + return true; > + } > + > + return false; > +} > + > /// Tests if a given file name designates a kernel debuginfo package. > /// > /// @param file_name the file name to consider. > @@ -2812,6 +2842,16 @@ build_corpus_group_from_kernel_dist_under(const string& root, > vector di_roots; > di_roots.push_back(&di_root_ptr); > > +#ifdef WITH_CTF > + shared_ptr di_root_ctf; > + if (requested_fe_kind & corpus::CTF_ORIGIN) > + { > + di_root_ctf = make_path_absolute(root.c_str()); > + char *di_root_ctf_ptr = di_root_ctf.get(); > + di_roots.push_back(&di_root_ctf_ptr); > + } > +#endif > + > abigail::elf_based_reader_sptr reader = > create_best_elf_based_reader(vmlinux, > di_roots, > diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc > index a4b4f1a1..c2fc09ca 100644 > --- a/tools/abipkgdiff.cc > +++ b/tools/abipkgdiff.cc > @@ -2022,8 +2022,8 @@ maybe_handle_kabi_whitelist_pkg(const package& pkg, options &opts) > if (pkg.type() != abigail::tools_utils::FILE_TYPE_RPM) > return false; > > - string pkg_name = pkg.base_name(); > - bool is_linux_kernel_package = file_is_kernel_package(pkg_name, pkg.type()); > + bool is_linux_kernel_package = file_is_kernel_package(pkg.path(), > + pkg.type()); > > if (!is_linux_kernel_package) > return false; > @@ -2036,7 +2036,7 @@ maybe_handle_kabi_whitelist_pkg(const package& pkg, options &opts) > return false; > > string rpm_arch; > - if (!get_rpm_arch(pkg_name, rpm_arch)) > + if (!get_rpm_arch(pkg.base_name(), rpm_arch)) > return false; > > string kabi_wl_path = kabi_wl_pkg->extracted_dir_path(); > @@ -2412,8 +2412,7 @@ create_maps_of_package_content(package& package, options& opts) > // if package is linux kernel package and its associated debug > // info package looks like a kernel debuginfo package, then try to > // go find the vmlinux file in that debug info file. > - string pkg_name = package.base_name(); > - bool is_linux_kernel_package = file_is_kernel_package(pkg_name, > + bool is_linux_kernel_package = file_is_kernel_package(package.path(), > package.type()); > if (is_linux_kernel_package) > { > @@ -3219,7 +3218,7 @@ compare_prepared_package(package& first_package, package& second_package, > { > abidiff_status status = abigail::tools_utils::ABIDIFF_OK; > > - if (abigail::tools_utils::file_is_kernel_package(first_package.base_name(), > + if (abigail::tools_utils::file_is_kernel_package(first_package.path(), > first_package.type())) > { > opts.show_symbols_not_referenced_by_debug_info = false; > @@ -3737,14 +3736,14 @@ main(int argc, char* argv[]) > | abigail::tools_utils::ABIDIFF_ERROR); > } > > - if (file_is_kernel_package(first_package->base_name(), > + if (file_is_kernel_package(first_package->path(), > abigail::tools_utils::FILE_TYPE_RPM) > - || file_is_kernel_package(second_package->base_name(), > + || file_is_kernel_package(second_package->path(), > abigail::tools_utils::FILE_TYPE_RPM)) > { > - if (file_is_kernel_package(first_package->base_name(), > + if (file_is_kernel_package(first_package->path(), > abigail::tools_utils::FILE_TYPE_RPM) > - != file_is_kernel_package(second_package->base_name(), > + != file_is_kernel_package(second_package->path(), > abigail::tools_utils::FILE_TYPE_RPM)) > { > emit_prefix("abipkgdiff", cerr) > -- > 2.39.2 > > > > -- > Dodji