Your message dated Sun, 11 Oct 2009 00:17:29 +0000
with message-id <[email protected]>
and subject line Bug#482323: fixed in viewvc 1.0.9-1
has caused the Debian Bug report #482323,
regarding [patch] viewvc: tarball from svn reps have incorrect file permissions
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
482323: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482323
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: viewvc
Version: 1.0.5-0.1
Severity: normal
Tags: patch

Hello ViewVC maintainer,

Tarball generated from a subversion repository have all files permissions 
set to 644.  This can break compilation because some script cannot be run.

See upstream tracker: <http://viewvc.tigris.org/issues/show_bug.cgi?id=233>

I am not sure whether the patch in the tracker is totally safe, but it works
for me, and I need that feature.

Please find the patch in quilt format.

Cheers,
Bill

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages viewvc depends on:
ii  cvs                       1:1.12.13-8    Concurrent Versions System
ii  debconf [debconf-2.0]     1.5.11etch1    Debian configuration management sy
ii  gawk                      1:3.1.5.dfsg-4 GNU awk, a pattern scanning and pr
ii  mime-support              3.39-1         MIME files 'mime.types' & 'mailcap
ii  python                    2.4.4-2        An interactive high-level object-o
ii  python-subversion         1.4.2dfsg1-2   Python bindings for Subversion
ii  python-support            0.5.6          automated rebuilding support for p
ii  rcs                       5.7-18         The GNU Revision Control System
ii  subversion                1.4.2dfsg1-2   Advanced version control system

Versions of packages viewvc recommends:
ii  apache [httpd]          1.3.34-4.1+etch1 versatile, high-performance HTTP s
ii  enscript                1.6.4-11         Converts ASCII text to Postscript,

-- debconf information:
* viewvc/forbidden:
* viewvc/svnroots:
* viewvc/cvsroots:
* viewvc/allow_tar: true
* viewvc/defaultroot:
Patch from http://viewvc.tigris.org/issues/show_bug.cgi?id=233
by C. Michael Pilato to fix permission in generated tarballs.

===============================================================

Implement the beginnings of a generic-as-it-gets vclib interface for
item properties, and use it to set the mode for files in generated
tarballs.  A poem for issue #233.

* viewvc/lib/vclib/__init__.py
  (Repository.itemprops): New.
  (ItemProperties): New class for hold properties-related data.

* viewvc/lib/vclib/svn/__init__.py
  (SubversionRepository.itemprops, _make_item_properties): New.

* viewvc/lib/viewvc.py
  (generate_tarball): Check the executable bit for Subversion files.

* viewvc/lib/vclib/bincvs/__init__.py
  (CVSRepository.itemprops): New.

* viewvc/lib/vclib/ccvs/__init__.py
  (CCVSRepository.itemprops): New.  Duplicate of the
    bincvs.CVSRepository implementation, because just using the parent
    class implementation didn't seem to work.

Index: viewvc-1.0.5/lib/vclib/__init__.py
===================================================================
--- viewvc-1.0.5.orig/lib/vclib/__init__.py     2008-05-21 20:24:33.000000000 
+0200
+++ viewvc-1.0.5/lib/vclib/__init__.py  2008-05-21 21:18:58.000000000 +0200
@@ -133,8 +133,11 @@
 
     These object are sort by their line_number components.
     """
-    
 
+  def itemprops(self, path_paths, rev):
+    """Return an ItemProperties object associated with a versioned item."""
+
+  
 # ======================================================================
 class DirEntry:
   "Instances represent items in a directory listing"
@@ -168,6 +171,20 @@
   def __cmp__(self, other):
     return cmp(self.number, other.number)
 
+class ItemProperties:
+  """Instances hold information about properties of versioned resources"""
+
+  """Creata a new ItemProperties() item:
+        IS_BINARY:  Boolean, whether or not the item is binary (non-text)
+        MODE:  chmod()-style file mode
+        PROPS:  Dictionary mapping VC-system-specific property names to
+                their values.
+  """
+  def __init__(self, is_binary, mode, props):
+    self.is_binary = is_binary
+    self.mode = mode
+    self.props = props
+    
 # ======================================================================
 
 class Error(Exception):
Index: viewvc-1.0.5/lib/vclib/bincvs/__init__.py
===================================================================
--- viewvc-1.0.5.orig/lib/vclib/bincvs/__init__.py      2008-05-21 
20:24:33.000000000 +0200
+++ viewvc-1.0.5/lib/vclib/bincvs/__init__.py   2008-05-21 21:18:58.000000000 
+0200
@@ -283,6 +283,13 @@
       if not line or line[0:5] == 'diff ':
         break
     return fp
+
+  def itemprops(self, path_parts, rev):
+    rcsfile = self.rcsfile(path_parts, 1)
+    mode = os.stat(rcsfile)[stat.ST_MODE]
+    ### TODO:  Use keywords to determine binariness.
+    ### TODO:  Return a real set of properties (-kflags, e.g.)
+    return vclib.ItemProperties(0, mode, {})
   
 
 class CVSDirEntry(vclib.DirEntry):
Index: viewvc-1.0.5/lib/vclib/ccvs/__init__.py
===================================================================
--- viewvc-1.0.5.orig/lib/vclib/ccvs/__init__.py        2008-05-21 
20:24:33.000000000 +0200
+++ viewvc-1.0.5/lib/vclib/ccvs/__init__.py     2008-05-21 21:18:58.000000000 
+0200
@@ -15,6 +15,7 @@
 """
 
 import os
+import stat
 import string
 import re
 import cStringIO
@@ -128,6 +129,15 @@
     revision = sink.last and sink.last.string
     return cStringIO.StringIO(string.join(sink.sstext.text, "\n")), revision
 
+  def itemprops(self, path_parts, rev):
+    ### FIXME:  Figure out why this has to be duplicated here instead
+    ### of just using the CVSRepository implementation.
+    rcsfile = self.rcsfile(path_parts, 1)
+    mode = os.stat(rcsfile)[stat.ST_MODE]
+    ### TODO:  Use keywords to determine binariness.
+    ### TODO:  Return a real set of properties (-kflags, e.g.)
+    return vclib.ItemProperties(0, mode, {})
+
 class MatchingSink(rcsparse.Sink):
   """Superclass for sinks that search for revisions based on tag or number"""
 
Index: viewvc-1.0.5/lib/vclib/svn/__init__.py
===================================================================
--- viewvc-1.0.5.orig/lib/vclib/svn/__init__.py 2008-05-21 20:24:33.000000000 
+0200
+++ viewvc-1.0.5/lib/vclib/svn/__init__.py      2008-05-21 21:18:58.000000000 
+0200
@@ -408,6 +408,19 @@
 def get_youngest_revision(svnrepos):
   return svnrepos.youngest
 
+
+def _make_item_properties(item_props):
+  propnames = item_props.keys()
+  mode = core.SVN_PROP_EXECUTABLE in propnames and 0755 or 0644  # Uh-huh.
+  is_binary = core.SVN_PROP_MIME_TYPE in propnames \
+              and core.svn_mime_type_is_binary(
+                       item_props[core.SVN_PROP_MIME_TYPE])
+  props = {}
+  for name in propnames:  # God save the pool.
+    props[name] = item_props[name]
+  return vclib.ItemProperties(is_binary, mode, props)
+
+
 def temp_checkout(svnrepos, path, rev, pool):
   """Check out file revision to temporary file"""
   temp = tempfile.mktemp()
@@ -726,6 +739,15 @@
         raise vclib.InvalidRevision
       raise
 
+  def itemprops(self, path_parts, rev):
+    path = self._getpath(path_parts)
+    rev = self._getrev(rev)
+    fsroot = self._getroot(rev)
+    props = _make_item_properties(fs.node_proplist(fsroot, path,
+                                                   self.scratch_pool))
+    self._scratch_clear()
+    return props
+
   def _getpath(self, path_parts):
     return string.join(path_parts, '/')
 
Index: viewvc-1.0.5/lib/vclib/svn_ra/__init__.py
===================================================================
--- viewvc-1.0.5.orig/lib/vclib/svn_ra/__init__.py      2008-05-21 
20:24:33.000000000 +0200
+++ viewvc-1.0.5/lib/vclib/svn_ra/__init__.py   2008-05-21 21:18:58.000000000 
+0200
@@ -20,7 +20,8 @@
 import tempfile
 import popen2
 import time
-from vclib.svn import Revision, ChangedPath, _datestr_to_date, _compare_paths, 
_cleanup_path
+from vclib.svn import Revision, ChangedPath, _datestr_to_date
+from vclib.svn import _compare_paths, _cleanup_path, _make_item_properties
 from svn import core, delta, client, wc, ra
 
 
@@ -415,6 +416,15 @@
         raise vclib.InvalidRevision
       raise
 
+  def itemprops(self, path_parts, rev):
+    path = self._getpath(path_parts)
+    rev = self._getrev(rev)
+    stream, rev, props = ra.get_file(self.ra_session, path, rev,
+                                     self.scratch_pool)
+    props = _make_item_properties(props)
+    self._scratch_clear()
+    return props
+
   def _getpath(self, path_parts):
     return string.join(path_parts, '/')
 
Index: viewvc-1.0.5/lib/viewvc.py
===================================================================
--- viewvc-1.0.5.orig/lib/viewvc.py     2008-05-21 20:24:40.000000000 +0200
+++ viewvc-1.0.5/lib/viewvc.py  2008-05-21 21:18:58.000000000 +0200
@@ -2947,12 +2947,9 @@
         generate_tarball_header(out, dir, mtime=dir_mtime)
       del stack[:]
 
-    if cvs:
-      info = os.stat(file.path)
-      mode = (info[stat.ST_MODE] & 0555) | 0200
-    else:
-      mode = 0644
-
+    mode = (request.repos.itemprops(rep_path + [file.name],
+                                    request.pathrev).mode & 0555) | 0200
+    
     ### FIXME: Read the whole file into memory?  Bad... better to do
     ### 2 passes.
     fp = request.repos.openfile(rep_path + [file.name], request.pathrev)[0]

--- End Message ---
--- Begin Message ---
Source: viewvc
Source-Version: 1.0.9-1

We believe that the bug you reported is fixed in the latest version of
viewvc, which is due to be installed in the Debian FTP archive:

viewvc-query_1.0.9-1_all.deb
  to pool/main/v/viewvc/viewvc-query_1.0.9-1_all.deb
viewvc_1.0.9-1.diff.gz
  to pool/main/v/viewvc/viewvc_1.0.9-1.diff.gz
viewvc_1.0.9-1.dsc
  to pool/main/v/viewvc/viewvc_1.0.9-1.dsc
viewvc_1.0.9-1_all.deb
  to pool/main/v/viewvc/viewvc_1.0.9-1_all.deb
viewvc_1.0.9.orig.tar.gz
  to pool/main/v/viewvc/viewvc_1.0.9.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
David Martínez Moreno <[email protected]> (supplier of updated viewvc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 28 Sep 2009 05:24:27 +0200
Source: viewvc
Binary: viewvc viewvc-query
Architecture: source all
Version: 1.0.9-1
Distribution: unstable
Urgency: high
Maintainer: David Martínez Moreno <[email protected]>
Changed-By: David Martínez Moreno <[email protected]>
Description: 
 viewvc     - view CVS/SVN repositories via HTTP
 viewvc-query - utility to query CVS commit database
Closes: 440188 482323 485187 500779 502257 545779
Changes: 
 viewvc (1.0.9-1) unstable; urgency=high
 .
   * New upstream release (closes: #502257):
     - Ignore arbitrary user-provided MIME types (closes: #500779).
     - Fixed bug in regexp searches.
     - Fixed bug in handling of certain 'co' output.
     - Fixed annotate code syntax error.
     - Fixed mod_python import cycle.
     - Fixed directory view sorting UI.
     - Tolerate malformed Accept-Language headers.
     - Fixed directory log views in revision-less Subversion repositories.
     - Fixed exception in rev-sorted remote Subversion directory views.
     - Security fixes: validate the 'view' parameter to avoid XSS attack
       and avoid printing illegal parameter names and values (closes:
       #545779).
   * debian/control:
     - Moved docbook-to-man from B-D-I to B-D, as it is in build target
       (closes: #440188).
     - Added B-D on quilt (>= 0.46-7) in order to have dh_quilt_*.
     - Upgraded Standards-Version to 3.8.3.
     - Added ${misc:Depends} to viewvc and viewvc-query.
     - Bumped dependency on debhelper to >=6.
     - Added Homepage.
   * debian/rules:
     - Moved patch targets into the XXI century: removed lots of old lines
       by a couple of calls to dh_quilt_* helpers.
   * debian/patches:
     - Refreshed everything to get rid of errors and removed additional
       options like -p0 (closes: #485187).
     - 04_tarball_permission_fix: Added to series, closes: #482323.
   * debian/viewvc.config: Removed prepended path to debconf-show.
   * debian/compat: Upgraded to v6.
   * debian/viewvc.postinst: Added set -e to catch up errors.
Checksums-Sha1: 
 f618627d1aba16561743201141c69d4dc102fa78 1152 viewvc_1.0.9-1.dsc
 a985496ad577e2c4c75bac915eb203da790d7f3e 522905 viewvc_1.0.9.orig.tar.gz
 933dcf44cf9117ef829143eaf79c65e1dabbf569 41961 viewvc_1.0.9-1.diff.gz
 7403570e842a4783ca1c7551810ddc578b52309c 518312 viewvc_1.0.9-1_all.deb
 3e9186a2bf5142204637ac0e5209111e729320b7 23630 viewvc-query_1.0.9-1_all.deb
Checksums-Sha256: 
 13496713e173c27322f97e904a6e6220d54a62c81426bbb46e8821948b948cdc 1152 
viewvc_1.0.9-1.dsc
 399f2813d89457c1dcd9056af2db8c693bfe4ebf801b4c8bb2e4928667b4e322 522905 
viewvc_1.0.9.orig.tar.gz
 50cac0328b542bcde99ff3f6aace2cdfe5c3be6e58b0f685c715b082fabd69e5 41961 
viewvc_1.0.9-1.diff.gz
 0098967cfa5f3b30d3d58f43a57ebf9f00f4046a310bce3ff4b42a5f2e080902 518312 
viewvc_1.0.9-1_all.deb
 ddd2a77974b7a39ab0eb103c556a780fe397b426bc910c8a0f314899a5f9b9c8 23630 
viewvc-query_1.0.9-1_all.deb
Files: 
 b9c947f9fc813bc5d71e6a42b7b15fe0 1152 devel optional viewvc_1.0.9-1.dsc
 5aa48bb866f65bfcf32aa0cd581bf7d3 522905 devel optional viewvc_1.0.9.orig.tar.gz
 352f4d83751db575358b642b3f7559dd 41961 devel optional viewvc_1.0.9-1.diff.gz
 d3d68d0935d755bc6cab733281c9792f 518312 devel optional viewvc_1.0.9-1_all.deb
 7b0a599c94de3d4d22de5b041dfe6923 23630 devel optional 
viewvc-query_1.0.9-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkrBQoUACgkQWs/EhA1iABtnzACgnaaLIMlfk1OVteW6o8J6WFT2
dsgAoM1Fbvph3QEmH2/j2LD98HBLqLlk
=sKeZ
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to