rpms/smart/F-11 smart-sha256.diff,1.1,1.2 smart.spec,1.42,1.43

Axel Thimm athimm at fedoraproject.org
Thu Apr 16 10:38:40 UTC 2009


Author: athimm

Update of /cvs/extras/rpms/smart/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20238/F-11

Modified Files:
	smart-sha256.diff smart.spec 
Log Message:
Fix sha256 patch.

smart-sha256.diff:

Index: smart-sha256.diff
===================================================================
RCS file: /cvs/extras/rpms/smart/F-11/smart-sha256.diff,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- smart-sha256.diff	15 Apr 2009 15:41:17 -0000	1.1
+++ smart-sha256.diff	16 Apr 2009 10:38:10 -0000	1.2
@@ -1,7 +1,6 @@
-=== modified file 'smart/backends/rpm/metadata.py'
---- smart/backends/rpm/metadata.py	2008-12-31 11:12:46 +0000
-+++ smart/backends/rpm/metadata.py	2009-02-20 12:47:55 +0000
-@@ -71,6 +71,9 @@
+--- smart/backends/rpm/metadata.py.sha256	2009-03-05 00:07:50.000000000 +0100
++++ smart/backends/rpm/metadata.py	2009-04-16 12:19:20.000000000 +0200
+@@ -70,6 +70,9 @@
      def getSHA(self, url):
          return self._info.get("sha")
  
@@ -11,10 +10,8 @@
      def getDescription(self):
          return self._info.get("description", "")
  
-
-=== modified file 'smart/cache.py'
---- smart/cache.py	2008-12-12 07:18:07 +0000
-+++ smart/cache.py	2009-02-20 12:34:05 +0000
+--- smart/cache.py.sha256	2009-03-05 00:07:50.000000000 +0100
++++ smart/cache.py	2009-04-16 12:20:41.000000000 +0200
 @@ -179,6 +179,9 @@
      def getSHA(self, url):
          return None
@@ -25,11 +22,11 @@
      def validate(self, url, localpath, withreason=False):
          try:
              if not os.path.isfile(localpath):
-@@ -208,6 +211,23 @@
+@@ -208,6 +211,22 @@
                      raise Error, _("Invalid MD5 (expected %s, got %s)") % \
                                   (filemd5, lfilemd5)
              else:
-+                filesha256 = item.getInfo(uncompprefix+"sha256")
++                filesha256 = self.getSHA256(url)
 +                if filesha256:
 +                    try:
 +                        from hashlib import sha256
@@ -43,17 +40,14 @@
 +                        if lfilesha256 != filesha256:
 +                           raise Error, _("Invalid SHA256 (expected %s, got %s)") % \
 +                                         (filesha256, lfilesha256)
-+                        return
 +                    except ImportError:
 +                        pass
                  filesha = self.getSHA(url)
                  if filesha:
                      try:
-
-=== modified file 'smart/channels/rpm_md.py'
---- smart/channels/rpm_md.py	2009-01-22 11:34:02 +0000
-+++ smart/channels/rpm_md.py	2009-02-20 12:46:14 +0000
-@@ -130,12 +130,16 @@
+--- smart/channels/rpm_md.py.sha256	2009-03-05 00:07:50.000000000 +0100
++++ smart/channels/rpm_md.py	2009-04-16 12:19:20.000000000 +0200
+@@ -108,12 +108,16 @@
                                 uncomp_md5=info["primary"].get("uncomp_md5"),
                                 sha=info["primary"].get("sha"),
                                 uncomp_sha=info["primary"].get("uncomp_sha"),
@@ -70,10 +64,8 @@
                                   uncomp=True)
          fetcher.run(progress=progress)
   
-
-=== modified file 'smart/control.py'
---- smart/control.py	2008-12-12 07:17:44 +0000
-+++ smart/control.py	2009-02-20 12:33:35 +0000
+--- smart/control.py.sha256	2009-03-05 00:07:50.000000000 +0100
++++ smart/control.py	2009-04-16 12:19:20.000000000 +0200
 @@ -659,6 +659,7 @@
                  pkgitems[pkg].append(fetcher.enqueue(url, media=media,
                                                       md5=info.getMD5(url),
@@ -82,10 +74,8 @@
                                                       size=info.getSize(url),
                                                       validate=info.validate))
          if targetdir:
-
-=== modified file 'smart/fetcher.py'
---- smart/fetcher.py	2008-12-12 07:18:07 +0000
-+++ smart/fetcher.py	2009-02-20 13:26:02 +0000
+--- smart/fetcher.py.sha256	2009-03-05 00:07:50.000000000 +0100
++++ smart/fetcher.py	2009-04-16 12:20:26.000000000 +0200
 @@ -336,7 +336,9 @@
              prefix = "uncomp_"
          else:
@@ -97,7 +87,7 @@
  
      def validate(self, item, localpath, withreason=False, uncomp=False):
          try:
-@@ -382,6 +384,23 @@
+@@ -382,6 +384,22 @@
                      raise Error, _("Invalid MD5 (expected %s, got %s)") % \
                                   (filemd5, lfilemd5)
              else:
@@ -115,13 +105,12 @@
 +                        if lfilesha256 != filesha256:
 +                           raise Error, _("Invalid SHA256 (expected %s, got %s)") % \
 +                                         (filesha256, lfilesha256)
-+                        return
 +                    except ImportError:
 +                        pass
                  filesha = item.getInfo(uncompprefix+"sha")
                  if filesha:
                      try:
-@@ -489,12 +508,13 @@
+@@ -489,12 +507,13 @@
          #             or just 'valid', depending on 'withreason'. 'valid'
          #             may be None, True, or False. If it's True or False,
          #             no other information will be checked.
@@ -138,4 +127,3 @@
              value = info.get(kind)
              if value:
                  info[kind] = value.lower()
-


Index: smart.spec
===================================================================
RCS file: /cvs/extras/rpms/smart/F-11/smart.spec,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- smart.spec	15 Apr 2009 15:41:18 -0000	1.42
+++ smart.spec	16 Apr 2009 10:38:10 -0000	1.43
@@ -7,7 +7,7 @@
 Summary: Next generation package handling tool
 Name: smart
 Version: 1.2
-Release: 63%{?dist}
+Release: 64%{?dist}
 License: GPLv2+
 Group: Applications/System
 URL: http://labix.org/smart/
@@ -17,7 +17,7 @@
 Source3: smart.desktop
 Source4: distro.py
 Source5: ksmarttray.desktop
-Patch0: http://launchpadlibrarian.net/22909615/smart-sha256.diff
+Patch0: http://launchpadlibrarian.net/25524187/smart-sha256.diff
 Patch1: http://launchpadlibrarian.net/25485185/smart-mdclean.patch
 Patch2: http://launchpadlibrarian.net/23697017/smart-unicode-provides.diff
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -75,7 +75,6 @@
 %prep
 %setup -q
 %patch0 -p0 -b .sha256
-perl -pi -e's,filesha256 = item\.getInfo\(uncompprefix\+"sha256"\),filesha256 = self.getSHA256(url),' smart/cache.py
 %patch1 -p0 -b .mdclean
 %patch2 -p0 -b .unicode-provides
 # /usr/lib is hardcoded 
@@ -208,6 +207,9 @@
 %endif
 
 %changelog
+* Thu Apr 16 2009 Axel Thimm <Axel.Thimm at ATrpms.net> - 1.2-64
+- Fix premature returns in sha256 patch.
+
 * Wed Apr 15 2009 Axel Thimm <Axel.Thimm at ATrpms.net> - 1.2-62
 - Fix sha256 and mdclean patches.
 




More information about the fedora-extras-commits mailing list