From 7792716dcf87c7782a910c436fc86d4593a4b1fd Mon Sep 17 00:00:00 2001 From: David Salinas Date: Fri, 23 Jun 2023 16:15:51 +0000 Subject: [PATCH] SWDEV-404809 - hip packages shouldn't depend in non-default perl modules Change-Id: I30829a735dd6a6f1d5780578e30701e3f8d3394a [ROCm/clr commit: c1126fc72743725b78e115096350f5150bcdae74] --- projects/clr/hipamd/bin/roc-obj-extract | 5 ++--- projects/clr/hipamd/bin/roc-obj-ls | 6 ++---- projects/clr/hipamd/install.sh | 6 +++--- projects/clr/hipamd/packaging/CMakeLists.txt | 4 ++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/projects/clr/hipamd/bin/roc-obj-extract b/projects/clr/hipamd/bin/roc-obj-extract index 9420a4b059..b2cc2b5707 100755 --- a/projects/clr/hipamd/bin/roc-obj-extract +++ b/projects/clr/hipamd/bin/roc-obj-extract @@ -27,7 +27,7 @@ use File::Which; use Cwd 'realpath'; use Getopt::Std; use List::Util qw(max); -use URI::Encode; +use URI::Escape; my $extract_range_specifier; my $extract_pid; @@ -111,7 +111,6 @@ foreach my $uri_str(@ARGV) { chomp $uri_str; my ($uri_protocol, $specs) = split(/:\/\//,$uri_str); - my $obj_uri_encode = URI::Encode->new(); my $decoded_extract_file; my $file_size; @@ -120,7 +119,7 @@ foreach my $uri_str(@ARGV) { ($extract_file, $extract_range_specifier) = split(/[#,?]/,$specs); # decode the file name. URIs may have file/path names with non-alphanumeric characters, which will be encoded with %. We need to decode these. - $decoded_extract_file = $obj_uri_encode->decode($extract_file); + $decoded_extract_file = uri_unescape($extract_file); # verify file exists: if (! -e $decoded_extract_file) { diff --git a/projects/clr/hipamd/bin/roc-obj-ls b/projects/clr/hipamd/bin/roc-obj-ls index 7ce201978e..56d58e0f94 100755 --- a/projects/clr/hipamd/bin/roc-obj-ls +++ b/projects/clr/hipamd/bin/roc-obj-ls @@ -22,12 +22,11 @@ use strict; use File::Copy; use File::Spec; -use File::Basename; use File::Which; use Cwd 'realpath'; use Getopt::Std; use List::Util qw(max); -use URI::Encode; +use URI::Escape; sub usage { print("Usage: $0 [-v|h] executable...\n"); @@ -159,8 +158,7 @@ foreach my $executable_file(@ARGV) { printf("abs_offset: 0x%X\n",$abs_offset) if $debug; - my $obj_uri_encode = URI::Encode->new(); - my $encoded_executable_file = $obj_uri_encode->encode($executable_file); + my $encoded_executable_file = uri_unescape($executable_file); printf("%-8s%-40s%35s%s%s%s%s%s%s\n",$num_bundles,$triple,"file:\/\/",$encoded_executable_file,"\#offset=",$abs_offset, "\&size=",$entry_size); diff --git a/projects/clr/hipamd/install.sh b/projects/clr/hipamd/install.sh index aae947f9ab..dc69476599 100755 --- a/projects/clr/hipamd/install.sh +++ b/projects/clr/hipamd/install.sh @@ -95,12 +95,12 @@ function setupENV() if [ "$OS_NAME" == "Ubuntu" ] then sudo apt-get update - sudo apt-get install dpkg-dev rpm doxygen libelf-dev rename liburi-encode-perl \ - libfile-basedir-perl libfile-copy-recursive-perl libfile-listing-perl + sudo apt-get install dpkg-dev rpm doxygen libelf-dev rename \ + libfile-copy-recursive-perl libfile-listing-perl elif [ "$OS_NAME" == "CentOS" ] then yum install dpkg-dev rpm-build doxygen elfutils-libelf-devel prename \ - perl-URI-Encode perl-File-Listing perl-File-BaseDir + perl-File-Listing fi } diff --git a/projects/clr/hipamd/packaging/CMakeLists.txt b/projects/clr/hipamd/packaging/CMakeLists.txt index 711e8e2d1c..681516d213 100644 --- a/projects/clr/hipamd/packaging/CMakeLists.txt +++ b/projects/clr/hipamd/packaging/CMakeLists.txt @@ -202,13 +202,13 @@ configure_file(hip-devel.postinst ${CMAKE_CURRENT_BINARY_DIR}/dev/postinst @ONLY configure_file(hip-devel.prerm ${CMAKE_CURRENT_BINARY_DIR}/dev/prerm @ONLY) set(CPACK_DEBIAN_DEV_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/dev/postinst;${CMAKE_CURRENT_BINARY_DIR}/dev/prerm") -set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS "perl (>= 5.0), liburi-encode-perl, libfile-basedir-perl, libfile-copy-recursive-perl, libfile-listing-perl, libfile-which-perl, libc6, file, rocm-core, hipcc") +set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS "perl (>= 5.0), libfile-copy-recursive-perl, libfile-listing-perl, libfile-which-perl, libc6, file, rocm-core, hipcc") set(CPACK_DEBIAN_DEV_PACKAGE_PROVIDES "hip-base") set(CPACK_DEBIAN_DEV_PACKAGE_REPLACES "hip-base") set(CPACK_RPM_DEV_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/dev/postinst") set(CPACK_RPM_DEV_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/dev/prerm") -set(CPACK_RPM_DEV_PACKAGE_REQUIRES "perl >= 5.0, perl-File-Which, perl-File-Listing, perl-File-BaseDir, perl-URI-Encode, file, rocm-core, hipcc") +set(CPACK_RPM_DEV_PACKAGE_REQUIRES "perl >= 5.0, perl-File-Which, perl-File-Listing, file, rocm-core, hipcc") set(CPACK_RPM_DEV_PACKAGE_PROVIDES "hip-base") set(CPACK_RPM_DEV_PACKAGE_OBSOLETES "hip-base")