[devel] [PATCH] gb-task-check-noarch-i: check package scriptlets

Vladimir D. Seleznev vseleznv на altlinux.org
Вт Июл 21 15:42:06 MSK 2020


On Tue, Jul 21, 2020 at 03:40:24PM +0300, Vladimir D. Seleznev wrote:
> noarch packages should have equal scriptlets across all arches.
> New function dump_scriptlets() prints content of RPM package scriptlets.
> 
> * dump_scriptlets(): New function.
> * dump_noarch(): Use dump_scriptlets().
> * dump_arch(): Use dump_scriptlets().
> 
> Reported-by: Ivan Zakharyaschev <imz на altlinux.org>
> ---
>  gb/gb-task-check-noarch-i | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/gb/gb-task-check-noarch-i b/gb/gb-task-check-noarch-i
> index 2e38b6c..05ade0c 100755
> --- a/gb/gb-task-check-noarch-i
> +++ b/gb/gb-task-check-noarch-i
> @@ -79,10 +79,26 @@ dump_deps()
>  	rpmquery --qf "$R$P$O$C" -p "$1"
>  }
>  
> +dump_scriptlets()
> +{
> +	for rpmtag in POSTIN POSTINPROG \
> +		      POSTUN POSTUNPROG \
> +		      PREIN PREINPROG \
> +		      PREUN PREUNPROG \
> +		      TRIGGERSCRIPTS TRIGGERSCRIPTPROG \
> +		      VERIFYSCRIPT VERIFYSCRIPTPROG
> +		do
> +		# print nicely formated scriptlet
> +		rpmquery --qf "%{$rpmtag}\n" -p "$1" |sed '=' |
> +			sed "s,^,${rpmtag}:,;N;s,\n, ,"
> +	done
> +}
> +
>  dump_noarch()
>  {
>  	dump_rpmfile "$1"
>  	dump_deps "$1"
> +	dump_scriptlets "$1"
>  }
>  
>  set -- $GB_ARCH
> @@ -176,6 +192,7 @@ dump_arch()
>  	rpmquery --qf "$F" -p "$1" |
>  		LC_ALL=C grep -v '^/usr/share/' || [ $? -eq 1 ]
>  	dump_deps "$1"
> +	dump_scriptlets "$1"
>  }
>  
>  srcN=
> -- 
> 2.25.4
> 

Результаты rpm, который используется на сборочнице:

# rpmquery --querytags |grep 'PROG$' |wc
      6       6      77

-- 
   WBR,
   Vladimir D. Seleznev


Подробная информация о списке рассылки Devel