#!/bin/sh -ef export LC_ALL=C dump_file() { rpm -qp --qf '[%{FILENAMES}\t%{FILEMODES:octal}\n]' "$@" >files if [ -d d ]; then chmod -Rf u+rwX d; rm -rf d; fi rpm2cpio "$@" |(mkdir d; cd d; cpio -idmu --quiet) awk -F'\t' '{printf"d/%s\0",$1}' files |xargs -r0 file -b >types paste files types } dump_dir() { local d="$1"; shift packages "$d" >packages sort -t$'\t' -o packages -u -k1,1 packages mkdir -p c while IFS=$'\t' read p v f _; do b="${f%%.rpm}" [ -f c/"$b" ] || dump_file "$d/$f" >c/"$b" awk -v p="$p" '{print p"\t"$0}' c/"$b" done [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), file(1) =cut __EOF__