Subject: README.html & binary packages
To: None <tech-pkg@netbsd.org>
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
List: tech-pkg
Date: 06/18/1999 06:08:17
I've been thinking a bit about the way we create our "download" section
in the README.html files. I always annoyed me that "make readme" provides
links for only the binary package matching the current (latest) package
version, and doesn't offer any older binary packages for download:
* i386 (NetBSD 1.4, 1.3.3 )
* arm32 (NetBSD 1.4 )
* sparc (NetBSD 1.4 )
* alpha (NetBSD 1.4 )
where links are on the release numbers. I've reworked this, and now
things look like:
* i386: emacs-20.2 (NetBSD 1.4)
* arm32: emacs-20.3 (NetBSD 1.4)
* sparc: emacs-20.3 (NetBSD 1.3)
* sparc: emacs-20.3 (NetBSD 1.4)
Links are on the package names.
I've attached the code, any comments welcome.
- Hubert
Index: templates/README.pkg
===================================================================
RCS file: /cvsroot/pkgsrc/templates/README.pkg,v
retrieving revision 1.8
diff -u -r1.8 README.pkg
--- README.pkg 1998/08/20 15:17:28 1.8
+++ README.pkg 1999/06/18 04:05:26
@@ -48,10 +48,11 @@
<p>
Click here to <FONT COLOR=red>download</FONT> the package in
-precompiled binary form for the following machine architectures:
-<UL>
+precompiled binary form for the following machine architectures:
+<P>
+<TABLE>
%%BIN_PKGS%%
-</UL>
+</TABLE>
</p>
Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.282
diff -u -r1.282 bsd.pkg.mk
--- bsd.pkg.mk 1999/06/14 01:56:52 1.282
+++ bsd.pkg.mk 1999/06/18 04:05:33
@@ -1825,30 +1826,43 @@
@cd ${PACKAGES}; \
case `/bin/pwd` in \
*/pkgsrc/packages) \
- if [ -f ${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ]; then \
- ${ECHO} "<li> ${MACHINE_ARCH} (${OPSYS} <a href=\"${PKG_URL}/${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX}\"> ${OS_VERSION} </a>)"; \
- fi \
+ for pkg in ${PKGREPOSITORYSUBDIR}/${PKGNAME:C/-[^-]*$/-[0-9]*/}${PKG_SUFX} ; \
+ do \
+ if [ -f "$$pkg" ] ; then \
+ ${ECHO} "<!-- case1 --><TR><TD> ${MACHINE_ARCH}: <TD><a href=\"${PKG_URL}/$pkg\"> <TD>(${OPSYS} ${OS_VERSION}) </a>)"; \
+ fi ; \
+ done ; \
;; \
*) \
cd ${PACKAGES}/../..; \
- for i in [1-9].*/*; do \
- if [ -f $$i/${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ]; then \
- ${ECHO} $$i; \
- fi ; \
+ for i in [1-9].*/*; do ( \
+ cd $$i/${PKGREPOSITORYSUBDIR} ; \
+ for j in ${PKGNAME:C/-[^-]*$/-[0-9]*/}${PKG_SUFX} ; \
+ do \
+ if [ -f "$$j" ] ; then \
+ ${ECHO} $$i/$$j; \
+ fi ; \
+ done ) ; \
done | ${AWK} -F/ ' \
{ \
release = $$1; \
arch = $$2; \
+ pkg = $$3; \
+ gsub("\.tgz","", pkg); \
if (arch != "m68k") { \
if (arch in urls) \
- urls[arch] = "<a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX}\">" release "</a>, " urls[arch]; \
+ urls[arch "/" pkg "/" release] = "<!-- case2 --><a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/" pkg "${PKG_SUFX}\">" pkg "</a>, " urls[arch]; \
else \
- urls[arch] = "<a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX}\">" release "</a> "; \
+ urls[arch "/" pkg "/" release] = "<!-- case3 --><a href=\"${PKG_URL}/" release "/" arch "/${PKGREPOSITORYSUBDIR}/" pkg "${PKG_SUFX}\">" pkg "</a> "; \
} \
} \
END { \
- for (arch in urls) { \
- print "<li> " arch " (NetBSD " urls[arch] ")"; \
+ for (av in urls) { \
+ split(av, ava, "/"); \
+ arch=ava[1]; \
+ pkg=ava[2]; \
+ release=ava[3]; \
+ print "<TR><TD><LI> " arch ": <TD>" urls[av] " <TD>(${OPSYS} " release ")"; \
} \
} ' \
;; \
--
NetBSD - Better for your uptime than Viagra