[PATCH v2 0/2] range-diff v1/v2

Lukas Schmelting <[email protected]>
Newsgroups gmane.linux.gentoo.devel
Message-ID <[email protected]>
> This command does not actually reload anything; it updates /etc/udev/hwdb.bin.
> 
> Please rename the function to udev_hwdb_update instead.
> 
> Also remove the /run/udev check; that's not needed here since we do
> not actually communicate with udevd.
> 
> Also remove the comma in "Running systemd-hwdb update, to update the
> binary hardware database".
Revised patches 2/3 and 3/3 accordingly and slightly adjusted the wording.

$ PAGER=cat git range-diff udev-hwdb-v1...udev-hwdb-v2 --creation-factor=100
1:  54ae7a6b7c96 ! 1:  9759663666c7 udev.eclass: add udev_hwdb_reload function
@@ Metadata
 Author: Lukas Schmelting <[email protected]>
 
  ## Commit message ##
-    udev.eclass: add udev_hwdb_reload function
+    udev.eclass: add udev_hwdb_update function
 
-    reload the udev hardware database using the `systemd-hwdb update`
+    update the udev hardware database binary using the `systemd-hwdb update`
     command. The `udevadm hwdb` has been deprecated upstream.
 
     See-also: https://github.com/systemd/systemd/commit/f8717d2a723cf594617c3acb7e90992c881a3280
@@ eclass/udev.eclass: udev_reload() {
  
  fi
 +
-+# @FUNCTION: udev_hwdb_reload
++# @FUNCTION: udev_hwdb_update
 +# @DESCRIPTION:
-+# Update the udev hardware database.
-+# Should be called from pkg_postinst and pkg_postrm in packages installing hwdb
-+# files.
-+udev_hwdb_reload() {
++
++# Rebuild the systemd hwdb binary database used by udev for hardware
++# property lookups.  Should be called from pkg_postinst and pkg_postrm
++# in packages installing hwdb files.
++udev_hwdb_update() {
 +  if [[ -n ${ROOT} ]]; then
 +          return 0
 +  fi
-+
-+  if [[ -d ${ROOT}/run/udev ]]; then
-+          ebegin "Running systemd-hwdb update, to update the binary hardware database"
-+          systemd-hwdb update --root "${ROOT}"
-+          eend $?
-+  fi
++  ebegin "Running systemd-hwdb update to regenerate binary udev hardware database"
++  systemd-hwdb update --root "${ROOT}"
++  eend $?
 +}
2:  6c33e70cc5aa ! 2:  dcc74cdd89c7 metadata/install-qa-check.d: add udev hwdb check
@@ metadata/install-qa-check.d/60udev-eclass
  # 3) Installation of udev files without triggering udev state updates in
  #    pkg_postinst and pkg_postrm via eclass helper functions.
  #    3a) udev_reload
-+#    3b) udev_reload_hwdb
++#    3b) udev_hwdb_update
  
  
  # Check whether a directory contains any non-hidden files (i.e avoid triggering
@@ metadata/install-qa-check.d/60udev-eclass: udev_rules_check() {
    fi
  
      local need_udev_reload=0
-+    local need_udev_hwdb_reload=0
++    local need_udev_hwdb_update=0
  
      # Check 2a: Check if udev rules must be updated
      if _dir_has_nonhidden_files "lib/udev/rules.d"
@@ metadata/install-qa-check.d/60udev-eclass: udev_rules_check() {
 +    # Check 2b: Check if udev binary hardware database must be updated
 +    if _dir_has_nonhidden_files "lib/udev/hwdb.d"
 +       || _dir_has_nonhidden_files "usr/lib/udev/hwdb.d"; then
-+      need_udev_hwdb_reload=1
++      need_udev_hwdb_update=1
 +    fi
 +
      # No relevant files -> nothing to enforce
@@ metadata/install-qa-check.d/60udev-eclass: udev_rules_check() {
 -    # If any udev rules or hwdb files are present, the eclass must be inherited
 -    if [[ ${need_udev_reload} -eq 1 ]] && ! has udev ${INHERITED}; then
 +    # If any udev feature is used, eclass must be inherited
-+    if [[ ${need_udev_reload} -eq 1 || ${need_udev_hwdb_reload} -eq 1 ]] \
++    if [[ ${need_udev_reload} -eq 1 || ${need_udev_hwdb_update} -eq 1 ]] \
 +       && ! has udev ${INHERITED}; then
        eqawarn "QA Notice: package is installing udev-related files without inheriting"
          eqawarn "udev.eclass! Packages must inherit udev.eclass then call the respective"
 -        eqawarn "eclass function (udev_reload) in pkg_postinst and pkg_postrm."
-+        eqawarn "eclass function (udev_reload and udev_hwdb_reload) in pkg_postinst and"
++        eqawarn "eclass function (udev_reload and udev_hwdb_update) in pkg_postinst and"
 +        eqawarn "pkg_postrm."
        return
      fi
@@ metadata/install-qa-check.d/60udev-eclass: udev_rules_check() {
        fi
      fi
 +
-+    if [[ ${need_udev_hwdb_reload} -eq 1 ]]; then
-+      if [[ ! ${pkg_postinst_body} == *udev_hwdb_reload* ]]; then
++    if [[ ${need_udev_hwdb_update} -eq 1 ]]; then
++      if [[ ! ${pkg_postinst_body} == *udev_hwdb_update* ]]; then
 +              eqawarn "QA Notice: package is installing hwdb files without calling"
-+              eqawarn "udev_hwdb_reload in pkg_postinst phase"
++              eqawarn "udev_hwdb_update in pkg_postinst phase"
 +      fi
 +
-+      if [[ ! ${pkg_postrm_body} == *udev_hwdb_reload* ]]; then
++      if [[ ! ${pkg_postrm_body} == *udev_hwdb_update* ]]; then
 +              eqawarn "QA Notice: package is installing hwdb files without calling"
-+              eqawarn "udev_hwdb_reload in pkg_postrm phase"
++              eqawarn "udev_hwdb_update in pkg_postrm phase"
 +      fi
 +    fi
   }

-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.