Re: [gentoo-portage-dev] [PATCH] Adjust mangling of "arch" value from scanelf output

2020-12-23 Thread Zac Medico
On 12/23/20 7:34 PM, Mike Gilbert wrote:
> scanelf may generate output that looks like this:
> 
> ```
> UNKNOWN_TYPE;lib/firmware/ath10k/WCN3990/hw1.0/wlanmdsp.mbn;;  -  ;
> EM_ARM;lib/firmware/mediatek/mt8183/scp.img;;  -  ;
> ...
> ```
> 
> Previously, we removed the first 3 characters of the first field and
> stored this as the "arch" in NEEDED.ELF.2. This unintentionally
> changes "UNKNOWN_TYPE" to "NOWN_TYPE".
> 
> Instead, let's just remove the string "EM_" from the front.
> 
> Signed-off-by: Mike Gilbert 
> ---
>  bin/misc-functions.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
> index c2a16cbe0..d7009d7eb 100755
> --- a/bin/misc-functions.sh
> +++ b/bin/misc-functions.sh
> @@ -194,7 +194,7 @@ install_qa_check() {
>   fi
>  
>   echo "${obj} ${needed}" >> 
> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
> - echo "${arch:3};${obj};${soname};${rpath};${needed}" >> 
> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
> + echo "${arch#EM_};${obj};${soname};${rpath};${needed}" 
> >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
>   done }
>  
>   [ -n "${QA_SONAME_NO_SYMLINK}" ] && \
> 

Look good. This won't cause any problems for portage since these files
are outside of the known multilib categories.
-- 
Thanks,
Zac





signature.asc
Description: OpenPGP digital signature


[gentoo-portage-dev] Re: [RFC PATCH gentoolkit] bin: Add merge-driver-ekeyword

2020-12-23 Thread Matt Turner
On Wed, Dec 23, 2020 at 2:46 PM Junio C Hamano  wrote:
>
> Matt Turner  writes:
>
> > I want to handle conflicts automatically on lines like
> >
> >> KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv 
> >> ~s390 ~sparc ~x86"
> >
> > where conflicts frequently happen by adding/removing ~ before the
> > architecture names or adding/removing whole architectures. I don't
> > know if I should use a custom git merge driver or a custom git merge
> > strategy.
>
> A merge strategy is about how the changes at the tree level are
> handled.  A merge driver is given three blobs (original, your
> version, and their version) and comes up with a merged blob.
>
> In your case, you'd want a custom merge driver if you want to handle
> word changes on a single line, because the default text merge driver
> is pretty much line oriented.

Thanks, that makes sense. The merge driver I've written seems to work
great for handling the KEYWORDS=... line.

If users could more simply opt into using it (e.g., on the command
line rather than enabling it via ~/.gitattributes) I think it would be
fine to use. Better yet, is there a way git can be configured to
fallback to another merge driver if the first returns a non-zero
status due to unresolved conflicts? For example, if there are changes
to other lines, how can I fall back to another merge driver?

Thank you for your advice!



[gentoo-portage-dev] [PATCH] Adjust mangling of "arch" value from scanelf output

2020-12-23 Thread Mike Gilbert
scanelf may generate output that looks like this:

```
UNKNOWN_TYPE;lib/firmware/ath10k/WCN3990/hw1.0/wlanmdsp.mbn;;  -  ;
EM_ARM;lib/firmware/mediatek/mt8183/scp.img;;  -  ;
...
```

Previously, we removed the first 3 characters of the first field and
stored this as the "arch" in NEEDED.ELF.2. This unintentionally
changes "UNKNOWN_TYPE" to "NOWN_TYPE".

Instead, let's just remove the string "EM_" from the front.

Signed-off-by: Mike Gilbert 
---
 bin/misc-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index c2a16cbe0..d7009d7eb 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -194,7 +194,7 @@ install_qa_check() {
fi
 
echo "${obj} ${needed}" >> 
"${PORTAGE_BUILDDIR}"/build-info/NEEDED
-   echo "${arch:3};${obj};${soname};${rpath};${needed}" >> 
"${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
+   echo "${arch#EM_};${obj};${soname};${rpath};${needed}" 
>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
done }
 
[ -n "${QA_SONAME_NO_SYMLINK}" ] && \
-- 
2.30.0.rc1