ccan.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Misc fixes for webpages target
@ 2016-03-25 13:12 Andrew Jeffery
  2016-03-25 13:12 ` [PATCH 1/3] Makefile-ccan: Add cppmagic to MODS_NO_SRC Andrew Jeffery
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Jeffery @ 2016-03-25 13:12 UTC (permalink / raw)
  To: ccan

Hi all,

Here are a few patches to fix up issuess I encountered with the webpages make
target. Two patches are to do with supporting newer versions of PHP, and one is
to fix cppmagic violating the modcheck sanity test.

Cheers,

Andrew

Andrew Jeffery (3):
  Makefile-ccan: Add cppmagic to MODS_NO_SRC
  Makefile-web: Introduce variable for PHP binary
  staticmoduleinfo: Replace deprecated split() with explode()

 Makefile-ccan            |  3 ++-
 Makefile-web             | 14 +++++++++-----
 web/staticmoduleinfo.php |  2 +-
 3 files changed, 12 insertions(+), 7 deletions(-)

-- 
2.7.3

_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] Makefile-ccan: Add cppmagic to MODS_NO_SRC
  2016-03-25 13:12 [PATCH 0/3] Misc fixes for webpages target Andrew Jeffery
@ 2016-03-25 13:12 ` Andrew Jeffery
  2016-03-25 13:12 ` [PATCH 2/3] Makefile-web: Introduce variable for PHP binary Andrew Jeffery
  2016-03-25 13:12 ` [PATCH 3/3] staticmoduleinfo: Replace deprecated split() with explode() Andrew Jeffery
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Jeffery @ 2016-03-25 13:12 UTC (permalink / raw)
  To: ccan

The error below was encountered when building the webpages target:

    $ mkdir /tmp/ccan-webdir
    $ make WEBDIR=/tmp/ccan-webdir webpages
    ...
    inter-depends
    [ "" ] || ! git status --porcelain | grep .
    mkdir -p /tmp/ccan-webdir/tarballs
    mkdir -p /tmp/ccan-webdir/tarballs/with-deps
    mkdir -p /tmp/ccan-webdir/info
    cp config.h /tmp/ccan-webdir/example-config.h
    'cppmagic' found but 'cpuid' in MOD
    Makefile-web:18: recipe for target 'modcheck' failed
    make: *** [modcheck] Error 1
    make: *** Waiting for unfinished jobs....

Add cppmagic to MODS_NO_SRC to avoid the build failure.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 Makefile-ccan | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile-ccan b/Makefile-ccan
index a0be58f..865db9e 100644
--- a/Makefile-ccan
+++ b/Makefile-ccan
@@ -17,6 +17,7 @@ MODS_NO_SRC := alignof \
 	check_type \
 	compiler \
 	container_of \
+	cppmagic \
 	darray \
 	endian \
 	lqueue \
@@ -50,9 +51,9 @@ MODS_WITH_SRC := aga \
 	cdump \
 	charset \
 	ciniparser \
+	cpuid \
 	crc \
 	crcsync \
-	cpuid \
 	crypto/ripemd160 \
 	crypto/sha256 \
 	crypto/shachain \
-- 
2.7.3

_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] Makefile-web: Introduce variable for PHP binary
  2016-03-25 13:12 [PATCH 0/3] Misc fixes for webpages target Andrew Jeffery
  2016-03-25 13:12 ` [PATCH 1/3] Makefile-ccan: Add cppmagic to MODS_NO_SRC Andrew Jeffery
@ 2016-03-25 13:12 ` Andrew Jeffery
  2016-03-25 13:12 ` [PATCH 3/3] staticmoduleinfo: Replace deprecated split() with explode() Andrew Jeffery
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Jeffery @ 2016-03-25 13:12 UTC (permalink / raw)
  To: ccan

I don't have PHP5 installed on my system but I do have PHP7. Allow
selection of the PHP binary through a variable.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 Makefile-web | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/Makefile-web b/Makefile-web
index a7f9297..fc8d818 100644
--- a/Makefile-web
+++ b/Makefile-web
@@ -1,6 +1,10 @@
 # This can be overridden on cmdline to generate pages elsewhere.
 WEBDIR=/srv/www/ccodearchive.net
 
+# Similarly, override on the commandline to use an alternate PHP interpreter
+# (e.g. php7)
+PHP=php5
+
 ALL_PAGES=$(patsubst %, $(WEBDIR)/info/%.html, $(MODS))
 DIRECT_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/%.tar.bz2, $(MODS))
 DEPEND_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/with-deps/%.tar.bz2, $(MODS))
@@ -36,7 +40,7 @@ $(WEBDIR)/junkcode/%.tar.bz2: junkcode/% $(WEBDIR)/junkcode
 
 $(WEBDIR)/junkcode/%.html: $(WEBDIR)/junkcode/%.tar.bz2
 	cd $(WEBDIR) && tar xfj junkcode/$*.tar.bz2
-	URLPREFIX=../ php5 web/staticjunkcode.php junkcode/$* $* > $@
+	URLPREFIX=../ $(PHP) web/staticjunkcode.php junkcode/$* $* > $@
 
 # We want tarball to contain ccan/; we put junkcode in, but don't depend on it.
 $(WEBDIR)/ccan.tar.bz2: config.h Makefile Makefile-ccan $(shell git ls-files ccan tools licenses)
@@ -45,17 +49,17 @@ $(WEBDIR)/ccan.tar.bz2: config.h Makefile Makefile-ccan $(shell git ls-files cca
 $(ALL_PAGES): tools/doc_extract web/staticmoduleinfo.php
 
 $(WEBDIR)/list.html: web/staticall.php tools/doc_extract $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(JUNKBALLS)
-	php5 web/staticall.php ccan/ junkcode/ $(WEBDIR) $(MODS) > $@
+	$(PHP) web/staticall.php ccan/ junkcode/ $(WEBDIR) $(MODS) > $@
 
 $(WEBDIR)/upload.html: web/staticupload.php
-	php5 web/staticupload.php > $@
+	$(PHP) web/staticupload.php > $@
 
 # cpp inserts gratuitous linebreaks at start of file, makes for php problems.
 $(WEBDIR)/uploader.php: web/uploader.php.cpp
 	cpp -w -C -P $< | grep . > $@
 
 $(WEBDIR)/index.html: web/staticindex.php
-	php5 web/staticindex.php > $@
+	$(PHP) web/staticindex.php > $@
 
 $(WEBDIR)/example-config.h: config.h
 	cp $< $@
@@ -74,7 +78,7 @@ $(WEBDIR)/ccan.css: web/ccan.css
 
 $(WEBDIR)/info/%.html: $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
 	@mkdir -p `dirname $@`
-	URLPREFIX=../`echo $* | tr -dc '/' | sed s',/,../,g'` php5 web/staticmoduleinfo.php `pwd`/ccan/$* $* > $@
+	URLPREFIX=../`echo $* | tr -dc '/' | sed s',/,../,g'` $(PHP) web/staticmoduleinfo.php `pwd`/ccan/$* $* > $@
 
 $(WEBDIR)/tarballs/%.tar.bz2: ccan/%/_info clean-tree
 	@mkdir -p `dirname $@`
-- 
2.7.3

_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] staticmoduleinfo: Replace deprecated split() with explode()
  2016-03-25 13:12 [PATCH 0/3] Misc fixes for webpages target Andrew Jeffery
  2016-03-25 13:12 ` [PATCH 1/3] Makefile-ccan: Add cppmagic to MODS_NO_SRC Andrew Jeffery
  2016-03-25 13:12 ` [PATCH 2/3] Makefile-web: Introduce variable for PHP binary Andrew Jeffery
@ 2016-03-25 13:12 ` Andrew Jeffery
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Jeffery @ 2016-03-25 13:12 UTC (permalink / raw)
  To: ccan

split() was deprecated in PHP5 and was removed in PHP7[1]. An
alternative function is explode(), which was introduced in PHP4[1].
So given we previously had a hard dependency on the php5 binary, switch
to explode().

[1] https://secure.php.net/manual/en/function.split.php
[2] https://secure.php.net/manual/en/function.explode.php

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 web/staticmoduleinfo.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web/staticmoduleinfo.php b/web/staticmoduleinfo.php
index 7f388c2..ac4ac68 100644
--- a/web/staticmoduleinfo.php
+++ b/web/staticmoduleinfo.php
@@ -63,7 +63,7 @@ if ($extdepends) {
 <h3>External dependencies:</h3>
 <ul class='external-dependencies'>
 <?php
-	foreach (split("\n", $extdepends) as $dep) {
+	foreach (explode("\n", $extdepends) as $dep) {
 		$fields=preg_split("/\s+/", $dep);
 		echo "<li>" . $fields[0].' ';
 		if (count($fields) > 1)
-- 
2.7.3

_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-25 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-25 13:12 [PATCH 0/3] Misc fixes for webpages target Andrew Jeffery
2016-03-25 13:12 ` [PATCH 1/3] Makefile-ccan: Add cppmagic to MODS_NO_SRC Andrew Jeffery
2016-03-25 13:12 ` [PATCH 2/3] Makefile-web: Introduce variable for PHP binary Andrew Jeffery
2016-03-25 13:12 ` [PATCH 3/3] staticmoduleinfo: Replace deprecated split() with explode() Andrew Jeffery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).