Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../lib/rpm
File: ocaml-find-provides.sh
#!/bin/sh -
[0] Fix | Delete
# OCaml-specific "find-provides" for RPM.
[1] Fix | Delete
# By Richard W.M. Jones <rjones@redhat.com>
[2] Fix | Delete
# $Id: ocaml-find-provides.sh,v 1.2 2007/09/06 11:49:59 rjones Exp $
[3] Fix | Delete
[4] Fix | Delete
#set -x
[5] Fix | Delete
[6] Fix | Delete
# Usage:
[7] Fix | Delete
# (1) If you don't want the module to depend on the exact compiler
[8] Fix | Delete
# version then use ocaml-find-requires.sh -c, but this is not something
[9] Fix | Delete
# you should do normally.
[10] Fix | Delete
#
[11] Fix | Delete
# (2) For any modules which you want to ignore, use '-i Modulename'.
[12] Fix | Delete
[13] Fix | Delete
OCAMLOBJINFO=ocamlobjinfo
[14] Fix | Delete
TEMP=`getopt -o i:f: -n ocaml-find-provides.sh -- "$@"`
[15] Fix | Delete
if [ $? != 0 ]; then echo "ocaml-find-provides.sh: failed" >&2; exit 1; fi
[16] Fix | Delete
eval set -- "$TEMP"
[17] Fix | Delete
[18] Fix | Delete
ignore_modules=nOTREAL
[19] Fix | Delete
[20] Fix | Delete
while true; do
[21] Fix | Delete
case "$1" in
[22] Fix | Delete
-i) ignore_modules="$2 $ignore_modules"; shift 2;;
[23] Fix | Delete
-f) OCAMLOBJINFO="$2"; shift 2;;
[24] Fix | Delete
--) shift; break;;
[25] Fix | Delete
*) echo "ocaml-find-provides.sh: option error at $1"; exit 1;;
[26] Fix | Delete
esac
[27] Fix | Delete
done
[28] Fix | Delete
[29] Fix | Delete
# Get the list of files.
[30] Fix | Delete
files=`sed "s/['\"]/\\\&/g"`
[31] Fix | Delete
[32] Fix | Delete
# Get list of .cmi, .cmo and .cma files.
[33] Fix | Delete
files=`echo $files | tr '[:blank:]' '\n' | grep '\.cm[ioa]$'`
[34] Fix | Delete
[35] Fix | Delete
if [ -z "$files" ]; then exit 0; fi
[36] Fix | Delete
[37] Fix | Delete
# Get the list of modules exported by the files.
[38] Fix | Delete
modules=`$OCAMLOBJINFO $files |
[39] Fix | Delete
grep -E '(Unit|Module) name: ' |
[40] Fix | Delete
awk '{print $3}'`
[41] Fix | Delete
[42] Fix | Delete
# Turn list of modules into a regexp that matches the module names.
[43] Fix | Delete
modules_re=`echo $modules | sed 's/ /|/g'`
[44] Fix | Delete
ignore_modules_re=`echo $ignore_modules | sed 's/ /|/g'`
[45] Fix | Delete
[46] Fix | Delete
# Get a list of the modules these file(s) provide.
[47] Fix | Delete
$OCAMLOBJINFO $files |
[48] Fix | Delete
grep -Eo '[0-9a-f]{32}[[:space:]]+[A-Za-z0-9_]+' |
[49] Fix | Delete
grep -E '[0-9a-f]{32}[[:space:]]+'"($modules_re)\$" |
[50] Fix | Delete
while read md5sum module; do
[51] Fix | Delete
echo "ocaml($module) = $md5sum"
[52] Fix | Delete
done |
[53] Fix | Delete
grep -Ev "$ignore_modules_re" |
[54] Fix | Delete
sort -u
[55] Fix | Delete
[56] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function