Adjust script detection rules to work with file >= 5.07 too (RhBug:712251)
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 10 Jun 2011 09:08:45 +0000 (12:08 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 10 Jun 2011 09:11:55 +0000 (12:11 +0300)
- Somewhere between file 5.05 and 5.07 it started adding encoding
  to script descriptions, eg "<mumble> script text executable" became
  "<mumble> script, <encoding> text executable" breaking what had
  been working for 10+ years in the case of old find-requires.
- Permit either comma or space after "script", this works for both
  old and new file.

autodeps/linux.req
fileattrs/script.attr

index cf60bd9..b9a8f99 100644 (file)
@@ -20,10 +20,11 @@ fi
 # --- Grab the file manifest and classify files.
 #filelist=`sed "s/['\"]/\\\&/g"`
 filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
-exelist=`echo $filelist | xargs -r file | grep -Ev ":.* (commands|script) " | \
+exelist=`echo $filelist | xargs -r file | \
+       grep -Ev ":.* (commands|script)[, ]" | \
        grep ":.*executable" | cut -d: -f1`
 scriptlist=`echo $filelist | xargs -r file | \
-       grep -E ":.* (commands|script) " | cut -d: -f1`
+       grep -E ":.* (commands|script)[, ]" | cut -d: -f1`
 liblist=`echo $filelist | xargs -r file | \
        grep ":.*shared object" | cut -d : -f1`
 
index 13b8ba0..79f4d73 100644 (file)
@@ -1,3 +1,3 @@
 %__script_requires     %{_rpmconfigdir}/script.req
-%__script_magic                ^.* script text.*$
+%__script_magic                ^.* script[, ].*$
 %__script_flags                exeonly