#163 brp-mangle-shebangs: also mangle shebangs of JavaScript executables
Merged 2 years ago by churchyard. Opened 2 years ago by churchyard.
rpms/ churchyard/redhat-rpm-config javascript-shebangs  into  rawhide

file modified
+1 -1
@@ -76,7 +76,7 @@ 

  # (Take care to exclude filenames which would mangle "file" output).

  find -executable -type f ! -path '*:*' ! -path $'*\n*' \

  | file -N --mime-type -f - \

- | grep -P ".+(?=: text/)" \

+ | grep -P ".+(?=: (text/|application/javascript))" \

  | {

  fail=0

  while IFS= read -r line; do

file modified
+5 -1
@@ -6,7 +6,7 @@ 

  

  Summary: Red Hat specific rpm configuration files

  Name: redhat-rpm-config

- Version: 205

+ Version: 206

  Release: 1%{?dist}

  # No version specified.

  License: GPL+
@@ -190,6 +190,10 @@ 

  %doc buildflags.md

  

  %changelog

+ * Tue Dec 07 2021 Miro Hrončok <mhroncok@redhat.com> - 206-1

+ - brp-mangle-shebangs: also mangle shebangs of JavaScript executables

+ - Fixes: rhbz#1998924

+ 

  * Thu Nov 18 2021 Michal Domonkos <mdomonko@redhat.com> - 205-1

  - Drop kernel-rpm-macros subpackage & kmod.attr (new home: kernel-srpm-macros)

  

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1998924

Unfortunately, the MIME type of JavaScript executables is not text/... but
application/javascript. See RFC 4329.

After considering various approaches to fix this problem, including:

1) limiting the number of characters file reads
2) using eu-elfclassify instead of file

This seems like the most sensible approach to fix this one particular problem.
If more instances are found problematic in the future, we'll keep adding the
MIME types.

See the linked bugzilla, the eu-elfclassify pull request 1,
and the devel mailing list thread 2 for details about this problem and
the considered solutions.

Note that I wanted to test this but apparently, on rawhide, Javascript is no longer reported as application/javascript but rather text/plain. I'd like to check if that is a deliberate change or a regression before merging this.

Build succeeded.

rebased onto faf5c36

2 years ago

Build succeeded.

+1 (but I'm away today and can't do a build).

Pull-Request has been merged by churchyard

2 years ago