forked from apache/incubator-pagespeed-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextract_so_from_deb.sh
More file actions
executable file
·39 lines (31 loc) · 926 Bytes
/
extract_so_from_deb.sh
File metadata and controls
executable file
·39 lines (31 loc) · 926 Bytes
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
38
39
#!/bin/sh
#
# Given a deb, extract mod_pagespeed.so and mod_pagespeed_ap24.so. This is
# useful for running load tests on prior releases. The files are left in a temp
# directory, and the path to them is printed to stdout.
set -e # exit script if any command returns an error
set -u # exit the script if any variable is uninitialized
if [ ! $# -eq 1 ]; then
echo "Usage: ./extract_so_from_deb.sh mod-pagespeed-beta_current_amd64.deb"
exit 1
fi
if [ ! -e $1 ]; then
echo "File '$1' not found."
exit 1
fi
input_deb=$(readlink -e $1)
TMP=$(mktemp -d)
cd "$TMP"
mkdir scratch
cd scratch
ar vx "$input_deb" > /dev/null
# all deb files have a data.tar.gz, which is now in the current directory.
tar -x --file=data.tar.gz \
--wildcards ./usr/lib/apache2/modules/mod_pagespeed\*.so
mv usr/lib/apache2/modules/* ..
cd ..
rm -r scratch/
echo "The .so files are:"
for x in $PWD/*; do
echo " $x"
done | sort -r