⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 package.sgml

📁 ecos实时嵌入式操作系统
💻 SGML
📖 第 1 页 / 共 4 页
字号:
<!-- {{{ Banner                 --><!-- =============================================================== --><!--                                                                 --><!--     package.sgml                                                --><!--                                                                 --><!--     How to write a package.                                     --><!--                                                                 --><!-- =============================================================== --><!-- ####COPYRIGHTBEGIN####                                          --><!--                                                                 --><!-- =============================================================== --><!-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.                    --><!--                                                                 --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/)                            --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission obtained from the copyright holder                   --><!-- =============================================================== --><!--                                                                 -->      <!-- ####COPYRIGHTEND####                                            --><!-- =============================================================== --><!-- #####DESCRIPTIONBEGIN####                                       --><!--                                                                 --><!-- Author(s):   bartv                                              --><!-- Contact(s):  bartv                                              --><!-- Date:        2000/02/06                                         --><!-- Version:     0.01                                               --><!--                                                                 --><!-- ####DESCRIPTIONEND####                                          --><!-- =============================================================== --><!-- }}} --><chapter id="package"><title>Package Organization</title><!-- {{{ Introit                --><para>For a package to be usable in the &eCos; component framework it mustconform to certain rules imposed by that framework. Packages must bedistributed in a form that is understood by the component repositoryadministration tool. There must be a top-level &CDL; script whichdescribes the package to the component framework. There are certainlimitations related to how a package gets built, so that the packagecan still be used in a variety of host environments. In addition tothese rules, the component framework provides a number of guidelines.Packages do not have to conform to the guidelines, but sticking tothem can simplify certain operations.</para><para>This chapter deals with the general organization of a package, forexample how to distinguish between private and exported header files.<xref linkend="language"> describes the &CDL; language.<xref linkend="build"> details the build process.</para><!-- }}} --><!-- {{{ Repository             --><sect1 id="package.hierarchy"><title>Packages and the Component Repository</title><para>All &eCos; installations include a component repository. This is adirectory structure for all installed packages. The componentframework comes with an administration tool that allows new packagesor new versions of a package to be installed, old packages to beremoved, and so on. The component repository includes a simpledatabase, maintained by the administration tool, which containsdetails of the various packages.</para><informalfigure PgWide=1><mediaobject><imageobject><imagedata fileref="repo.png" Scalefit=1 Align="Center"></imageobject></mediaobject></informalfigure><para>Each package has its own little directory hierarchy within thecomponent repository. Keeping several packages in a single directoryis illegal. The error, infra and kernel packages all live at thetop-level of the repository. For other types of packages there aresome pre-defined directories: <filenameclass="directory">compat</filename> is used for compatibilitypackages, which implement other interfaces such as &uITRON; or POSIXusing native &eCos; calls; <filename class="directory">hal</filename>is used for packages that port &eCos; to different architectures orplatforms, and this directory is further organized on aper-architecture basis; <filename class="directory">io</filename> isintended for device drivers; <filenameclass="directory">language</filename> is used for language supportlibraries, for example the C library. There are no strict rulesdefining where new packages should get installed. Obviously if anexisting top-level directory such as <filenameclass="directory">compat</filename> is applicable then the new packageshould go in there. If a new category is desirable then it is possibleto create a new sub-directory in the component repository. Forexample, an organization planning to release a number of &eCos;packages may want them all to appear below a sub-directorycorresponding to the organization's name&nbsp;&mdash; in the hope thatthe name will not change too often. It is possible to add new packagesdirectly to the top-level of the component repository, but this shouldbe avoided.</para><para>The <database>ecos.db</database> file holds the component repositorydatabase and is managed by the administration tool. The variousconfiguration tools read in this file when they start-up to obtaininformation about the various packages that have been installed. Whendeveloping a new package it is necessary to add some information tothe file, as described in <xref linkend="language.database">. The<filename class="directory">templates</filename> directory holdsvarious configuration templates.</para><note><para>Earlier releases of &eCos; came with two separate files,<filename>targets</filename> and <filename>packages</filename>. The<database>ecos.db</database> database replaces both of these.</para></note><caution><para>The current <database>ecos.db</database> database does not yet provideall of the information needed by the component framework. Its formatis subject to change in future releases, and the file may be replacedcompletely if necessary. There are a number of other likely futuredevelopments related to the component repository and the database. Theway targets are described is subject to change. Sometimes it isdesirable for component writers to do their initial development in adirectory outside the component repository, but there is no specificsupport in the framework for that yet.</para></caution></sect1><!-- }}} --><!-- {{{ Versioning             --><sect1 id="package.versions"><title>Package Versioning</title><para>Below each package directory there can be one or more versionsub-directories, named after the versions. This is a requirement ofthe component framework: it must be possible for users to installmultiple versions of a package and select which one to use for anygiven application. This has a number of advantages to users: mostimportantly it allows a single component repository to be sharedbetween multiple users and multiple projects, as required; also itfacilitates experiments, for example it is relatively easy to try outthe latest version of some package and see if it makes any difference.There is a potential disadvantage in terms of disk space. Howeversince &eCos; packages generally consist of source code intended forsmall embedded systems, and given typical modern disk sizes, keeping anumber of different versions of a package installed will usually beacceptable. The administration tool can be used to remove versionsthat are no longer required.</para><informalfigure PgWide=1><mediaobject><imageobject><imagedata fileref="version.png" Scalefit=1 Align="Center"></imageobject></mediaobject></informalfigure><para>The version <filename>current</filename> is special. Typically itcorresponds to the very latest version of the sources, obtained byanonymous &CVS;. These sources may change frequently, unlike fullreleases which do not change (or only when patches are produced).Component writers may also want to work on the<filename>current</filename> version.</para><para>All other subdirectories of a package correspond to specific releasesof that package. The component framework allows users to select theparticular version of a package they want to use, but by default themost recent one will be used. This requires some rules for orderingversion numbers, a difficult task because of the wide variety of waysin which versions can be identified.</para><orderedlist><listitem><para>The version <filename>current</filename> is always considered to bethe most recent version.</para</listitem><listitem><para>If the first character of both strings are either <literal>v</literal>or <literal>V</literal>, these are skipped because it makes littlesense to enforce case sensitivity here. Potentially this could resultin ambiguity if there are two version directories<literal>V1.0</literal> and <literal>v1.0</literal>, but this willmatch the confusion experienced by any users of such a package.However if two subsequent releases are called <literal>V1.0</literal>and <literal>v1.1</literal>, e.g. because of a minor mix-up whenmaking the distribution file, then the case difference is ignored.</para></listitem><listitem><para>Next the two version strings are compared one character at a time.If both strings are currently at a digit then a string to numberconversion takes place, and the resulting numbers are compared.For example <literal>v10</literal> is a more recent release than<literal>v2</literal>. If the two numbers are the same then processingcontinues, so for <literal>v2b</literal> and <literal>v2c</literal>the version comparison code would move on to <literal>b</literal> and<literal>c</literal>. </para></listitem><listitem><para>The characters dot <literal>.</literal>, hyphen <literal>-</literal>and underscore <literal>_</literal> are treated as equivalentseparators, so if one release goes out as <literal>v1_1</literal> andthe next goes out as <literal>v1.2</literal> the separator has noeffect.</para></listitem><listitem><para>If neither string has yet terminated but the characters are different,ASCII comparison is used. For example <literal>V1.1b</literal> ismore recent than <literal>v1.1alpha</literal>.</para></listitem><listitem><para>If one version string terminates before the other, the currentcharacter determines which is the more recent. If the other string iscurrently at a separator character, for example<literal>v1.3.1</literal> and <literal>v1.3</literal>, then the formeris assumed to be a minor release and hence more recent than thelatter. If the other string is not at a separator character, forexample <literal>v1.3beta</literal>, then it is treated as anexperimental version of the <literal>v1.3</literal> release and henceolder. </para></listitem><listitem><para>There is no special processing of dates, so with two versions<literal>ss-20000316</literal> and <literal>ss-20001111</literal>the numerical values <literal>20001111</literal> and<literal>20000316</literal> determine the result: larger values aremore recent. It is suggested that the full year be used in such casesrather than a shorthand like <literal>00</literal>, to avoidY2100 problems.</para></listitem><listitem><para>There is no limit on how many levels of versioning are used, sothere could in theory be a <literal>v3.1.4.1.5.9.2.7</literal> releaseof a package. However this is unlikely to be of benefit to typicalusers of a package.</para></listitem></orderedlist><para>The version comparison rules of the component framework may not besuitable for every version numbering scheme in existence, but theyshould cope with many common cases.</para><caution><para>There are some issues still to be resolved before it is possible tocombine the <filename>current</filename> sources available viaanonymous &CVS and full releases of &eCos; and additional packages ina single component repository. The first problem relates to the<database>ecos.db</database> database: if a new package is added viathe CVS repository then this requires a database update, but theadministration tool is bypassed. The second problem arises if anorganization chooses to place its component repository under sourcecode control using &CVS;, in which case different directories willbelong to different &CVS; servers. These issues will be addressed in afuture release.</para></caution></sect1><!-- }}} --><!-- {{{ Package contents       --><!-- {{{ Introit                --><sect1 id="package.contents"><title>Package Contents and Layout</title>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -