mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
jw-pckg: Fix duplicates in compile-templates
Files were listed twice in compile-templates, because apparently, during postinstall, rpm -ql returns the list of a packages files twice. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
1fd318687d
commit
32450c47bf
1 changed files with 12 additions and 5 deletions
|
|
@ -123,12 +123,18 @@ list_projects()
|
|||
sort -u
|
||||
}
|
||||
|
||||
list_files()
|
||||
{
|
||||
# Need to sort -u, because apparently, during installation, rpm -ql
|
||||
# returns every file in the package _twice_. Funny.
|
||||
list_packages "$@" | sort -u | xargs -r rpm -ql
|
||||
}
|
||||
|
||||
cmd_rpmnew()
|
||||
{
|
||||
local file
|
||||
|
||||
list_packages "$@" |
|
||||
xargs -r rpm -ql |
|
||||
list_files "$@" |
|
||||
while read file; do
|
||||
if [ -e "$file.rpmnew" ]; then
|
||||
if diff -q $file $file.rpmnew; then
|
||||
|
|
@ -187,7 +193,8 @@ cmd_list_templates()
|
|||
local ext_from="$template_exts" # TODO: support more than one
|
||||
local ext_from_re=`echo $ext_from | sed 's/\./\\./g'`
|
||||
local f
|
||||
list_packages "$@" | xargs -r rpm -ql | while read f; do
|
||||
|
||||
list_files "$@" | while read f; do
|
||||
[ -f "$f" -o -L "$f" ] || continue
|
||||
echo $f | grep -q "$ext_from_re$" || continue
|
||||
echo $f
|
||||
|
|
@ -198,7 +205,7 @@ cmd_list_template_tables()
|
|||
{
|
||||
local ext_from="$table_exts"
|
||||
local e f t
|
||||
list_packages "$@" | xargs -r rpm -ql | while read f; do
|
||||
list_files "$@" | while read f; do
|
||||
[ -f "$f" -o -L "$f" ] || continue
|
||||
for e in $ext_from; do
|
||||
t="${f%.*}$e"
|
||||
|
|
@ -212,7 +219,7 @@ cmd_list_template_output()
|
|||
{
|
||||
local re=`echo $template_exts | sed 's/\./\\\\./g; s/^ *//; s/ *$//; s/ */$\\\\|/g; s/\(.*\)/\\\\(\1$\\\\)/'`
|
||||
local f
|
||||
list_packages "$@" | xargs -r rpm -ql | sed "/$re/ !d; s/$re//" | while read f; do
|
||||
list_files "$@" | sed "/$re/ !d; s/$re//" | while read f; do
|
||||
[ -f "$f" -o -L "$f" ] || continue
|
||||
echo $f
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue