]> code.ossystems Code Review - openembedded-core.git/commitdiff
fetchers: Use tar --exclude pattern to remove SCM files
authorKhem Raj <raj.khem@gmail.com>
Fri, 24 Sep 2010 22:46:59 +0000 (15:46 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 14:46:37 +0000 (14:46 +0000)
This option will exclude the SCM metadata from tar files.

Tested with gcc where svn tar which used to be 156M for gcc 4.5
is now 77M

(Bitbake rev: f264cb6d43472525ad787b0887764ea696ec52ba)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/fetch/bzr.py
bitbake/lib/bb/fetch/cvs.py
bitbake/lib/bb/fetch/git.py
bitbake/lib/bb/fetch/hg.py
bitbake/lib/bb/fetch/svn.py

index 8b0bd9ff3a7bd0fa8c8d77fbd40aa61985be058b..3ca125f3704e84aa10c1dd0a4426be1c125a2199 100644 (file)
@@ -107,7 +107,7 @@ class Bzr(Fetch):
         os.chdir(ud.pkgdir)
         # tar them up to a defined filename
         try:
-            runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.basename(ud.pkgdir)), d)
+            runfetchcmd("tar --exclude '.bzr' --exclude '.bzrtags' -czf %s %s" % (ud.localpath, os.path.basename(ud.pkgdir)), d)
         except:
             t, v, tb = sys.exc_info()
             try:
index 1064b09e114f42b3d46a40d4000d534d32920362..42d71ba9fe30f167d9e198371138f5f6a764929b 100644 (file)
@@ -162,7 +162,7 @@ class Cvs(Fetch):
         # tar them up to a defined filename
         if 'fullpath' in ud.parm:
             os.chdir(pkgdir)
-            myret = os.system("tar -czf %s %s" % (ud.localpath, localdir))
+            myret = os.system("tar --exclude 'CVS' -czf %s %s" % (ud.localpath, localdir))
         else:
             os.chdir(moddir)
             os.chdir('..')
index 57d758dcda6981322da5c4e43676915814f17458..8a00a013f93eb5adaf1a5255af44af7f37f24dce 100644 (file)
@@ -187,7 +187,7 @@ class Git(Fetch):
 
         os.chdir(codir)
         logger.info("Creating tarball of git checkout")
-        runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d)
+        runfetchcmd("tar --exclude '.git' -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d)
 
         os.chdir(ud.clonedir)
         bb.utils.prunedir(codir)
index ab00d43033ec18dbeb79c9f37ba16c2332744c5d..9c11debd80ebda958164ed2a614d146e7295251e 100644 (file)
@@ -145,7 +145,7 @@ class Hg(Fetch):
 
         os.chdir(ud.pkgdir)
         try:
-            runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d)
+            runfetchcmd("tar --exclude '.hg' --exclude '.hgrags' -czf %s %s" % (ud.localpath, ud.module), d)
         except:
             t, v, tb = sys.exc_info()
             try:
index 34f8132257aa8deb95b12a92febc1c035f0e617d..c236e413fd763223982b374391cc18d33640689e 100644 (file)
@@ -159,7 +159,7 @@ class Svn(Fetch):
         os.chdir(ud.pkgdir)
         # tar them up to a defined filename
         try:
-            runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d)
+            runfetchcmd("tar --exclude '.svn' -czf %s %s" % (ud.localpath, ud.module), d)
         except:
             t, v, tb = sys.exc_info()
             try: