Changeset 506120ee for BLFS


Ignore:
Timestamp:
08/09/2017 01:55:55 PM (7 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
dd08e14
Parents:
200fbde
Message:

install-blfs-tools.sh:

  • Add instructions to retrieve and parse LFS book into packages.xml
Location:
BLFS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BLFS/Makefile

    r200fbde r506120ee  
    2626# Those directories and files will be created and populated by make:
    2727# directory of the book sources:
     28LFS_XML          = $(TOPDIR)/lfs-xml
    2829BLFS_XML         = $(TOPDIR)/blfs-xml
    2930# contains the REV used in the preceding call:
     
    3839BOOK_XML         = $(TOPDIR)/book.xml
    3940
     41LFSTMP           = $(LFS_XML)/tmp
    4042RENDERTMP        = $(BLFS_XML)/tmp
     43LFS_FULL         = $(LFSTMP)/lfs-full.xml
    4144BLFS_FULL        = $(RENDERTMP)/blfs-full.xml
    4245
     
    5861endef
    5962
     63LFS-SVN = svn://svn.linuxfromscratch.org/LFS/trunk/BOOK
    6064SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
    6165
     
    6468                        find $(BLFS_XML) -name \*.xml; \
    6569                      fi))
     70ALLXMLLFS:= $(filter-out $(LFSTMP)/%, \
     71              $(shell if [ -d $(LFS_XML) ]; then \
     72                        find $(LFS_XML) -name \*.xml; \
     73                      fi))
    6674ALLXSL := $(filter-out $(RENDERTMP)/%, \
    6775              $(shell if [ -d $(BLFS_XML) ]; then \
    6876                        find $(BLFS_XML) -name \*.xsl; \
     77                      fi))
     78ALLXSLLFS := $(filter-out $(LFSTMP)/%, \
     79              $(shell if [ -d $(LFS_XML) ]; then \
     80                        find $(LFS_XML) -name \*.xsl; \
    6981                      fi))
    7082
     
    98110        $(Q)xsltproc --nonet -o $@ $(XSLDIR)/gen_config.xsl $(PACK_LIST)
    99111
    100 $(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE)
     112$(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE) $(LFS_FULL)
    101113        $(Q)xsltproc --stringparam installed-packages $(TRACKFILE) \
     114        --stringparam lfs-full $(LFS_FULL) \
    102115        -o $@.tmp $(XSLDIR)/gen_pkg_list.xsl $(BLFS_FULL)
    103116        $(Q)xmllint --postvalid --format -o $@ $@.tmp
     
    138151ifneq ($(REV),$(REV1))
    139152$(BLFS_FULL): FORCE
    140 endif
     153$(LFS_FULL): FORCE
     154endif
     155$(LFS_FULL): $(LFS_XML) $(LFS_XML)/general.ent $(ALLXMLLFS) $(ALLXSLLFS)
     156        @echo "Processing LFS bootscripts..."
     157        $(Q)cd $(LFS_XML) && bash process-scripts.sh
     158        $(Q)[ -d $(LFSTMP) ] || mkdir -p $(LFSTMP)
     159        @echo "Adjusting LFS for revision $(REV)..."
     160        $(Q)xsltproc --nonet --xinclude                          \
     161                     --stringparam profile.revision $(REV)       \
     162                     --output $(LFSTMP)/lfs-prof.xml         \
     163                     $(LFS_XML)/stylesheets/lfs-xsl/profile.xsl \
     164                     $(LFS_XML)/index.xml
     165        @echo "Validating the LFS book..."
     166        $(Q)xmllint --nonet --noent --postvalid \
     167          -o $@ $(LFSTMP)/lfs-prof.xml
     168        $(Q)rm -f $(LFS_XML)/appendices/*.script
     169        $(Q)cd $(LFS_XML) && ./aux-file-data.sh $@
     170        $(Q)echo $(REV) > $(REVFILE)
     171
    141172$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
    142173        $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
    143         @echo "Adjusting for revision $(REV)..."
     174        @echo "Adjusting BLFS for revision $(REV)..."
    144175        $(Q)xsltproc --nonet --xinclude                          \
    145176                     --stringparam profile.revision $(REV)       \
     
    147178                     $(BLFS_XML)/stylesheets/lfs-xsl/profile.xsl \
    148179                     $(BLFS_XML)/index.xml
    149         @echo "Validating the book..."
     180        @echo "Validating the BLFS book..."
    150181        $(Q)xmllint --nonet --noent --postvalid \
    151182          -o $@ $(RENDERTMP)/blfs-prof.xml
     
    154185all: update $(BOOK_XML)
    155186
    156 update: $(BLFS_XML)
     187update: $(BLFS_XML) $(LFS_XML)
    157188        @echo Updating the book sources
     189        $(Q)cd $(LFS_XML) && svn up
    158190        $(Q)cd $(BLFS_XML) && svn up
    159191
     192$(LFS_XML):
     193        @echo Getting the LFS book sources...
     194        $(Q)svn co $(LFS-SVN) $@
     195
    160196$(BLFS_XML):
    161         @echo Getting the book sources...
     197        @echo Getting the BLFS book sources...
    162198        $(Q)svn co $(SVN) $@
    163199
  • BLFS/xsl/gen_pkg_list.xsl

    r200fbde r506120ee  
    66     installed packages in the tracking file (stringparam
    77     'installed-packages') -->
     8<!-- Extract also a list of LFS packages from stringparam lfs-full -->
    89
    910<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    1011    version="1.0">
    1112
     13  <xsl:param name="lfs-full" select="'./lfs-xml/lfs-full.xml'"/>
    1214  <xsl:param name="installed-packages" select="'../lib/instpkg.xml'"/>
    1315
     
    2325  <xsl:template match="/">
    2426    <princList>
    25     <xsl:text>&#xA;&#xA;</xsl:text>
     27      <xsl:text>&#xA;&#xA;  </xsl:text>
     28      <list>
     29        <xsl:attribute name="id">lfs</xsl:attribute>
     30        <xsl:text>&#xA;    </xsl:text>
     31        <name>LFS Packages</name>
     32        <xsl:text>&#xA;    </xsl:text>
     33        <sublist>
     34          <xsl:attribute name="id">lfs-6</xsl:attribute>
     35          <xsl:text>&#xA;      </xsl:text>
     36          <name>LFS Chapter 6</name>
     37          <xsl:apply-templates
     38               select='document($lfs-full)//
     39                            chapter[@id="chapter-building-system"]/
     40                                 sect1/sect1info'/>
     41          <xsl:text>&#xA;    </xsl:text>
     42        </sublist>
     43        <sublist>
     44          <xsl:attribute name="id">lfs-8</xsl:attribute>
     45          <xsl:text>&#xA;      </xsl:text>
     46          <name>LFS Chapter 8</name>
     47          <xsl:apply-templates select='document($lfs-full)//chapter[@id="chapter-bootable"]/sect1/sect1info[./productname="linux"]'/>
     48          <xsl:text>&#xA;    </xsl:text>
     49        </sublist>
     50        <sublist>
     51          <xsl:attribute name="id">lfs-9</xsl:attribute>
     52          <xsl:text>&#xA;      </xsl:text>
     53          <name>LFS Chapter 9</name>
     54          <xsl:apply-templates select='document($lfs-full)//sect1[@id="ch-finish-theend"]//userinput[starts-with(string(),"echo")]'/>
     55          <xsl:text>&#xA;    </xsl:text>
     56        </sublist>
     57        <xsl:text>&#xA;&#xA;  </xsl:text>
     58      </list>
    2659<!-- How to have blfs-bootscripts versionned? Do not know, so
    2760     avoid it (TODO ?) -->
    2861      <xsl:apply-templates select="//part[not(@id='introduction')]"/>
    2962    </princList>
     63  </xsl:template>
     64
     65  <xsl:template match="userinput">
     66<!-- Only used in lFS chapter 9, to retrieve book version -->
     67    <package>
     68      <name>LFS-Release</name>
     69      <xsl:element name="version">
     70        <xsl:copy-of select="substring-after(substring-before(string(),' &gt;'),'echo ')"/>
     71      </xsl:element>
     72      <xsl:if
     73          test="document($installed-packages)//package[name='LFS-Release']">
     74        <xsl:text>&#xA;        </xsl:text>
     75        <xsl:element name="inst-version">
     76          <xsl:value-of
     77            select="document(
     78                     $installed-packages
     79                            )//package[name='LFS-Release']/version"/>
     80        </xsl:element>
     81      </xsl:if>
     82    </package>
     83  </xsl:template>
     84
     85  <xsl:template match="sect1info">
     86    <xsl:text>      </xsl:text>
     87    <xsl:choose>
     88<!-- Never update linux headers -->
     89      <xsl:when test="./productname='linux'
     90                      and ancestor::chapter[@id='chapter-building-system']"/>
     91<!-- Gcc version is taken from BLFS -->
     92      <xsl:when test="./productname='gcc'"/>
     93<!-- Shadow version is taken from BLFS -->
     94      <xsl:when test="./productname='shadow'"/>
     95<!-- Dbus version is taken from BLFS -->
     96      <xsl:when test="./productname='dbus'"/>
     97<!-- Systemd version is taken from BLFS -->
     98      <xsl:when test="./productname='systemd'"/>
     99      <xsl:otherwise>
     100        <package><xsl:text>&#xA;        </xsl:text>
     101          <xsl:element name="name">
     102            <xsl:value-of select="./productname"/>
     103          </xsl:element>
     104          <xsl:text>&#xA;        </xsl:text>
     105          <xsl:element name="version">
     106            <xsl:value-of select="./productnumber"/>
     107          </xsl:element>
     108          <xsl:if
     109              test="document($installed-packages)//package[name=current()/productname]">
     110            <xsl:text>&#xA;        </xsl:text>
     111            <xsl:element name="inst-version">
     112              <xsl:value-of
     113                select="document(
     114                         $installed-packages
     115                                )//package[name=current()/productname]/version"/>
     116            </xsl:element>
     117          </xsl:if>
     118        </package>
     119      </xsl:otherwise>
     120    </xsl:choose>
     121<!-- No deps for now: a former version  is always installed -->
    30122  </xsl:template>
    31123
Note: See TracChangeset for help on using the changeset viewer.