Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Nov 2010 00:12:42 GMT
From:      Diego Schulz <dschulz@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/152585: Update port: www/cherokee
Message-ID:  <201011260012.oAQ0CgoE008354@red.freebsd.org>
Resent-Message-ID: <201011260020.oAQ0K5b0065257@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         152585
>Category:       ports
>Synopsis:       Update port: www/cherokee
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 26 00:20:05 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Diego Schulz
>Release:        
>Organization:
>Environment:
>Description:
The attached patch updates the www/cherokee port from  version 1.0.9 to 1.0.10.

Updated files:
./Makefile
./distinfo
./pkg-plist
./files/patch-cherokee-admin-systemstats.py

Removed files:
./files/patch-cherokee-admin-market-Package.py
./files/patch-cherokee-main_admin.c
./files/patch-cherokee-util.c

to apply:

cd $PORTSDIR/www/cherokee && patch -p1 < /path/to/the/patch-109-to-1010.diff.txt

and then remove the .orig files.

Thanks!






>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN cherokee/Makefile cherokee-new/Makefile
--- cherokee/Makefile	2010-11-25 11:00:15.000000000 -0300
+++ cherokee-new/Makefile	2010-11-25 11:26:29.000000000 -0300
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	cherokee
-PORTVERSION=	1.0.9
+PORTVERSION=	1.0.10
 CATEGORIES=	www
 MASTER_SITES=	http://www.cherokee-project.com/download/1.0/${PORTVERSION}/ \
 		http://cherokee.osuosl.org/1.0/${PORTVERSION}/ \
diff -ruN cherokee/distinfo cherokee-new/distinfo
--- cherokee/distinfo	2010-11-25 11:00:15.000000000 -0300
+++ cherokee-new/distinfo	2010-11-25 11:47:59.000000000 -0300
@@ -1,2 +1,2 @@
-SHA256 (cherokee-1.0.9.tar.gz) = ab637e411717a57545f374e0c44b1e1ecb421e0a57a70f5fb456029631c4db46
-SIZE (cherokee-1.0.9.tar.gz) = 5784929
+SHA256 (cherokee-1.0.10.tar.gz) = 688b8112506c2692cd0547dc9f4dc0837aa1a4b38d077ec3dacef3acacbe474d
+SIZE (cherokee-1.0.10.tar.gz) = 5689814
diff -ruN cherokee/files/patch-cherokee-admin-market-Package.py cherokee-new/files/patch-cherokee-admin-market-Package.py
--- cherokee/files/patch-cherokee-admin-market-Package.py	2010-11-18 08:08:18.000000000 -0300
+++ cherokee-new/files/patch-cherokee-admin-market-Package.py	1969-12-31 20:00:00.000000000 -0400
@@ -1,9 +0,0 @@
---- admin/market/Package.py-orig	2010-11-15 18:14:42.000000000 -0300
-+++ admin/market/Package.py	2010-11-15 18:14:57.000000000 -0300
-@@ -30,5 +30,5 @@
-         self.status_setup      = CTK.ImageStock('loading')
- 
-         table  = CTK.Table()
--        table += [CTK.RawHTML ("Uncompress"),
-+        table += [CTK.RawHTML ("Uncompress"),]
- 
diff -ruN cherokee/files/patch-cherokee-admin-systemstats.py cherokee-new/files/patch-cherokee-admin-systemstats.py
--- cherokee/files/patch-cherokee-admin-systemstats.py	2010-11-18 08:08:18.000000000 -0300
+++ cherokee-new/files/patch-cherokee-admin-systemstats.py	2010-11-25 20:40:41.000000000 -0300
@@ -1,12 +1,19 @@
---- admin/SystemStats.py-orig	2010-11-03 13:54:15.000000000 -0300
-+++ admin/SystemStats.py	2010-11-17 20:21:01.000000000 -0300
-@@ -42,6 +42,9 @@
+--- admin/SystemStats.py-orig	2010-11-18 07:53:18.000000000 -0300
++++ admin/SystemStats.py	2010-11-25 20:38:23.000000000 -0300
+@@ -23,6 +23,7 @@
+ #
+ 
+ import os
++import popen
+ import re
+ import sys
+ import time
+@@ -42,6 +43,8 @@
              _stats = System_stats__Linux()
          elif sys.platform == 'darwin':
              _stats = System_stats__Darwin()
-+        elif sys.platform.rstrip('987') == 'freebsd' :
++        elif sys.platform.startswith ('freebsd'):
 +            _stats = System_stats__FreeBSD()
-+        
  
      assert _stats, "Not implemented"
      return _stats
@@ -15,121 +22,121 @@
  
  
 +
-+# FreeBSD implementation	
++# FreeBSD implementation
 +class System_stats__FreeBSD (Thread, System_stats):
 +    CHECK_INTERVAL = 2
 +
 +    def __init__ (self):
 +        Thread.__init__ (self)
 +        System_stats.__init__ (self)
++        
++        self.vmstat_fd = subprocess.Popen ("/usr/bin/vmstat -H -w%d" %(self.CHECK_INTERVAL),
++                                            shell=True, stdout = subprocess.PIPE, close_fds=True )
++
++	#first,second = self.vmstat_fd.stdout.readline(),self.vmstat_fd.stdout.readline()
 +
-+        self.cpu._user_prev = 0
-+        self.cpu._sys_prev  = 0
-+        self.cpu._nice_prev = 0
-+        self.cpu._idle_prev = 0
 +
 +        # Read valid values
 +        self._read_hostname()
 +        self._read_cpu()
 +        self._read_memory()
-+        self._read_cpu_info()
++        self._read_cpu_and_mem_info()
 +
 +        self.start()
 +
 +    def _read_hostname (self):
-+        import os
-+
-+	hname = os.uname()[1]
-+
-+	if not hname:
-+          # Execute sysctl 
-+          fd = subprocess.Popen ("/sbin/sysctl -n kern.hostname", shell=True, stdout = subprocess.PIPE)
-+          hname = fd.stdout.readline().strip()
-+
-+        self.hostname=hname
-+
-+    def _read_cpu_info (self):
-+	    
-+	fd = subprocess.Popen("/sbin/sysctl hw.ncpu  hw.clockrate  kern.threads.virtual_cpu", shell=True, stdout =subprocess.PIPE)    
-+        lines = fd.stdout.readlines()
-+     
-+
-+        ncpus=0
-+        vcpus=0 
-+	clock=''
++        # First try: uname()
++	self.hostname = os.uname()[1]
++        if self.hostname:
++            return
++
++        # Second try: sysctl()
++        ret = popen.popen_sync ("/sbin/sysctl -n kern.hostname")
++        self.hostname = ret['stdout'].rstrip()
++        if self.hostname:
++            return
++
++        # Could not figure it out
++        self.hostname = "Unknown"
++
++    def _read_cpu_and_mem_info (self):
++        # Execute sysctl
++        ret = popen.popen_sync ("/sbin/sysctl hw.ncpu hw.clockrate kern.threads.virtual_cpu hw.pagesize vm.stats.vm.v_page_count")
++        lines = filter (lambda x: x, ret['stdout'].split('\n'))
++
++        # Parse output
++	
++	# cpu related
++        ncpus = 0
++        vcpus = 0
++	clock = ''
++
++        # mem related
++	psize  = 0
++	pcount = 0
 +
 +	for line in lines:
 +	    parts = line.split()
 +	    if parts[0] == 'hw.ncpu:':
 +		ncpus = int(parts[1])
 +            elif parts[0] == 'hw.clockrate:':
-+		clock = parts[1] 
++		clock = parts[1]
 +            elif parts[0] == 'kern.threads.virtual_cpu:':
-+		vcpus = parts[1] 
-+
++		vcpus = parts[1]
++            elif parts[0] == 'vm.stats.vm.v_page_count:':
++		pcount = int(parts[1])
++            elif parts[0] == 'hw.pagesize:':
++		psize = int(parts[1])
++
++	# Deal with cores
++        if vcpus:
++            self.cpu.num   = str (int(vcpus) / int(ncpus))
++            self.cpu.cores = vcpus
++        else:
++            self.cpu.num   = int (ncpus)
++            self.cpu.cores = int (ncpus)
 +
-+	# FIXME: Is this reliable?
-+	self.cpu.num=str(int(vcpus)/int(ncpus))
-+ 	self.cpu.cores=vcpus
-+        
++        # Global speed
 +	self.cpu.speed = '%s MHz' %(clock)
 +
++
++	# Physical mem
++	self.mem.total = (psize * pcount) / 1024 
++
 +    def _read_cpu (self):
-+	fd = subprocess.Popen("/sbin/sysctl -n kern.cp_time", shell=True, stdout =subprocess.PIPE)    
++
++	# Read a new line
++        line = self.vmstat_fd.stdout.readline().rstrip('\n')
++
++        # Skip headers
++	if len(filter (lambda x: x not in " .0123456789", line)):
++	    return
 +        
-+	fields = fd.stdout.readline().split()
++        # Parse
++	parts = filter (lambda x: x, line.split(' '))
 +
-+        user = float(fields[0])
-+        sys  = float(fields[1])
-+        nice = float(fields[2])
-+#	intr = float(fields[3]) # 4th is interrupts, not used
-+        idle = float(fields[4])
-+
-+        total = ((user - self.cpu._user_prev) + (sys - self.cpu._sys_prev) + (nice - self.cpu._nice_prev) + (idle - self.cpu._idle_prev))
-+        self.cpu.usage = int(100.0 * ((user + sys + nice) - (self.cpu._user_prev + self.cpu._sys_prev + self.cpu._nice_prev)) / (total + 0.001) + 0.5)
-+
-+        if (self.cpu.usage > 100):
-+            self.cpu.usage = 100
-+
-+        self.cpu.idle = 100 - self.cpu.usage
-+
-+        self.cpu._user_prev = user
-+        self.cpu._sys_prev  = sys
-+        self.cpu._nice_prev = nice
-+        self.cpu._idle_prev = idle
++	if not len(parts) == 18:
++		return
++
++	self.cpu.idle  = int(parts[17])
++	self.cpu.usage = 100 - self.cpu.idle
 +
 +    def _read_memory (self):
 +
-+	# What we need from sysctl:
-+	#  * vm.stats.vm.v_free_count
-+        #  * vm.stats.vm.v_page_count
-+        #  * hw.pagesize
-+
-+        # physical memory free = v_free_count*page_size;
-+        # physical memory size = v_page_count*page_size;
-+        # physical memory used = size - free space
-+
-+	fd = subprocess.Popen("/sbin/sysctl vm.stats.vm.v_active_count vm.stats.vm.v_page_count hw.pagesize", shell=True, stdout =subprocess.PIPE)    
-+	lines = fd.stdout.readlines()
-+
-+        pagesize  = 0
-+        pagecount = 0
-+        activecount = 0
++        line = self.vmstat_fd.stdout.readline().rstrip('\n')
 +
-+	for line in lines:
-+	    parts = line.split()
-+	    if   parts[0] == 'hw.pagesize:':
-+               pagesize = int(parts[1])
-+            elif parts[0] == 'vm.stats.vm.v_active_count:':   
-+               activecount = int(parts[1])
-+            elif parts[0] == 'vm.stats.vm.v_page_count:':   
-+	       pagecount = int(parts[1])
++        # Skip headers
++        if len(filter (lambda x: x not in " .0123456789", line)):
++            return
 +
++        # Parse
++        values = filter (lambda x: x, line.split(' '))
 +
-+        self.mem.total = (pagesize * pagecount) / 1024
-+        self.mem.free  = (pagesize * (pagecount-activecount)) / 1024
-+        self.mem.used  = (pagesize * activecount) / 1024
++	if not len(values)==18:
++		return 
 +
++        self.mem.free  = int(values[4]) 
++        self.mem.used  = self.mem.total - self.mem.free
 +
 +    def run (self):
 +        while True:
@@ -141,9 +148,3 @@
  if __name__ == '__main__':
      sys_stats = get_system_stats()
  
-@@ -305,3 +432,5 @@
-         print 'free',  sys_stats.mem.free
- 
-         time.sleep(1)
-+
-+
diff -ruN cherokee/files/patch-cherokee-main_admin.c cherokee-new/files/patch-cherokee-main_admin.c
--- cherokee/files/patch-cherokee-main_admin.c	2010-11-18 08:08:18.000000000 -0300
+++ cherokee-new/files/patch-cherokee-main_admin.c	1969-12-31 20:00:00.000000000 -0400
@@ -1,13 +0,0 @@
---- cherokee/main_admin.c-orig	2010-10-29 07:11:18.000000000 -0300
-+++ cherokee/main_admin.c	2010-11-15 16:56:39.000000000 -0300
-@@ -35,6 +35,10 @@
- #include "server-protected.h"
- #include "util.h"
- 
-+#ifdef HAVE_SYS_WAIT_H
-+# include <sys/wait.h>
-+#endif
-+
- #ifdef HAVE_GETOPT_LONG
- # include <getopt.h>
- #else
diff -ruN cherokee/files/patch-cherokee-util.c cherokee-new/files/patch-cherokee-util.c
--- cherokee/files/patch-cherokee-util.c	2010-11-18 08:08:18.000000000 -0300
+++ cherokee-new/files/patch-cherokee-util.c	1969-12-31 20:00:00.000000000 -0400
@@ -1,14 +0,0 @@
---- cherokee/util.c-orig	2010-11-15 17:53:34.000000000 -0300
-+++ cherokee/util.c	2010-11-15 17:56:46.000000000 -0300
-@@ -38,6 +38,11 @@
- #include <errno.h>
- #include <fcntl.h>
- 
-+ 
-+#ifdef HAVE_SYS_WAIT_H
-+# include <sys/wait.h>
-+#endif
-+
- #ifdef HAVE_SYS_TIME_H
- # include <sys/time.h>
- #else
diff -ruN cherokee/pkg-plist cherokee-new/pkg-plist
--- cherokee/pkg-plist	2010-11-25 11:00:15.000000000 -0300
+++ cherokee-new/pkg-plist	2010-11-25 20:28:01.000000000 -0300
@@ -297,7 +297,6 @@
 %%ADMIN%%%%DATADIR%%/admin/market/InstallUtil.py
 %%ADMIN%%%%DATADIR%%/admin/market/Install_Log.py
 %%ADMIN%%%%DATADIR%%/admin/market/Menu.py
-%%ADMIN%%%%DATADIR%%/admin/market/Package.py
 %%ADMIN%%%%DATADIR%%/admin/market/PageApp.py
 %%ADMIN%%%%DATADIR%%/admin/market/PageCategory.py
 %%ADMIN%%%%DATADIR%%/admin/market/PageIndex.py
@@ -323,7 +322,6 @@
 %%ADMIN%%%%DATADIR%%/admin/market/Maintenance.pyc
 %%ADMIN%%%%DATADIR%%/admin/market/ows_consts.pyc
 %%ADMIN%%%%DATADIR%%/admin/market/CommandProgress.pyc
-%%ADMIN%%%%DATADIR%%/admin/market/Package.pyc
 %%ADMIN%%%%DATADIR%%/admin/CTK/CTK/Init.py
 %%ADMIN%%%%DATADIR%%/admin/CTK/CTK/Paginator.py
 %%ADMIN%%%%DATADIR%%/admin/CTK/CTK/StarRating.py
@@ -566,6 +564,7 @@
 %%ADMIN%%%%DATADIR%%/admin/CTK/static/images/carousel-left-arrow.png
 %%ADMIN%%%%DATADIR%%/admin/CTK/static/images/carousel-right-arrow.png
 %%ADMIN%%%%DATADIR%%/admin/CTK/static/js/StarRating.js
+%%ADMIN%%%%DATADIR%%/admin/static/images/other/latest.png
 %%ADMIN%%%%DATADIR%%/admin/static/images/other/linkedin.png
 %%ADMIN%%%%DATADIR%%/admin/static/images/other/irc.png
 %%ADMIN%%%%DATADIR%%/admin/static/images/other/left.png
@@ -1005,6 +1004,10 @@
 %%DATADIR%%/themes/plain/footer.html
 %%DATADIR%%/themes/plain/header.html
 %%DATADIR%%/themes/plain/theme.css
+%%DATADIR%%/themes/white/header.html
+%%DATADIR%%/themes/white/footer.html
+%%DATADIR%%/themes/white/entry.html
+%%DATADIR%%/themes/white/theme.css
 www/cherokee/images/cherokee-logo.png
 www/cherokee/images/default-bg.png
 www/cherokee/images/favicon.ico
@@ -1014,6 +1017,7 @@
 @dirrm www/cherokee
 %%NLS%%@dirrmtry share/locale/sv_SE/LC_MESSAGES
 %%NLS%%@dirrmtry share/locale/sv_SE
+@dirrm %%DATADIR%%/themes/white
 @dirrm %%DATADIR%%/themes/plain
 @dirrm %%DATADIR%%/themes/firefox3
 @dirrm %%DATADIR%%/themes/default


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011260012.oAQ0CgoE008354>