Commit Graph

61 Commits

Author SHA1 Message Date
Jonathan Maple
43e56cc58a
Fixingup error returns for directives (#26)
The processing of pkg/directives/patch.go will return an error type but
handeling of it was attempting to use JSON encoding to print to screen.
There is no reason to use that since the `error` type only has a string
in it but doesn't get marshalled properly to json due to the private
variables.
This is also the only time json marshaling is used so instead covert the
error handling to just `fmt.Printf`.
2024-07-12 14:04:42 -04:00
Louis Abel
ced0546d71
Change patch directive to maximum compatible form
The `%patchN` method of performing patches in `%prep` has long been
deprecated and should no longer be used. The form of `%patch -PN` is
preferred for maximum compatibility between all current and upcoming
EL releases.
2024-06-24 00:14:23 -07:00
Louis Abel
ab57fbe33b
Ensure json is returned even when there's no changes 2024-06-10 16:12:51 -07:00
Louis Abel
7c1d85b963
bump to golang 1.21 2024-06-10 14:02:55 -07:00
Louis Abel
04bd3b64a6
remove deprecated ioutil functions 2024-06-10 08:31:26 -07:00
Louis Abel
18f9f5c77c
Add git name option for source-rpm
Adds the ability to set a source git repo name for the package that will
be imported.
2024-06-09 21:40:53 -07:00
Dirk Müller
82271f5d9e
Support the openELA "PATCHES" directory format as well 2023-11-06 16:53:43 +01:00
Louis Abel
162e7cea34
continue as it's a loop 2023-09-19 17:16:08 -07:00
Louis Abel
edeb0239df
Add two features and one fix
This commit attempts to merge in custom changes on distrobuild. In
particular:

* Imports
  * Package: If there are no changes, do not import. This currently
    returns as an error, so may need adjusting.
  * Module: Import, regardless if there is changes or not. MBS cares
    more about the fact there's a commit associated with a module build.
    It will not build off the same commit ID.
  * Add --module-branch-names-only flag to make it so module yamls will
    have a branch name rather than commit ID. This makes it easier to
    work with MBS.
* Fixes
  * tagless imports should use the _topdir macro, otherwise a bug may
    surface where macros or other data cannot be determined, and a
    cryptic error may display.
2023-09-05 03:50:43 -07:00
Skip Grube
44725a727d
Repaired manual commits feature and added some bugfixes:
- Manual commits work properly again, and are passed to "tagless mode" for version discovery + tagging
- Fixed tagless mode issue with rpmspec warnings, only stdout is considered
- Fixed tagless mode issue where renamed folders were not properly overwritten, causing potential bad commits

-Skip G.
2023-03-05 22:04:20 -05:00
Skip Grube
4f975913b4
Removed old commented line
-Skip
2023-02-28 16:23:51 -05:00
Skip Grube
3371826851
Fixed up formatting issues from rpmspec commit
-Skip G.
2023-02-28 15:25:11 -05:00
skip77
f4f2a0a9e4
Merge branch 'rocky-linux:main' into main 2023-02-27 16:32:24 -05:00
skip77
5e8ed2e521
Fix Default cdn behavior (#9)
- CDN returned as-is for processing if no template indicators are found

-Skip G.
2023-02-27 15:26:21 -05:00
Skip Grube
2eb0768f33
Switched to using rpmspec for version determination in tagless mode:
- Greatly simplified getVersionFromSpec function due to rpmspec usage
- Function now returns error info in case rpmspec shell command goes wrong

-Skip Grube
2023-02-26 22:59:24 -05:00
Skip Grube
0ea6123b6e
More cleanup from feedback
- Removed extra lines
- Externalized Lookaside struct{}

-Skip Grube
2023-02-23 13:57:21 -05:00
Skip Grube
2cc3bcc3a3
Updated cdn-related commits for style and cleanup
-Skip Grube
2023-02-23 12:31:31 -05:00
Skip Grube
3237794071
Updates to add flexibility to lookasides and tagless handling:
- Added template "macros" to allow for complex --cdn-url specifications ( {{.Name}}, {{.Branch}}, etc.)
- Added --cdn <distro> option with pre-set URL patterns to simplify use
- Kept default fallback behavior and search patterns of --cdn-url if templates are not used
- Removed "--altlookaside" option, as the above features make it redundant

- Automatic tagless:  If a proper git version/imports tag isn't found, a "tagless-mode" import will be attempted automatically at run-time
- taglessmode command line option kept in case user still wants to force a tagless import

-Skip Grube
2023-02-22 23:23:47 -05:00
06ffd1e507
Support ~ and % in Release 2022-11-15 15:14:59 +01:00
29778c7ea2
Proper NVR matching 2022-11-06 04:54:35 +01:00
2a2b10ba10
Formatting 2022-11-06 04:53:02 +01:00
f3ac46447d
Stop converting v3 to v2 2022-11-03 04:36:25 +01:00
skip77
cff0cc0fbf
feature: "tagless import" feature mode (#4)
In order to build from lookahead sources, srpmproc must support the new gitlab address for centos 9 stream as well as manipulating the sources to expected format.

Resolves #2.


- Options for tagless import and new stream lookaside format added
- Git Mode now supports scanning for branch head in addition to the "normal" pulling of specific version tags
- Alternate ProcessRPM added for Tagless mode in process.go (still a WIP)
- Tagless mode converts a repo to the "traditional" format (SPECS/ + SOURCES/ + <pkg>.metadata )
- Tagless mode will build a dummy srpm to determine NVR information (rpmbuild + rpm shell commands) (will use this to tag imports in the target git)
- Limitation:  Tagless imports only pull the latest head from a branch
- CentOS-Stream import branches are converted from stream-<MODULE_VERSION>-<RHEL_VERSION> to the more familiar r9s-stream-<VERSION>
- stream-style YAML is detected and converted for modules, similar to the older modulemd.src.txt files
- This new pattern is for "tagless mode" only, previous tagged imports (from git.centos.org) should not be affected
2022-09-27 23:32:50 -04:00
jarod.w
d7ed1c7a7f Fix the issue that nothing is ever written to tmpfs location when the
tmpfs is absolute path.

The test case of absolute path is below:
[root@rockylinux86 ~]# srpmproc --version 8 --upstream-prefix file:///root/rocky --storage-addr file:///tmp/srpmproc-cache --source-rpm sed --tmpfs-mode /root/rocky/rpms/sed
[root@rockylinux86 ~]# ls /root/rocky/rpms/sed/
r8  r8-beta  r8s

The test case of relative path is below:
[root@rockylinux86 ~]# pwd
/root
[root@rockylinux86 ~]# srpmproc --version 8 --upstream-prefix file:///root/rocky --storage-addr file:///tmp/srpmproc-cache --source-rpm sed --tmpfs-mode ./rocky/rpms/sed
[root@rockylinux86 ~]# ls /root/rocky/rpms/sed/
r8  r8-beta  r8s

Signed-off-by: jarod.w <wl.jarod@gmail.com>
2022-09-11 17:52:36 +08:00
Mustafa Gezen
6df2fe1e3f Fix NVR regex 2022-05-10 16:32:31 +02:00
Mustafa Gezen
e889daa21f Regex arguments should be escaped 2022-05-10 12:02:37 +02:00
Mustafa Gezen
3f4c4ad211 Fetch should conform to metadata format 2022-05-10 10:34:02 +02:00
Mustafa Gezen
6ab7f9f00a Metadata file not being found should throw an error 2022-05-10 09:35:48 +02:00
Mustafa Gezen
16ad80fdeb Support inconsistent metadata naming and case-insensitive tags 2022-05-09 19:57:43 +02:00
Mustafa Gezen
8199a79889 Add support for version/release based fetching 2022-05-05 04:25:07 +02:00
Mustafa Gezen
f7017a9eac Fix NVR regex for versions with a percentage, and fix dist regex for any EL 2022-05-02 10:39:42 +02:00
Mustafa Gezen
dd7fd31ebb retry fetching patch repo if the error is invalid auth method 2022-04-24 15:53:36 +02:00
Mustafa Gezen
bc9d81bd8e Strict branch mode should still include module streams 2022-04-23 22:56:39 +02:00
Mustafa Gezen
a84d5e5b62 fix non strict branch mode 2022-04-22 01:44:18 +02:00
Mustafa Gezen
45ad998d41 non-tmpfs mode should use memfs 2022-04-21 07:39:10 +02:00
Mustafa Gezen
a97ccb698b add support for modulemd v3 2022-04-21 07:25:44 +02:00
Mustafa Gezen
61eaa8b8f8 fix tmpfs mode, replace stream mode with branch suffix and strict mode 2022-04-21 06:30:33 +02:00
Mustafa Gezen
8f55eb397f enhancement: add support for downloading from blob storage instead of http endpoint 2022-04-03 04:29:49 +02:00
Mustafa Gezen
8f00773aac fix: disabling auto align should always return one space 2022-03-28 19:55:40 +02:00
Mustafa Gezen
2fafebaee8 Add support for disabling auto align 2022-03-28 19:49:55 +02:00
Mustafa Gezen
e0081b4ad9 Retry without authentication when upstream REQUIRES authentication and add support for basic auth in CLI 2022-03-25 18:54:23 +01:00
Mustafa Gezen
08aed871a3 Try the common authenticator for upstream then try without if failing 2022-03-25 18:40:09 +01:00
Mustafa Gezen
70c4c22665 Add authenticator to all Git calls (makes it possible to have private repos) 2022-03-25 17:39:50 +01:00
102ff0427a
enhancement: allow callers to use custom loggers 2022-01-05 15:42:49 +01:00
ad004a1671
fix: remove 8 check 2021-11-02 20:52:27 +01:00
16e049c658
fix: filesystem based blob storage should not fail when a blob is missing 2021-10-15 22:27:11 +02:00
ef5bd995b1
fix: fetch should respect root 2021-09-30 20:28:02 +02:00
6483386e19
fix(s3): nil dereference when key isn't found 2021-09-11 03:12:02 +02:00
7c15c41a9f
fix: s3 not found should not return an error 2021-09-11 03:08:24 +02:00
1e769f96dd
fix: make force-path-style available 2021-09-10 23:08:16 +02:00