mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-22 14:10:39 +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
|
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()
|
cmd_rpmnew()
|
||||||
{
|
{
|
||||||
local file
|
local file
|
||||||
|
|
||||||
list_packages "$@" |
|
list_files "$@" |
|
||||||
xargs -r rpm -ql |
|
|
||||||
while read file; do
|
while read file; do
|
||||||
if [ -e "$file.rpmnew" ]; then
|
if [ -e "$file.rpmnew" ]; then
|
||||||
if diff -q $file $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="$template_exts" # TODO: support more than one
|
||||||
local ext_from_re=`echo $ext_from | sed 's/\./\\./g'`
|
local ext_from_re=`echo $ext_from | sed 's/\./\\./g'`
|
||||||
local f
|
local f
|
||||||
list_packages "$@" | xargs -r rpm -ql | while read f; do
|
|
||||||
|
list_files "$@" | while read f; do
|
||||||
[ -f "$f" -o -L "$f" ] || continue
|
[ -f "$f" -o -L "$f" ] || continue
|
||||||
echo $f | grep -q "$ext_from_re$" || continue
|
echo $f | grep -q "$ext_from_re$" || continue
|
||||||
echo $f
|
echo $f
|
||||||
|
|
@ -198,7 +205,7 @@ cmd_list_template_tables()
|
||||||
{
|
{
|
||||||
local ext_from="$table_exts"
|
local ext_from="$table_exts"
|
||||||
local e f t
|
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
|
[ -f "$f" -o -L "$f" ] || continue
|
||||||
for e in $ext_from; do
|
for e in $ext_from; do
|
||||||
t="${f%.*}$e"
|
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 re=`echo $template_exts | sed 's/\./\\\\./g; s/^ *//; s/ *$//; s/ */$\\\\|/g; s/\(.*\)/\\\\(\1$\\\\)/'`
|
||||||
local f
|
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
|
[ -f "$f" -o -L "$f" ] || continue
|
||||||
echo $f
|
echo $f
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue