pck-update: fix the unpackaged files list issues (x86_64 only)

conf/04-rpmbuild-format-unpackaged-filelist.conf
Split the translation rules for the unpackaged files into a common block
('format_unpackaged_file_list_common') and an architecture-specific file
per supported architecture (currently 'i586' and 'x86_64').
This solves the problem of some wrongly filenames reported by autospec
when running on the x86_64 architecture.

The translation rules for Python 2.7 and Python 3 have been updated
to reflect the current support for Python in openmamba.

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2014-08-13 20:54:02 +02:00
parent b767938678
commit d4e5b9a752
3 changed files with 44 additions and 10 deletions

View File

@ -1,22 +1,18 @@
## unpackaged file list conversion --------------------------------------------
format_unpackaged_file_list="\
# translations for python packages
s,^/usr/lib/python2.6/site-packages,%{python_sitearch},
format_unpackaged_file_list_common="\
# python
s,^/usr/include/python3.3m,%{python3_inc},
# generic translations
s,^/usr/bin,%{_bindir},
s,^/usr/sbin,%{_sbindir},
s,^/usr/libexec,%{_libexecdir},
s,^/usr/lib,%{_libdir},
s,^/usr/share/info,%{_infodir},
s,^/usr/share/man,%{_mandir},
s,^/usr/share,%{_datadir},
s,^/usr/include,%{_includedir},
s,^/etc,%{_sysconfdir},
s,^/lib,/%{_lib},
s,^/lib64,/%{_lib},
s,^/var,%{_localstatedir},
# translations for kde4 packages
# kde4
s,^/etc/opt/kde,%{_kde4_sysconfdir},
s,^/opt/kde/bin,%{_kde4_bindir},
s,^/opt/kde/sbin,%{_kde4_sbindir},
@ -45,3 +41,31 @@ s,^/opt/kde/share/sounds,%{_kde4_soundsdir},
s,^/opt/kde/share/templates,%{_kde4_templatesdir},
s,^/opt/kde/share/wallpapers,%{_kde4_wallpaperdir},
s,^/opt/kde/share,%{_kde4_sharedir},"
## lines which are (target) architecture specific
### i586
format_unpackaged_file_list_i586="\
# python
s,^/usr/lib/python2.7/site-packages,%{python27_sitearch},
s,^/usr/lib/python3.3/site-packages,%{python3_sitearch},
# libraries
s,^/usr/libexec,%{_libexecdir},
s,^/usr/lib,%{_libdir},
s,^/lib,/%{_lib},"
### arm
format_unpackaged_file_list_arm="$format_unpackaged_file_list_i586"
### x86_64
format_unpackaged_file_list_x86_64="\
# python
s,^/usr/lib64/python2.7/site-packages,%{python27_sitearch},
s,^/usr/lib/python2.7/site-packages,%{python27_sitelib},
s,^/usr/lib64/python3.3/site-packages,%{python3_sitearch},
# libraries
s,^/usr/libexec64,%{_libexecdir},
s,^/usr/libexec,%{_prefix}/libexec,
s,^/usr/lib64,%{_libdir},
s,^/usr/lib,%{_prefix}/lib,
s,^/lib64,/%{_lib},"

View File

@ -1,6 +1,6 @@
#!/bin/bash
# pck-update -- plugin for @package@
# Copyright (C) 2004-2013 Davide Madrisan <davide.madrisan@gmail.com>
# Copyright (C) 2004-2014 Davide Madrisan <davide.madrisan@gmail.com>
[ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 3 ] &&
{ echo $"this script requires bash version 3 or better" >&2 && exit 1; }
@ -2163,6 +2163,12 @@ It seems good but do not forget to run quality and security tests"\
notify.debug "tmpunpackfiles = \`${NOTE}$tmpunpackfiles${NORM}'"
local skipline=1
local format_unpackaged_file_list_arch="\
format_unpackaged_file_list_${target_cpu}"
[ -n "${!format_unpackaged_file_list_arch}" ] ||
notify.warning \
$"no arch-specific pattern translations for unpackaged files"
while read line; do
case "$line" in
"error: Installed (but unpackaged) file(s) found:")
@ -2172,7 +2178,8 @@ It seems good but do not forget to run quality and security tests"\
[ "$skipline" = 1 ] || echo "$line"
done < <(LC_ALL=C eval rpmbuild -bl $rpmbuild_opts --nodeps --nobuild \
$SRPM_SPECFILE_WITH_PATH $USER_RPMDEFINE_OPTS 2>&1) | \
sed -e "$format_unpackaged_file_list" \
sed -e "$format_unpackaged_file_list_common;\
${!format_unpackaged_file_list_arch}" \
> $tmpunpackfiles
if [ -s "$tmpunpackfiles" ]; then

View File

@ -740,6 +740,9 @@ msgid "It seems good but do not forget to run quality and security tests"
msgstr "Sembra ok ma non dimenticare di eseguire i test di qualità e "
"sicurezza"
msgid "no arch-specific pattern translations for unpackaged files"
msgstr "nessuna corrispondenza di pattern legati all'architettura per i file non pacchetizzati"
msgid "Add the following files in the right %files blocks"
msgstr "Smistare i seguenti file nelle sezioni %files corrispondenti"