Skip to contentSkip to conversation

lib/bb/fetch2: don't skip checksums when local mirror enabled

PATCH Applied Paul Eggleton 3 participants 5 messages Apr 5, 2012 – Apr 11, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/bb/fetch2: don't skip checksums when local mirror enabled

If you have PREMIRRORS set up to point to a local directory, the local download function does nothing and always succeeds and the mirror code was writing a .done stamp regardless, thus the checksum verification was being skipped even if the file wasn't actually copied from the mirror.

---
 lib/bb/fetch2/__init__.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
lib/bb/fetch2/__init__.py +4 -3
index e5c4b34..414cc2b 100644
@@ -476,9 +476,10 @@ def try_mirrors(d, origud, mirrors, check = False):
 
             if not os.path.exists(ud.donestamp) or ud.method.need_update(newuri, ud, ld):
                 ud.method.download(newuri, ud, ld)
-                open(ud.donestamp, 'w').close()
-                if hasattr(ud.method,"build_mirror_data"):
-                    ud.method.build_mirror_data(newuri, ud, ld)
+                if os.path.exists(ud.localpath):
+                    open(ud.donestamp, 'w').close()
+                    if hasattr(ud.method,"build_mirror_data"):
+                        ud.method.build_mirror_data(newuri, ud, ld)
 
             if not ud.localpath or not os.path.exists(ud.localpath):
                 continue
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 18 lines · Paul Eggleton

If you have PREMIRRORS set up to point to a local directory, the local download function does nothing and always succeeds and the mirror code was writing a .done stamp regardless, thus the checksum verification was being skipped even if the file wasn't actually copied from the mirror.

---
 lib/bb/fetch2/__init__.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
lib/bb/fetch2/__init__.py +0 -0
index e5c4b34..414cc2b 100644
@@ -476,9 +476,10 @@ def try_mirrors(d, origud, mirrors, check = False):
 
             if not os.path.exists(ud.donestamp) or ud.method.need_update(newuri, ud, ld):
                 ud.method.download(newuri, ud, ld)

lib/bb/fetch2/__init__.py def try_mirrors(d, origud, mirrors, check = False): · line 485

Quoted 10 lines
lib/bb/fetch2/__init__.py +4 -3
-                open(ud.donestamp, 'w').close()
-                if hasattr(ud.method,"build_mirror_data"):
-                    ud.method.build_mirror_data(newuri, ud, ld)
+                if os.path.exists(ud.localpath):
+                    open(ud.donestamp, 'w').close()
+                    if hasattr(ud.method,"build_mirror_data"):
+                        ud.method.build_mirror_data(newuri, ud, ld)
 
             if not ud.localpath or not os.path.exists(ud.localpath):
                 continue

I messed up some commands and this ended up merged with the following commit I manipulated:

http://git.openembedded.org/bitbake/commit/?id=c9eed04c6275ef2c694f89e047f85c7de76f89b6

Since its pushed at this point I'm not sure what options I have to undo it. Sorry :(

Richard

#2 lore raw
Quoted 12 lines · On Wednesday 11 April 2012 00:25:24 Richard Purdie wrote:
Quoted 11 lines · Paul Eggleton

If you have PREMIRRORS set up to point to a local directory, the local download function does nothing and always succeeds and the mirror code was writing a .done stamp regardless, thus the checksum verification was being skipped even if the file wasn't actually copied from the mirror.

---

 lib/bb/fetch2/__init__.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Quoted 7 lines

lib/bb/fetch2/__init__.py def try_mirrors(d, origud, mirrors, check = False): · line 476

Quoted 7 lines
lib/bb/fetch2/__init__.py +0 -0
index e5c4b34..414cc2b 100644
@@ -476,9 +476,10 @@ def try_mirrors(d, origud, mirrors, check = False):
             if not os.path.exists(ud.donestamp) or 

ud.method.need_update(newuri, ud, ld):

Quoted 13 lines

lib/bb/fetch2/__init__.py def try_mirrors(d, origud, mirrors, check = False): · line 485

Quoted 12 lines
lib/bb/fetch2/__init__.py +4 -3
                 ud.method.download(newuri, ud, ld)
 
-                open(ud.donestamp, 'w').close()
-                if hasattr(ud.method,"build_mirror_data"):
-                    ud.method.build_mirror_data(newuri, ud, ld)
+                if os.path.exists(ud.localpath):
+                    open(ud.donestamp, 'w').close()
+                    if hasattr(ud.method,"build_mirror_data"):
+                        ud.method.build_mirror_data(newuri, ud, ld)
 
             if not ud.localpath or not os.path.exists(ud.localpath):
                 continue
Quoted 8 lines

I messed up some commands and this ended up merged with the following commit I manipulated:

http://git.openembedded.org/bitbake/commit/?id=c9eed04c6275ef2c694f89e047f85
c7de76f89b6

Since its pushed at this point I'm not sure what options I have to undo it. Sorry :(

No worries - but does this fix in any way help with the problem Gary was seeing?

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#3 lore raw
Quoted 37 lines · Paul Eggleton
Quoted 12 lines · On Wednesday 11 April 2012 00:25:24 Richard Purdie wrote:
Quoted 11 lines · Paul Eggleton

If you have PREMIRRORS set up to point to a local directory, the local download function does nothing and always succeeds and the mirror code was writing a .done stamp regardless, thus the checksum verification was being skipped even if the file wasn't actually copied from the mirror.

---

  lib/bb/fetch2/__init__.py |    7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)
Quoted 7 lines

lib/bb/fetch2/__init__.py def try_mirrors(d, origud, mirrors, check = False): · line 476

Quoted 7 lines
lib/bb/fetch2/__init__.py +0 -0
index e5c4b34..414cc2b 100644
@@ -476,9 +476,10 @@ def try_mirrors(d, origud, mirrors, check = False):
              if not os.path.exists(ud.donestamp) or

ud.method.need_update(newuri, ud, ld):

Quoted 16 lines

lib/bb/fetch2/__init__.py def try_mirrors(d, origud, mirrors, check = False): · line 485

Quoted 12 lines
lib/bb/fetch2/__init__.py +4 -3
                  ud.method.download(newuri, ud, ld)
 
-                open(ud.donestamp, 'w').close()
-                if hasattr(ud.method,"build_mirror_data"):
-                    ud.method.build_mirror_data(newuri, ud, ld)
+                if os.path.exists(ud.localpath):
+                    open(ud.donestamp, 'w').close()
+                    if hasattr(ud.method,"build_mirror_data"):
+                        ud.method.build_mirror_data(newuri, ud, ld)
 
              if not ud.localpath or not os.path.exists(ud.localpath):
                  continue

I messed up some commands and this ended up merged with the following commit I manipulated:

Quoted 8 lines
Quoted 5 lines

http://git.openembedded.org/bitbake/commit/?id=c9eed04c6275ef2c694f89e047f85
c7de76f89b6

Since its pushed at this point I'm not sure what options I have to undo it. Sorry :(

No worries - but does this fix in any way help with the problem Gary was seeing?

No, it does not. See https://lists.yoctoproject.org/pipermail/poky/2012-April/007752.html

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#4 lore raw
In reply to Paul Eggleton
Quoted 9 lines · Paul Eggleton

If you have PREMIRRORS set up to point to a local directory, the local download function does nothing and always succeeds and the mirror code was writing a .done stamp regardless, thus the checksum verification was being skipped even if the file wasn't actually copied from the mirror.

---
 lib/bb/fetch2/__init__.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Merged to master, thanks.

Richard