Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit b857620

Browse files
authored
release: open source extract_so_from_deb (#1475)
1 parent 6a15917 commit b857620

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

extract_so_from_deb.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/sh
2+
#
3+
# Given a deb, extract mod_pagespeed.so and mod_pagespeed_ap24.so. This is
4+
# useful for running load tests on prior releases. The files are left in a temp
5+
# directory, and the path to them is printed to stdout.
6+
7+
set -e # exit script if any command returns an error
8+
set -u # exit the script if any variable is uninitialized
9+
10+
if [ ! $# -eq 1 ]; then
11+
echo "Usage: ./extract_so_from_deb.sh mod-pagespeed-beta_current_amd64.deb"
12+
exit 1
13+
fi
14+
15+
if [ ! -e $1 ]; then
16+
echo "File '$1' not found."
17+
exit 1
18+
fi
19+
20+
input_deb=$(readlink -e $1)
21+
22+
TMP=$(mktemp -d)
23+
cd "$TMP"
24+
mkdir scratch
25+
cd scratch
26+
27+
ar vx "$input_deb" > /dev/null
28+
# all deb files have a data.tar.gz, which is now in the current directory.
29+
tar -x --file=data.tar.gz \
30+
--wildcards ./usr/lib/apache2/modules/mod_pagespeed\*.so
31+
32+
mv usr/lib/apache2/modules/* ..
33+
cd ..
34+
rm -r scratch/
35+
36+
echo "The .so files are:"
37+
for x in $PWD/*; do
38+
echo " $x"
39+
done | sort -r

0 commit comments

Comments
 (0)