From 7eca8827523f39386c528a94fe6ea4f6976889b7 Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Tue, 12 Feb 2019 06:47:45 +0100 Subject: [PATCH 1/3] {pre,post}inst-qa-check.d: Move gnome2_icon_cache_check() from 50gnome2-utils to 50xdg-utils. No changes inside source code of this function. Bug: https://bugs.gentoo.org/677776 Signed-off-by: Arfrever Frehtes Taifersar Arahesis --- bin/postinst-qa-check.d/50gnome2-utils | 54 -------------------------- bin/postinst-qa-check.d/50xdg-utils | 54 ++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/bin/postinst-qa-check.d/50gnome2-utils b/bin/postinst-qa-check.d/50gnome2-utils index 29ea7c844..9a5565ee2 100644 --- a/bin/postinst-qa-check.d/50gnome2-utils +++ b/bin/postinst-qa-check.d/50gnome2-utils @@ -1,61 +1,7 @@ # check for missing calls to gnome2-utils regen functions -gnome2_icon_cache_check() { - type -P gtk-update-icon-cache &>/dev/null || return - - local d f all_files=() missing - for d in usr/share/icons/*/; do - # gnome2_icon_cache_update updates only themes with an index - [[ -f ${d}/index.theme ]] || continue - - local files=() find_args=( - # gtk-update-icon-cache supports only specific file - # suffixes; match that to avoid false positives - '(' -name '*.png' -o -name '*.svg' - -o -name '*.xpm' -o -name '*.icon' ')' - ) - # if the cache does not exist at all, we complain for any file - # otherwise, we look for files newer than the cache - [[ -f ${d}/icon-theme.cache ]] && - find_args+=( -newercm "${d}"/icon-theme.cache ) || missing=1 - - # (use -mindepth 2 to easily skip the cache files) - while read -r -d $'\0' f; do - files+=( "${f}" ) - done < <(find "${d}" -mindepth 2 -type f "${find_args[@]}" -print0) - - # if any files were found, update the db to avoid repeating - # the warning for subsequent packages - if [[ ${files[@]} ]]; then - all_files+=("${files[@]}") - addwrite "${d}" - gtk-update-icon-cache -qf "${d}" - fi - done - - # preinst initializes the baseline state for the posinst check - [[ ${PORTAGE_QA_PHASE} == preinst ]] && return - - # parallel-install makes it impossible to blame a specific package - has parallel-install ${FEATURES} && return - - # avoid false-positives on first install (bug 649464) - [[ ${PN} == gtk-update-icon-cache ]] && return - - # The eqatag call is prohibitively expensive if the cache is - # missing and there are a large number of files. - if [[ -z ${missing} && ${all_files[@]} ]]; then - eqawarn "QA Notice: new icons were found installed but GTK+ icon cache" - eqawarn "has not been updated:" - eqatag -v gnome2-utils.icon-cache "${all_files[@]/#//}" - eqawarn "Please make sure to call gnome2_icon_cache_update()" - eqawarn "in pkg_postinst() and pkg_postrm() phases of appropriate pkgs." - fi -} - gnome2_utils_postinst_check() { cd "${EROOT:-/}" || die - gnome2_icon_cache_check } gnome2_utils_postinst_check diff --git a/bin/postinst-qa-check.d/50xdg-utils b/bin/postinst-qa-check.d/50xdg-utils index b33df4743..9945cc336 100644 --- a/bin/postinst-qa-check.d/50xdg-utils +++ b/bin/postinst-qa-check.d/50xdg-utils @@ -46,6 +46,59 @@ xdg_desktop_database_check() { fi } +gnome2_icon_cache_check() { + type -P gtk-update-icon-cache &>/dev/null || return + + local d f all_files=() missing + for d in usr/share/icons/*/; do + # gnome2_icon_cache_update updates only themes with an index + [[ -f ${d}/index.theme ]] || continue + + local files=() find_args=( + # gtk-update-icon-cache supports only specific file + # suffixes; match that to avoid false positives + '(' -name '*.png' -o -name '*.svg' + -o -name '*.xpm' -o -name '*.icon' ')' + ) + # if the cache does not exist at all, we complain for any file + # otherwise, we look for files newer than the cache + [[ -f ${d}/icon-theme.cache ]] && + find_args+=( -newercm "${d}"/icon-theme.cache ) || missing=1 + + # (use -mindepth 2 to easily skip the cache files) + while read -r -d $'\0' f; do + files+=( "${f}" ) + done < <(find "${d}" -mindepth 2 -type f "${find_args[@]}" -print0) + + # if any files were found, update the db to avoid repeating + # the warning for subsequent packages + if [[ ${files[@]} ]]; then + all_files+=("${files[@]}") + addwrite "${d}" + gtk-update-icon-cache -qf "${d}" + fi + done + + # preinst initializes the baseline state for the posinst check + [[ ${PORTAGE_QA_PHASE} == preinst ]] && return + + # parallel-install makes it impossible to blame a specific package + has parallel-install ${FEATURES} && return + + # avoid false-positives on first install (bug 649464) + [[ ${PN} == gtk-update-icon-cache ]] && return + + # The eqatag call is prohibitively expensive if the cache is + # missing and there are a large number of files. + if [[ -z ${missing} && ${all_files[@]} ]]; then + eqawarn "QA Notice: new icons were found installed but GTK+ icon cache" + eqawarn "has not been updated:" + eqatag -v gnome2-utils.icon-cache "${all_files[@]/#//}" + eqawarn "Please make sure to call gnome2_icon_cache_update()" + eqawarn "in pkg_postinst() and pkg_postrm() phases of appropriate pkgs." + fi +} + xdg_mimeinfo_database_check() { type -P update-mime-database &>/dev/null || return @@ -92,6 +145,7 @@ xdg_mimeinfo_database_check() { xdg_utils_postinst_check() { cd "${EROOT:-/}" || die xdg_desktop_database_check + gnome2_icon_cache_check xdg_mimeinfo_database_check } -- 2.20.1 From 3a9cb14f099642e4d985607d3be703f2078fa518 Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Tue, 12 Feb 2019 06:56:50 +0100 Subject: [PATCH 2/3] {pre,post}inst-qa-check.d/50xdg-utils: gnome2_icon_cache_update -> xdg_icon_cache_update Bug: https://bugs.gentoo.org/677776 Signed-off-by: Arfrever Frehtes Taifersar Arahesis --- bin/postinst-qa-check.d/50xdg-utils | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/postinst-qa-check.d/50xdg-utils b/bin/postinst-qa-check.d/50xdg-utils index 9945cc336..9a7c036e6 100644 --- a/bin/postinst-qa-check.d/50xdg-utils +++ b/bin/postinst-qa-check.d/50xdg-utils @@ -46,12 +46,12 @@ xdg_desktop_database_check() { fi } -gnome2_icon_cache_check() { +xdg_icon_cache_check() { type -P gtk-update-icon-cache &>/dev/null || return local d f all_files=() missing for d in usr/share/icons/*/; do - # gnome2_icon_cache_update updates only themes with an index + # xdg_icon_cache_update updates only themes with an index [[ -f ${d}/index.theme ]] || continue local files=() find_args=( @@ -91,10 +91,10 @@ gnome2_icon_cache_check() { # The eqatag call is prohibitively expensive if the cache is # missing and there are a large number of files. if [[ -z ${missing} && ${all_files[@]} ]]; then - eqawarn "QA Notice: new icons were found installed but GTK+ icon cache" + eqawarn "QA Notice: new icons were found installed but icon cache" eqawarn "has not been updated:" - eqatag -v gnome2-utils.icon-cache "${all_files[@]/#//}" - eqawarn "Please make sure to call gnome2_icon_cache_update()" + eqatag -v xdg-utils.icon-cache "${all_files[@]/#//}" + eqawarn "Please make sure to call xdg_icon_cache_update()" eqawarn "in pkg_postinst() and pkg_postrm() phases of appropriate pkgs." fi } @@ -145,7 +145,7 @@ xdg_mimeinfo_database_check() { xdg_utils_postinst_check() { cd "${EROOT:-/}" || die xdg_desktop_database_check - gnome2_icon_cache_check + xdg_icon_cache_check xdg_mimeinfo_database_check } -- 2.20.1 From 091f99e0960e632ee93f6656802f17a9d542741d Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Tue, 12 Feb 2019 06:59:40 +0100 Subject: [PATCH 3/3] {pre,post}inst-qa-check.d/50gnome2-utils: Delete obsolete files. Bug: https://bugs.gentoo.org/677776 Signed-off-by: Arfrever Frehtes Taifersar Arahesis --- bin/postinst-qa-check.d/50gnome2-utils | 10 ---------- bin/preinst-qa-check.d/50gnome2-utils | 1 - 2 files changed, 11 deletions(-) delete mode 100644 bin/postinst-qa-check.d/50gnome2-utils delete mode 120000 bin/preinst-qa-check.d/50gnome2-utils diff --git a/bin/postinst-qa-check.d/50gnome2-utils b/bin/postinst-qa-check.d/50gnome2-utils deleted file mode 100644 index 9a5565ee2..000000000 --- a/bin/postinst-qa-check.d/50gnome2-utils +++ /dev/null @@ -1,10 +0,0 @@ -# check for missing calls to gnome2-utils regen functions - -gnome2_utils_postinst_check() { - cd "${EROOT:-/}" || die -} - -gnome2_utils_postinst_check -: # guarantee successful exit - -# vim:ft=sh diff --git a/bin/preinst-qa-check.d/50gnome2-utils b/bin/preinst-qa-check.d/50gnome2-utils deleted file mode 120000 index ee57f814d..000000000 --- a/bin/preinst-qa-check.d/50gnome2-utils +++ /dev/null @@ -1 +0,0 @@ -../postinst-qa-check.d/50gnome2-utils \ No newline at end of file -- 2.20.1