Skip to content

Commit

Permalink
Merge branch 'master' of github.com:IBM/ibmi-bob
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundreinhardt committed Feb 10, 2023
2 parents 2c2c65c + d374632 commit cdda64d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ibmi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
echo " StrictHostKeyChecking no" >> ~/.ssh/config
- name: Generate the RPM spec file
run: |
python3 tools/release/generate_spec.py ${{ steps.get_version.outputs.VERSION }} CHANGELOG
python3 tools/release/generate_spec.py ${{ steps.get_version.outputs.VERSION }} CHANGELOG True
- name: Create rpmbuild directory
run: |
mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,BUILDROOT}
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ yum install bash coreutils gawk grep-gnu make-gnu python39 python39-ibm_db sed-g
To download the latest rpm file on IBM i, run the following

```bash
curl -L https://github.com/IBM/ibmi-bob/releases/latest/download/bob-x.x.x-1.ibmi7.3.ppc64.rpm -o bob.ppc64.rpm
curl -L https://github.com/IBM/ibmi-bob/releases/latest/download/bob.rpm -o bob.ppc64.rpm
```

**Note:** the path may differ than the URL used above in the `curl` command above.
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def publish(session: nox.Session) -> None:

session.log(f"Generating the spec file for v{current_version}")

session.run("python", "tools/release/generate_spec.py", current_version, os.fsdecode(changelog_file))
session.run("python", "tools/release/generate_spec.py", current_version, os.fsdecode(changelog_file), "False")

session.log(f"Publishing the spec file for v{current_version}")
session.run("python", "tools/release/publish_spec.py", current_version, os.fsdecode(spec_file))
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.4.8
current_version = 2.4.9
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serialize = {major}.{minor}.{patch}
commit = True
Expand Down
2 changes: 1 addition & 1 deletion src/makei/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.4.8"
__version__ = "2.4.9"
16 changes: 11 additions & 5 deletions tools/release/generate_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def replace_changelog(template: str,
return re.sub(r"\${CHANGELOG}", changelog, template)


def generate_spec(version: str, changelog_file: pathlib.Path) -> str:
def generate_spec(version: str, changelog_file: pathlib.Path, fetch_source: bool) -> str:
"""Generate the spec file by replacing ${VERSION} and ${CHANGELOG} in the given template string.
Args:
Expand All @@ -57,25 +57,31 @@ def generate_spec(version: str, changelog_file: pathlib.Path) -> str:
Returns:
str: The modified spec file.
"""
template = template_file.read_text()
if fetch_source:
template = "%undefine _disable_source_fetch\n"
else:
template = ""
template = template + template_file.read_text()
template = replace_version(template, version)
template = replace_changelog(template, changelog_file)
return template


def main():
"""Generate the spec file by replacing ${VERSION} and ${CHANGELOG} in the template file."""
if len(sys.argv) != 3:
print("Usage: generate_spec.py VERSION CHANGELOG_FILE")
if len(sys.argv) != 4:
print("Usage: generate_spec.py VERSION CHANGELOG_FILE FETCH_SOURCE")
sys.exit(1)
version = sys.argv[1]
changelog_file = pathlib.Path(sys.argv[2])
fetch_source = sys.argv[3] == "True"


if not changelog_file.exists():
print(f"Changelog file {changelog_file} does not exist")
sys.exit(1)

spec = generate_spec(version, changelog_file)
spec = generate_spec(version, changelog_file, fetch_source)
with open("bob.spec", "w", encoding="utf-8") as out_file:
out_file.write(spec)

Expand Down

0 comments on commit cdda64d

Please sign in to comment.