pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/www/py-django-binary-database-files



Module Name:    pkgsrc
Committed By:   joerg
Date:           Wed Aug 19 00:29:46 UTC 2020

Modified Files:
        pkgsrc/www/py-django-binary-database-files: Makefile distinfo
        pkgsrc/www/py-django-binary-database-files/patches:
            patch-binary__database__files_storage.py

Log Message:
Fix one more issue with the path handling. Bump revision.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/www/py-django-binary-database-files/Makefile \
    pkgsrc/www/py-django-binary-database-files/distinfo
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/www/py-django-binary-database-files/Makefile
diff -u pkgsrc/www/py-django-binary-database-files/Makefile:1.1 pkgsrc/www/py-django-binary-database-files/Makefile:1.2
--- pkgsrc/www/py-django-binary-database-files/Makefile:1.1     Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/Makefile Wed Aug 19 00:29:46 2020
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.1 2020/08/18 14:27:16 joerg Exp $
+# $NetBSD: Makefile,v 1.2 2020/08/19 00:29:46 joerg Exp $
 
 DISTNAME=      django-binary-database-files-1.0.13
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
+PKGREVISION=   1
 CATEGORIES=    www python
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=kimetrica/}
 
Index: pkgsrc/www/py-django-binary-database-files/distinfo
diff -u pkgsrc/www/py-django-binary-database-files/distinfo:1.1 pkgsrc/www/py-django-binary-database-files/distinfo:1.2
--- pkgsrc/www/py-django-binary-database-files/distinfo:1.1     Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/distinfo Wed Aug 19 00:29:46 2020
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.1 2020/08/18 14:27:16 joerg Exp $
+$NetBSD: distinfo,v 1.2 2020/08/19 00:29:46 joerg Exp $
 
 SHA1 (django-binary-database-files-1.0.13-cedd9f4608eb0da343cf15cfcaf5400a0754cc28.tar.gz) = 74c359eff5cd2039a9bc2badf7f4de581439c4ad
 RMD160 (django-binary-database-files-1.0.13-cedd9f4608eb0da343cf15cfcaf5400a0754cc28.tar.gz) = 880660c927751ba1cb0def0b97f3b10915a8f893
 SHA512 (django-binary-database-files-1.0.13-cedd9f4608eb0da343cf15cfcaf5400a0754cc28.tar.gz) = 
a275dc6763f98baf1170c0e160e3b9f2c515af7ee1bfb1229d0106c634c9a77af3b399d8cac781692fad56355f83cc260fd7a22f610600dcd1bbaebd3ce11598
 Size (django-binary-database-files-1.0.13-cedd9f4608eb0da343cf15cfcaf5400a0754cc28.tar.gz) = 31835 bytes
-SHA1 (patch-binary__database__files_storage.py) = a76139fecdee6af2a1fe12d886ad6e76d8ce599a
+SHA1 (patch-binary__database__files_storage.py) = 76eed8510370dd17bddc671b13251581db556181
 SHA1 (patch-binary__database__files_tests_tests.py) = d578a3cbdfb53f8547f689c9e761113abc795fc3

Index: pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py
diff -u pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py:1.1 pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py:1.2
--- pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py:1.1     Tue Aug 18 14:27:16 2020
+++ pkgsrc/www/py-django-binary-database-files/patches/patch-binary__database__files_storage.py Wed Aug 19 00:29:46 2020
@@ -1,7 +1,7 @@
-$NetBSD: patch-binary__database__files_storage.py,v 1.1 2020/08/18 14:27:16 joerg Exp $
+$NetBSD: patch-binary__database__files_storage.py,v 1.2 2020/08/19 00:29:46 joerg Exp $
 
 1df96f9f7caf621c4c0d94bc09b27584e1c5aa9d
-b52960824eb95a3e98c8d0a8c8ac08b38a6821ca
+73cd278717a4dd9020979d6d08eb56365a728357
 
 --- binary_database_files/storage.py.orig      2020-08-10 14:31:32.000000000 +0000
 +++ binary_database_files/storage.py
@@ -26,7 +26,16 @@ b52960824eb95a3e98c8d0a8c8ac08b38a6821ca
          return o
  
      def _save(self, name, content):
-@@ -110,15 +115,22 @@ class DatabaseStorage(FileSystemStorage)
+@@ -109,21 +109,31 @@ class DatabaseStorage(FileSystemStorage):
+         full_path = safe_join(self.location, name)
+         return full_path[len(root_path) + 1 :]
+ 
++    def _path(self, instance_name):
++        return safe_join(settings.MEDIA_ROOT, instance_name)
++
+     def path(self, name):
+         """
+         Return a local filesystem path where the file can be retrieved using
          Python's built-in open() function.
  
          File names are normalized to the MEDIA_ROOT.
@@ -35,7 +44,7 @@ b52960824eb95a3e98c8d0a8c8ac08b38a6821ca
 +        be raised.
          """
 -        return safe_join(settings.MEDIA_ROOT, self.get_instance_name(name))
-+        localpath = safe_join(settings.MEDIA_ROOT, self.get_instance_name(name))
++        localpath = self._path(self.get_instance_name(name))
 +        if not os.path.exists(localpath):
 +            raise NotImplementedError
 +        return localpath
@@ -46,8 +55,19 @@ b52960824eb95a3e98c8d0a8c8ac08b38a6821ca
          if models.File.objects.filter(name=name).exists():
              return True
 -        return super(DatabaseStorage, self).exists(name)
-+        localpath = safe_join(settings.MEDIA_ROOT, self.get_instance_name(name))
++        localpath = self._path(name)
 +        return os.path.exists(localpath)
  
      def delete(self, name):
          """Delete the file with filename `name` from the database and filesystem."""
+@@ -135,7 +145,9 @@ class DatabaseStorage(FileSystemStorage):
+                 os.remove(hash_fn)
+         except models.File.DoesNotExist:
+             pass
+-        return super(DatabaseStorage, self).delete(name)
++        localpath = self._path(name)
++        if os.path.exists(localpath):
++            return super(DatabaseStorage, self).delete(name)
+ 
+     def url(self, name):
+         """Return the web-accessible URL for the file with filename `name`.



Home | Main Index | Thread Index | Old Index