From 3912bc2506023d94ab0c5b3fdb8f6c22de6a9df3 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Mon, 18 Apr 2022 14:57:36 -0400 Subject: [PATCH 1/4] common/travis/xpkgdiff.sh: add script to compare pkgs to previous version --- common/travis/xpkgdiff.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 common/travis/xpkgdiff.sh diff --git a/common/travis/xpkgdiff.sh b/common/travis/xpkgdiff.sh new file mode 100755 index 000000000000..508f961aea46 --- /dev/null +++ b/common/travis/xpkgdiff.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# xpkgdiff.sh + +export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo XBPS_HOSTDIR="$HOME/hostdir" +export DIFF='diff --unified=0 --report-identical-files --suppress-common-lines + --color=always --label REPO --label BUILT' + +while read -r pkg; do + for subpkg in $(xsubpkg $pkg); do + if xbps-query --repository=$HOME/hostdir/binpkgs \ + --repository=$HOME/hostdir/binpkgs/nonfree \ + -i "$subpkg" >&/dev/null; then + /bin/echo -e "\x1b[32mFile Diff of $subpkg:\x1b[0m" + xpkgdiff -f $subpkg + /bin/echo -e "\x1b[32mMetadata Diff of $subpkg:\x1b[0m" + xpkgdiff -S $subpkg + /bin/echo -e "\x1b[32mDependency Diff of $subpkg:\x1b[0m" + xpkgdiff -x $subpkg + else + /bin/echo -e "\x1b[33m$subpkg wasn't found\x1b[0m" + fi + done +done < /tmp/templates From 4978000947d0052e71a1f4f8a07c13f9e0c6e9c0 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Mon, 18 Apr 2022 15:52:39 -0400 Subject: [PATCH 2/4] .github/workflows/build.yaml: add xpkgdiff CI step --- .github/workflows/build.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2ae7a3e728fa..3563708980ad 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -94,6 +94,14 @@ jobs: "$here/common/travis/show_files.sh" "$BOOTSTRAP" "$ARCH" ) + - name: Compare to previous + run: | + ( + here="$(pwd)" + cd / + "$here/common/travis/xpkgdiff.sh" "$BOOTSTRAP" "$ARCH" + ) + - name: Verify repository state run: | ( From 0f62bc9bf1c6b61bb3b8c9334e010b06226e6749 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Mon, 18 Apr 2022 18:41:15 -0400 Subject: [PATCH 3/4] chezmoi: test --- srcpkgs/chezmoi/template | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template index bacfc8c9b294..1aa7f6d03cc3 100644 --- a/srcpkgs/chezmoi/template +++ b/srcpkgs/chezmoi/template @@ -1,12 +1,11 @@ # Template file for 'chezmoi' pkgname=chezmoi version=2.15.1 -revision=1 +revision=2 build_style=go go_import_path="github.com/twpayne/chezmoi/v2" go_build_tags="noembeddocs noupgrade" -go_ldflags="-X main.version=${version} -X main.commit=v${version} - -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ) -X main.builtBy=xbps" +go_ldflags="-X main.version=${version} -X main.commit=v${version} -X main.builtBy=xbps" short_desc="Manage your dotfiles across multiple machines, securely" maintainer="classabbyamp " license="MIT" @@ -14,7 +13,13 @@ homepage="https://chezmoi.io/" distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz" checksum=0100dcf8b70774595f56859e5d1b635319ba584ad7b280946352be328f36d679 -export CGO_ENABLED=1 +pre_build() { + local _date + if [ "$SOURCE_DATE_EPOCH" ]; then + _date="$(date --utc --date "@$SOURCE_DATE_EPOCH" "+%Y-%m-%d")" + go_ldflags="$go_ldflags -X main.date=${_date}" + fi +} post_install() { vlicense LICENSE From e81da97d4df526fad2fbc9a103a75e00aef6d3b6 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Mon, 18 Apr 2022 18:49:54 -0400 Subject: [PATCH 4/4] tmp --- common/travis/xpkgdiff.sh | 42 +++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/common/travis/xpkgdiff.sh b/common/travis/xpkgdiff.sh index 508f961aea46..3274445d6f8a 100755 --- a/common/travis/xpkgdiff.sh +++ b/common/travis/xpkgdiff.sh @@ -2,23 +2,27 @@ # # xpkgdiff.sh -export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo XBPS_HOSTDIR="$HOME/hostdir" -export DIFF='diff --unified=0 --report-identical-files --suppress-common-lines - --color=always --label REPO --label BUILT' +if [ "$1" != "$2" ]; then + /bin/echo -e "\x1b[33mDoes not run properly on cross\x1b[0m" +else + export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo XBPS_HOSTDIR="$HOME/hostdir" + export DIFF='diff --unified=0 --report-identical-files --suppress-common-lines + --color=always --label REPO --label BUILT' -while read -r pkg; do - for subpkg in $(xsubpkg $pkg); do - if xbps-query --repository=$HOME/hostdir/binpkgs \ - --repository=$HOME/hostdir/binpkgs/nonfree \ - -i "$subpkg" >&/dev/null; then - /bin/echo -e "\x1b[32mFile Diff of $subpkg:\x1b[0m" - xpkgdiff -f $subpkg - /bin/echo -e "\x1b[32mMetadata Diff of $subpkg:\x1b[0m" - xpkgdiff -S $subpkg - /bin/echo -e "\x1b[32mDependency Diff of $subpkg:\x1b[0m" - xpkgdiff -x $subpkg - else - /bin/echo -e "\x1b[33m$subpkg wasn't found\x1b[0m" - fi - done -done < /tmp/templates + while read -r pkg; do + for subpkg in $(xsubpkg $pkg); do + if xbps-query --repository=$HOME/hostdir/binpkgs \ + --repository=$HOME/hostdir/binpkgs/nonfree \ + -i "$subpkg" >&/dev/null; then + /bin/echo -e "\x1b[32mFile Diff of $subpkg:\x1b[0m" + xpkgdiff -f $subpkg + /bin/echo -e "\x1b[32mMetadata Diff of $subpkg:\x1b[0m" + xpkgdiff -S $subpkg + /bin/echo -e "\x1b[32mDependency Diff of $subpkg:\x1b[0m" + xpkgdiff -x $subpkg + else + /bin/echo -e "\x1b[33m$subpkg wasn't found\x1b[0m" + fi + done + done < /tmp/templates +fi