summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2022-05-08 11:57:23 +0200
committerDamien Regad <dregad@mantisbt.org>2022-05-08 11:57:23 +0200
commit464ea0f17cf188c5beb2658234bc0d098009b206 (patch)
treeb33f1733054f69fc98cd35dc68d9adc5e5c31526 /scripts
parent94030fbcfcac1ae8c835dad70b13c127a3714427 (diff)
downloadadodb-464ea0f17cf188c5beb2658234bc0d098009b206.tar.gz
adodb-464ea0f17cf188c5beb2658234bc0d098009b206.tar.bz2
adodb-464ea0f17cf188c5beb2658234bc0d098009b206.zip
Simplify version update script
Since v5.21.1, the ADOdb version number is only referenced in the $ADODB_vers global variable in adodb.inc.php, so it is not necessary to process all library files anymore. This allows optimization of the version matching regex, to also work when there is no release date appended.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/updateversion.py21
1 files changed, 2 insertions, 19 deletions
diff --git a/scripts/updateversion.py b/scripts/updateversion.py
index 5590f37f..da302c07 100755
--- a/scripts/updateversion.py
+++ b/scripts/updateversion.py
@@ -164,7 +164,7 @@ def sed_script(version):
Build sed script to update version information in source files.
"""
# Version number and release date
- script = r"s/{0}\s+{1}/v{2} {3}/".format(
+ script = r"/ADODB_vers/s/{0}(\s+{1})?/v{2} {3}/".format(
_version_regex,
_release_date_regex,
version,
@@ -173,23 +173,6 @@ def sed_script(version):
return script
-def sed_filelist():
- """
- Build list of files to update.
- """
- dirlist = []
- for root, dirs, files in os.walk(".", topdown=True):
- # Filter files by extensions
- files = [
- f for f in files
- if re.search(r'\.php$', f, re.IGNORECASE)
- ]
- for fname in files:
- dirlist.append(path.join(root, fname))
-
- return dirlist
-
-
def sed_run(script, files):
"""
Run sed.
@@ -404,7 +387,7 @@ def version_set(version, do_commit=True, do_tag=True):
update_changelog(version)
print("Updating version and date in source files")
- sed_run(sed_script(version), " ".join(sed_filelist()))
+ sed_run(sed_script(version), "adodb.inc.php")
print("Version set to {0}".format(version))
if do_commit: