File: perl.prov.files

package info (click to toggle)
libb-perlreq-perl 0.82-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 700 kB
  • ctags: 909
  • sloc: perl: 1,090; sh: 69; makefile: 11
file content (37 lines) | stat: -rwxr-xr-x 1,014 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh -efu
#
# Copyright (c) 2007 Alexey Tourbin, ALT Linux Team.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This is /usr/lib/rpm/find-provides filter.  It reads << file -NF$'\t' >>
# output and decides which files should be processed with perl.prov.
#

while IFS=$'\t' read -r f t; do
	case "$f" in
		*/auto/share/dist/*) continue ;;
		*/auto/share/module/*) continue ;;
	esac
	case "$f" in
		*.pm | *.pl | *.ph ) ;;
		*) continue ;;
	esac
	case "$t" in
		*" text"*)
			echo "$f" ;;
		# file(1) check for text files is not quite reliable
		# I use perl for '-T $f' heuristic check (see perlfunc for details)
		*)
			if perl -e '$f=shift; exit( -T $f ? 0 : 1 )' "$f"; then
				echo "${0##*/}: $f: $t (PASS)" >&2
				echo "$f"
			else
				echo "${0##*/}: $f: $t (IGNORE)" >&2
			fi
			;;
	esac
done