Skip to content

Commit

Permalink
fix(app-misc/xq): resolve conflict with app-misc/yq
Browse files Browse the repository at this point in the history
  • Loading branch information
SpiderX committed Jul 4, 2024
1 parent b0cf541 commit 6a825fc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions app-misc/xq/xq-1.2.4.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"

src_prepare() {
default

# rename reference (app-misc/yq)
sed -i '/Use:/s|xq|xxq|' cmd/root.go || die "sed failed for root.go"
# rename man
sed -i 's/xq/xxq/;s/XQ/XXQ/' docs/xq.man || die "sed failed for xq.man"
}

src_compile() {
DATE="$(date -u '+%Y-%m-%d-%H%M UTC')"
LDFLAGS="-X main.version=${PV} -X \"main.date=${DATE}\" -X main.commit=${COMMIT}"
Expand All @@ -167,6 +176,6 @@ src_test() {

src_install() {
einstalldocs
dobin xq
newman docs/xq.man xq.1
newbin xq xxq
newman docs/xq.man xxq.1
}
13 changes: 11 additions & 2 deletions app-misc/xq/xq-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ src_unpack() {
go-module_live_vendor
}

src_prepare() {
default

# rename reference (app-misc/yq)
sed -i '/Use:/s|xq|xxq|' cmd/root.go || die "sed failed for root.go"
# rename man
sed -i 's/xq/xxq/;s/XQ/XXQ/' docs/xq.man || die "sed failed for xq.man"
}

src_compile() {
DATE="$(date -u '+%Y-%m-%d-%H%M UTC')"
COMMIT="$(git log -n 1 --format='%h')"
Expand All @@ -32,6 +41,6 @@ src_test() {

src_install() {
einstalldocs
dobin xq
newman docs/xq.man xq.1
newbin xq xxq
newman docs/xq.man xxq.1
}

0 comments on commit 6a825fc

Please sign in to comment.