Skip to contentSkip to conversation

fetch2/__init__.py: remove broken sysmlink

PATCH In review Robert Yang 2 participants 4 messages Aug 19, 2014

lore
Share & tools
lore
#0 lore raw

cover fetch2/__init__.py: remove broken sysmlink

The following changes since commit 201af937a0a45dd0203b1a4a00cffa7a24a31c20:

newbb.vim: remove PR (2014-08-18 17:30:25 -0700)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib rbt/dl
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/dl

Robert Yang (1):
fetch2/__init__.py: remove broken sysmlink

 bitbake/lib/bb/fetch2/__init__.py |    5 +++++
 1 file changed, 5 insertions(+)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 fetch2/__init__.py: remove broken sysmlink

Fixed:
(Simulate mirror the tarball from PREMIRRORS)

$ ln -sf /path/to/local/PREMIRROR/bzip2 bzip2-1.0.6.tar.gz
(Simulate the PREMIRRORS are gone)
$ rm -f /path/to/local/PREMIRROR/bzip2-1.0.6.tar.gz
$ bitbake bzip2 -ccleansstate && bitbake bzip2 -cfetch

Then the newly get bzip2-1.0.6.tar.gz will be saved to /path/to/local/PREMIRROR/bzip2-1.0.6.tar.gz rather than then the DL_DIR, or get error if we don't have the write permission on to the mirror. This is because wget uses "lstat()" to follow the symlink for FTP (but fstat() for HTTP, so http doesn't have this issue), and we can't fix wget (this might be intended by wget) since it is one of SANITY_REQUIRED_UTILITIES.

Remove the broken sysmlink in DL_DIR will fix the problem.

---
 bitbake/lib/bb/fetch2/__init__.py |    5 +++++
 1 file changed, 5 insertions(+)
bitbake/lib/bb/fetch2/__init__.py +5 -0
index df2f2b0..c95f177 100644
@@ -1081,6 +1081,11 @@ class FetchData(object):
         self.donestamp = basepath + '.done'
         self.lockfile = basepath + '.lock'
 
+        # Remove the broken sysmlink
+        if self.localpath and not os.path.exists(self.localpath) and \
+                os.path.islink(self.localpath):
+            os.unlink(self.localpath)
+
     def setup_revisons(self, d):
         self.revisions = {}
         for name in self.names:
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 6 lines · Robert Yang

Fixed:
(Simulate mirror the tarball from PREMIRRORS)

$ ln -sf /path/to/local/PREMIRROR/bzip2 bzip2-1.0.6.tar.gz
(Simulate the PREMIRRORS are gone)
$ rm -f /path/to/local/PREMIRROR/bzip2-1.0.6.tar.gz
$ bitbake bzip2 -ccleansstate && bitbake bzip2 -cfetch

Why does it need to re-fetch it when you haven't don't cleanall?

If it has different checksums, then fetcher should rename it, before re-downloading it.

Shouldn't fetcher just use bzip2-1.0.6.tar.gz if there is bzip2-1.0.6.tar.gz.done?

I'm not saying that your change isn't correct, but maybe it uncovers worse issue with fetcher redownloading unnecessary.

Quoted 9 lines

Then the newly get bzip2-1.0.6.tar.gz will be saved to /path/to/local/PREMIRROR/bzip2-1.0.6.tar.gz rather than then the DL_DIR, or get error if we don't have the write permission on to the mirror. This is because wget uses "lstat()" to follow the symlink for FTP (but fstat() for HTTP, so http doesn't have this issue), and we can't fix wget (this might be intended by wget) since it is one of SANITY_REQUIRED_UTILITIES.

Remove the broken sysmlink in DL_DIR will fix the problem.

type symlink

Quoted 11 lines
---
 bitbake/lib/bb/fetch2/__init__.py |    5 +++++
 1 file changed, 5 insertions(+)
bitbake/lib/bb/fetch2/__init__.py +0 -0
index df2f2b0..c95f177 100644

bitbake/lib/bb/fetch2/__init__.py class FetchData(object): · line 1084

Quoted 4 lines
bitbake/lib/bb/fetch2/__init__.py +1 -0
@@ -1081,6 +1081,11 @@ class FetchData(object):
         self.donestamp = basepath + '.done'
         self.lockfile = basepath + '.lock'
 
+        # Remove the broken sysmlink

typo "symlink"

Quoted 15 lines
bitbake/lib/bb/fetch2/__init__.py +4 -0
+        if self.localpath and not os.path.exists(self.localpath) and \
+                os.path.islink(self.localpath):
+            os.unlink(self.localpath)
+
     def setup_revisons(self, d):
         self.revisions = {}
         for name in self.names:
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw
Quoted 9 lines · Martin Jansa
Quoted 6 lines · Robert Yang

Fixed:
(Simulate mirror the tarball from PREMIRRORS)

$ ln -sf /path/to/local/PREMIRROR/bzip2 bzip2-1.0.6.tar.gz
(Simulate the PREMIRRORS are gone)
$ rm -f /path/to/local/PREMIRROR/bzip2-1.0.6.tar.gz
$ bitbake bzip2 -ccleansstate && bitbake bzip2 -cfetch

Why does it need to re-fetch it when you haven't don't cleanall?

I met this error when the local PREMIRROR is gone, I think that it needs re-fetch is because the symlink is broken? (os.path.exits() returns False ?)

Quoted 18 lines

If it has different checksums, then fetcher should rename it, before re-downloading it.

Shouldn't fetcher just use bzip2-1.0.6.tar.gz if there is bzip2-1.0.6.tar.gz.done?

I'm not saying that your change isn't correct, but maybe it uncovers worse issue with fetcher redownloading unnecessary.

Quoted 8 lines

Then the newly get bzip2-1.0.6.tar.gz will be saved to /path/to/local/PREMIRROR/bzip2-1.0.6.tar.gz rather than then the DL_DIR, or get error if we don't have the write permission on to the mirror. This is because wget uses "lstat()" to follow the symlink for FTP (but fstat() for HTTP, so http doesn't have this issue), and we can't fix wget (this might be intended by wget) since it is one of SANITY_REQUIRED_UTILITIES.

Quoted 3 lines
Quoted 1 line

Remove the broken sysmlink in DL_DIR will fix the problem.

type symlink

Thanks, fixed the typos in the repo.

// Robert

Quoted 35 lines
Quoted 12 lines
---
  bitbake/lib/bb/fetch2/__init__.py |    5 +++++
  1 file changed, 5 insertions(+)
bitbake/lib/bb/fetch2/__init__.py +0 -0
index df2f2b0..c95f177 100644

bitbake/lib/bb/fetch2/__init__.py class FetchData(object): · line 1084

Quoted 4 lines
bitbake/lib/bb/fetch2/__init__.py +1 -0
@@ -1081,6 +1081,11 @@ class FetchData(object):
          self.donestamp = basepath + '.done'
          self.lockfile = basepath + '.lock'
 
+        # Remove the broken sysmlink

typo "symlink"

Quoted 15 lines
bitbake/lib/bb/fetch2/__init__.py +4 -1
+        if self.localpath and not os.path.exists(self.localpath) and \
+                os.path.islink(self.localpath):
+            os.unlink(self.localpath)
+
      def setup_revisons(self, d):
          self.revisions = {}
          for name in self.names:
--

1.7.9.5

--
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel