gstreamer1-plugins-bad-free/gst-p-bad-cleanup.sh

198 lines
2.6 KiB
Bash
Raw Normal View History

2012-08-20 16:09:17 +00:00
#!/bin/sh
# Process a gst-plugins-bad tarball to remove
# unwanted GStreamer plugins.
#
# See https://bugzilla.redhat.com/show_bug.cgi?id=532470
# for details
#
# Bastien Nocera <bnocera@redhat.com> - 2010
#
SOURCE="$1"
NEW_SOURCE=`echo $SOURCE | sed 's/bad-/bad-free-/'`
DIRECTORY=`echo $SOURCE | sed 's/\.tar\.xz//'`
ALLOWED="
aacparse
2013-07-12 17:34:29 +00:00
accurip
2012-08-20 16:09:17 +00:00
adpcmdec
adpcmenc
aiff
aiffparse
amrparse
asfmux
2017-01-13 14:15:50 +00:00
audiobuffersplit
2013-07-12 17:34:29 +00:00
audiofxbad
2018-03-05 12:03:44 +00:00
audiolatency
2014-07-11 15:34:31 +00:00
audiomixer
2017-02-24 19:41:51 +00:00
audiomixmatrix
2012-08-20 16:09:17 +00:00
audioparsers
audiovisualizers
autoconvert
bayer
camerabin
camerabin2
cdxaparse
2021-06-04 10:02:28 +00:00
codecalpha
2023-01-23 10:18:37 +00:00
codectimestamper
2012-08-20 16:09:17 +00:00
coloreffects
colorspace
2014-07-11 15:34:31 +00:00
compositor
2012-08-20 16:09:17 +00:00
dataurisrc
dccp
debugutils
dtmf
2020-06-22 14:57:00 +00:00
dvbsubenc
2023-12-20 22:57:09 +00:00
dvbsuboverlay
2012-08-20 16:09:17 +00:00
faceoverlay
festival
fieldanalysis
freeverb
freeze
frei0r
gaudieffects
2012-09-14 16:03:51 +00:00
gdp
2012-08-20 16:09:17 +00:00
geometrictransform
h264parse
hdvparse
hls
id3tag
inter
interlace
invtelecine
ivfparse
2013-07-12 17:34:29 +00:00
ivtc
2012-08-20 16:09:17 +00:00
jpegformat
jp2kdecimator
legacyresample
librfb
liveadder
2013-07-12 17:34:29 +00:00
midi
2012-08-20 16:09:17 +00:00
mve
mpegdemux
mpeg4videoparse
mpegpsmux
mpegtsdemux
mpegtsmux
mpegvideoparse
mxf
2016-02-19 16:07:23 +00:00
netsim
2012-08-20 16:09:17 +00:00
nsf
nuvdemux
2015-06-08 15:45:24 +00:00
onvif
openh264
2012-08-20 16:09:17 +00:00
patchdetect
pcapparse
pnm
proxy
2012-08-20 16:09:17 +00:00
qtmux
rawparse
removesilence
2020-06-22 14:57:00 +00:00
rist
rtmp2
2015-06-08 15:45:24 +00:00
rtp
2012-08-20 16:09:17 +00:00
rtpmux
rtpvp8
scaletempo
sdi
sdp
segmentclip
selector
2023-12-20 22:57:09 +00:00
siren
2012-08-20 16:09:17 +00:00
smooth
speed
stereo
subenc
2020-06-22 14:57:00 +00:00
switchbin
2016-09-01 14:24:39 +00:00
timecode
2020-06-22 14:57:00 +00:00
transcode
2012-08-20 16:09:17 +00:00
tta
valve
videofilters
2016-01-05 11:35:59 +00:00
videoframe_audiolevel
2012-08-20 16:09:17 +00:00
videomaxrate
videomeasure
videoparsers
videosignal
vmnc
2013-07-12 17:34:29 +00:00
yadif
2012-08-20 16:09:17 +00:00
y4m
"
NOT_ALLOWED="
dvdspu
"
error()
{
MESSAGE=$1
echo $MESSAGE
exit 1
}
check_allowed()
{
MODULE=$1
for i in $ALLOWED ; do
if test x$MODULE = x$i ; then
return 0;
fi
done
# Ignore errors coming from ext/ directory
# they require external libraries so are ineffective anyway
return 1;
}
check_not_allowed()
{
MODULE=$1
for i in $NOT_ALLOWED ; do
if test x$MODULE = x$i ; then
return 0;
fi
done
return 1;
}
rm -rf $DIRECTORY
tar xJf $SOURCE || error "Cannot unpack $SOURCE"
pushd $DIRECTORY > /dev/null || error "Cannot open directory \"$DIRECTORY\""
unknown=""
for subdir in gst ext sys; do
for dir in $subdir/* ; do
# Don't touch non-directories
if ! [ -d $dir ] ; then
continue;
fi
MODULE=`basename $dir`
if ( check_not_allowed $MODULE ) ; then
echo "**** Removing $MODULE ****"
echo "Removing directory $dir"
rm -r $dir || error "Cannot remove $dir"
echo
elif test $subdir = ext || test $subdir = sys; then
# Ignore library or system non-blacklisted plugins
continue;
elif ! ( check_allowed $MODULE ) ; then
echo "Unknown module in $dir"
unknown="$unknown $dir"
fi
done
done
echo
if test "x$unknown" != "x"; then
echo -n "Aborting due to unkown modules: "
echo "$unknown" | sed "s/ /\n /g"
exit 1
fi
popd > /dev/null
tar cJf $NEW_SOURCE $DIRECTORY
echo "$NEW_SOURCE is ready to use"