#!/bin/sh -ef export LC_ALL=C while getopts h opt; do case "$opt" in h) pod2usage --exit=0 "$0"; exit 0 ;; *) pod2usage --exit=2 "$0"; exit 2 ;; esac done shift "$((OPTIND-1))" if [ $# -lt 2 ]; then echo "${0##*/}: not enough arguments" >&2 pod2usage --exit=2 "$0"; exit 2 fi atexit() { local rc=$? trap - EXIT chmod -Rf u+rwX "$tmpdir" rm -rf "$tmpdir" exit $rc } tmpdir="$(mktemp -d -t "${0##*/}.XXXXXXXX")" trap atexit EXIT HUP INT QUIT PIPE TERM rpm2cpio "$1" |(cd "$tmpdir"; fakeroot -s .fakedata -- \ cpio -idmu --quiet --no-absolute-filenames) || exit 2 shift cd "$tmpdir" fakeroot -i .fakedata -- "$@" || exit 1 : <<'__EOF__' =head1 NAME rpmpeek - execute command within RPM contents =head1 SYNOPSIS B [B<-h>] I [I...] =head1 AUTHOR Written by Alexey Tourbin . =head1 COPYING Copyright (c) 2005 Alexey Tourbin, ALT Linux Team. This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. =head1 SEE ALSO rpm(8), rpm2cpio(8), fakeroot(1) =cut __EOF__