XML catalogue of packages which are available for installation, using the mingw-get installer.
Revision | 22a171eb915d00c492a4600d21107bf7c14727c6 (tree) |
---|---|
Zeit | 2013-04-17 21:38:13 |
Autor | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Add issue number tracking within published package lists.
@@ -1,3 +1,36 @@ | ||
1 | +2013-04-16 Keith Marshall <keithmarshall@users.sourceforge.net> | |
2 | + | |
3 | + Add issue number tracking within published package lists. | |
4 | + | |
5 | + * makeopts.m4: New file; copy it from MinGW.org's build-aux package. | |
6 | + | |
7 | + * configure.ac (AC_INIT): Bump version number to 2.0 | |
8 | + (makeopts.m4): m4_include it; it is required to provide support for... | |
9 | + (MINGW_AC_MAKE_NO_PRINT_DIRECTORY): ...this additional feature test. | |
10 | + | |
11 | + * Makefile.in (all): Require... | |
12 | + (update-references): ...this new build goal; implement it, using... | |
13 | + (update-local-references): ...this new recursively invoked rule, and... | |
14 | + (issue.sed): ...this new call-back rule. | |
15 | + | |
16 | + * Makefile.stub.in (top_builddir): Define it as a macro. | |
17 | + | |
18 | + * Makefile.comm.in (update_issue_number): New macro; define it. | |
19 | + (store_issue_number): Likewise; both are required to implement... | |
20 | + (generate_catalogue): ...this new sed script defining macro. | |
21 | + (sha1hash): Redefined macro; it now depends on substitution of... | |
22 | + ($catalogue): ...this local shell variable, in place of $<. | |
23 | + (extract_log_file_header, extract_log_file_footer): New macros. | |
24 | + (update-references, issue.sed): New build goals; they facilitate... | |
25 | + (update-local-references): ...this recursively invoked top-down build | |
26 | + goal; implement it in terms of refactored commands, abstracted from... | |
27 | + (%.xml.lzma: %.xml): ...this original goal, to create... | |
28 | + (generate-catalogue, generate-reference, select-for-publication): | |
29 | + (update-issue-log, issue.chk, issue.new, issue.tmp): ...these new | |
30 | + intermediate goals; they are invoked recursively, by use of... | |
31 | + (SET_MAKE): ...this autoconf defined and AC_SUBSTed hook, with... | |
32 | + (RMAKE): ...this new macro; define it. | |
33 | + | |
1 | 34 | 2013-04-10 Earnie Boyd <earnie@users.sourceforge.net> |
2 | 35 | |
3 | 36 | * mingw32/mingw32-wsl-candidate.xml: Add the 4.0-rc-2 release. |
@@ -3,7 +3,7 @@ | ||
3 | 3 | # $Id$ |
4 | 4 | # |
5 | 5 | # Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
6 | -# Copyright (C) 2010, 2011, MinGW Project | |
6 | +# Copyright (C) 2010, 2011, 2013, MinGW.org Project | |
7 | 7 | # |
8 | 8 | # |
9 | 9 | # Makefile template for generating mingw-get distribution manifests. |
@@ -50,7 +50,8 @@ Makefile.sub: ${srcdir}/*.xml | ||
50 | 50 | echo ' $$(EXTRA_DISTFILES)' >> $@ |
51 | 51 | |
52 | 52 | include Makefile.sub |
53 | -all-distfiles: unpublished $(DISTFILES) $(auto-distfiles) | |
53 | +all-distfiles: unpublished issue.sed $(DISTFILES) $(auto-distfiles) | |
54 | +@SET_MAKE@ | |
54 | 55 | |
55 | 56 | # Distributed manifests are serialised by incorporating a date-stamped |
56 | 57 | # issue number, of the form YYYYMMDDNN; we track issue numbers using the |
@@ -61,13 +62,20 @@ issue_number = YYYYMMDDNN | ||
61 | 62 | issue_key = awk '$$3 == "$*.xml" { print $$1 }' issue.new |
62 | 63 | issue_log = ${srcdir}/issue.log |
63 | 64 | |
65 | +update_issue_number = \ | |
66 | + test -n "$$issue" || issue=0; \ | |
67 | + test $$issue -lt $${mark="`date -u +%Y%m%d`00"} && \ | |
68 | + issue=$$mark || issue=`expr $$issue + 1` | |
69 | +generate_catalogue = -f ${top_builddir}/issue.sed -e $(store_issue_number) | |
70 | +store_issue_number = "s/@$(issue_number)@/$(issue)/" | |
71 | + | |
64 | 72 | # We use SHA1 hashes to determine when source files have been changed |
65 | 73 | # from the last published version, as recorded in `issue.log'; the hash |
66 | 74 | # is computed by openssl, after filtering the source through awk; (this |
67 | 75 | # ensures that the computed hash is not influenced by any unintentional |
68 | 76 | # pollution due to accidental insertion of CRLF line endings). |
69 | 77 | # |
70 | -sha1hash = awk '{ sub( "\r$$", "" ); print }' $< | $(sha1sum) | |
78 | +sha1hash = awk '{ sub( "\r$$", "" ); print }' $$catalogue | $(sha1sum) | |
71 | 79 | sha1sum = openssl sha1 | awk '{print $$NF}' |
72 | 80 | |
73 | 81 | # Formatting within issue.log is controlled by PAD and TAB settings. |
@@ -87,25 +95,20 @@ PAD = " " | ||
87 | 95 | # any updated manifest is uploaded to the repository server. |
88 | 96 | # |
89 | 97 | %.xml.lzma: %.xml |
98 | + @echo | |
90 | 99 | >> $(issue_log) |
91 | 100 | rm -f issue.new issue.tmp |
101 | + test -f ${top_builddir}/issue.sed || $(MAKE) issue.sed | |
92 | 102 | sed '/^$(TAB)*$$/d;/^$(TAB)*#/d' $(issue_log) > issue.new |
93 | - issue=`awk '$$3 == "$*.xml" { print $$2 }' issue.new`; \ | |
94 | - if test x$${hash="`$(sha1hash)`"} != x"`$(issue_key)`"; then \ | |
95 | - test -n "$$issue" || issue=0; \ | |
96 | - test $$issue -lt $${mark="`date -u +%Y%m%d`00"} && \ | |
97 | - issue=$$mark || issue=`expr $$issue + 1`; \ | |
98 | - awk '$$3 != "$*.xml"' issue.new > issue.tmp; \ | |
99 | - echo $(PAD)$$hash $$issue $*.xml >> issue.tmp; \ | |
100 | - fi; \ | |
101 | - sed "s/@$(issue_number)@/$$issue/" $< | lzma -c > $@ | |
102 | - if test -f issue.tmp; then \ | |
103 | - sed -n '/^$(TAB)*$$/q;/^$(TAB)*[^#]/q;p' $(issue_log) > issue.new; \ | |
104 | - LC_COLLATE=POSIX sort -k3 issue.tmp >> issue.new; \ | |
105 | - sed -n 's/^$(TAB)*$$/break/;1,/^$(TAB)*[^#]/d;/^$(TAB)*#/p' \ | |
106 | - $(issue_log) >> issue.new; \ | |
107 | - rm -f $(issue_log) && mv issue.new $(issue_log); \ | |
108 | - cd unpublished && $(LN_S) -f ../$@ .; \ | |
103 | + @catalogue="$<" issue=`awk '$$3 == "$*.xml" { print $$2 }' issue.new`; \ | |
104 | + if test x$${hash="`$(sha1hash)`"} != x"`$(issue_key)`"; then \ | |
105 | + $(update_issue_number); \ | |
106 | + $(RMAKE) refname=$*.xml issue=$$issue hash=$$hash issue.tmp; \ | |
107 | + fi; \ | |
108 | + $(RMAKE) catalogue=$@ source=$< issue=$$issue generate-catalogue | |
109 | + @if test -f issue.tmp; then \ | |
110 | + $(RMAKE) refname=$@ select-for-publication; \ | |
111 | + $(RMAKE) update-issue-log; \ | |
109 | 112 | fi |
110 | 113 | rm -f issue.new issue.tmp |
111 | 114 |
@@ -120,7 +123,94 @@ FORCE: | ||
120 | 123 | # processed, even on explicit file-by-file request). |
121 | 124 | # |
122 | 125 | ${srcdir}/*.xml: unpublished |
123 | -unpublished: FORCE | |
124 | - test -d unpublished || mkdir unpublished | |
126 | +unpublished: | |
127 | + test -d $@ || mkdir $@ | |
128 | + | |
129 | +# Package lists are dynamically updated, to record the latest issues of each | |
130 | +# referenced package catalogue; the "sed" script used to accomplish this must | |
131 | +# be generated, and driven from, within the top build directory. | |
132 | +# | |
133 | +update-references issue.sed: FORCE | |
134 | + cd ${top_builddir}; $(MAKE) $@ | |
135 | + | |
136 | +# Requests to update references will be redirected back to each sub-directory | |
137 | +# in turn, to be processed by the following recursive make rule. | |
138 | +# | |
139 | +update-local-references: unpublished issue.sed | |
140 | + rm -rf tmp; mkdir tmp; rm -f issue.tmp | |
141 | + sed '/^$(TAB)*$$/d;/^$(TAB)*#/d' $(issue_log) > issue.new | |
142 | + @for catalogue in `grep -l 'catalogue=' ${srcdir}/*.xml`; \ | |
143 | + do refname=`echo $$catalogue | sed 's,^${srcdir}/,,'` \ | |
144 | + issue=`awk '$$3 == "'$$refname'" { print $$2 }' issue.new`; \ | |
145 | + $(RMAKE) refname=$$refname issue=$$issue generate-reference; \ | |
146 | + lzma -dc $$refname.lzma | cmp -s - tmp/$$refname || \ | |
147 | + { $(update_issue_number); \ | |
148 | + $(RMAKE) dir=${top_builddir} issue.chk; \ | |
149 | + $(RMAKE) refname=$$refname issue=$$issue \ | |
150 | + hash=`$(sha1hash)` issue.tmp; \ | |
151 | + $(RMAKE) catalogue=$$refname.lzma source=$$catalogue \ | |
152 | + issue=$$issue generate-catalogue; \ | |
153 | + $(RMAKE) refname=$$refname.lzma select-for-publication; \ | |
154 | + }; \ | |
155 | + done | |
156 | + @test -f issue.tmp && $(RMAKE) update-issue-log || true | |
157 | + rm -f ${top_builddir}/issue.sed issue.new issue.tmp | |
158 | + rm -rf tmp | |
159 | + | |
160 | +# The preceding rules for compiling catalogues for publication, and resolving | |
161 | +# "package-list" references, use several recursive make hooks to perform common | |
162 | +# sub-tasks. GNU make tends to be very verbose about entering and leaving the | |
163 | +# directories in which these sub-tasks are performed, even when there is no | |
164 | +# change of directory involved; to make it quieter, we prefer this form of | |
165 | +# recursive invocation for local sub-tasks. | |
166 | +# | |
167 | +RMAKE = $(MAKE)@NO_PRINT_DIRECTORY@ | |
168 | + | |
169 | +# The following sub-task rule creates a tentative "publication-ready" version | |
170 | +# of each catalogue. | |
171 | +# | |
172 | +generate-catalogue: FORCE | |
173 | + sed $(generate_catalogue) $(source) \ | |
174 | + | lzma -c > $(catalogue) | |
175 | + | |
176 | +# The following sub-task rule creates a reference copy of each catalogue, for | |
177 | +# comparison with the tentative "publication-ready" version, when checking for | |
178 | +# changes introduced by resolution of "package-list" references. | |
179 | +# | |
180 | +generate-reference: FORCE | |
181 | + sed $(generate_catalogue) ${srcdir}/$(refname) \ | |
182 | + > tmp/$(refname) | |
183 | + | |
184 | +# When any generated catalogue has been found to differ from its previously | |
185 | +# published version, (if any), the following rule adds it to the schedule of | |
186 | +# catalogues which should be republished, (or published for the first time). | |
187 | +# | |
188 | +select-for-publication: FORCE | |
189 | + cd unpublished && $(LN_S) -f ../$(refname) . | |
190 | + | |
191 | +# The remaining macros and rules define the sub-tasks for management of the | |
192 | +# temporary files used to control the iterative resolution of "package-list" | |
193 | +# references, and to capture modifications to be recorded in the issue log... | |
194 | +# | |
195 | +extract_log_file_header = '/^$(TAB)*$$/q;/^$(TAB)*[^\#]/q;p' | |
196 | +extract_log_file_footer = 's/^$(TAB)*$$/break/;1,/^$(TAB)*[^\#]/d;/^$(TAB)*\#/p' | |
197 | + | |
198 | +issue.chk: FORCE | |
199 | + test -f issue.tmp && mv -f issue.tmp issue.new || true | |
200 | + test -f ${dir}/$@ && echo check > ${dir}/$@ || true | |
201 | + | |
202 | +issue.new: FORCE | |
203 | +issue.tmp: issue.new | |
204 | + awk '$$3 != "$(refname)"' $^ > $@ | |
205 | + echo $(PAD)$(hash) $(issue) $(refname) >> $@ | |
206 | + | |
207 | +# ...with this final rule completing the recording of the current state of | |
208 | +# publication, in the permanent issue log files. | |
209 | +# | |
210 | +update-issue-log: FORCE | |
211 | + sed -n $(extract_log_file_header) $(issue_log) > issue.new | |
212 | + LC_COLLATE=POSIX sort -k3 issue.tmp >> issue.new; | |
213 | + sed -n $(extract_log_file_footer) $(issue_log) >> issue.new; | |
214 | + rm -f $(issue_log) && mv issue.new $(issue_log) | |
125 | 215 | |
126 | 216 | # $RCSfile$: end of file |
@@ -3,7 +3,7 @@ | ||
3 | 3 | # $Id$ |
4 | 4 | # |
5 | 5 | # Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
6 | -# Copyright (C) 2010, 2011, MinGW Project | |
6 | +# Copyright (C) 2010, 2011, 2013, MinGW.org Project | |
7 | 7 | # |
8 | 8 | # |
9 | 9 | # Makefile template for generating mingw-get distribution manifests. |
@@ -25,8 +25,9 @@ | ||
25 | 25 | # MinGW Project, accept liability for any damages, however caused, |
26 | 26 | # arising from the use of this software. |
27 | 27 | # |
28 | -all: @mingw_ac_subdirs@ | |
28 | +all: @mingw_ac_subdirs@ update-references | |
29 | 29 | |
30 | +@SET_MAKE@ | |
30 | 31 | @mingw_ac_subdirs@: FORCE |
31 | 32 | @if test -r $@/Makefile; then \ |
32 | 33 | cd $@; $(MAKE) $(MAKECMDGOALS); \ |
@@ -42,4 +43,35 @@ FORCE: | ||
42 | 43 | # |
43 | 44 | all-distfiles: all |
44 | 45 | |
46 | +# To support optimised "mingw-get update", the package lists must be | |
47 | +# dynamically updated, to correctly identify the latest issue of each | |
48 | +# individual package catalogue file; the following rule, (which MUST | |
49 | +# be invoked at top level), creates a "sed" script which may then be | |
50 | +# paste the appropriate tags into the package list files. | |
51 | +# | |
52 | +ref = @top_srcdir@/*/ | |
53 | +issue.sed: FORCE | |
54 | + echo 's/issue=.*\(catalogue=\)/\\1/' > $@ | |
55 | + for tag in `sed -n '/.*catalogue="/{s///;s/".*//p;}' ${ref}*.xml`; \ | |
56 | + do awk /$$tag'.xml$$/{ \ | |
57 | + print "s/catalogue=\"'$$tag'\"/issue=\"" $$2 "\" &/" \ | |
58 | + }' ${ref}issue.log; \ | |
59 | + done >> $@ | |
60 | + | |
61 | +# The generated "sed" script must be applied iteratively, to each of | |
62 | +# the catalogue files which contains "package-list" references, until | |
63 | +# all cross references have been fully resolved... | |
64 | +# | |
65 | +update-references: FORCE | |
66 | + echo check > issue.chk | |
67 | + @while test x"`cat issue.chk`" != xclean; \ | |
68 | + do echo clean > issue.chk; \ | |
69 | + $(MAKE) update-local-references; \ | |
70 | + done | |
71 | + rm -f issue.chk | |
72 | + | |
73 | +# ...considering all catalogues, in all registered sub-directories. | |
74 | +# | |
75 | +update-local-references: @mingw_ac_subdirs@ | |
76 | + | |
45 | 77 | # $RCSfile$: end of file |
@@ -7,7 +7,7 @@ | ||
7 | 7 | # $Id$ |
8 | 8 | # |
9 | 9 | # Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
10 | -# Copyright (C) 2010, MinGW Project | |
10 | +# Copyright (C) 2010, 2013, MinGW.org Project | |
11 | 11 | # |
12 | 12 | # |
13 | 13 | # Makefile template for generating mingw-get distribution manifests. |
@@ -30,6 +30,7 @@ | ||
30 | 30 | # arising from the use of this software. |
31 | 31 | # |
32 | 32 | srcdir = @srcdir@ |
33 | - include @top_builddir@/Makefile.comm | |
33 | + top_builddir = @top_builddir@ | |
34 | + include ${top_builddir}/Makefile.comm | |
34 | 35 | # |
35 | 36 | # $RCSfile$: end of file |
@@ -3,7 +3,7 @@ | ||
3 | 3 | # $Id$ |
4 | 4 | # |
5 | 5 | # Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
6 | -# Copyright (C) 2010, 2011, MinGW Project | |
6 | +# Copyright (C) 2010, 2011, 2013, MinGW.org Project | |
7 | 7 | # |
8 | 8 | # |
9 | 9 | # Configuration script for mingw-dist |
@@ -22,10 +22,12 @@ | ||
22 | 22 | # MinGW Project, accept liability for any damages, however caused, |
23 | 23 | # arising from the use of this software. |
24 | 24 | # |
25 | - AC_INIT([mingw-dist],[1.0],[http://mingw.org/reporting_bugs]) | |
25 | + AC_INIT([mingw-dist],[2.0],[http://mingw.org/reporting_bugs]) | |
26 | 26 | |
27 | 27 | # Check for required tools. |
28 | 28 | # |
29 | + m4_include([makeopts.m4]) | |
30 | + MINGW_AC_MAKE_NO_PRINT_DIRECTORY | |
29 | 31 | AC_PROG_LN_S |
30 | 32 | |
31 | 33 | # Specify all makefiles which are to be created |
@@ -0,0 +1,59 @@ | ||
1 | +## makeopts.m4 -*- autoconf -*- vim: filetype=config | |
2 | +## | |
3 | +## $Id$ | |
4 | +## | |
5 | +## Written by Keith Marshall <keithmarshall@users.sourceforge.net> | |
6 | +## Copyright (C) 2013, MinGW.org Project | |
7 | +## | |
8 | +## | |
9 | +## Autoconf macros to check for options supported by 'make'. | |
10 | +## | |
11 | +## | |
12 | +## This is free software. Permission is hereby granted to copy | |
13 | +## and redistribute this software, either as is or in modified form, | |
14 | +## subject only to the restrictions that the original author's notice | |
15 | +## of copyright and disclaimers of warranty and of liability shall be | |
16 | +## preserved without change in EVERY copy, and that modified copies | |
17 | +## shall be clearly identified as such. | |
18 | +## | |
19 | +## This software is provided "as is", in the hope that it may prove | |
20 | +## useful, but there is NO WARRANTY OF ANY KIND; not even an implied | |
21 | +## WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR A PARTICULAR PURPOSE. | |
22 | +## Under no circumstances will the author, or the MinGW Project, accept | |
23 | +## liability for any damages, however caused, arising from the use of | |
24 | +## this software. | |
25 | + | |
26 | + | |
27 | +# MINGW_AC_MAKE_OPTION_SUPPORTED( VARNAME, OPTION ) | |
28 | +# ------------------------------------------------- | |
29 | +# If OPTION is supported by make, set VARNAME=' OPTION', otherwise | |
30 | +# set VARNAME to nothing; in either case, call AC_SUBST for VARNAME. | |
31 | +# | |
32 | +AC_DEFUN([MINGW_AC_MAKE_OPTION_SUPPORTED], | |
33 | +[AC_REQUIRE([AC_PROG_MAKE_SET])dnl | |
34 | + AC_MSG_CHECKING([whether make supports the $2 option]) | |
35 | + TAB=' ' $1=; mkdir conftest.dir | |
36 | + cat <<-EOF> conftest.dir/Makefile | |
37 | + conftest: | |
38 | + ${TAB}@\$(MAKE) $2 conftest-recursive | |
39 | + | |
40 | + conftest-recursive: | |
41 | + ${TAB}@true | |
42 | + EOF | |
43 | + ( cd conftest.dir; make >/dev/null 2>&1 ) && ac_val=yes $1=' $2' || ac_val=no | |
44 | + rm -rf conftest.dir | |
45 | + AC_MSG_RESULT([$ac_val])dnl | |
46 | + AC_SUBST([$1])dnl | |
47 | +])# MINGW_AC_MAKE_OPTION_SUPPORTED | |
48 | + | |
49 | +# MINGW_AC_MAKE_NO_PRINT_DIRECTORY | |
50 | +# -------------------------------- | |
51 | +# Assign NO_PRINT_DIRECTORY=" --no-print-directory", if make supports | |
52 | +# the --no-print-directory option, otherwise leave NO_PRINT_DIRECTORY | |
53 | +# unassigned; in either case, call AC_SUBST for NO_PRINT_DIRECTORY. | |
54 | +# | |
55 | +AC_DEFUN([MINGW_AC_MAKE_NO_PRINT_DIRECTORY], | |
56 | +[MINGW_AC_MAKE_OPTION_SUPPORTED([NO_PRINT_DIRECTORY],[--no-print-directory])dnl | |
57 | +])# MINGW_AC_MAKE_NO_PRINT_DIRECTORY | |
58 | + | |
59 | +# $RCSfile$: end of file |