Re: [Rpm-maint] [PATCH] tests/tpmbuild.at: Make file sed regexp more strict to extract BuildID.

2017-03-04 Thread Igor Gnatenko
On Fri, 2017-03-03 at 23:51 +0100, Mark Wielaard wrote:
> From: Mark Wielaard 
> 
> In some testcases we extract the BuildID with the file command.
> Unfortunately the file command output changed slightly between
> versions.
> Make the sed regexp more strict by only matching a hex-string.
> Also properly "escape" [ and ] which inside an AT_CHECK should be [[
> and ]].
> 
> Tested against file versions 5.11, 5.29 and 5.30.
> 
> Signed-off-by: Mark Wielaard 
Tested-by: Igor Gnatenko 
> ---
>  tests/rpmbuild.at | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
> index 0a2c01e..1c18740 100644
> --- a/tests/rpmbuild.at
> +++ b/tests/rpmbuild.at
> @@ -422,11 +422,11 @@ hello2_file=./usr/local/bin/hello2
>  test -f $hello_file || echo "no hello file: $hello_file"
>  test -f $hello2_file || echo "no hello2 file: $hello2_file"
>  
> -id1=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
> -id2=$(file $hello2_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
> -id1debug=$(file $hello_file_debug | sed 's/.*,
> BuildID[.*]=\(.*\),.*/\1/')
> -id2debug=$(file $hello2_file_debug | sed 's/.*,
> BuildID[.*]=\(.*\),.*/\1/')
> -idmulti=$(file $hello_multi_file | sed 's/.*,
> BuildID[.*]=\(.*\),.*/\1/')
> +id1=$(file $hello_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-
> f]]*\),.*/\1/')
> +id2=$(file $hello2_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-
> f]]*\),.*/\1/')
> +id1debug=$(file $hello_file_debug | sed 's/.*,
> BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
> +id2debug=$(file $hello2_file_debug | sed 's/.*,
> BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
> +idmulti=$(file $hello_multi_file | sed 's/.*, BuildID\[[.*\]]=\([[0-
> 9a-f]]*\),.*/\1/')
>  
>  test "$id1" = "$id1debug" || echo "id1: $id1 != id1debug: $id1debug"
>  test "$id2" = "$id2debug" || echo "id2: $id2 != id2debug: $id2debug"
> @@ -515,11 +515,11 @@ hello2_file=./usr/local/bin/hello2
>  test -f $hello_file || echo "no hello file: $hello_file"
>  test -f $hello2_file || echo "no hello2 file: $hello2_file"
>  
> -id1=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
> -id2=$(file $hello2_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
> -id1debug=$(file $hello_file_debug | sed 's/.*,
> BuildID[.*]=\(.*\),.*/\1/')
> -id2debug=$(file $hello2_file_debug | sed 's/.*,
> BuildID[.*]=\(.*\),.*/\1/')
> -idmulti=$(file $hello_multi_file | sed 's/.*,
> BuildID[.*]=\(.*\),.*/\1/')
> +id1=$(file $hello_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-
> f]]*\),.*/\1/')
> +id2=$(file $hello2_file | sed 's/.*, BuildID\[[.*\]]=\([[0-9a-
> f]]*\),.*/\1/')
> +id1debug=$(file $hello_file_debug | sed 's/.*,
> BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
> +id2debug=$(file $hello2_file_debug | sed 's/.*,
> BuildID\[[.*\]]=\([[0-9a-f]]*\),.*/\1/')
> +idmulti=$(file $hello_multi_file | sed 's/.*, BuildID\[[.*\]]=\([[0-
> 9a-f]]*\),.*/\1/')
>  
>  test "$id1" = "$id1debug" || echo "id1: $id1 != id1debug: $id1debug"
>  test "$id2" = "$id2debug" || echo "id2: $id2 != id2debug: $id2debug"

-- 
-Igor Gnatenko

signature.asc
Description: This is a digitally signed message part
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [PATCH] debugedit: Support String/Line table rewriting for larger/smaller paths.

2017-03-04 Thread Panu Matilainen

On 02/27/2017 05:28 PM, Mark Wielaard wrote:

From: Mark Wielaard 

debugedit --base to --dest rewriting of debug source file paths only
supported dest paths that were smaller or equal than the base path
(and the size should differ more than 1 character for correct debug lines).
All paths were changed "in place". Which could in theory mess up debug str
sharing.

This rewrite supports base and dest strings of any size (some limitations,
see below). This is done by reconstructing the debug_str and debug_line
tables and updating the references in the debug_info attributes pointing
to these tables. Plus, if necessary (only for ET_REL kernel modules),
updating any relocations for the debug_info and debug_line sections.

This has the nice benefit of merging any duplicate strings in the
debug_str table which might resulting on slightly smaller files.
kernel modules are ET_REL files that often contain a lot of duplicate
strings.

The rewrite uses elfutils (either libebl or libdw) to reconstruct the
debug_str table. Since we are changing some section sizes now we cannot
just use mmap and rawdata to poke the values, but need to read in and
write out the changed sections. This does take a bit more memory because
we now also need to keep track of all string/line references.


I dont feel qualified to really review this, and perhaps others are 
feeling the same way since it's been out there for a week now with no 
comments at all.


Because this seems quite awesome (even if also a bit scary), to avoid 
stalling forever with no-one to review it: if there are no objections 
raised by Monday I'm going to just apply it (and the couple of other 
recent debuginfo patches). So anybody having doubts, speak up now.


- Panu -
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint