YaST/Development/Devtools/check deps

From openSUSE

Contents

About

This script has been created to simplify the dependency-checking for YaST RPMs.

You can find it in yast2-devtools RPM since version 2.16.2 or download it from here.

Syntax

 ./check_deps [src_directory [be_verbose [RPM_root]]]
  • src_directory - Which directory should be checked (focused on checking the sources as they are in SVN). By default it's a working directory, so . is the same.
  • be_verbose - More verbose output. Additionally to imported RPMs prints also which imported module belongs to which RPM package.
  • RPM_root - By default, the information which imported module belongs to which RPM package is taken from the current RPM database however you can be debugging some non-current distribution and thus another root should be given as a parameter. See man rpm and search for --root how to prepare a different RPM-root.

Examples

Simple Check

 miracle:/yast/openSUSE_11.0/firewall # /usr/share/YaST2/data/devtools/bin/check_deps
 Working in directory: /yast/openSUSE_11.0/firewall
 Root: /
 
 All imported modules:
 ---------------------
 Address CWM CWMServiceStart CommandLine Confirm DialogTree IP Label Map Message Mode
 Netmask Popup PortAliases ProductFeatures Progress Report Sequencer String SuSEFirewall
 SuSEFirewallCMDLine SuSEFirewallExpertRules SuSEFirewallProposal SuSEFirewallServices
 SuSEFirewallUI Wizard
 
 All imported YaST packages:
 ---------------------------
 yast2
 yast2-firewall

Verbose Output

 miracle:/yast/openSUSE_11.0/firewall # /usr/share/YaST2/data/devtools/bin/check_deps . .
 Working in directory: .
 Root: /
 
 All imported modules:
 ---------------------
 Address CWM CWMServiceStart CommandLine Confirm DialogTree IP Label Map Message Mode
 Netmask Popup PortAliases ProductFeatures Progress Report Sequencer String SuSEFirewall
 SuSEFirewallCMDLine SuSEFirewallExpertRules SuSEFirewallProposal SuSEFirewallServices
 SuSEFirewallUI Wizard
 All imported YaST packages:
 ---------------------------
 
 yast2   File: /usr/share/YaST2/modules/Address.ycp
 yast2   File: /usr/share/YaST2/modules/CWM.ycp
 yast2   File: /usr/share/YaST2/modules/CWMServiceStart.ycp
 yast2   File: /usr/share/YaST2/modules/CommandLine.ycp
 yast2   File: /usr/share/YaST2/modules/Confirm.ycp
 yast2   File: /usr/share/YaST2/modules/DialogTree.ycp
 yast2   File: /usr/share/YaST2/modules/IP.ycp
 yast2   File: /usr/share/YaST2/modules/Label.ycp
 yast2   File: /usr/share/YaST2/modules/Map.ycp
 yast2   File: /usr/share/YaST2/modules/Message.ycp
 yast2   File: /usr/share/YaST2/modules/Mode.ycp
 yast2   File: /usr/share/YaST2/modules/Netmask.ycp
 yast2   File: /usr/share/YaST2/modules/Popup.ycp
 yast2   File: /usr/share/YaST2/modules/PortAliases.ycp
 yast2   File: /usr/share/YaST2/modules/ProductFeatures.ycp
 yast2   File: /usr/share/YaST2/modules/Progress.ycp
 yast2   File: /usr/share/YaST2/modules/Report.ycp
 yast2   File: /usr/share/YaST2/modules/Sequencer.ycp
 yast2   File: /usr/share/YaST2/modules/String.ycp
 yast2   File: /usr/share/YaST2/modules/SuSEFirewall.ycp
 yast2   File: /usr/share/YaST2/modules/SuSEFirewallExpertRules.ycp
 yast2   File: /usr/share/YaST2/modules/SuSEFirewallProposal.ycp
 yast2   File: /usr/share/YaST2/modules/SuSEFirewallServices.ycp
 yast2   File: /usr/share/YaST2/modules/Wizard.ycp
 yast2-firewall  File: /usr/share/YaST2/modules/SuSEFirewallCMDLine.ycp
 yast2-firewall  File: /usr/share/YaST2/modules/SuSEFirewallUI.ycp

False-Positive Matches

Sometimes a YaST module is identified as imported and thus required but this is a fake-dependency valid only in first-stage installation. These modules might be used in inst_* YCP scripts.

But be careful:

  • Not all inst_* clients called in first-stage installation are called in the ins-sys environment, some are called after chrooting to the system just being installed.
  • Some inst_* clients are called also in a different mode (autoyast/normal/...).
  • Some inst_* clients are only wrappers that call different YCP scripts.

All in all, for check_deps script, it's almost impossible to identify false-positive matches.

TODO

Currently, only imported modules are checked but there might be several includes across YaST RPMs. Check for includes should be implemented as well.