YaST/教程/一般YaST开发

< YaST‎ | 教程
Jump to: navigation, search

Susemini.png 本文处于需要修订的文章的状态,欢迎您积极参与翻译与修订。 翻译人员:kcbi,修订人员:无。

开始开发之前

Almost every YaST development needs a standard development environment with development tools. A developer should understand the terms used and know the YaST directory structure.

几乎每项YaST程序的开发工作都需要标准的开发环境及开发工具。开发者应该理解所使用的术语以及YaST的目录结构

开发环境

YaST module development is automated in many steps by a number of helper tools. However, if you want to take advantage of it, you must install some additional packages.

YaST模块在开发过程中,借助于一系列帮助工具可以自动完成若干步骤。在您使用这些工具之前,您需要安装一些软件包。

Here is the full list of packages needed in alphabetical order: autoconf automake blocxx-devel dejagnu expect gcc gettext-devel glibc-devel hwinfo-devel libgcj libstdc++-devel libxcrypt-devel libxml2-devel liby2util-devel ncurses-devel openssl-devel pcre-devel perl-XML-Writer pkgconfig readline-devel tcl yast2 yast2-core yast2-core-devel yast2-devtools yast2-perl-bindings yast2-testsuite zlib-devel

如下是所需软件包的按照名字排列的完整列表:autoconf automake blocxx-devel dejagnu expect gcc gettext-devel glibc-devel hwinfo-devel libgcj libstdc++-devel libxcrypt-devel libxml2-devel liby2util-devel ncurses-devel openssl-devel pcre-devel perl-XML-Writer pkgconfig readline-devel tcl yast2 yast2-core yast2-core-devel yast2-devtools yast2-perl-bindings yast2-testsuite zlib-devel

术语

  • YaST Module — In a general view, a YaST module is a stand-alone tool for some functionality, such as the configuration tool for an NFS server, user manager, or system monitoring tool.
  • YaST模块 - 一般来说,YaST的一个模块是实现某项功能的一个独立工具,例如NFS服务器的配置工具或系统监测工具。
  • Project — A project is a general concept for any YaST module.
  • 项目 - 项目指任意一个YaST模块从整体上讲的构思、内容、概念等。
  • YCP Module — Set of functionality inside a library written in the YCP language. It can have several global or local functions and variables. A YaST module can use several YCP modules. A YCP module itself can also use other modules.
  • YCP模块 - 使用YCP语言编写的包含一些列功能的库。这种模块可以包含若干全局或局部函数、变量。一个YaST模块可以调用多个YCP模块。一个YCP模块也可以使用其它模块。
  • Perl Module — The same as a YCP module, but written in Perl.
  • Perl模块 - 和YCP模块相同,但是使用Perl语言编写。
  • SCR Agent — They are the only way to read and write a configuration or execute system commands. Developer mustn't touch the system by any other way. SCR Agents are very small programs written in C, Bash, or Perl or written as scripts using the unified Ini-Agent or Any-Agent interface. YaST uses the unified SCR YCP module for accessing these agents.
  • SCR代理 - 这是读写配置文件、执行系统命令的唯一方法。开发人员不可以使用其他方法访问系统。SCR代理是使用C、Bash、Perl语言编写的小程序,也可以是使用统一Ini-Agent或Any-Agent接口编写的脚本。YaST使用统一的SCR YCP模块访问这些代理。
  • Helper Tool — A script or binary that has some functionality for helping a developer achieve fast results by calling many annoying and repetitive commands on its own.
  • 帮助工具 - 一种用来辅助开发者的脚本或二进制程序,这些工具的功能一般是快速实现对大量重复性的或复杂的让人厌恶的命令的调用,并将最终调用结果返回给开发者。

YaST目录结构

The directions in this tutorial touch several directories on the system. Here is the list of directories where you can find files or directories related to YaST:

这份指南里涉及到系统上的多个目录。通过这些目录,您可以找到和YaST相关的许多文件和目录。

/usr/lib/YaST2/                 -- helpers, libraries, and SCR agents
/usr/lib/YaST2/                 -- 帮助程序、库和SCR代理
/usr/share/applications/YaST2/* -- .desktop files of YaST modules
/usr/share/applications/YaST2/* -- YaST模块的.desktop文件
/usr/share/YaST2/               -- base directory of YaST scripts, clients, and modules
/usr/share/YaST2/               -- YaST脚本、客户端和模块
/usr/share/doc/packages/yast2*  -- documentation for particular YaST packages
/usr/share/doc/packages/yast2*  -- 一些特殊YaST包的文档
/var/lib/YaST2/                 -- variable data directory
/var/lib/YaST2/                 -- var数据目录
/var/log/YaST2/                 -- logging directory with automatically rotated logs
/var/log/YaST2/                 -- 带有自动滚动功能的日志目录