Skip to content

Commit 17e40ac

Browse files
authored
Merge pull request #1635 from olehermanse/deptool-fixes
Smaller fixes to deptool, related GH Action, and READMEs
2 parents 8c0b14e + dca6cd5 commit 17e40ac

File tree

4 files changed

+74
-61
lines changed

4 files changed

+74
-61
lines changed

.github/workflows/update-dep-tables.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Update dependencies tables
1+
name: Update dependency tables
22

33
on:
44
push:
55
branches:
66
- master
7-
workflow_dispatch: # Enables manual trigger
7+
workflow_dispatch: # Enables manual trigger
88

99
jobs:
1010
update_dep_tables:
11-
name: Update dependencies tables
11+
name: Update dependency tables
1212
runs-on: ubuntu-24.04
1313
steps:
1414
- name: Checks-out repository
@@ -35,11 +35,11 @@ jobs:
3535
if: env.COMMIT_MADE == 'true'
3636
uses: cfengine/create-pull-request@v6
3737
with:
38-
title: Update dependencies tables
39-
body: Automated dependencies tables update using [the `update_dep_tables` workflow](https://github.com/cfengine/buildscripts/blob/master/.github/workflows/update-deps-tables.yml).
38+
title: Update dependency tables
39+
body: Automated dependency tables update using [the `update_dep_tables` workflow](https://github.com/cfengine/buildscripts/blob/master/.github/workflows/update-dep-tables.yml).
4040
reviewers: |
4141
olehermanse
4242
larsewi
4343
craigcomstock
44-
branch: update-dependencies-tables
44+
branch: update-dependency-tables
4545
branch-suffix: timestamp

README.md

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ This repository contains the necessary tools to build and test cfengine packages
22

33
## Hardware requirements
44

5-
By experimentation I have found that building hub packages, which includes php dependency requires more than 1.6G of RAM/swap. 2.6G worked for me, less might work as well.
5+
By experimentation I have found that building hub packages, which includes php dependency requires more than 1.6G of RAM/swap.
6+
2.6G worked for me, less might work as well.
67

78
## Example build of Community Agent
89

910
A minimal example would be to build packages for cfengine community agent.
1011
This should be done in an isolated environment such as a dedicated host, virtual machine or linux container.
1112

12-
Install necessary distribution packages. For example on debian/ubuntu:
13+
Install necessary distribution packages.
14+
For example on debian/ubuntu:
1315

1416
```
1517
apt update -y
@@ -52,72 +54,72 @@ ls -l cfengine-community/*.deb
5254

5355
## General Build Machine Prerequisites
5456

55-
Due to sheer diversity of the environments, build machine is expected to provide
56-
strict minimum amount of software (don't forget --no-install-recommends on
57-
dpkg-based systems):
57+
Due to sheer diversity of the environments, build machine is expected to provide strict minimum amount of software (don't forget `--no-install-recommends` on dpkg-based systems):
5858

5959
To access the build machine:
60-
* SSH server
61-
* Bundled one on Unixes
62-
* FreeSSHd on Windows
63-
* 'build' account with SSH key installed
60+
61+
- SSH server
62+
- Bundled one on Unixes
63+
- FreeSSHd on Windows
64+
- 'build' account with SSH key installed
6465

6566
To transfer files back and forth:
66-
* rsync on Unixes
67-
* 7z on Windows
67+
68+
- rsync on Unixes
69+
- 7z on Windows
6870

6971
To be able to install packages and run tests:
70-
* passwordless sudo access for 'build' account
71-
* sudo should not require TTY (remove 'Defaults requiretty' from /etc/sudoers)
72+
73+
- passwordless sudo access for 'build' account
74+
- sudo should not require TTY (remove 'Defaults requiretty' from /etc/sudoers)
7275

7376
To build everything:
74-
* GCC (gcc)
75-
* GNU make (make)
76-
* libc development package (libc-dev, glibc-devel)
77-
* bison (bison)
78-
* flex (flex)
79-
* fakeroot (but not fakeroot 1.12, it is horribly slow!)
77+
78+
- GCC (gcc)
79+
- GNU make (make)
80+
- libc development package (libc-dev, glibc-devel)
81+
- bison (bison)
82+
- flex (flex)
83+
- fakeroot (but not fakeroot 1.12, it is horribly slow!)
8084

8185
To create packages:
82-
* Native packaging manager
83-
* rpm-build on RPM-based systems
84-
* dpkg-dev, debhelper, fakeroot
85-
* WiX on Windows
86+
87+
- Native packaging manager
88+
- rpm-build on RPM-based systems
89+
- dpkg-dev, debhelper, fakeroot
90+
- WiX on Windows
8691

8792
To build MySQL library (yeah!):
88-
* g++ (gcc-c++, g++)
89-
* ncurses (ncurses-devel, libncurses5-dev)
93+
94+
- g++ (gcc-c++, g++)
95+
- ncurses (ncurses-devel, libncurses5-dev)
9096

9197
To build libvirt:
92-
* pkg-config (pkg-config, pkgconfig)
9398

94-
Anything else is either preprocessed on buildbot slave or built and installed
95-
during build.
99+
- pkg-config (pkg-config, pkgconfig)
100+
101+
Anything else is either preprocessed on buildbot slave or built and installed during build.
96102

97103
## Documentation build pre-requisites
98104

99-
* texinfo
100-
* texlive
101-
* cm-super
102-
* texlive-fonts-extra
105+
- texinfo
106+
- texlive
107+
- cm-super
108+
- texlive-fonts-extra
103109

104110
## Non-requisites
105111

106-
Build machines should not contain the following items, which may interfere with
107-
build process:
112+
Build machines should not contain the following items, which may interfere with build process:
108113

109-
* CFEngine itself, either in source or binary form (build machines are
110-
short-living, so this is not a problem)
111-
* Development packages for anything beside libc to avoid picking them up
112-
instead of bundled ones accidentally.
113-
* MySQL and PostgreSQL servers, clients and libraries
114+
- CFEngine itself, either in source or binary form (build machines are short-living, so this is not a problem)
115+
- Development packages for anything beside libc to avoid picking them up instead of bundled ones accidentally.
116+
- MySQL and PostgreSQL servers, clients and libraries
114117

115-
The following packages should not be installed on build machines as well, to
116-
avoid accidentally regenerating files transferred from buildslave:
118+
The following packages should not be installed on build machines as well, to avoid accidentally regenerating files transferred from buildslave:
117119

118-
* automake
119-
* autoconf
120-
* libtool
120+
- automake
121+
- autoconf
122+
- libtool
121123

122124
## Dependencies
123125

@@ -147,7 +149,7 @@ File `install-dependencies` and the relevant subdirectories in `deps-packaging`
147149
| [leech](https://github.com/larsewi/leech/releases) | | | 0.1.21 | |
148150
| libgcc | | | | AIX and Solaris only |
149151

150-
### Enterprise Hub dependencies:
152+
### Enterprise Hub dependencies
151153

152154
| CFEngine version | 3.21.x | 3.24.x | master |
153155
| --------------------------------------------------- | ------ | ------ | ------ |
@@ -161,6 +163,6 @@ File `install-dependencies` and the relevant subdirectories in `deps-packaging`
161163
| [nghttp2](https://nghttp2.opg/) | - | - | 1.64.0 |
162164
| [rsync](https://download.samba.org/pub/rsync/) | 3.3.0 | 3.3.0 | 3.3.0 |
163165

164-
* [MinGW-w64](https://sourceforge.net/projects/mingw-w64/) **OUTDATED** needed
166+
- [MinGW-w64](https://sourceforge.net/projects/mingw-w64/) **OUTDATED** needed
165167
for [redmine#2932](https://dev.cfengine.com/issues/2932)
166-
* Requires change of buildslaves (autobuild)
168+
- Requires change of buildslaves (autobuild)

scripts/README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
# deptool
2-
`deptool.py` is a script which can be used to enumerate dependencies of CFEngine. It supports printing to stdout in the Markdown table format, and printing to file in the JSON format (see `--to-json`). It can be used as a replacement for the [cf-bottom](https://github.com/cfengine/cf-bottom/) `depstable` command.
32

4-
`deptool.py` works on a local buildscripts repository. By default, the repository is assumed to be located in the parent directory of the current working directory (as `deptool.py` lives in the `scripts` directory in the buildscript repository). A custom path for the local repository can be specified using the `--root` argument. Running the script will modify the git state of the repository by checking out branches (and with `--patch`, also overwriting and git-adding `README.md`), so it might be preferable to [use a copy of the buildscripts repository](https://github.com/cfengine/buildscripts/tree/master/scripts#using-a-copy-of-the-repository).
3+
`deptool.py` is a script which can be used to enumerate dependencies of CFEngine.
4+
It supports printing to stdout in the Markdown table format, and printing to file in the JSON format (see `--to-json`).
5+
It can be used as a replacement for the [cf-bottom](https://github.com/cfengine/cf-bottom/) `depstable` command.
6+
7+
`deptool.py` works on a local buildscripts repository. By default, the repository is assumed to be current working directory (i.e. `.`).
8+
A custom path for the local repository can be specified using the `--root` argument.
9+
Running the script will modify the git state of the repository by checking out branches (and with `--patch`, also overwriting and git-adding `README.md`), so it might be preferable to [use a copy of the buildscripts repository](https://github.com/cfengine/buildscripts/tree/master/scripts#using-a-copy-of-the-repository).
510

611
A custom list of versions to process can be specified ([given as space-separated command-line arguments](https://github.com/cfengine/buildscripts/tree/master/scripts#specifying-custom-versions-list)).
712

813
See `python deptool.py -h` for more information on all available command-line arguments.
914

1015
## Examples
16+
1117
### Suppressing logs
18+
1219
```
1320
$ cd scripts
1421
$ python deptool.py --no-info
1522
WARNING:root:didn't find dep in line [| libgcc | | | | AIX and Solaris only |]
16-
### Agent Dependencies:
23+
### Agent Dependencies
1724
1825
| CFEngine version | 3.21.x | 3.24.x | master | Notes |
1926
| --------------------------------------------------------------------------------- | ------ | ------ | ------ | ------------------------ |
@@ -36,7 +43,7 @@ WARNING:root:didn't find dep in line [| libgcc
3643
| [librsync](https://github.com/librsync/librsync/releases) | - | - | 2.3.4 | |
3744
| [leech](https://github.com/larsewi/leech/releases) | - | - | 0.1.24 | |
3845
39-
### Enterprise Hub dependencies:
46+
### Enterprise Hub dependencies
4047
4148
| CFEngine version | 3.21.x | 3.24.x | master |
4249
| --------------------------------------------------- | ------ | ------ | ------ |
@@ -53,11 +60,13 @@ WARNING:root:didn't find dep in line [| libgcc
5360
```
5461

5562
### Specifying custom versions list
63+
5664
```
5765
python deptool.py 3.21.6 3.24.x master
5866
```
5967

6068
### Comparing versions
69+
6170
```
6271
$ python deptool.py 3.24.x master --compare --no-info
6372
| CFEngine version | 3.24.x | **master** |
@@ -93,6 +102,7 @@ $ python deptool.py 3.24.x master --compare --no-info
93102
```
94103

95104
Rows which contain no dependency version changes can be omitted:
105+
96106
```
97107
$ python deptool.py --compare 3.21.5 3.21.6 3.24.0 3.24.1 --no-info --skip-unchanged
98108
| CFEngine version | 3.21.5 | **3.21.6** | 3.24.0 | **3.24.1** |
@@ -114,6 +124,7 @@ $ python deptool.py --compare 3.21.5 3.21.6 3.24.0 3.24.1 --no-info --skip-uncha
114124
```
115125

116126
## Using a copy of the repository
127+
117128
```
118129
python deptool.py --root ../../buildscripts-copy
119130
```

scripts/deptool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def __init__(self, repo_path=None, log_info=True):
223223
REPO_OWNER = "cfengine"
224224
REPO_NAME = "buildscripts"
225225
if repo_path is None:
226-
repo_path = ".."
226+
repo_path = "."
227227
self.buildscripts_repo = GitRepo(
228228
repo_path,
229229
REPO_OWNER,
@@ -457,7 +457,7 @@ def updated_deps_markdown_table(self, refs):
457457
def patch_readme(self, updated_readme):
458458
TARGET_README_PATH = "README.md"
459459
self.buildscripts_repo.put_file(TARGET_README_PATH, updated_readme)
460-
self.buildscripts_repo.commit("Update dependencies tables")
460+
self.buildscripts_repo.commit("Update dependency tables")
461461

462462
def write_deps_json(self, json_path, refs):
463463
deps_data, _ = self.deps_dict(refs)
@@ -661,9 +661,9 @@ def main():
661661
comparison_table = dr.comparison_md_table(args.refs, args.skip_unchanged)
662662
print(comparison_table)
663663
else:
664-
print("### Agent Dependencies:\n")
664+
print("### Agent Dependencies\n")
665665
print(updated_agent_table)
666-
print("\n### Enterprise Hub dependencies:\n")
666+
print("\n### Enterprise Hub dependencies\n")
667667
print(updated_hub_table)
668668

669669
if args.patch:

0 commit comments

Comments
 (0)