svn commit: r1828902 - in /attic/site/docs: flagged/oltu.apache.org/ flagged/oltu/ scripts/add-banner.lua

2018-04-11 Thread henkp
Author: henkp
Date: Wed Apr 11 14:24:19 2018
New Revision: 1828902

URL: http://svn.apache.org/viewvc?rev=1828902=rev
Log:
fix add-banner

Added:
attic/site/docs/flagged/oltu.apache.org/
  - copied from r1828862, attic/site/docs/flagged/oltu/
Removed:
attic/site/docs/flagged/oltu/
Modified:
attic/site/docs/scripts/add-banner.lua

Modified: attic/site/docs/scripts/add-banner.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/add-banner.lua?rev=1828902=1828901=1828902=diff
==
--- attic/site/docs/scripts/add-banner.lua (original)
+++ attic/site/docs/scripts/add-banner.lua Wed Apr 11 14:24:19 2018
@@ -94,7 +94,7 @@ function handle(r)
   local err = nil
   local HOST = r.hostname
   local PROJ, _ = string.gsub ( HOST, '.apache.org', '' )
-  local PATH = r.pathinfo
+  local PATH = r.path_info
   local TEST = false
 
   r.content_type = "text/html"
@@ -104,26 +104,7 @@ function handle(r)
   --   r:puts( string.format("arg [%s] [%s]\n", k, v) )
   -- end
 
-  if get.PROJ then
-if get.PROJ == '' then
-  err = "PROJ is empty"
-else
-  PROJ = get.PROJ
-  HOST = PROJ .. '.apache.org'
-end
---else
---  local uri = r.unparsed_uri:sub(string.len(PROG)-1)
---  local idx = uri:find('/')
---  if idx then
---PROJ = uri:sub(1,idx-1) ; PATH = uri:sub(idx+1)
---  else
---PROJ = uri ; PATH = ''
---  end
-  end
-
-  if err ~= nil then r:puts(err) return apache2.OK end
-
-  if not TEST and not get.test and not in_attic(PROJ) then
+  if not TEST and not get.test and not in_attic(HOST) then
 err = "project is not in attic"
   .. " PROJ [" .. PROJ .. "]"
   .. " HOST [" .. HOST .. "]"




Re: += scripts/

2018-04-11 Thread Jan Iversen
of course, no problem.

rgds
jan i

Sent from my iPad

> On 11 Apr 2018, at 08:06, Henk P. Penning  wrote:
> 
> Hi,
> 
>  I will add a scripts/ directory to the attic-site shortly,
>  for the script that adds a banner to retired TLP sites.
> 
>  Hope that's OK ; regards, Henk Penning
> 
>    _
> Henk P. Penning, ICT-beta R Uithof MG-403_/ \_
> Faculty of Science, Utrecht UniversityT +31 30 253 4106 / \_/ \
> Leuvenlaan 4, 3584CE Utrecht, NL  F +31 30 253 4553 \_/ \_/
> http://www.staff.science.uu.nl/~penni101/ M penn...@uu.nl \_/


svn commit: r1828888 - /attic/site/docs/scripts/add-banner.lua

2018-04-11 Thread henkp
Author: henkp
Date: Wed Apr 11 09:43:21 2018
New Revision: 182

URL: http://svn.apache.org/viewvc?rev=182=rev
Log:
fix add-banner

Modified:
attic/site/docs/scripts/add-banner.lua

Modified: attic/site/docs/scripts/add-banner.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/add-banner.lua?rev=182=1828887=182=diff
==
--- attic/site/docs/scripts/add-banner.lua (original)
+++ attic/site/docs/scripts/add-banner.lua Wed Apr 11 09:43:21 2018
@@ -119,7 +119,7 @@ function handle(r)
 --  else
 --PROJ = uri ; PATH = ''
 --  end
---end
+  end
 
   if err ~= nil then r:puts(err) return apache2.OK end
 




svn commit: r1828887 - /attic/site/docs/scripts/add-banner.lua

2018-04-11 Thread henkp
Author: henkp
Date: Wed Apr 11 09:42:16 2018
New Revision: 1828887

URL: http://svn.apache.org/viewvc?rev=1828887=rev
Log:
fix add-banner

Modified:
attic/site/docs/scripts/add-banner.lua

Modified: attic/site/docs/scripts/add-banner.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/add-banner.lua?rev=1828887=1828886=1828887=diff
==
--- attic/site/docs/scripts/add-banner.lua (original)
+++ attic/site/docs/scripts/add-banner.lua Wed Apr 11 09:42:16 2018
@@ -108,17 +108,18 @@ function handle(r)
 if get.PROJ == '' then
   err = "PROJ is empty"
 else
-  PROJ = r.subprocess_env['REQUEST_URI']
+  PROJ = get.PROJ
+  HOST = PROJ .. '.apache.org'
 end
-  else
-local uri = r.unparsed_uri:sub(string.len(PROG)-1)
-local idx = uri:find('/')
-if idx then
-  PROJ = uri:sub(1,idx-1) ; PATH = uri:sub(idx+1)
-else
-  PROJ = uri ; PATH = ''
-end
-  end
+--else
+--  local uri = r.unparsed_uri:sub(string.len(PROG)-1)
+--  local idx = uri:find('/')
+--  if idx then
+--PROJ = uri:sub(1,idx-1) ; PATH = uri:sub(idx+1)
+--  else
+--PROJ = uri ; PATH = ''
+--  end
+--end
 
   if err ~= nil then r:puts(err) return apache2.OK end
 




svn commit: r1828886 - /attic/site/docs/scripts/add-banner.lua

2018-04-11 Thread henkp
Author: henkp
Date: Wed Apr 11 09:36:29 2018
New Revision: 1828886

URL: http://svn.apache.org/viewvc?rev=1828886=rev
Log:
fix add-banner

Modified:
attic/site/docs/scripts/add-banner.lua

Modified: attic/site/docs/scripts/add-banner.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/add-banner.lua?rev=1828886=1828885=1828886=diff
==
--- attic/site/docs/scripts/add-banner.lua (original)
+++ attic/site/docs/scripts/add-banner.lua Wed Apr 11 09:36:29 2018
@@ -92,7 +92,7 @@ function in_attic(p) return exists ( ATT
 function handle(r)
   local get = r:parseargs()
   local err = nil
-  local HOST = r:hostname
+  local HOST = r.hostname
   local PROJ, _ = string.gsub ( HOST, '.apache.org', '' )
   local PATH = r.pathinfo
   local TEST = false




svn commit: r1828870 - /attic/site/docs/scripts/add-banner.lua

2018-04-11 Thread henkp
Author: henkp
Date: Wed Apr 11 08:00:05 2018
New Revision: 1828870

URL: http://svn.apache.org/viewvc?rev=1828870=rev
Log:
fix add-banner

Modified:
attic/site/docs/scripts/add-banner.lua

Modified: attic/site/docs/scripts/add-banner.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/add-banner.lua?rev=1828870=1828869=1828870=diff
==
--- attic/site/docs/scripts/add-banner.lua (original)
+++ attic/site/docs/scripts/add-banner.lua Wed Apr 11 08:00:05 2018
@@ -122,7 +122,7 @@ function handle(r)
   if err ~= nil then r:puts(err) return apache2.OK end
 
   if not TEST and not get.test and not in_attic(PROJ) then
-err = "project is not in attic [" .. PROJ .. "]"
+err = "project is not in attic [" .. PROJ .. "] [" .. r.unparsed_uri .. "]"
   end
 
   if err ~= nil then




svn commit: r1828865 - /attic/site/docs/scripts/add-banner.lua

2018-04-11 Thread henkp
Author: henkp
Date: Wed Apr 11 06:30:36 2018
New Revision: 1828865

URL: http://svn.apache.org/viewvc?rev=1828865=rev
Log:
fix add-banner

Modified:
attic/site/docs/scripts/add-banner.lua

Modified: attic/site/docs/scripts/add-banner.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/add-banner.lua?rev=1828865=1828864=1828865=diff
==
--- attic/site/docs/scripts/add-banner.lua (original)
+++ attic/site/docs/scripts/add-banner.lua Wed Apr 11 06:30:36 2018
@@ -82,7 +82,7 @@ function change_loc()
 
 ]=]
 
-local PROG  = 'add-banner.lua' ;
+local PROG  = 'scripts/add-banner.lua' ;
 local ATTIC_DIR  = '/var/www/attic.apache.org/'
 local ATTIC_PRJS = ATTIC_DIR .. 'flagged/'
 




svn commit: r1828864 - /attic/site/docs/scripts/add-banner.lua

2018-04-11 Thread henkp
Author: henkp
Date: Wed Apr 11 06:26:06 2018
New Revision: 1828864

URL: http://svn.apache.org/viewvc?rev=1828864=rev
Log:
add-banner -= try2

Modified:
attic/site/docs/scripts/add-banner.lua

Modified: attic/site/docs/scripts/add-banner.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/add-banner.lua?rev=1828864=1828863=1828864=diff
==
--- attic/site/docs/scripts/add-banner.lua (original)
+++ attic/site/docs/scripts/add-banner.lua Wed Apr 11 06:26:06 2018
@@ -77,7 +77,7 @@ function change_loc()
   
   
   
-  
+  
 
 
 ]=]
@@ -94,7 +94,7 @@ function handle(r)
   local err = nil
   local PROJ
   local PATH
-  local TEST = true
+  local TEST = false
 
   r.content_type = "text/html"
 
@@ -110,8 +110,7 @@ function handle(r)
   PROJ = r.subprocess_env['REQUEST_URI']
 end
   else
--- |try2| == 1 + 3
-local uri = r.unparsed_uri:sub(3+string.len(PROG))
+local uri = r.unparsed_uri:sub(string.len(PROG)-1)
 local idx = uri:find('/')
 if idx then
   PROJ = uri:sub(1,idx-1) ; PATH = uri:sub(idx+1)




svn commit: r1828863 - in /attic/site/docs/scripts: ./ add-banner.lua

2018-04-11 Thread henkp
Author: henkp
Date: Wed Apr 11 06:18:31 2018
New Revision: 1828863

URL: http://svn.apache.org/viewvc?rev=1828863=rev
Log:
init add-banner.lua

Added:
attic/site/docs/scripts/
attic/site/docs/scripts/add-banner.lua   (with props)

Added: attic/site/docs/scripts/add-banner.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/add-banner.lua?rev=1828863=auto
==
--- attic/site/docs/scripts/add-banner.lua (added)
+++ attic/site/docs/scripts/add-banner.lua Wed Apr 11 06:18:31 2018
@@ -0,0 +1,142 @@
+local posix = require 'posix'
+local TEMPL = [=[
+http://www.w3.org/TR/html4/loose.dtd;>
+
+
+Project !PROJ! is retired.
+
+
+
+
+//!HOST! ..."
+loc.innerHTML = '

' + + '[to leave frame] ' + + 'Use the show only this frame function ' + + 'of your browser.' +return ; + } +var url = 'http://attic.apache.org/projects/!PROJ!.html";>' + + 'attic page' +top.innerHTML = "Project !PROJ! is retired ; " + + "for details, see !PROJ!'s " + url + '.' +loc.innerHTML = '

location: ' + + f2.contentWindow.location.pathname + } +//]]> + + + + + + + + + + +]=] + +local PROG = 'add-banner.lua' ; +local ATTIC_DIR = '/var/www/attic.apache.org/' +local ATTIC_PRJS = ATTIC_DIR .. 'flagged/' + +function exists(f) return posix.stat(f) ~= nil end +function in_attic(p) return exists ( ATTIC_PRJS .. p ) end + +function handle(r) + local get = r:parseargs() + local err = nil + local PROJ + local PATH + local TEST = true + + r.content_type = "text/html" + + -- r:puts ( r.unparsed_uri .. "\n" ) + -- for k, v in pairs ( get ) do + -- r:puts( string.format("arg [%s] [%s]\n", k, v) ) + -- end + + if get.PROJ then +if get.PROJ == '' then + err = "PROJ is empty" +else + PROJ = r.subprocess_env['REQUEST_URI'] +end + else +-- |try2| == 1 + 3 +local uri = r.unparsed_uri:sub(3+string.len(PROG)) +local idx = uri:find('/') +if idx then + PROJ = uri:sub(1,idx-1) ; PATH = uri:sub(idx+1) +else + PROJ = uri ; PATH = '' +end + end + + if err ~= nil then r:puts(err) return apache2.OK end + + if not TEST and not get.test and not in_attic(PROJ) then +err = "project is not in attic [" .. PROJ .. "]" + end + + if err ~= nil then +r:puts(err) + else +local text = TEMPL +local subs = + { ['!PROJ!'] = PROJ + , ['!HOST!'] = PROJ .. '.apache.org' + , ['!PATH!'] = PATH + } +for k, v in pairs ( subs ) do text, _ = string.gsub ( text, k, v ) end +r:puts(text) + end + return apache2.OK +end Propchange: attic/site/docs/scripts/add-banner.lua -- svn:executable = *


+= scripts/

2018-04-11 Thread Henk P. Penning

Hi,

  I will add a scripts/ directory to the attic-site shortly,
  for the script that adds a banner to retired TLP sites.

  Hope that's OK ; regards, Henk Penning

   _
Henk P. Penning, ICT-beta R Uithof MG-403_/ \_
Faculty of Science, Utrecht UniversityT +31 30 253 4106 / \_/ \
Leuvenlaan 4, 3584CE Utrecht, NL  F +31 30 253 4553 \_/ \_/
http://www.staff.science.uu.nl/~penni101/ M penn...@uu.nl \_/