[OS-BUILD PATCHv5 16/18] redhat: remove GL_DISTGIT_USER, RHDISTGIT and unify dist-git cloning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

redhat: remove GL_DISTGIT_USER, RHDISTGIT and unify dist-git cloning

Tested: make DISTRO=centos dist-git-test

1) GL_DISTGIT_USER is used for private fork cloning. There is no
   reason to use private fork in dist-git cloning. First this would
   require to keep the fork in sync with the orig repo main branch
   and moreover this behaves differently if the local repo cache is
   specified or not(*pkg vs git).

2) Copying sources from repo cache depends on working dir and it
   requires the sources to be updated anyways. Just remove this step.

3) *pkg commands allow to pass extra args to git. There is no need
   to use two ways how to clone the repo. This also makes RHDISTGIT
   obsolete. Use just *pkg for cloning and remove RHDISTGIT.

4) With these clean-ups there is no need to keep clone_tree.sh around.
   Just remove it and move the few commands directly into rh-dist-git.sh

Signed-off-by: Frantisek Hrbata <fhrbata@xxxxxxxxxx>
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
@@ -755,12 +755,6 @@ dist-git: dist-srpm $(KABI_TARBALL) $(KABIDW_TARBALL)
 ifeq ("$(RHDISTGIT_BRANCH)", "")
  $(error RHDISTGIT_BRANCH unset)
 endif
-	@if [ "$(DISTRO)" == "centos" ]; then \
-	if [ -z "$(GL_DISTGIT_USER)" ]; then \
-		echo "Error: please provide your gitlab username with GL_DISTGIT_USER"; \
-		exit 1; \
-	fi; \
-	fi
 	$(REDHAT)/scripts/rh-dist-git.sh
 
 dist-rtg: dist-release
diff --git a/redhat/Makefile.rhpkg b/redhat/Makefile.rhpkg
index blahblah..blahblah 100644
--- a/redhat/Makefile.rhpkg
+++ b/redhat/Makefile.rhpkg
@@ -30,16 +30,3 @@ ifeq ("$(RHDISTGIT_CACHE)", "")
   include $(TOPDIR)/.rhpkg.mk
  endif
 endif
-
-ifeq ("$(DISTRO)", "fedora")
-	RHDISTGIT:=ssh://$(RHDISTGIT_USER)@pkgs.fedoraproject.org/rpms/$(PACKAGE_NAME)
-else ifeq ("$(DISTRO)", "centos")
-	# CentOS uses a fork + merge request based workflow with dist-git to
-	# handle changes, so you need to provide the gitlab username and we by
-	# default set the default user's fork path. The dist-git target in
-	# redhat/Makefile has a check to see if the variable is not set.
-	GL_FORK_PATH?=$(PACKAGE_NAME).git
-	RHDISTGIT:=git@xxxxxxxxxx:$(GL_DISTGIT_USER)/$(GL_FORK_PATH)
-else
-	RHDISTGIT:=ssh://$(RHDISTGIT_USER)@pkgs.devel.redhat.com/rpms/$(PACKAGE_NAME)
-endif
diff --git a/redhat/scripts/clone_tree.sh b/redhat/scripts/clone_tree.sh
deleted file mode 100755
index blahblah..blahblah 0
--- a/redhat/scripts/clone_tree.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# Clones a RHEL dist-git tree using a local reference if existent
-
-function die
-{
-	echo "Error: $1" >&2;
-	exit 1;
-}
-
-date=$(date +"%Y-%m-%d")
-tmp="$(mktemp -d --tmpdir="$RHDISTGIT_TMP" RHEL"$RHEL_MAJOR"."$date".XXXXXXXX)";
-cd "$tmp" || die "Unable to create temporary directory";
-
-if [[ -n $RHDISTGIT && -n $RHDISTGIT_CACHE ]]; then
-	git clone --reference "$RHDISTGIT_CACHE" "$RHDISTGIT" "$PACKAGE_NAME" >/dev/null || die "Unable to clone using local cache";
-	# if there're tarballs present that are listed in the "sources" file,
-	# copy them or it'll be downloaded again
-	if [ -e "$RHDISTGIT_CACHE/sources" ]; then
-		while IFS= read -r i; do
-			if [ -f "$RHDISTGIT_CACHE/$i" ]; then
-				cp "$RHDISTGIT_CACHE/$i" "$tmp/kernel/";
-			fi
-		done < "$RHDISTGIT_CACHE"/sources
-	fi
-else
-	echo "No local repo, cloning using $RHPKG_BIN" >&2;
-	$RHPKG_BIN clone "$PACKAGE_NAME" >/dev/null || die "Unable to clone using $RHPKG_BIN";
-fi
-
-echo "$tmp";
-
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
@@ -23,8 +23,14 @@ fi
 
 echo "Cloning the repository"
 # clone the dist-git, considering cache
-tmpdir=$("$REDHAT"/scripts/clone_tree.sh);
-
+date=$(date +"%Y-%m-%d")
+tmpdir="$(mktemp -d --tmpdir="$RHDISTGIT_TMP" RHEL"$RHEL_MAJOR"."$date".XXXXXXXX)"
+cd "$tmpdir" || die "Unable to create temporary directory";
+test -n "$RHDISTGIT_CACHE" && reference="-- --reference $RHDISTGIT_CACHE"
+echo "Cloning using $RHPKG_BIN" >&2;
+# shellcheck disable=SC2086
+eval $RHPKG_BIN clone "$PACKAGE_NAME" "$reference" >/dev/null || die "Unable to clone using $RHPKG_BIN";
+ 
 echo "Switching the branch"
 # change in the correct branch
 cd "$tmpdir/$PACKAGE_NAME";
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -21,7 +21,6 @@ EARLY_YRELEASE=
 FLAVOR= 
 GIT=git 
 GITID=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-GL_FORK_PATH=kernel.git 
 GNUMAKEFLAGS= 
 HEAD=2585cf9dfaad 
 INCLUDE_FEDORA_FILES=1 
@@ -48,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-0.rc5.6.test 
-RHDISTGIT=git@xxxxxxxxxx:/kernel.git 
 RHDISTGIT_BRANCH=c9s 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -21,7 +21,6 @@ EARLY_YRELEASE=
 FLAVOR= 
 GIT=git 
 GITID=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-GL_FORK_PATH=kernel.git 
 GNUMAKEFLAGS= 
 HEAD=2585cf9dfaad 
 INCLUDE_FEDORA_FILES=1 
@@ -48,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-0.rc5.6.test 
-RHDISTGIT=git@xxxxxxxxxx:/kernel.git 
 RHDISTGIT_BRANCH=c9s 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -21,7 +21,6 @@ EARLY_YRELEASE=
 FLAVOR= 
 GIT=git 
 GITID=78e36f3b0dae586f623c4a37ec5eb5496f5abbe1 
-GL_FORK_PATH=kernel.git 
 GNUMAKEFLAGS= 
 HEAD=78e36f3b0dae 
 INCLUDE_FEDORA_FILES=1 
@@ -48,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.17.0-0.rc0.78e36f3b0dae.6.test 
-RHDISTGIT=git@xxxxxxxxxx:/kernel.git 
 RHDISTGIT_BRANCH=c9s 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -21,7 +21,6 @@ EARLY_YRELEASE=
 FLAVOR= 
 GIT=git 
 GITID=78e36f3b0dae586f623c4a37ec5eb5496f5abbe1 
-GL_FORK_PATH=kernel.git 
 GNUMAKEFLAGS= 
 HEAD=78e36f3b0dae 
 INCLUDE_FEDORA_FILES=1 
@@ -48,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.17.0-0.rc0.78e36f3b0dae.6.test 
-RHDISTGIT=git@xxxxxxxxxx:/kernel.git 
 RHDISTGIT_BRANCH=c9s 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -21,7 +21,6 @@ EARLY_YRELEASE=
 FLAVOR= 
 GIT=git 
 GITID=df0cc57e057f18e44dac8e6c18aba47ab53202f9 
-GL_FORK_PATH=kernel.git 
 GNUMAKEFLAGS= 
 HEAD=df0cc57e057f 
 INCLUDE_FEDORA_FILES=1 
@@ -48,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-6.test 
-RHDISTGIT=git@xxxxxxxxxx:/kernel.git 
 RHDISTGIT_BRANCH=c9s 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.fc25 b/redhat/self-test/data/centos-df0cc57e057f.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.fc25
+++ b/redhat/self-test/data/centos-df0cc57e057f.fc25
@@ -21,7 +21,6 @@ EARLY_YRELEASE=
 FLAVOR= 
 GIT=git 
 GITID=df0cc57e057f18e44dac8e6c18aba47ab53202f9 
-GL_FORK_PATH=kernel.git 
 GNUMAKEFLAGS= 
 HEAD=df0cc57e057f 
 INCLUDE_FEDORA_FILES=1 
@@ -48,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-6.test 
-RHDISTGIT=git@xxxxxxxxxx:/kernel.git 
 RHDISTGIT_BRANCH=c9s 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/centos-fce15c45d3fb.el7 b/redhat/self-test/data/centos-fce15c45d3fb.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-fce15c45d3fb.el7
+++ b/redhat/self-test/data/centos-fce15c45d3fb.el7
@@ -21,7 +21,6 @@ EARLY_YRELEASE=
 FLAVOR= 
 GIT=git 
 GITID=fce15c45d3fbd9fc1feaaf3210d8e3f8b33dfd3a 
-GL_FORK_PATH=kernel.git 
 GNUMAKEFLAGS= 
 HEAD=fce15c45d3fb 
 INCLUDE_FEDORA_FILES=1 
@@ -48,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-0.rc5.fce15c45d3fb.6.test 
-RHDISTGIT=git@xxxxxxxxxx:/kernel.git 
 RHDISTGIT_BRANCH=c9s 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/centos-fce15c45d3fb.fc25 b/redhat/self-test/data/centos-fce15c45d3fb.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-fce15c45d3fb.fc25
+++ b/redhat/self-test/data/centos-fce15c45d3fb.fc25
@@ -21,7 +21,6 @@ EARLY_YRELEASE=
 FLAVOR= 
 GIT=git 
 GITID=fce15c45d3fbd9fc1feaaf3210d8e3f8b33dfd3a 
-GL_FORK_PATH=kernel.git 
 GNUMAKEFLAGS= 
 HEAD=fce15c45d3fb 
 INCLUDE_FEDORA_FILES=1 
@@ -48,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-0.rc5.fce15c45d3fb.6.test 
-RHDISTGIT=git@xxxxxxxxxx:/kernel.git 
 RHDISTGIT_BRANCH=c9s 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/fedora-2585cf9dfaad.el7 b/redhat/self-test/data/fedora-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-2585cf9dfaad.el7
+++ b/redhat/self-test/data/fedora-2585cf9dfaad.el7
@@ -47,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-0.rc5.6.test 
-RHDISTGIT=ssh://"shadowman"@pkgs.fedoraproject.org/rpms/kernel 
 RHDISTGIT_BRANCH=rawhide 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/fedora-2585cf9dfaad.fc25 b/redhat/self-test/data/fedora-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/fedora-2585cf9dfaad.fc25
@@ -47,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-0.rc5.6.test 
-RHDISTGIT=ssh://"shadowman"@pkgs.fedoraproject.org/rpms/kernel 
 RHDISTGIT_BRANCH=rawhide 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/fedora-78e36f3b0dae.el7 b/redhat/self-test/data/fedora-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-78e36f3b0dae.el7
+++ b/redhat/self-test/data/fedora-78e36f3b0dae.el7
@@ -47,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.17.0-0.rc0.78e36f3b0dae.6.test 
-RHDISTGIT=ssh://"shadowman"@pkgs.fedoraproject.org/rpms/kernel 
 RHDISTGIT_BRANCH=rawhide 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/fedora-78e36f3b0dae.fc25 b/redhat/self-test/data/fedora-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/fedora-78e36f3b0dae.fc25
@@ -47,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.17.0-0.rc0.78e36f3b0dae.6.test 
-RHDISTGIT=ssh://"shadowman"@pkgs.fedoraproject.org/rpms/kernel 
 RHDISTGIT_BRANCH=rawhide 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/fedora-df0cc57e057f.el7 b/redhat/self-test/data/fedora-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-df0cc57e057f.el7
+++ b/redhat/self-test/data/fedora-df0cc57e057f.el7
@@ -47,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-6.test 
-RHDISTGIT=ssh://"shadowman"@pkgs.fedoraproject.org/rpms/kernel 
 RHDISTGIT_BRANCH=rawhide 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/fedora-df0cc57e057f.fc25 b/redhat/self-test/data/fedora-df0cc57e057f.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-df0cc57e057f.fc25
+++ b/redhat/self-test/data/fedora-df0cc57e057f.fc25
@@ -47,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-6.test 
-RHDISTGIT=ssh://"shadowman"@pkgs.fedoraproject.org/rpms/kernel 
 RHDISTGIT_BRANCH=rawhide 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/fedora-fce15c45d3fb.el7 b/redhat/self-test/data/fedora-fce15c45d3fb.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-fce15c45d3fb.el7
+++ b/redhat/self-test/data/fedora-fce15c45d3fb.el7
@@ -47,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-0.rc5.fce15c45d3fb.6.test 
-RHDISTGIT=ssh://"shadowman"@pkgs.fedoraproject.org/rpms/kernel 
 RHDISTGIT_BRANCH=rawhide 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 
diff --git a/redhat/self-test/data/fedora-fce15c45d3fb.fc25 b/redhat/self-test/data/fedora-fce15c45d3fb.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-fce15c45d3fb.fc25
+++ b/redhat/self-test/data/fedora-fce15c45d3fb.fc25
@@ -47,7 +47,6 @@ PROCESS_CONFIGS_OPTS=-n -w -c
 REDHAT=../redhat 
 RELEASED_KERNEL=0 
 RELEASETAG=kernel-5.16.0-0.rc5.fce15c45d3fb.6.test 
-RHDISTGIT=ssh://"shadowman"@pkgs.fedoraproject.org/rpms/kernel 
 RHDISTGIT_BRANCH=rawhide 
 RHDISTGIT_TMP=/tmp 
 RHDISTGIT_USER="shadowman" 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2021
_______________________________________________
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, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux