All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake: fetch2/svn: Add tarsnapshots parameter
@ 2018-03-23  9:28 Niko Mauno
  2018-04-04  7:56 ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Niko Mauno @ 2018-03-23  9:28 UTC (permalink / raw)
  To: bitbake-devel

By adding 'tarsnapshots=currentonly' option to svn-specific component in
SRC_URI, associated subversion repository module's existing tarball
snapshots are removed from DL_DIR, before creating a new one.

This provides a means to avoid downloads directory becoming congested
with a subversion repository module's tarball snapshots, which may occur
for example during circumstances where source code residing in a
subversion repository is subject to long-term development work, and
recipe used in continuous integration builds has SRCREV set to AUTOREV.

Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
---
 bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml | 6 ++++++
 bitbake/lib/bb/fetch2/svn.py                                     | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
index 29ae486a7c..b4f1f673ec 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
@@ -484,6 +484,12 @@
                         You can use this parameter to specify the ssh
                         program used by svn.
                         </para></listitem>
+                    <listitem><para><emphasis>"tarsnapshots":</emphasis>
+                        If this optional parameter is set to "currentonly" then
+                        any previously created tarball snapshots of associated
+                        repository module are removed from DL_DIR, before
+                        creating a new one.
+                        </para></listitem>
                     <listitem><para><emphasis>"transportuser":</emphasis>
                         When required, sets the username for the transport.
                         By default, this parameter is empty.
diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
index 3f172eec9b..3b58492f8f 100644
--- a/bitbake/lib/bb/fetch2/svn.py
+++ b/bitbake/lib/bb/fetch2/svn.py
@@ -148,6 +148,12 @@ class Svn(FetchMethod):
         else:
             tar_flags = "--exclude='.svn'"
 
+        tarsnapshots = ud.parm.get("tarsnapshots", "")
+        if tarsnapshots == "currentonly":
+            rm_path = ud.localpath.replace('_%s_.tar.' % ud.revision, '_[0-9]*_.tar.')
+            bb.utils.remove(rm_path)
+            bb.utils.remove(rm_path + '.done')
+
         # tar them up to a defined filename
         runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.path_spec), d,
                     cleanup=[ud.localpath], workdir=ud.pkgdir)
-- 
2.16.2



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

end of thread, other threads:[~2018-04-08  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23  9:28 [PATCH] bitbake: fetch2/svn: Add tarsnapshots parameter Niko Mauno
2018-04-04  7:56 ` Richard Purdie
2018-04-08  8:28   ` Niko Mauno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.