????

Your IP : 18.222.110.5


Current Path : /proc/324102/root/usr/bin/
Upload File :
Current File : //proc/324102/root/usr/bin/rpmdev-cksum

#!/bin/sh

# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#               2008-2009 Ville Skyttä <ville.skytta@iki.fi>
#  
# This program 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; version 2 of the License.
#  
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#  
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

name="$(basename $0)"
csum="${name##rpmdev-}"
csum="${csum%%sum}"

while test "$1"; do
    case "$1" in
	--help)		echo $"Usage: $name <archive-file>"; exit 0;;
	--version)	echo $"$name 0.8"; exit 0;;
	--)		shift; break;;
	*)		break
    esac
    shift
done

test "$1" || {
    echo $"No package file specified; use '--help' for more information"
    exit 1
}


unset CDPATH
tmp=`mktemp -d ${TMPDIR:-/tmp}/"$name.XXXXXX"`
trap "rm -rf '$tmp'" EXIT

cd -- `dirname -- "$1"`
dir=`pwd`
file=`basename -- "$1"`
"${csum}sum" -- "$file"

cd "$tmp"
rpmdev-extract -q "$dir/$file"
find . -type f -print0 | xargs -0r "${csum}sum" | sed -e 's|\(\s\)./[^/]*/|\1|'