Compare commits

..

203 Commits

Author SHA1 Message Date
Brett T. Warden e005f2164e Make catchup- a little bit more flexible with tag names
We support tag names like
${package}-${version}
${package}-v${version}
${version}
v${version}

Now add support for things like
${package}-foo-bar-${version}
foo-bar-${version}

for example:
vulkan-sdk-1.3.275.0 for SPIRV-Headers
2025-04-30 13:31:19 -07:00
Arjan van de Ven 5ed7435295 update packages file 2025-04-24 19:10:13 +00:00
Arjan van de Ven 0215deaf60 update packages file 2025-04-22 18:26:19 +00:00
Arjan van de Ven 3bea87a841 update packages file 2025-04-17 16:25:14 +00:00
Arjan van de Ven 1d363fd932 update packages file 2025-04-15 16:10:10 +00:00
Arjan van de Ven 05ccbbe7a7 update packages file 2025-04-10 16:35:03 +00:00
Arjan van de Ven b4b4a84dbb update packages file 2025-03-25 18:25:21 +00:00
Arjan van de Ven 8e2a825ca8 update packages file 2025-03-20 23:10:10 +00:00
Arjan van de Ven e8c53e4a2e update packages file 2025-03-17 15:39:42 +00:00
Arjan van de Ven 5d1521256e update packages file 2025-03-11 16:33:54 +00:00
Arjan van de Ven c43ccd01e8 update packages file 2025-03-06 19:44:36 +00:00
Arjan van de Ven f80b262ad7 update packages file 2025-03-05 07:49:33 +00:00
Arjan van de Ven 2b6b813c0a update packages file 2025-02-27 22:27:51 +00:00
Arjan van de Ven ec9fa3b778 update packages file 2025-02-25 19:01:23 +00:00
Arjan van de Ven e473e2bce8 update packages file 2025-02-18 18:30:50 +00:00
Arjan van de Ven d5dc76d31e update packages file 2025-02-13 18:17:21 +00:00
Arjan van de Ven f825b6b7fc update packages file 2025-02-12 07:05:01 +00:00
Arjan van de Ven 4627d7a47d update packages file 2025-02-04 18:21:27 +00:00
Arjan van de Ven 8b2e15fa59 update packages file 2025-01-28 17:50:13 +00:00
Arjan van de Ven ec3903192a update packages file 2025-01-24 00:07:48 +00:00
Arjan van de Ven da6bc31e4a update packages file 2025-01-17 14:49:29 +00:00
Arjan van de Ven c360ffe52c update packages file 2025-01-09 19:17:51 +00:00
Arjan van de Ven f092f66d8d update packages file 2024-12-19 06:03:26 +00:00
Brett T. Warden 704e8c90b8 Cleanup parsing of version from specfile in catchup targets
Make sure we only parse %{version} one time while doing a catchup.
2024-12-05 17:11:40 -08:00
Brett T. Warden 1ca80a16a3 Implement catchup targets
Implement a new target 'catchup' that will backport upstream commits
from the current package version to HEAD.
Implement a new target 'catchup-<commit|tag>' that will backport
upstream commits up to the target, as resolvable by git. This powers
'catchup'.
Rework the target 'backport-<commit>' to clone and use the upstream
git repository instead of using GitHub URLs. This also simplifies the
resolution of targets to full commit hashes, as needed to ensure unique
patch names and entries in 'series'.

'make catchup' will backport all the patches to catch this package up to
the upstream's HEAD
'make catchup-v5.0' will backport all the patches to catch this package
up to tag "v5.0" upstream.
'make catchup-ffdcba' will backport all the patches between this
package's current version and the upstream commit ffdcba.
'make backport-ffdcba' will backport ONLY upstream commit ffdcba.

All targets will produce patches named "backport-<commit>.patch", where
<commit> is the full SHA1 commit hash, regardless of whether you used an
abbreviated hash (or a tag, for catchup-%).

Patches are added to 'series' in chronological order, unless they're
already anywhere in that file.
2024-12-05 16:00:31 -08:00
Arjan van de Ven 27e359bda0 update packages file 2024-12-05 19:57:20 +00:00
Brett T. Warden 3db02dd609 Implement backport-<commit> target
For packages with a GitHub repo configured in options.conf, allow
downloading and applying backport patches via the 'backport-<commit>'
target. If given an abbreviated commit ID, it will still create a
backport-<commit>.patch file with the full commit hash, plus add it (if
it does not already exist) to the end of the series file.

Because this handles a single commit at a time, this should be wrappable
by a future Makefile target that applies individual commits to catch up
to a target tag, for example.
2024-12-02 16:13:06 -08:00
Arjan van de Ven 5866d7afbf update packages file 2024-11-25 21:15:54 +00:00
Arjan van de Ven 437d1ee01a update packages file 2024-11-13 17:16:18 +00:00
Arjan van de Ven cb5d78bb2f update packages file 2024-11-05 04:43:02 +00:00
William Douglas 9bfaefc491 Add support for multiple Cargo.toml files
Some projects store multiple Cargo.toml files, let vendor handle all
of them (might be worth having some config for certain Cargo.toml
paths to skip in the future though).

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-10-31 10:30:24 -07:00
Arjan van de Ven 64a20fa5c2 update packages file 2024-10-24 18:55:47 +00:00
Arjan van de Ven e0b152250f use gz not xz 2024-10-22 15:39:37 +00:00
Arjan van de Ven 70ca088ce6 update packages file 2024-10-18 19:19:02 +00:00
Arjan van de Ven a3c7b734fa packages update 2024-10-17 15:08:53 +00:00
Arjan van de Ven 7ff8c3a6d5 update packages file 2024-10-15 13:47:25 +00:00
William Douglas bdac11063e bump target: Stash repo first
In order to prevent content that wasn't committed from working its way
into a build, stash prior to doing the rest of the bump.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-10-10 11:47:15 -07:00
Arjan van de Ven 52f73c1530 packages update 2024-09-20 15:00:40 +00:00
Arjan van de Ven 072d9b81a2 packages update 2024-09-11 17:01:52 +00:00
Brett T. Warden 85a3e1cd32 Add libpng-2.0 license 2024-09-11 08:38:47 -07:00
William Douglas 3bf41ad9c9 Update vendor script to always use the latest tag
Sometimes vendor repos get tagged but the package fails to update for
another reason. In this case the repo wouldn't have the new vendor
ARCHIVE set and new attempts to build would use the old vendor archive
causing failures. Force using the latest vendor tag as generally this
is what we want (if we get a bad vendor tag somehow, it should mean a
new tag needs to be created to replace it anyway).

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-09-06 13:12:13 -07:00
Arjan van de Ven 92b3d682ec udpate 2024-08-22 18:35:05 +00:00
Arjan van de Ven ce873b4b19 packages update 2024-08-20 15:16:40 +00:00
Arjan van de Ven 463112629b packages update 2024-08-13 15:18:01 +00:00
Arjan van de Ven 0fd1fc5a1d packages update 2024-07-30 16:29:55 +00:00
William Douglas 0e9a2b7e82 Force git attributes for vendor directories
Avoid cases where user git settings cause files to have different line
endings than the package and cause hash mismatches when building.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-25 12:45:07 -07:00
William Douglas 398fb69708 Always remove the pumpAutospec file
Remove pumpAutospec even if the package hasn't yet become a git repo
yet.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-24 15:36:47 -07:00
William Douglas cdcb8aa9d8 Switch to git rm for removing the autospec log file
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-22 16:38:33 -07:00
Arjan van de Ven 3168ba058e update 2024-07-22 23:22:51 +00:00
William Douglas 76fef57d5b Add env var for autospec logging
Add environment variable that autospec uses to decide when to log
fatal errors to a special file used for the update process.

Also does the cleanup of the autospec created file for new autospec
runs.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-22 16:20:55 -07:00
Arjan van de Ven 59ea0b102e new packages file 2024-07-09 18:23:06 +00:00
William Douglas e4c604a161 Export the output of cargo vendor
autospec learned how to use 'cargo vendor' output as a drop in
configuration file so put the output of cargo vendor there.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-08 15:11:34 -07:00
William Douglas 59c4520f37 Fix import order
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-08 14:07:10 -07:00
William Douglas 16f813a390 Add support for update.first
Add additional capability for update target to read a package's
update.first file that will run make update on each of the packages
included in that file.

The intended usage model is for packages that need to be updated in
order to specify that order via the update.first (the packages are
updated in the order specified unless a package in the list also has
an update.first file).

As part of this change, force the update target to always build in
koji synchronously to avoid issues where the update being depended on
isn't finished in koji.

Loops are not supported and will cause problems.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-03 15:03:11 -07:00
William Douglas 79eebc6aa6 Remove autospecnewgo target and its component parts
This wasn't a practical target and is no longer used so remove it.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-03 13:33:17 -07:00
William Douglas d1accc8077 Fix CLEANUP option handling for autospecnew target
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-03 11:34:09 -07:00
Arjan van de Ven b23d156f2c update packages file 2024-07-01 16:20:05 +00:00
Arjan van de Ven 39e8d4e68a update packages 2024-06-20 22:38:41 +00:00
Arjan van de Ven 9d440aff3a update packages 2024-06-13 20:01:45 +00:00
Arjan van de Ven c1e426713a packages update 2024-05-27 15:34:45 +00:00
William Douglas d9e4f478eb Rework vendoring support
Changes vendor from a target (it could still have a stand-alone target
but it wouldn't be used by the autospec target).

This change is needed because the Makefile is rewritten in the
autospec target but the ARCHIVES make variable is going to use the
value when make is executed. The common change causes the ARCHIVES
value to be eval'd during the autospec target execution in order for
the update from the vendor script to be seen by make.

The vendor script changes fix bugs in updating the options.conf and
Makefile. It also now handles returning the original ARCHIVES value as
well as prevent subshell scripts from outputting and adding badness
into the eval'd ARCHIVES variable.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-05-22 12:26:37 -07:00
William Douglas 96b366e71f Don't blacklist the update target directory
This is shipped by the filesystem package.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-29 12:39:38 -07:00
Brett T. Warden 84097fd526 Don't alter a list we're iterating through
Fix a couple of places where we're trying to remove files from the files
list while we're iterating through it -- replicate the change elsewhere
to keep a temporary list of the files to remove, then iterate through
*that* list after iterating through the global files list.
2024-04-24 10:59:16 -07:00
William Douglas c2cd51b5f2 Have vendor.py also update the options.conf file
This file is used for spec and upstream content so updating it is
important for improving the build automation.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-18 13:55:36 -07:00
Arjan van de Ven ed1ef58d9a update packages 2024-04-17 01:23:14 +00:00
Arjan van de Ven 497f2a66f4 update packages 2024-03-15 20:03:14 +00:00
William Douglas 3b8d3c66ea Remove echo on koji tag/untag
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-03-12 15:34:16 -07:00
William Douglas 373cbad44c Add koji-tag and koji-untag targets
Add koji-tag and koji-untag targets that can be used to tag and untag
dist-clear on the current nvr build of the package in koji.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-03-12 15:31:04 -07:00
clrbuilder 0fcc984675 Update packages file for version 40810
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-02-07 10:37:45 -08:00
clrbuilder 78023bd74a Update packages file for version 40800
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-02-06 13:47:20 -08:00
clrbuilder d2b5b72346 Update packages file for version 40770
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-02-06 00:07:38 -08:00
clrbuilder 4953d9e087 Update packages file for version 40760
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-02-02 00:19:19 -08:00
clrbuilder ee37765ed2 Update packages file for version 40750
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-02-01 00:07:47 -08:00
clrbuilder 492abf6d32 Update packages file for version 40740
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-01-30 19:12:45 -08:00
clrbuilder 2562a8c7fb Update packages file for version 40720
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-01-30 00:07:47 -08:00
clrbuilder 5fd02ece36 Update packages file for version 40700
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-01-23 00:07:31 -08:00
clrbuilder 039e63fb1e Update packages file for version 40690
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-01-18 00:08:20 -08:00
clrbuilder dcf8bc4978 Update packages file for version 40660
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-01-14 09:22:12 -08:00
clrbuilder 3951710117 Update packages file for version 40630
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-01-09 00:07:14 -08:00
clrbuilder 504d77bc58 Update packages file for version 40590
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2024-01-02 00:07:06 -08:00
clrbuilder d3514ae496 Update packages file for version 40540
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-12-21 22:33:32 -08:00
clrbuilder 4403e9280a Update packages file for version 40500
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-12-19 06:25:34 -08:00
clrbuilder 0aed61be35 Update packages file for version 40460
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-12-12 00:09:31 -08:00
clrbuilder cdda6bcece Update packages file for version 40440
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-12-05 00:07:28 -08:00
clrbuilder 61203724ab Update packages file for version 40430
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-12-01 11:56:03 -08:00
clrbuilder 3dfbdf4c58 Update packages file for version 40420
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-11-30 00:06:04 -08:00
clrbuilder e0e5b4b1a7 Update packages file for version 40410
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-11-28 05:38:34 -08:00
clrbuilder b95dd8c67f Update packages file for version 40370
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-11-21 00:06:56 -08:00
Brett T. Warden 8ed4d2d0de Fix regex escaping in vendor.py
Address this warning from Python:
SyntaxWarning: invalid escape sequence '\-'
2023-11-20 12:58:01 -08:00
clrbuilder 023a2da624 Update packages file for version 40360
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-11-16 00:06:50 -08:00
clrbuilder cdd4aeebe2 Update packages file for version 40340
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-11-14 00:07:06 -08:00
clrbuilder ee744332e0 Update packages file for version 40310
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-11-03 09:03:52 -07:00
clrbuilder 353042a9bd Update packages file for version 40290
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-11-01 11:20:28 -07:00
clrbuilder 1a0366ab21 Update packages file for version 40260
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-30 12:23:45 -07:00
clrbuilder 4080b704f3 Update packages file for version 40250
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-26 10:05:44 -07:00
clrbuilder 4626f673ca Update packages file for version 40240
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-25 16:23:36 -07:00
clrbuilder 5121c565eb Update packages file for version 40200
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-20 17:30:37 -07:00
clrbuilder a26aea0290 Update packages file for version 40180
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-19 14:39:37 -07:00
clrbuilder 54a9f967c3 Update packages file for version 40150
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-19 10:40:39 -07:00
clrbuilder 9153630dcb Update packages file for version 40120
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-12 00:06:02 -07:00
clrbuilder d80039c90b Update packages file for version 40110
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-11 15:08:34 -07:00
clrbuilder f5a3630590 Update packages file for version 40100
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-11 11:55:44 -07:00
clrbuilder 75cb8bf424 Update packages file for version 40070
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-10 00:07:18 -07:00
clrbuilder 2a586be1b3 Update packages file for version 40060
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-05 00:06:54 -07:00
clrbuilder 93fccd1edf Update packages file for version 40050
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-03 12:45:48 -07:00
clrbuilder 9527057e5e Update packages file for version 40040
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-10-03 00:06:48 -07:00
clrbuilder f3500feb2d Update packages file for version 40030
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-09-28 11:39:36 -07:00
clrbuilder 05598abd55 Update packages file for version 40010
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-09-26 08:04:38 -07:00
clrbuilder 2b0163ef73 Update packages file for version 40000
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-09-25 13:55:49 -07:00
clrbuilder 3f2b9100e6 Update packages file for version 39990
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-09-22 11:34:36 -07:00
William Douglas 1b841e095d Update help comment for clean-pkgs-dir
Signed-off-by: William Douglas <william.douglas@intel.com>
2023-09-19 11:24:22 -07:00
William Douglas 579d79ef92 Make clean-pkgs-dir backup things it cleans up
If something already exists in backup form, skip it, otherwise move
the content to the backup directory.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-09-19 11:22:01 -07:00
clrbuilder d85dfaec30 Update packages file for version 39970
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-09-19 00:06:54 -07:00
clrbuilder 8787caac84 Update packages file for version 39940
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-09-12 00:06:48 -07:00
clrbuilder 181006f851 Update packages file for version 39910
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-09-07 00:07:05 -07:00
clrbuilder 480917e514 Update packages file for version 39900
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-09-05 00:07:23 -07:00
clrbuilder afab562778 Update packages file for version 39890
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-31 00:06:52 -07:00
clrbuilder 21ae357eeb Update packages file for version 39880
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-29 12:26:30 -07:00
clrbuilder b4989fae9b Update packages file for version 39870
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-29 00:06:49 -07:00
clrbuilder 09d1f48a31 Update packages file for version 39860
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-24 00:09:48 -07:00
clrbuilder 3a5cfb76c6 Update packages file for version 39850
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-22 00:06:40 -07:00
clrbuilder 763c25ac43 Update packages file for version 39800
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-15 00:05:31 -07:00
clrbuilder b97bc72f65 Update packages file for version 39790
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-14 08:30:03 -07:00
clrbuilder 6af8cdfa99 Update packages file for version 39780
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-09 18:08:15 -07:00
clrbuilder dd378bba6c Update packages file for version 39770
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-09 12:05:28 -07:00
clrbuilder 4b63761b45 Update packages file for version 39760
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-08 15:12:41 -07:00
clrbuilder 5882fa9b80 Update packages file for version 39730
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-03 00:06:37 -07:00
clrbuilder 8c028f361d Update packages file for version 39720
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-08-01 00:07:18 -07:00
clrbuilder 56dfe24b31 Update packages file for version 39710
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-27 00:09:15 -07:00
clrbuilder 5f2827db17 Update packages file for version 39690
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-24 10:55:02 -07:00
clrbuilder f3d664e694 Update packages file for version 39660
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-20 06:52:51 -07:00
clrbuilder 088ab41319 Update packages file for version 39650
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-18 21:30:52 -07:00
clrbuilder b2a39834c2 Update packages file for version 39640
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-18 00:07:19 -07:00
clrbuilder b7184a56a8 Update packages file for version 39630
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-14 05:37:18 -07:00
clrbuilder 976837dd36 Update packages file for version 39620
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-13 00:07:09 -07:00
clrbuilder 6102ce39b8 Update packages file for version 39610
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-11 00:08:15 -07:00
clrbuilder 4ed6de4b77 Update packages file for version 39600
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-07 12:42:26 -07:00
clrbuilder 5af73631bd Update packages file for version 39590
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-06 07:19:14 -07:00
clrbuilder 7a63c36293 Update packages file for version 39550
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-07-03 11:31:57 -07:00
clrbuilder 442543a9aa Update packages file for version 39540
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-06-29 00:06:26 -07:00
clrbuilder 43b28277c0 Update packages file for version 39530
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-06-28 14:39:47 -07:00
clrbuilder c371f6a233 Update packages file for version 39490
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-06-27 15:09:21 -07:00
clrbuilder 485815c4fe Update packages file for version 39470
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-06-27 00:07:28 -07:00
clrbuilder ffd02240f4 Update packages file for version 39460
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-06-26 16:11:45 -07:00
clrbuilder 69e4a64658 Update packages file for version 39450
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-06-23 09:07:00 -07:00
William Douglas 61a91af0ff Fix logic for detecting new vendor
Missing grouping in vendor .git changed caused detection failures.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-06-01 15:08:51 -07:00
clrbuilder fc6b90aaa5 Update packages file for version 38830
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-04-18 07:56:02 -07:00
clrbuilder b25ec94cf9 Update packages file for version 38820
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-04-17 13:01:55 -07:00
clrbuilder a8500a2645 Update packages file for version 38810
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-04-17 07:48:28 -07:00
clrbuilder 9d15900efd Update packages file for version 38800
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-04-14 09:13:47 -07:00
clrbuilder 9d101b84cf Update packages file for version 38760
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-04-12 11:23:10 -07:00
clrbuilder 89d86df8d3 Update packages file for version 38750
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-04-11 00:07:27 -07:00
clrbuilder 23e40ddcd8 Update packages file for version 38740
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-04-06 00:07:15 -07:00
clrbuilder e0a40a10f2 Update packages file for version 38710
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-04-03 14:52:16 -07:00
clrbuilder 3b76c04f7f Update packages file for version 38700
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-30 16:26:28 -07:00
clrbuilder 8b9b13698f Update packages file for version 38690
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-30 11:21:18 -07:00
clrbuilder 1f2b9cc5a7 Update packages file for version 38680
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-30 00:06:55 -07:00
William Douglas aa0028d372 Correct test for config value being set
Fix the vendor.py test checking if cargo vendoring should be done.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-03-29 16:31:28 -07:00
clrbuilder fb17b414ed Update packages file for version 38650
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-28 00:08:23 -07:00
William Douglas ead0c3e12d Only vendor if cargo_vendor is true not just if it exists
Signed-off-by: William Douglas <william.douglas@intel.com>
2023-03-27 10:19:53 -07:00
clrbuilder 610754dddd Update packages file for version 38640
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-24 13:27:46 -07:00
William Douglas ef9417d080 Add checks to ensure options.conf is valid
Signed-off-by: William Douglas <william.douglas@intel.com>
2023-03-24 11:18:11 -07:00
William Douglas dcc38f2193 Add vendor target
Add handling for a vendor target that will handle specific vendor
requirements from a package's options.conf.

The initial change adds handling for 'cargo vendor', creating a new
repo in the configured git repositiory and setting up the ARCHIVES
variable in the package's Makefile.

If the repo already exists, the tooling will check if a repo change
was detected after re-vendoring the sources. If a change is detected
the new content will be pushed and the ARCHIVES variable will be
updated.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-03-23 15:01:17 -07:00
clrbuilder 9be96daea4 Update packages file for version 38630
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-23 00:07:26 -07:00
clrbuilder 1350df4df6 Update packages file for version 38620
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-21 14:46:06 -07:00
clrbuilder 878e4e2b0b Update packages file for version 38570
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-16 00:07:52 -07:00
clrbuilder c1a0943a4e Update packages file for version 38550
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-14 15:24:17 -07:00
clrbuilder e7bb8022eb Update packages file for version 38530
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-14 00:06:59 -07:00
clrbuilder 854d1383df Update packages file for version 38520
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-10 11:55:36 -08:00
clrbuilder 34929eedc8 Update packages file for version 38410
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-03-07 00:06:38 -08:00
clrbuilder 37ceeabcf2 Update packages file for version 38380
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-28 18:04:55 -08:00
clrbuilder 22bcab527f Update packages file for version 38340
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-24 12:53:07 -08:00
clrbuilder 96827eba4b Update packages file for version 38300
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-21 00:06:13 -08:00
clrbuilder 209c76a22d Update packages file for version 38290
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-20 14:57:21 -08:00
clrbuilder 9b30546825 Update packages file for version 38280
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-16 00:06:23 -08:00
clrbuilder e114f003f5 Update packages file for version 38270
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-14 00:05:54 -08:00
clrbuilder be6d64a55b Update packages file for version 38260
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-13 14:26:47 -08:00
clrbuilder f9b8dab2a6 Update packages file for version 38220
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-07 00:07:51 -08:00
clrbuilder d324a604f2 Update packages file for version 38210
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-05 08:21:05 -08:00
clrbuilder 50dce59f66 Update packages file for version 38200
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-02 00:07:04 -08:00
clrbuilder 089cb1b6b6 Update packages file for version 38190
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-02-01 12:27:31 -08:00
clrbuilder 3c76c8ff41 Update packages file for version 38180
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-31 16:42:23 -08:00
clrbuilder bc355116ae Update packages file for version 38120
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-24 00:07:13 -08:00
clrbuilder 2263c2cc23 Update packages file for version 38100
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-19 00:07:21 -08:00
clrbuilder 3e53d2c8f4 Update packages file for version 38080
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-17 00:09:44 -08:00
clrbuilder abba4bc351 Update packages file for version 38070
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-13 14:08:46 -08:00
clrbuilder 56c84563c3 Update packages file for version 38040
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-11 10:37:57 -08:00
clrbuilder 30aac6114d Update packages file for version 38030
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-10 00:09:03 -08:00
clrbuilder 14a49e69a3 Update packages file for version 38020
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-06 10:42:22 -08:00
clrbuilder 2bc3354ce8 Update packages file for version 38010
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-05 16:55:39 -08:00
clrbuilder 658f3655f8 Update packages file for version 37970
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2023-01-03 00:08:22 -08:00
clrbuilder 6bec4f7dd7 Update packages file for version 37930
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-29 14:45:05 -08:00
clrbuilder 7d26584649 Update packages file for version 37920
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-29 10:02:10 -08:00
clrbuilder d309e565a7 Update packages file for version 37890
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-28 15:30:14 -08:00
clrbuilder 8a5f1ccf07 Update packages file for version 37870
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-27 12:51:24 -08:00
clrbuilder 5c3916cd20 Update packages file for version 37860
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-22 10:50:58 -08:00
clrbuilder d3ba502fa7 Update packages file for version 37810
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-20 16:23:53 -08:00
clrbuilder 3fb868c3a9 Update packages file for version 37790
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-19 14:39:21 -08:00
Patrick McCarty 9c109bcd84 toplevel: always clone main branch for package repos
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-12-16 21:18:45 +00:00
Arjan van de Ven 3f723df7db add 2022-12-16 01:27:18 +00:00
clrbuilder e5d8879be6 Update packages file for version 37770
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-15 00:08:59 -08:00
clrbuilder 51d154950f Update packages file for version 37750
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-13 11:32:18 -08:00
clrbuilder c1db07181a Update packages file for version 37740
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2022-12-13 00:08:35 -08:00
9 changed files with 923 additions and 559 deletions
+94 -20
View File
@@ -166,10 +166,12 @@ preautospec-checks:
#help to autospec.
#help For more information, see the project at https://github.com/clearlinux/autospec
autospec: preautospec-checks pullrebase localreponotice clean-old-content
git rm --ignore-unmatch pumpAutospec || rm -f pumpAutospec
@if [ -e $(SPECFILE) ] && ! grep -q "# Generated by: autospec.py" $(SPECFILE) ; then \
echo "Specfile already exists and was not created by autospec.py! Aborting."; \
exit 1; \
fi
$(eval ARCHIVES = $(shell $(TOPLVL)/projects/common/vendor.py '$(value ARCHIVES)' $(firstword $(NEWURL) $(URL)) $(PKG_NAME) $(VND_BASE_URL)))
@printf 'PKG_NAME := %s\nURL = %s\nARCHIVES = %s\n\ninclude ../common/Makefile.common\n' $(PKG_NAME) '$(firstword $(value NEWURL) $(value URL))' '$(value ARCHIVES)' > Makefile
python3 $(TOPLVL)/projects/autospec/autospec/autospec.py \
--target . \
@@ -221,6 +223,7 @@ scanlicense:
#help the variable BUMP_MSG is set, its value is used as the commit summary.
#help Otherwise a generic commit summary is used.
bump:
git stash
git pull --rebase
$(MAKE) bumpnogit
git add $(SPECFILE) release
@@ -386,6 +389,17 @@ koji-waitrepo: kojidef
koji wait-repo --build=${SRPMVERS} ${WAIT_OPTS} ${KOJI_TAG}-build; \
fi
.PHONY: koji-tag
#help koji-tag: runs koji tag-pkg on what's in the current specfile's nvr
koji-tag:
koji tag-pkg dist-clear $(SRPMVERS)
.PHONY: koji-untag
#help koji-untag: runs koji untag-pkg on what's in the current specfile's nvr
koji-untag:
koji untag-pkg dist-clear $(SRPMVERS)
update-versions:
.PHONY: update
@@ -394,17 +408,20 @@ update-versions:
#help or update the package and push the update to koji.
#help If no update.sh exists, update the version, autospec and push the
#help update to koji (bumping the bump.list if found).
update: export AUTOSPEC_UPDATE=1
update:
@if [ -f update.first ]; then \
for pkg in $$(< update.first); do \
(cd "../$${pkg}" || exit 1; $(MAKE) update-versions || exit 0; $(MAKE) update) || exit; \
done; \
fi
@if [ -f update.sh ]; then \
./update.sh; \
else \
$(MAKE) -s update-versions && \
$(MAKE) autospec CLEANUP=1 && \
if [ -f bump.list ]; then \
$(MAKE) -s koji; \
else \
$(MAKE) -s koji-nowait; \
fi \
$(MAKE) -s koji && \
$(MAKE) koji-waitrepo; \
fi \
logcheck:
@@ -428,21 +445,6 @@ repoadd: $(TOPLVL)/repo
$(MAKE) -s localrepocreate
$(MAKE) -s localrepoenable
#help repostage: Stages locally-built RPMs for this package to the local RPM
#help directory. If this directory does not yet exist, it is created and
#help enabled.
repostage: $(TOPLVL)/repo
@if [ -z "${LATEST_RPMS}" ]; then \
echo "No rpms found in rpms/ directory."; \
exit 1; \
fi
$(MAKE) -s repodel NO_CREATEREPO=1
@for r in ${LATEST_RPMS}; do \
echo "+$${rpm#rpms/}"; \
echo "$${rpm#rpms/}" >> .repo-index; \
done; \
flock $</repo.lock ln -f -t $< ${LATEST_RPMS}
#help repodel: Removes RPMs from the local RPM repository that were
#help previously added by 'make repoadd' for this package.
repodel: $(TOPLVL)/repo
@@ -580,6 +582,78 @@ cloc: $(SRPMFILE)
@$(MOCK) --clean --scrub=chroot --uniqueext=$(PKG_NAME)
cat results/cloc.txt
#help catchup: Backport the commits from the current version to the upstream HEAD (not release).
#help Only works if giturl is defined and the current package version can be mapped to a git tag.
catchup:
$(MAKE) catchup-HEAD
#help catchup-<commit|tag>: Backport the commits from the current version to the specified commit or tag.
#help Only works if giturl is defined and the current package version can be mapped to a git tag.
catchup-%:
@target=$*; \
giturl=$$(grep -E '^giturl\s*=\s*\S+' options.conf | sed 's/giturl\s*=\s*//' 2>/dev/null); \
if [[ -z "$${giturl}" ]]; then \
echo "Error: giturl not defined in options.conf"; \
exit 1; \
fi; \
mkdir -p results; \
if [[ -d results/$(PKG_NAME) ]]; then \
echo "Reusing existing repository..."; \
git -C results/$(PKG_NAME) fetch origin; \
else \
echo "Cloning upstream repository..."; \
git -C results clone "$${giturl}" $(PKG_NAME); \
fi; \
if ! git -C results/$(PKG_NAME) rev-parse --verify --quiet "$${target}" >/dev/null; then \
echo "Error: Target commit/tag $${target} not found"; \
exit 1; \
fi; \
version=$$(rpm -q --qf '%{VERSION}\n' --specfile $(SPECFILE) | head -1); \
echo "Version: $${version}"; \
current_tag=$$(git -C results/$(PKG_NAME) tag --list | grep -E "^($(PKG_NAME)-)?(.+-|v)?$${version}$$") || { \
echo "Error: No tag found for current package version"; \
exit 1; \
}; \
echo "Catching up from $${current_tag} to $${target}"; \
for commit in $$(git -C results/$(PKG_NAME) log --reverse --pretty=oneline $${current_tag}..$${target} | cut -d' ' -f1); do \
$(MAKE) backport-$${commit}; \
done;
#help backport-<commit>: Retrieve a commit from the upstream git repository and save it as a backport patch.
#help The giturl is read from options.conf.
backport-%:
@commit=$*; \
echo "Backporting commit: $${commit}"; \
giturl=$$(grep -E '^giturl\s*=\s*\S+' options.conf | sed 's/giturl\s*=\s*//' 2>/dev/null); \
if [[ -z "$${giturl}" ]]; then \
echo "Error: giturl not defined in options.conf"; \
exit 1; \
fi; \
mkdir -p results; \
if [[ -d results/$(PKG_NAME) ]]; then \
echo "Reusing existing repository..."; \
git -C results/$(PKG_NAME) fetch origin; \
else \
echo "Cloning upstream repository..."; \
git -C results clone "$${giturl}" $(PKG_NAME); \
fi; \
full_commit=$$(git -C results/$(PKG_NAME) show --pretty=oneline $${commit} 2>/dev/null | head -1 | cut -d' ' -f 1); \
if [[ -z "$${full_commit}" ]]; then \
echo "Error: Commit for $${commit} not found"; \
exit 1; \
fi; \
patch=backport-$${full_commit}.patch; \
git -C results/$(PKG_NAME) format-patch -1 --stdout $${full_commit} > $${patch}; \
if [[ -s $${patch} ]]; then \
echo "$${patch} created"; \
grep -qE "^$${patch}$$" series 2>/dev/null || echo "$${patch}" >> series; \
else \
rm -f $${patch}; \
echo "Error: Failed to create backport patch"; \
exit 1; \
fi \
.PHONY: whatrequires
#help whatrequires: Output a list of packages that directly depend on this one,
#help showing the subpackage-level breakdown. Each line of output has the format
+3
View File
@@ -35,6 +35,9 @@ PKG_BASE_URL = https://github.com/clearlinux-pkgs
# Location where project repos are hosted.
PRJ_BASE_URL = https://github.com/clearlinux
# Location where vendor repos are hosted.
VND_BASE_URL =
# Project repos that are integral to the common tooling.
PROJ_PKGS = autospec clr-bundles common
+11 -50
View File
@@ -52,7 +52,7 @@ $(clone_PKGS): $(PACKAGES_FILE) packages/common/Makefile.common
remotepkg=$(call remotepkgname,$$pkg); \
[ -d packages/$$pkg ] || ( \
echo "Checking out: packages/$$pkg"; \
git clone $(PKG_BASE_URL)/$$remotepkg packages/$$pkg; \
git clone -b main $(PKG_BASE_URL)/$$remotepkg packages/$$pkg; \
cd packages/$$pkg; \
$(call gitoliteurl,packages/$$pkg); \
$(call subjectprefix,$$pkg); \
@@ -126,11 +126,17 @@ endif
pull: ${PULL_PKGS}
#help clean-pkgs-dir: For packages that are no longer present in the distro,
#help removes the associated package repos from the ./packages tree
#help removes the associated package repos from the ./packages tree and stores
#help it in packages_old. If it already exists in packages_old, skip it.
clean-pkgs-dir: $(PACKAGES_FILE)
@for p in ${PKGS_ORPHANED}; do \
echo "Removing $$p from packages, it is no longer in common/packages."; \
rm -rf packages/$$p; \
mkdir -p packages_old; \
if [ -d "packages_old/$$p" ]; then \
echo "packages_old/$$p already exists, not touching it"; \
else \
echo "Moving $$p from packages to packages_old, as it is no longer in common/packages."; \
mv packages/$$p packages_old/$$p; \
fi; \
done
@echo "packages directory cleaned";
@@ -231,7 +237,7 @@ autospecnew: preautospecnew-checks localreponotice
--mock-config $(MOCK_CONFIG_VAL) \
--mock-opts="$(MOCK_OPTS)" \
$${SETVERSION:+ --version $${SETVERSION}} \
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
${NON_INTERACTIVE} ${SKIP_GIT} $(if $(CLEANUP),-C) \
$(URL); \
if [ $$? -eq 0 ]; then \
$(MAKE) link-new-rpms PKG_REPO_DIR="${TOPLVL}/packages/${NAME}"; \
@@ -250,51 +256,6 @@ autospecnew: preautospecnew-checks localreponotice
exit 1; \
fi
#help autospecnewgo: Creates a new autospec package with (dependencies)
#help for a given URL=$(URL) with NAME=$(NAME). Several files used by
#help autospec will be created in the help process.
#help Use MOCK_OPTS environment varible to pass down arbitrary mock options
#help to autospec.
#help For more information about autospec, see the project page on Github https://github.com/clearlinux/autospec
autospecnewgo: preautospecnew-checks localreponotice
@if [ -z $(NAME) ] || [ -z $(URL) ]; then \
echo "Please specify NAME and URL. The ARCHIVES variable is optional."; \
exit 1; \
fi
-$(MAKE) clone_$(NAME)
@if [ ! -d $(TOPLVL)/packages/$(NAME)/.git ]; then \
echo "no remote repository found, creating new package repository and running autospec"; \
mkdir -p $(TOPLVL)/packages/$(NAME); \
( \
cd $(TOPLVL)/packages/$(NAME); \
git init -b main; \
git remote add origin $(PKG_BASE_URL)/$(NAME); \
$(call gitoliteurl,packages/$(NAME)); \
$(call subjectprefix,$(NAME)); \
); \
printf 'PKG_NAME := %s\nURL = %s\nARCHIVES = %s\n\ninclude ../common/Makefile.common\n' $(NAME) '$(value URL)' '$(value ARCHIVES)' > $(TOPLVL)/packages/$(NAME)/Makefile; \
python3 $(TOPLVL)/projects/common/go-builder.py \
--target packages/$(NAME) \
--integrity \
--config "$(AUTOSPEC_CONF)" \
--name $(NAME) \
--archives $(ARCHIVES) \
--mock-config $(MOCK_CONFIG_VAL) \
--mock-opts "$(MOCK_OPTS)" \
$(URL); \
if [ $$? -eq 0 ]; then \
$(MAKE) link-new-rpms PKG_REPO_DIR="${TOPLVL}/packages/${NAME}"; \
$(TOPLVL)/projects/common/checkblacklist.sh $(TOPLVL)/projects/common/blacklist $(TOPLVL)/packages/${NAME}/results/*.rpm; \
python3 $(TOPLVL)/projects/common/patchfilter.py <(git -C $(TOPLVL)/packages/$(NAME) show) > $(TOPLVL)/packages/$(NAME)/for-review.txt; \
python3 $(TOPLVL)/projects/common/patchfilter.py <(git -C $(TOPLVL)/packages/$(NAME) show); \
else \
exit 1; \
fi; \
else \
echo "$(NAME) already exists at $(TOPLVL)/packages/$(NAME)"; \
exit 1; \
fi
#help repoenable: Enables the local RPM repository for use with Yum/DNF and
#help Mock. If this repository does not yet exist, it is created.
repoenable: localrepoenable ;
-1
View File
@@ -2,4 +2,3 @@
/usr/lib/systemd/system/sysinit.target.wants/systemd-firstboot.service
/usr/lib/systemd/system/sysinit.target.wants/systemd-hwdb-update.service
/usr/lib/systemd/system/sysinit.target.wants/systemd-update-done.service
/usr/lib/systemd/system/update-triggers.target.wants
-285
View File
@@ -1,285 +0,0 @@
#!/usr/bin/env python3
#
# gowrap.py - part of autospec
# Copyright (C) 2019 Intel Corporation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import argparse
import os
import shutil
import subprocess
import sys
import tempfile
def parse_args():
"""Parse commandline arguments."""
parser = argparse.ArgumentParser()
parser.add_argument("url", help="Location of package archive")
parser.add_argument("-t", "--target", dest="target", action="store",
default=None,
help="Target location to create or reuse")
parser.add_argument("-c", "--config", dest="config", action="store",
default="/usr/share/defaults/autospec/autospec.conf",
help="Set configuration file to use")
parser.add_argument("-n", "--name", action="store", dest="name", default="",
help="Override the package name")
parser.add_argument("-i", "--integrity", action="store_true",
default=False,
help="Search for package signature from source URL and "
"attempt to verify package")
parser.add_argument("-m", "--mock-config", action="store", default="clear",
help="Value to pass with Mock's -r option. Defaults to "
"\"clear\", meaning that Mock will use "
"/etc/mock/clear.cfg.")
parser.add_argument("-o", "--mock-opts", action="store", default="",
help="Arbitrary options to pass down to mock when "
"building a package.")
parser.add_argument('-a', "--archives", action="store",
dest="archives", default=[], nargs='*',
help="tarball URLs for additional source archives and"
" a location for the sources to be extacted to (e.g."
" http://example.com/downloads/dependency.tar.gz"
" /directory/relative/to/extract/root )")
return parser.parse_args()
def missing_dependencies(name):
"""Check if the build failed due to missing dependencies."""
root_log = os.path.join("packages", name, "results", "root.log")
if not os.path.exists(root_log):
return False
with open(root_log, "r") as lfile:
for line in lfile.readlines():
if "No matching package to install" in line:
return True
return False
def already_built(name, version):
"""Check if the package and version are already built."""
if not os.path.exists(os.path.join("packages", name, "rpms")):
return False
vpath = os.path.join("packages", name, "versions")
if not os.path.exists(vpath):
return False
with open(vpath, "r") as vfile:
if version not in [x.strip() for x in vfile.readlines()]:
return False
return True
def build(path, args, name, url, version):
"""Try and build a package."""
if version:
ver_arg = ["-v", version]
else:
ver_arg = []
if already_built(name, version):
return True
print(f"Trying to autospec {name} - {version}")
proc = subprocess.run(["python3",
f"{path}/../autospec/autospec/autospec.py", url,
"-c", args.config, "-t", f"packages/{name}",
"-n", name, "-m", args.mock_config,
"-o", args.mock_opts, "-i"] + ver_arg, capture_output=True)
if proc.returncode == 0:
subprocess.run(["make", "link-new-rpms", f"PKG_REPO_DIR=packages/{name}"],
capture_output=True)
return proc.returncode == 0
def parse_go_mod(path):
"""Parse go.mod file for build requirements.
File content looks as follows:
module example.com/foo/bar
require (
github.com/BurntSushi/toml v0.3.1
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999
github.com/inconshreveable/mousetrap v1.0.0 // indirect
"github.com/spf13/cobra" v0.0.3
github.com/spf13/pflag v1.0.3 // indirect
)
Need to handle all require lines including //indirect.
Skip requires that use .git for now. May need to be handled
differently.
"""
reqs = []
with open(path, "r") as gfile:
dep_start = False
for line in gfile.readlines():
# Ideally the mod file is generated and the format is
# always correct but add a few defenses just in case
line = line.strip()
if line.startswith("//"):
# Skip comments
continue
if dep_start:
# End of the require section
if line.startswith(")"):
break
req = line.split()[:2]
req[0] = req[0].replace('"', '')
if req[0].endswith(".git"):
continue
reqs.append(req)
continue
if line.startswith("require ("):
dep_start = True
return reqs
def get_dependencies(name):
"""Return path to the go.mod file if it exists."""
command = None
path = None
pdir = os.path.join("packages", name)
reqs = []
for fname in os.listdir(pdir):
# Find the archive
if fname.endswith("zip"):
command = ["unzip", fname]
elif ".tar." in fname:
command = ["tar", "xf", fname]
else:
command = None
if command:
# Decompress archive
tdir = tempfile.mkdtemp()
tfile = os.path.join(tdir, fname)
shutil.copyfile(os.path.join(pdir, fname), tfile)
proc = subprocess.run(command, cwd=tdir, capture_output=True)
if not proc.returncode:
# inspect contents for a "go.sum" file
for root, _, files in os.walk(tdir):
if "go.mod" in files:
path = f"{name}.gomod"
shutil.copyfile(os.path.join(root, "go.mod"), path)
reqs += parse_go_mod(path)
os.unlink(path)
shutil.rmtree(tdir)
return reqs
def encode_requirements(requirement):
"""Encode the project's module and version."""
# Default dependency base proxy url
base_url = "https://proxy.golang.org/"
# Encoding based on
# https://tip.golang.org/cmd/go/#hdr-Module_proxy_protocol
encoded_module = ""
for char in requirement[0]:
if char.isupper():
encoded_module += "!" + char.lower()
else:
encoded_module += char
encoded_version = ""
for char in requirement[1]:
if char.isupper():
encoded_version += "!" + char.lower()
else:
encoded_version += char
return (encoded_module, encoded_version)
def initialize_package(name, url, version, path, args):
"""Setup package and try to build it."""
if already_built(name, version):
return True
print(f"Trying to autospecnew {name} - {version}")
proc = subprocess.run(["make", "autospecnew", f"URL={url}", f"NAME={name}", f"SETVERSION={version}"], capture_output=True)
if f"{name} already exists at" in proc.stdout.decode("utf-8"):
return build(path, args, name, url, version)
return proc.returncode == 0
def build_recursive(path, args, name, url, version=None, success=None):
"""Try and recursively build packages."""
if not success:
# First package being built, common utilities already run
# so just use autospec directly
success = {}
ret = build(path, args, name, url, version)
else:
ret = initialize_package(name, url, version, path, args)
if ret:
# Completed so we are done!
return True
if not missing_dependencies(name):
# Failed but not due to missing dependencies, bail
print(f"Unknown error building {name} - {version}")
return False
reqs = get_dependencies(name)
if not reqs:
# Didn't try and add anything so don't need to build again
print(f"Build failed with no missing requirements: {name} - {version}")
return False
print(f"First attempt to build failed due to missing dependencies {name} - {version}\n")
for req in reqs:
ereq = encode_requirements(req)
rname = "go-" + req[0].replace("/", "-")
rurl = f"https://proxy.golang.org/{ereq[0]}/@v/list"
if (rname, req[1]) in success:
# Rebuild detected, figure out if it is okay or not
if success[(rname, req[1])]:
# Already succeeded building req short circuit success
continue
else:
# Encountered a build loop, bail out as this likely
# requires manual fixing
print(f"Detected build loop when building {rname} - {req[1]}")
return True
success[(rname, req[1])] = False
if not build_recursive(path, args, rname, rurl, req[1], success):
print(f"Failed to build dependency {rname} - {req[1]}")
return False
success[(rname, req[1])] = True
subprocess.run(["make", "repodel"], cwd=f"packages/{rname}", capture_output=True)
subprocess.run(["make", "repostage"], cwd=f"packages/{rname}", capture_output=True)
# Create the repo with the new packages added
subprocess.run(["make", "localrepocreate"], capture_output=True)
# Retry previously failed build assuming dependencies got added
print(f"Rebuilding after resolving dependencies {name} - {version}")
ret = build(path, args, name, url, version)
print("")
return ret
def main():
"""Start program execution."""
args = parse_args()
path = os.path.dirname(os.path.realpath(__file__))
return build_recursive(path, args, args.name, args.url)
if __name__ == '__main__':
if not main():
sys.exit(-1)
print("\n\nBuild completed\n\n")
+1
View File
@@ -5,3 +5,4 @@ GFDL-1.3+
MIT-Opengroup
WXwindows
w3c
libpng-2.0
+640 -201
View File
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -98,9 +98,13 @@ def zap_entire_file_end(filename):
global files
global files_chunks
global files_header
files_to_remove = list()
for file in files:
if file.endswith(filename):
files.remove(file)
# Don't modify the original list while iterating over it
files_to_remove.append(file)
for file in files_to_remove:
files.remove(file)
def zap_line_in_file_substring(filename, match):
global header
@@ -186,7 +190,7 @@ def zap_empty_chunks():
files_to_remove = list()
for file in files:
if file not in files_chunks:
files.remove(file)
files_to_remove.append(file)
continue
to_remove = list()
for chunk in files_chunks[file]:
Executable
+168
View File
@@ -0,0 +1,168 @@
#!/usr/bin/env python3
import argparse
import configparser
import os
import re
import shutil
import subprocess
import tempfile
import time
import requests
from git import Repo
def vendor_check():
if not os.path.isfile('options.conf'):
return False
config = configparser.ConfigParser(interpolation=None)
config.read('options.conf')
if 'autospec' not in config.sections():
return False
if vendor := config['autospec'].get('cargo_vendor'):
if vendor == "true":
return 'cargo'
return False
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('archives')
parser.add_argument('url')
parser.add_argument('name')
parser.add_argument('git')
return parser.parse_args()
def setup_content(url):
tdir = tempfile.mkdtemp()
outfile = os.path.join(tdir, os.path.basename(url))
response = requests.get(url, timeout=30)
response.raise_for_status()
with open(outfile, 'wb') as cfile:
cfile.write(response.content)
subprocess.run(f"tar xf {outfile}", shell=True, cwd=tdir, check=True, stdout=subprocess.DEVNULL)
os.remove(outfile)
return tdir
def setup_cargo_vendor(path):
cargo_paths = []
for dirpath, _, files in os.walk(path):
for fname in files:
if fname == "Cargo.toml":
cargo_paths.append(os.path.join(dirpath, fname))
return cargo_paths
def update_cargo_vendor(tmpdir, cargo_paths, name, git):
git_uri = os.path.join(git, name)
vendor_path = os.path.join(tmpdir, 'vendor')
subprocess.run(f"git clone {git_uri} {vendor_path}", shell=True, check=True,
stdout=subprocess.DEVNULL)
vendor_git = os.path.join(vendor_path, '.git')
if not os.path.isdir(vendor_git):
# initialize a git repo
subprocess.run('git init .', cwd=vendor_path, shell=True, check=True,
stdout=subprocess.DEVNULL)
subprocess.run(f"git remote add origin {git_uri}", cwd=vendor_path,
shell=True, check=True, stdout=subprocess.DEVNULL)
backup_vendor_git = os.path.join(tmpdir, 'clear-linux-vendor-git')
subprocess.run(f"cp -a {vendor_git} {backup_vendor_git}", cwd=tmpdir,
shell=True, check=True, stdout=subprocess.DEVNULL)
shutil.rmtree(vendor_path)
vendor_cmd = 'cargo vendor ' + ' '.join([f"-s {x}" for x in cargo_paths[:-1]])
vendor_cmd += f" --manifest-path {cargo_paths[-1]}"
cargo_vendors = subprocess.run(vendor_cmd, cwd=tmpdir, shell=True,
check=True, stdout=subprocess.PIPE,
universal_newlines=True).stdout
with open(os.path.join(vendor_path, ".gitattributes"), "w", encoding='utf8') as gafile:
gafile.write("* text=false\n")
subprocess.run(f"cp -a {backup_vendor_git} {vendor_git}", cwd=tmpdir,
shell=True, check=True, stdout=subprocess.DEVNULL)
repo = Repo(vendor_path)
if not (len(repo.untracked_files) > 0 or repo.is_dirty()):
# Always use the newest tag as sometimes a new tag will
# be created but the package won't be updated to use it
# for a different failure reason.
tag = sorted(repo.tags, key=lambda x: x.name, reverse=True)[0]
return tag, cargo_vendors
subprocess.run('git add .', cwd=vendor_path, shell=True, check=True,
stdout=subprocess.DEVNULL)
subprocess.run('git commit -m "vendor update"', cwd=vendor_path,
shell=True, check=True, stdout=subprocess.DEVNULL)
gmt = time.gmtime()
tag = f"{gmt.tm_year}-{gmt.tm_mon:02d}-{gmt.tm_mday:02d}-{gmt.tm_hour:02d}-{gmt.tm_min:02d}-{gmt.tm_sec:02d}"
subprocess.run(f"git tag {tag}", cwd=vendor_path, shell=True,
check=True, stdout=subprocess.DEVNULL)
subprocess.run(f"git push origin main:main {tag}", cwd=vendor_path,
shell=True, check=True, stdout=subprocess.DEVNULL)
time.sleep(30)
return tag, cargo_vendors
def update_cargo_sources(name, tag, cargo_vendors):
makefile = []
options = []
archive_match = os.path.join(r'\$\(CGIT_BASE_URL\)', 'vendor', name,
'snapshot', name)
archive_replace = os.path.join('$(CGIT_BASE_URL)', 'vendor', name,
'snapshot', name)
with open('Makefile', encoding='utf8') as mfile:
for line in mfile.readlines():
if line.startswith('ARCHIVES'):
if re.search(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.gz', line):
new_archives = re.sub(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.gz',
f"{archive_replace}-{tag}.tar.gz", line)
else:
new_archives = f"{line[:-1]} {archive_replace}-{tag}.tar.gz ./vendor\n"
print(new_archives.replace('ARCHIVES = ', '', 1))
makefile.append(new_archives)
else:
makefile.append(line)
with open('Makefile', 'w', encoding='utf8') as mfile:
mfile.writelines(makefile)
archive_match = os.path.join('http://localhost', 'cgit', 'vendor', name,
'snapshot', name)
with open('options.conf', encoding='utf8') as ofile:
for line in ofile.readlines():
if line.startswith('archives'):
if re.search(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.gz', line):
new_archives = re.sub(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.gz',
f"{archive_match}-{tag}.tar.gz", line)
else:
new_archives = f"{line[:-1]} {archive_match}-{tag}.tar.gz ./vendor\n"
options.append(new_archives)
else:
options.append(line)
with open('options.conf', 'w', encoding='utf8') as ofile:
ofile.writelines(options)
with open('cargo_vendors', 'w', encoding='utf8') as cfile:
cfile.write(cargo_vendors)
def main():
args = get_args()
vtype = vendor_check()
if not vtype:
print(args.archives)
return
tdir = setup_content(args.url)
if vtype == 'cargo':
cargo_paths = setup_cargo_vendor(tdir)
if len(cargo_paths) == 0:
print(args.archives)
else:
tag, cargo_vendors = update_cargo_vendor(tdir, cargo_paths, args.name, args.git)
update_cargo_sources(args.name, tag, cargo_vendors)
shutil.rmtree(tdir)
if __name__ == '__main__':
main()