From: Prarit Bhargava <prarit@xxxxxxxxxx> redhat/scripts/rh-dist-git.sh: Use Makefile variables Use Makefile variables in rh-dist-git.sh. Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx> diff --git a/redhat/Makefile b/redhat/Makefile index blahblah..blahblah 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -637,7 +637,7 @@ endif exit 1; \ fi; \ fi - $(REDHAT)/scripts/rh-dist-git.sh "$(RHDISTGIT_BRANCH)" "$(RHDISTGIT_CACHE)" "$(RHDISTGIT_TMP)" "$(RHDISTGIT)" "$(TARBALL)" "$(KABI_TARBALL)" "$(KABIDW_TARBALL)" "$(__ZSTREAM)" "$(PACKAGE_NAME)" "$(RHEL_MAJOR)" "$(RHPKG_BIN)" "$(SRPMS)/$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)$(DIST).src.rpm" + $(REDHAT)/scripts/rh-dist-git.sh dist-rtg: dist-release @$(MAKE) dist-release-tag diff --git a/redhat/scripts/rh-dist-git.sh b/redhat/scripts/rh-dist-git.sh index blahblah..blahblah 100755 --- a/redhat/scripts/rh-dist-git.sh +++ b/redhat/scripts/rh-dist-git.sh @@ -1,32 +1,8 @@ #!/bin/bash # clones and updates a dist-git repo -# $1: branch to be used -# $2: local pristine clone of dist-git -# $3: alternate tmp directory (if you have faster storage) -# $4: alternate dist-git server -# $5: kernel source tarball -# $6: kabi stablelists tarball -# $7: dwarf-bases kabi tarball -# $8: zstream build -# $9: package name -# shellcheck disable=SC2164 - -rhdistgit_branch=$1; -rhdistgit_cache=$2; -rhdistgit_tmp=$3; -rhdistgit_server=$4; -rhdistgit_tarball=$5; -rhdistgit_kabi_tarball=$6; -rhdistgit_kabidw_tarball=$7; -rhdistgit_zstream_flag=$8; -package_name=$9; -rhel_major=${10}; -rhpkg_bin=${11}; -srpm_name=${12}; -redhat=$(dirname "$0")/..; -topdir="$redhat"/..; +# shellcheck disable=SC2164 function die { @@ -37,41 +13,41 @@ function die function upload() { [ -n "$RH_DIST_GIT_TEST" ] && return - $rhpkg_bin upload "$@" >/dev/null || die "uploading $*"; + $RHPKG_BIN upload "$@" >/dev/null || die "uploading $*"; } -if [ -z "$rhdistgit_branch" ]; then +if [ -z "$RHDISTGIT_BRANCH" ]; then echo "$0 <branch> [local clone] [alternate tmp] [alternate dist-git server]" >&2; exit 1; fi echo "Cloning the repository" # clone the dist-git, considering cache -tmpdir=$("$redhat"/scripts/clone_tree.sh "$rhdistgit_server" "$rhdistgit_cache" "$rhdistgit_tmp" "$package_name" "$rhel_major" "$rhpkg_bin"); +tmpdir=$("$REDHAT"/scripts/clone_tree.sh "$RHDISTGIT" "$RHDISTGIT_CACHE" "$RHDISTGIT_TMP" "$PACKAGE_NAME" "$RHEL_MAJOR" "$RHPKG_BIN"); echo "Switching the branch" # change in the correct branch -cd "$tmpdir/$package_name"; -$rhpkg_bin switch-branch "$rhdistgit_branch" || die "switching to branch $rhdistgit_branch"; +cd "$tmpdir/$PACKAGE_NAME"; +$RHPKG_BIN switch-branch "$RHDISTGIT_BRANCH" || die "switching to branch $RHDISTGIT_BRANCH"; echo "Copying updated files" # copy the required files (redhat/git/files) -"$redhat"/scripts/expand_srpm.sh "$topdir" "$tmpdir" "$package_name" "$srpm_name"; +"$REDHAT"/scripts/expand_srpm.sh "$TOPDIR" "$tmpdir" "$PACKAGE_NAME" "$SRPM"; echo "Uploading new tarballs" # upload tarballs -sed -i "/linux-.*.tar.xz/d" "$tmpdir/$package_name"/{sources,.gitignore}; -upload_list="$rhdistgit_tarball" +sed -i "/linux-.*.tar.xz/d" "$tmpdir/$PACKAGE_NAME"/{sources,.gitignore}; +upload_list="$TARBALL" # Only upload kernel-abi-stablelists tarball if its release counter changed. -if [ "$rhdistgit_zstream_flag" == "no" ]; then - if ! grep -q "$rhdistgit_kabi_tarball" "$tmpdir/$package_name"/sources; then - sed -i "/kernel-abi-stablelists.*.tar.bz2/d" "$tmpdir/$package_name"/{sources,.gitignore}; - upload_list="$upload_list $rhdistgit_kabi_tarball" +if [ "$__ZSTREAM" == "no" ]; then + if ! grep -q "$KABI_TARBALL" "$tmpdir/$PACKAGE_NAME"/sources; then + sed -i "/kernel-abi-stablelists.*.tar.bz2/d" "$tmpdir/$PACKAGE_NAME"/{sources,.gitignore}; + upload_list="$upload_list $KABI_TARBALL" fi - if ! grep -q "$rhdistgit_kabidw_tarball" "$tmpdir/$package_name"/sources; then - sed -i "/kernel-kabi-dw-.*.tar.bz2/d" "$tmpdir/$package_name"/{sources,.gitignore}; - upload_list="$upload_list $rhdistgit_kabidw_tarball" + if ! grep -q "$KABIDW_TARBALL" "$tmpdir/$PACKAGE_NAME"/sources; then + sed -i "/kernel-kabi-dw-.*.tar.bz2/d" "$tmpdir/$PACKAGE_NAME"/{sources,.gitignore}; + upload_list="$upload_list $KABIDW_TARBALL" fi fi @@ -82,10 +58,10 @@ upload $upload_list echo "Creating diff for review ($tmpdir/diff) and changelog" # diff the result (redhat/cvs/dontdiff). note: diff reuturns 1 if # differences were found -diff -X "$redhat"/git/dontdiff -upr "$tmpdir/$package_name" "$redhat"/rpm/SOURCES/ > "$tmpdir"/diff; +diff -X "$REDHAT"/git/dontdiff -upr "$tmpdir/$PACKAGE_NAME" "$REDHAT"/rpm/SOURCES/ > "$tmpdir"/diff; # creating the changelog file -"$redhat"/scripts/create_distgit_changelog.sh "$redhat/rpm/SOURCES/$package_name".spec \ - "$rhdistgit_zstream_flag" "$package_name" >"$tmpdir"/changelog +"$REDHAT"/scripts/create_distgit_changelog.sh "$REDHAT/rpm/SOURCES/$PACKAGE_NAME".spec \ + "$__ZSTREAM" "$PACKAGE_NAME" >"$tmpdir"/changelog # all done echo "$tmpdir" -- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647 _______________________________________________ kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure