public inbox for bitbake-devel@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] fetch: Drop Bazaar/bzr fetcher
@ 2026-02-13 15:59 Richard Purdie
  2026-02-16  7:56 ` [bitbake-devel] " Antonin Godard
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2026-02-13 15:59 UTC (permalink / raw)
  To: bitbake-devel

Bazaar has been of limited use outside of Launchpad for a while. Most uses
within launchpad now use git. The original bazaar client was also replaced
by breezy, which whilst supporting the bazaar repositories, mostly works with
git as the backend now too.

The existing code has been broken for a while and nobody seems to be using it,
lets remove the obsolete technology.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../bitbake-user-manual-fetching.rst          |   3 -
 .../bitbake-user-manual-ref-variables.rst     |   7 -
 lib/bb/fetch2/__init__.py                     |   2 -
 lib/bb/fetch2/bzr.py                          | 128 ------------------
 4 files changed, 140 deletions(-)
 delete mode 100644 lib/bb/fetch2/bzr.py

diff --git a/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst b/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
index 2b06c1d4716..efc0f8456ee 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
@@ -84,7 +84,6 @@ fetcher does know how to use HTTP as a transport.
 Here are some examples that show commonly used mirror definitions::
 
    PREMIRRORS ?= "\
-      bzr://.*/.\*  http://somemirror.org/sources/ \
       cvs://.*/.\*  http://somemirror.org/sources/ \
       git://.*/.\*  http://somemirror.org/sources/ \
       hg://.*/.\*   http://somemirror.org/sources/ \
@@ -827,8 +826,6 @@ Other Fetchers
 
 Fetch submodules also exist for the following:
 
--  Bazaar (``bzr://``)
-
 -  Mercurial (``hg://``)
 
 -  OSC (``osc://``)
diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
index 4b3b10d4662..c75f2c27b32 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
@@ -1127,10 +1127,6 @@ overview of their function and contents.
       A name assigned to the build. The name defaults to a datetime stamp
       of when the build was started but can be defined by the metadata.
 
-   :term:`BZRDIR`
-      The directory in which files checked out of a Bazaar system are
-      stored.
-
    :term:`CACHE`
       Specifies the directory BitBake uses to store a cache of the metadata
       so it does not need to be parsed every time BitBake is started.
@@ -1637,9 +1633,6 @@ overview of their function and contents.
 
       -  ``az://``: Fetches files from an Azure Storage account using HTTPS.
 
-      -  ``bzr://``: Fetches files from a Bazaar revision control
-         repository.
-
       -  ``ccrc://``: Fetches files from a ClearCase repository.
 
       -  ``cvs://``: Fetches files from a CVS revision control
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index bdd4973945a..d21e9c18fa0 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -2111,7 +2111,6 @@ from . import ssh
 from . import sftp
 from . import s3
 from . import perforce
-from . import bzr
 from . import hg
 from . import osc
 from . import repo
@@ -2134,7 +2133,6 @@ methods.append(ssh.SSH())
 methods.append(sftp.SFTP())
 methods.append(s3.S3())
 methods.append(perforce.Perforce())
-methods.append(bzr.Bzr())
 methods.append(hg.Hg())
 methods.append(osc.Osc())
 methods.append(repo.Repo())
diff --git a/lib/bb/fetch2/bzr.py b/lib/bb/fetch2/bzr.py
deleted file mode 100644
index fc558f50b04..00000000000
--- a/lib/bb/fetch2/bzr.py
+++ /dev/null
@@ -1,128 +0,0 @@
-"""
-BitBake 'Fetch' implementation for bzr.
-
-"""
-
-# Copyright (C) 2007 Ross Burton
-# Copyright (C) 2007 Richard Purdie
-#
-#   Classes for obtaining upstream sources for the
-#   BitBake build tools.
-#   Copyright (C) 2003, 2004  Chris Larson
-#
-# SPDX-License-Identifier: GPL-2.0-only
-#
-
-import os
-import bb
-from bb.fetch2 import FetchMethod
-from bb.fetch2 import FetchError
-from bb.fetch2 import runfetchcmd
-from bb.fetch2 import logger
-
-class Bzr(FetchMethod):
-    def supports(self, ud, d):
-        return ud.type in ['bzr']
-
-    def urldata_init(self, ud, d):
-        """
-        init bzr specific variable within url data
-        """
-        # Create paths to bzr checkouts
-        bzrdir = d.getVar("BZRDIR") or (d.getVar("DL_DIR") + "/bzr")
-        relpath = self._strip_leading_slashes(ud.path)
-        ud.pkgdir = os.path.join(bzrdir, ud.host, relpath)
-
-        ud.setup_revisions(d)
-
-        if not ud.revision:
-            ud.revision = self.latest_revision(ud, d)
-
-        ud.localfile = d.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision))
-
-    def _buildbzrcommand(self, ud, d, command):
-        """
-        Build up an bzr commandline based on ud
-        command is "fetch", "update", "revno"
-        """
-
-        basecmd = d.getVar("FETCHCMD_bzr") or "/usr/bin/env bzr"
-
-        proto =  ud.parm.get('protocol', 'http')
-
-        bzrroot = ud.host + ud.path
-
-        options = []
-
-        if command == "revno":
-            bzrcmd = "%s revno %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
-        else:
-            if ud.revision:
-                options.append("-r %s" % ud.revision)
-
-            if command == "fetch":
-                bzrcmd = "%s branch %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
-            elif command == "update":
-                bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options))
-            else:
-                raise FetchError("Invalid bzr command %s" % command, ud.url)
-
-        return bzrcmd
-
-    def download(self, ud, d):
-        """Fetch url"""
-
-        if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
-            bzrcmd = self._buildbzrcommand(ud, d, "update")
-            logger.debug("BZR Update %s", ud.url)
-            bb.fetch2.check_network_access(d, bzrcmd, ud.url)
-            runfetchcmd(bzrcmd, d, workdir=os.path.join(ud.pkgdir, os.path.basename(ud.path)))
-        else:
-            bb.utils.remove(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir)), True)
-            bzrcmd = self._buildbzrcommand(ud, d, "fetch")
-            bb.fetch2.check_network_access(d, bzrcmd, ud.url)
-            logger.debug("BZR Checkout %s", ud.url)
-            bb.utils.mkdirhier(ud.pkgdir)
-            logger.debug("Running %s", bzrcmd)
-            runfetchcmd(bzrcmd, d, workdir=ud.pkgdir)
-
-        scmdata = ud.parm.get("scmdata", "")
-        if scmdata == "keep":
-            tar_flags = ""
-        else:
-            tar_flags = "--exclude='.bzr' --exclude='.bzrtags'"
-
-        # tar them up to a defined filename
-        runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(ud.pkgdir)),
-                    d, cleanup=[ud.localpath], workdir=ud.pkgdir)
-
-    def supports_srcrev(self):
-        return True
-
-    def _revision_key(self, ud, d, name):
-        """
-        Return a unique key for the url
-        """
-        return "bzr:" + ud.pkgdir
-
-    def _latest_revision(self, ud, d, name):
-        """
-        Return the latest upstream revision number
-        """
-        logger.debug2("BZR fetcher hitting network for %s", ud.url)
-
-        bb.fetch2.check_network_access(d, self._buildbzrcommand(ud, d, "revno"), ud.url)
-
-        output = runfetchcmd(self._buildbzrcommand(ud, d, "revno"), d, True)
-
-        return output.strip()
-
-    def sortable_revision(self, ud, d, name):
-        """
-        Return a sortable revision number which in our case is the revision number
-        """
-
-        return False, self._build_revision(ud, d)
-
-    def _build_revision(self, ud, d):
-        return ud.revision


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [bitbake-devel] [PATCH] fetch: Drop Bazaar/bzr fetcher
  2026-02-13 15:59 [PATCH] fetch: Drop Bazaar/bzr fetcher Richard Purdie
@ 2026-02-16  7:56 ` Antonin Godard
  2026-02-16  9:57   ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Antonin Godard @ 2026-02-16  7:56 UTC (permalink / raw)
  To: richard.purdie, bitbake-devel

Hi,

On Fri Feb 13, 2026 at 4:59 PM CET, Richard Purdie via lists.openembedded.org wrote:
[...]
> diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> index 4b3b10d4662..c75f2c27b32 100644
> --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst

The SRCREV definition also needs updating:

   :term:`SRCREV`
      The revision of the source code used to build the package. This
      variable applies only when using Subversion, Git, Mercurial and
      Bazaar.

Antonin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bitbake-devel] [PATCH] fetch: Drop Bazaar/bzr fetcher
  2026-02-16  7:56 ` [bitbake-devel] " Antonin Godard
@ 2026-02-16  9:57   ` Richard Purdie
  2026-02-16 10:02     ` Antonin Godard
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2026-02-16  9:57 UTC (permalink / raw)
  To: Antonin Godard, bitbake-devel

On Mon, 2026-02-16 at 08:56 +0100, Antonin Godard wrote:
> Hi,
> 
> On Fri Feb 13, 2026 at 4:59 PM CET, Richard Purdie via
> lists.openembedded.org wrote:
> [...]
> > diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-
> > variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-
> > variables.rst
> > index 4b3b10d4662..c75f2c27b32 100644
> > --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> > +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
> 
> The SRCREV definition also needs updating:
> 
>    :term:`SRCREV`
>       The revision of the source code used to build the package. This
>       variable applies only when using Subversion, Git, Mercurial and
>       Bazaar.

Thanks, I've added a tweak to the patch to remove that. I have a
feeling we might find a few more old references in one form or another
over time...

Cheers,

Richard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bitbake-devel] [PATCH] fetch: Drop Bazaar/bzr fetcher
  2026-02-16  9:57   ` Richard Purdie
@ 2026-02-16 10:02     ` Antonin Godard
  0 siblings, 0 replies; 4+ messages in thread
From: Antonin Godard @ 2026-02-16 10:02 UTC (permalink / raw)
  To: richard.purdie, bitbake-devel

Hi,

On Mon Feb 16, 2026 at 10:57 AM CET, Richard Purdie via lists.openembedded.org wrote:
> On Mon, 2026-02-16 at 08:56 +0100, Antonin Godard wrote:
>> Hi,
>> 
>> On Fri Feb 13, 2026 at 4:59 PM CET, Richard Purdie via
>> lists.openembedded.org wrote:
>> [...]
>> > diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-
>> > variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-
>> > variables.rst
>> > index 4b3b10d4662..c75f2c27b32 100644
>> > --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
>> > +++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
>> 
>> The SRCREV definition also needs updating:
>> 
>>    :term:`SRCREV`
>>       The revision of the source code used to build the package. This
>>       variable applies only when using Subversion, Git, Mercurial and
>>       Bazaar.
>
> Thanks, I've added a tweak to the patch to remove that. I have a
> feeling we might find a few more old references in one form or another
> over time...

I've quickly tried to grep for bzr/bazaar, and the other two fetchers you've
sent and couldn't find anymore. But yocto-docs will probably have some of those,
which I'll take care of.

Antonin


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-16 10:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-13 15:59 [PATCH] fetch: Drop Bazaar/bzr fetcher Richard Purdie
2026-02-16  7:56 ` [bitbake-devel] " Antonin Godard
2026-02-16  9:57   ` Richard Purdie
2026-02-16 10:02     ` Antonin Godard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox