Remove any self-provides from alpine packages
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
d9659dab9c
commit
00406493c2
|
@ -158,12 +158,14 @@ func BuildPackage(ctx context.Context, opts types.BuildOpts) ([]string, []string
|
||||||
|
|
||||||
log.Info("Building package metadata").Str("name", vars.Name).Send()
|
log.Info("Building package metadata").Str("name", vars.Name).Send()
|
||||||
|
|
||||||
pkgInfo, err := buildPkgMetadata(vars, dirs, append(repoDeps, builtNames...))
|
pkgFormat := getPkgFormat(opts.Manager)
|
||||||
|
|
||||||
|
pkgInfo, err := buildPkgMetadata(vars, dirs, pkgFormat, append(repoDeps, builtNames...))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
packager, err := nfpm.Get(getPkgFormat(opts.Manager))
|
packager, err := nfpm.Get(pkgFormat)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -477,7 +479,7 @@ func executeFunctions(ctx context.Context, dec *decoder.Decoder, dirs types.Dire
|
||||||
}
|
}
|
||||||
|
|
||||||
// buildPkgMetadata builds the metadata for the package that's going to be built.
|
// buildPkgMetadata builds the metadata for the package that's going to be built.
|
||||||
func buildPkgMetadata(vars *types.BuildVars, dirs types.Directories, deps []string) (*nfpm.Info, error) {
|
func buildPkgMetadata(vars *types.BuildVars, dirs types.Directories, pkgFormat string, deps []string) (*nfpm.Info, error) {
|
||||||
pkgInfo := &nfpm.Info{
|
pkgInfo := &nfpm.Info{
|
||||||
Name: vars.Name,
|
Name: vars.Name,
|
||||||
Description: vars.Description,
|
Description: vars.Description,
|
||||||
|
@ -496,6 +498,13 @@ func buildPkgMetadata(vars *types.BuildVars, dirs types.Directories, deps []stri
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pkgFormat == "apk" {
|
||||||
|
// Alpine refuses to install packages that provide themselves, so remove any such provides
|
||||||
|
pkgInfo.Overridables.Provides = slices.DeleteFunc(pkgInfo.Overridables.Provides, func(s string) bool {
|
||||||
|
return s == pkgInfo.Name
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if vars.Epoch != 0 {
|
if vars.Epoch != 0 {
|
||||||
pkgInfo.Epoch = strconv.FormatUint(uint64(vars.Epoch), 10)
|
pkgInfo.Epoch = strconv.FormatUint(uint64(vars.Epoch), 10)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue