Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
release: open source extract_so_from_deb (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkaufman committed Jan 11, 2017
1 parent 6a15917 commit b857620
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions extract_so_from_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit b857620

Please sign in to comment.