Skip to content

Commit

Permalink
chore: use pkgrel override instead of pkgver one
Browse files Browse the repository at this point in the history
  • Loading branch information
M0Rf30 committed Jun 14, 2024
1 parent 3f2f2e7 commit f0d3f0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/yap/command/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func init() {
"nomakedeps", "d", false, "Skip all make dependency (makedeps) checks")
buildCmd.Flags().BoolVarP(&project.NoBuild,
"nobuild", "o", false, "Download and extract files only")
buildCmd.PersistentFlags().StringVarP(&parser.OverridePkgver,
"pkgver", "w", "", "Use a custom package version (pkgver)")
buildCmd.PersistentFlags().StringVarP(&parser.OverridePkgRel,
"pkgrel", "r", "", "Use a custom package release (pkgrel)")
buildCmd.Flags().BoolVarP(&project.SkipSyncDeps,
"skip-sync", "s", false, "Skip sync with remotes for package managers")
buildCmd.Flags().StringVarP(&source.SSHPassword,
Expand Down
11 changes: 6 additions & 5 deletions pkg/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
"mvdan.cc/sh/v3/syntax"
)

// OverridePkgver is a variable that allows overriding the PkgVer field in
// PKGBUILD. This can be useful for setting a custom package version.
var OverridePkgver string
// OverridePkgRel is a variable that allows overriding the Pkgrel field in
// PKGBUILD. This can be useful for setting a custom package revision in
// CI, as a timestamp, for example.
var OverridePkgRel string

// ParseFile parses a file and returns a PKGBUILD object and an error.
//
Expand Down Expand Up @@ -75,8 +76,8 @@ func ParseFile(distro, release, startDir, home string) (*pkgbuild.PKGBUILD, erro
return nil, err
}

if OverridePkgver != "" {
pkgBuild.PkgVer = OverridePkgver
if OverridePkgRel != "" {
pkgBuild.PkgRel = OverridePkgRel
}

return pkgBuild, err
Expand Down

0 comments on commit f0d3f0d

Please sign in to comment.