Re: Publication of mingw-get package catalogues

Keith Marshall <[email protected]> Tue, 27 Aug 2013 21:54:06 +0100
Newsgroups gmane.comp.gnu.mingw.devel
Organization MinGW Project
Message-ID <[email protected]>
On 27/08/13 11:00, Keith Marshall wrote:
>>> I've been thinking, for a while now, that it would be useful to add a
>>> "make published" goal, which could collect and upload all unpublished
>>> files, from the entire tree, then remove the local unpublished file
>>> references.
>>
>> It might be worth it; I would have used it.  The sticky mess being
>> needing to "create" the SF shell.
> 
> If we use sftp, we shouldn't need to "create" an SF shell; something
> like (currently untested):
> 
>   ...snip...

I've now committed an actual implementation, (patch attached).  I've
tested it by repeating the upload of the package-list.xml.lzma file I
generated last night; it appears to work okay.

To use it, you'll need to update your mingw-dist working tree, run
autoconf (or autoreconf) in its top source directory, before rerunning
configure in the top build directory, adding FRS_USERNAME=your_sf_name
to your original set of configure arguments.  You may then simply run

   make published

either in the top builddir, or any one of its working subtrees, to
collect all unpublished catalogues, across all subtrees, and push them
to the FRS.

-- 
Regards,
Keith.

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

_______________________________________________
MinGW-dvlpr mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr
frs-publish.diff (text/x-patch, 4.1 KB)
2013-08-27  Keith Marshall  <[email protected]>

	Add support for automated catalogue publication.

	* Makefile.comm.in (published): New build goal; it redirects to the
	new primary goal implemented...

	* Makefile.in: ...here.
	(published): New primary build goal; implement it, using...
	(frs-username-check, frs-publish): ...these new internal build goals;
	implement them; they should not normally be invoked directly.
	(FRS_USERNAME, FRS_CATALOGUE): New macros; define them.
	(FRS_CATALOGUE_HOST, FRS_CATALOGUE_ROOT, FRS_CATALOGUE_PATH):
	(MAKE_RECURSIVE, PRIMARY_GOALS): Likewise.

	* configure.ac (AC_INIT): Bump version number to 2.2
	(FRS_USERNAME): Declare it as precious; assign "anonymous" as default.

diff --git a/Makefile.comm.in b/Makefile.comm.in
--- a/Makefile.comm.in
+++ b/Makefile.comm.in
@@ -139,13 +139,15 @@ FORCE:
 unpublished:
 	test -d $@ || mkdir $@
 
 # Package lists are dynamically updated, to record the latest issues of each
 # referenced package catalogue; the "sed" script used to accomplish this must
-# be generated, and driven from, within the top build directory.
+# be generated, and driven from, within the top build directory.  Similarly,
+# the procedure for publishing updated catalogues to the file release system
+# must be directed to the top build directory, to process the entire tree.
 #
-update-references issue.sed: FORCE
+published update-references issue.sed: FORCE
 	cd ${top_builddir}; $(MAKE) $@
 
 # Requests to update references will be redirected back to each sub-directory
 # in turn, to be processed by the following recursive make rule.
 #
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -88,10 +88,46 @@ update-references: FORCE
 
 # ...considering all catalogues, in all registered sub-directories.
 #
 update-local-references: @mingw_ac_subdirs@
 
+# Approiately authenticated users may publish updated catalogues
+# via the SourceForge file release system.
+#
+FRS_CATALOGUE_HOST = frs.sourceforge.net
+FRS_CATALOGUE_ROOT = /home/frs/project/mingw
+FRS_CATALOGUE_PATH = $(FRS_CATALOGUE_ROOT)/Installer/mingw-get/catalogue
+
+FRS_CATALOGUE = $(FRS_CATALOGUE_HOST):$(FRS_CATALOGUE_PATH)
+
+published:
+	rm -rf tmp; mkdir tmp
+	cd tmp; @LN_S@ ../*/unpublished/* .
+	@test "x`cd tmp; echo *`x" = 'x*x' \
+	  && echo "NOTE: there are no catalogue files awaiting publication" \
+	  || $(MAKE_RECURSIVE) frs-publish
+	rm -rf tmp
+
+# Publication of updated catalogues, to the file release system,
+# requires an authorised SourceForge user name specification.
+#
+FRS_USERNAME = @FRS_USERNAME@
+MAKE_RECURSIVE = $(MAKE)@NO_PRINT_DIRECTORY@ PRIMARY_GOALS=$(MAKECMDGOALS)
+frs-username-check:
+	@test "x$(FRS_USERNAME)" = "xanonymous" && \
+	  { echo 'ERROR: "$(FRS_USERNAME)" is not a valid FRS_USERNAME'; \
+	    echo 'please try "make FRS_USERNAME=username $(PRIMARY_GOALS)"'; \
+	    exit 1; \
+	  } || true
+
+# For potentially valid user names, publication entails an sftp
+# upload of all staged catalogues, to the file release system.
+#
+frs-publish: frs-username-check
+	cd tmp; echo 'put *' | sftp $(FRS_USERNAME)@$(FRS_CATALOGUE)
+	rm -f */unpublished/*
+
 # The following goals may be specified, when building as a sub-project
 # of mingw-get-setup; pass each request to all designated subdirectories,
 # in each of which it will become a no-op.
 #
 NO_OP_GOALS = build.tag dist clean distclean maintainer-clean
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -20,11 +20,16 @@
 # even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
 # PARTICULAR PURPOSE.  Under no circumstances will the author, or the
 # MinGW Project, accept liability for any damages, however caused,
 # arising from the use of this software.
 #
-  AC_INIT([mingw-dist],[2.1],[http://mingw.org/reporting_bugs])
+  AC_INIT([mingw-dist],[2.2],[http://mingw.org/reporting_bugs])
+
+# Specify a default (invalid) user name, for authentication to FRS.
+#
+  : ${FRS_USERNAME="anonymous"}
+  AC_ARG_VAR([FRS_USERNAME],[user name for FRS authentication [anonymous]])
 
 # Check for required tools.
 #
   m4_include([makeopts.m4])
   MINGW_AC_MAKE_NO_PRINT_DIRECTORY