summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2022-02-19 18:31:25 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2022-02-28 20:37:23 +0100
commitfa1e6cc5bfcf07140808891cf8e49f6dcdcb4b63 (patch)
tree446e66b7e649ea60db08f79ec6325454b4776c52
parent045f52d475f57053329b90e97dba7deb1676b5ec (diff)
downloadrockbox-fa1e6cc5bf.tar.gz
rockbox-fa1e6cc5bf.zip
rbutil: Replace deploy with tarball script.
The old deployment script doesn't work anymore due to the change to cmake, and since we build the distribution packages (zip / dmg / AppImage) with cmake directly there's not much need left for the old deployment. Change-Id: Ide20887c5bc2e22aabbfb47374d70529609fbc3c
-rwxr-xr-xutils/common/gitscraper.py17
-rwxr-xr-xutils/common/tarball-rbutil.py (renamed from utils/common/deploy-rbutil.py)87
2 files changed, 59 insertions, 45 deletions
diff --git a/utils/common/gitscraper.py b/utils/common/gitscraper.py
index 5b3b316115..8d162155d9 100755
--- a/utils/common/gitscraper.py
+++ b/utils/common/gitscraper.py
@@ -142,6 +142,23 @@ def get_object(repo, blob, destfile):
return True
+def parse_rev(repo, hash):
+ '''Retrieve output of git rev-parse for a given hash.
+ @param repo Path to repository root.
+ @param hash Hash identifying the tree / commit to describe.
+ @return Description string.
+ '''
+ output = subprocess.Popen(
+ ["git", "rev-parse", "--verify", "--short=10", hash],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=repo)
+ cmdout = output.communicate()
+ if len(cmdout[1]) > 0:
+ print("An error occured!\n")
+ print(cmdout[1])
+ return ""
+ return cmdout[0].decode().rstrip()
+
+
def describe_treehash(repo, treehash):
'''Retrieve output of git-describe for a given hash.
@param repo Path to repository root.
diff --git a/utils/common/deploy-rbutil.py b/utils/common/tarball-rbutil.py
index 0c98575843..ccc413ca59 100755
--- a/utils/common/deploy-rbutil.py
+++ b/utils/common/tarball-rbutil.py
@@ -1,13 +1,12 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
-# $Id$
#
-# Copyright (c) 2010 Dominik Riebeling
+# Copyright (c) 2022 Dominik Riebeling
#
# All files in this archive are subject to the GNU General Public License.
# See the file COPYING in the source tree root for full license agreement.
@@ -16,13 +15,44 @@
# KIND, either express or implied.
#
-import deploy
+import os
+import sys
+import gitscraper
-deploy.program = "RockboxUtility"
-deploy.project = "rbutil/rbutilqt/rbutilqt.pro"
-deploy.svnserver = "svn://svn.rockbox.org/rockbox/"
-deploy.svnpaths = \
- ["rbutil/",
+if len(sys.argv) < 2:
+ print("Usage: %s <version|hash>" % sys.argv[0])
+ sys.exit()
+
+repository = os.path.abspath(
+ os.path.join(os.path.dirname(os.path.abspath(__file__)), "../.."))
+
+if '.' in sys.argv[1]:
+ version = sys.argv[1]
+ basename = f"RockboxUtility-v{version}-src"
+ ref = f"refs/tags/rbutil_{version}"
+ refs = gitscraper.get_refs(repository)
+ if ref in refs:
+ tree = refs[ref]
+ else:
+ print("Could not find hash for version!")
+ sys.exit()
+else:
+ tree = gitscraper.parse_rev(repository, sys.argv[1])
+ basename = f"RockboxUtility-{tree}"
+
+filelist = ["utils/rbutilqt",
+ "utils/ipodpatcher",
+ "utils/sansapatcher",
+ "utils/mkamsboot",
+ "utils/chinachippatcher",
+ "utils/mks5lboot",
+ "utils/mkmpioboot",
+ "utils/mkimxboot",
+ "utils/mktccboot",
+ "utils/bspatch",
+ "utils/bzip2",
+ "utils/cmake",
+ "utils/CMakeLists.txt",
"tools/ucl",
"tools/rbspeex",
"utils/imxtools",
@@ -48,41 +78,8 @@ deploy.svnpaths = \
"tools/voicefont.h",
"tools/wavtrim.c",
"tools/sapi_voice.vbs"]
-deploy.useupx = False
-deploy.bundlecopy = {
- "icons/rbutilqt.icns" : "Contents/Resources/",
- "Info.plist" : "Contents/"
-}
-deploy.progexe = {
- "win32" : "release/RockboxUtility.exe",
- "darwin" : "RockboxUtility.app",
- "linux2" : "RockboxUtility",
- "linux" : "RockboxUtility"
-}
-deploy.regreplace = {
- "rbutil/rbutilqt/version.h" : [["\$Rev\$", "%REVISION%"],
- ["(^#define BUILDID).*", "\\1 \"%BUILDID%\""]],
- "rbutil/rbutilqt/Info.plist" : [["\$Rev\$", "%REVISION%"]],
-}
-# OS X 10.6 defaults to gcc 4.2. Building universal binaries that are
-# compatible with 10.4 requires using gcc-4.0.
-deploy.qmakespec = {
- "win32" : "",
- "darwin" : "macx-g++40",
- "linux2" : "",
- "linux" : ""
-}
-deploy.make = {
- "win32" : "mingw32-make",
- "darwin" : "make",
- "linux2" : "make",
- "linux" : "make"
-}
-# all files of the program. Will get put into an archive after building
-# (zip on w32, tar.bz2 on Linux). Does not apply on Mac which uses dmg.
-# progexe will get added automatically.
-deploy.programfiles = list()
-deploy.nsisscript = ""
+print(f"Getting git revision {tree}")
+gitscraper.archive_files(repository, tree, filelist, basename, archive="tbz")
-deploy.deploy()
+print(f"Created {basename}.tar.bz2.")