public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:dev commit in: scripts/
@ 2021-06-17  4:51 Theo Anderson
  2021-06-17  5:55 ` [gentoo-commits] repo/proj/guru:master " Theo Anderson
  0 siblings, 1 reply; 6+ messages in thread
From: Theo Anderson @ 2021-06-17  4:51 UTC (permalink / raw
  To: gentoo-commits

commit:     c738bdab3a5e364822bd6899875cc77c2213fa29
Author:     Theo Anderson <telans <AT> posteo <DOT> de>
AuthorDate: Thu Jun 17 04:37:11 2021 +0000
Commit:     Theo Anderson <telans <AT> posteo <DOT> de>
CommitDate: Thu Jun 17 04:51:06 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c738bdab

scripts/setup-and-run-repoman.sh: checkout portage tag

checking out any current repoman version tag puts portage
 into a version where EAPI 8 support is not enabled

Signed-off-by: Theo Anderson <telans <AT> posteo.de>

 scripts/setup-and-run-repoman.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/setup-and-run-repoman.sh b/scripts/setup-and-run-repoman.sh
index 471a05181..f45bee9e7 100755
--- a/scripts/setup-and-run-repoman.sh
+++ b/scripts/setup-and-run-repoman.sh
@@ -1,5 +1,6 @@
 #! /usr/bin/env bash
 # Maintainer: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
+# Maintainer: Theo Anderson <telans@posteo.de>
 #
 # This sets up repoman and runs the latest version
 #
@@ -16,7 +17,7 @@ git clone https://github.com/gentoo/portage.git
 cd portage
 
 # Get all versions, and read into array
-mapfile -t RM_VERSIONS < <( git tag | grep repoman | sort -uV )
+mapfile -t RM_VERSIONS < <( git tag | grep portage | sort -uV )
 
 # Select latests version (last element in array)
 RM_VERS="${RM_VERSIONS[-1]}"


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/proj/guru:dev commit in: scripts/
@ 2021-06-15  6:56 Andrew Ammerlaan
  2021-06-15  7:11 ` [gentoo-commits] repo/proj/guru:master " Andrew Ammerlaan
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Ammerlaan @ 2021-06-15  6:56 UTC (permalink / raw
  To: gentoo-commits

commit:     f5a89a542d5355496d0ac1dde6faeda00c5eaa9c
Author:     Yuan Liao <liaoyuan <AT> gmail <DOT> com>
AuthorDate: Mon Jun 14 20:22:34 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Tue Jun 15 06:56:16 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=f5a89a54

scripts/setup-and-run-repoman.sh: use 'sort -V' to get latest tag

Without the -V flag to enable version sort, 'sort' can falsely identify
a version string like 3.0.9 to be greater than 3.0.10.  This can be
shown by running 'git tag | grep portage | sort -u' in the Portage Git
tree.  This issue is not so prominent for repoman yet because the latest
version of repoman as of now is 3.0.3, but it will surface when repoman
3.0.10 is released.

Signed-off-by: Yuan Liao <liaoyuan <AT> gmail.com>
Closes: https://github.com/gentoo/sci/pull/1094
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 scripts/setup-and-run-repoman.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/setup-and-run-repoman.sh b/scripts/setup-and-run-repoman.sh
index f9e45a9cf..471a05181 100755
--- a/scripts/setup-and-run-repoman.sh
+++ b/scripts/setup-and-run-repoman.sh
@@ -16,7 +16,7 @@ git clone https://github.com/gentoo/portage.git
 cd portage
 
 # Get all versions, and read into array
-mapfile -t RM_VERSIONS < <( git tag | grep repoman | sort -u )
+mapfile -t RM_VERSIONS < <( git tag | grep repoman | sort -uV )
 
 # Select latests version (last element in array)
 RM_VERS="${RM_VERSIONS[-1]}"


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/proj/guru:master commit in: scripts/
@ 2021-02-19 10:20 Andrew Ammerlaan
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Ammerlaan @ 2021-02-19 10:20 UTC (permalink / raw
  To: gentoo-commits

commit:     94d33fa2343d2b33f5199e0f54898c99cf7ad8de
Author:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Thu Feb 18 18:41:54 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Thu Feb 18 18:42:31 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=94d33fa2

scripts/check-duplicates.sh: skip categories metadata.xml

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>

 scripts/check-duplicates.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/check-duplicates.sh b/scripts/check-duplicates.sh
index 85af7839..8c6743bb 100755
--- a/scripts/check-duplicates.sh
+++ b/scripts/check-duplicates.sh
@@ -9,12 +9,12 @@
 GENTOO_DIR="/var/db/repos/gentoo"
 GENTOO_PACKAGES=(
 	$(find ${GENTOO_DIR} -mindepth 2 -maxdepth 2 -printf "%P\n" \
-		| sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/"
+		| sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/|metadata.xml"
 	)
 )
 REPO_PACKAGES=(
 	$(find . -mindepth 2 -maxdepth 2 -printf "%P\n" \
-		| sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/"
+		| sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/|metadata.xml"
 	)
 )
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/proj/guru:master commit in: scripts/
@ 2021-02-19 10:14 Michał Górny
  0 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2021-02-19 10:14 UTC (permalink / raw
  To: gentoo-commits

commit:     13095e024d28d13f5f707b0ca94f2d67c7273459
Author:     Theo Anderson <telans <AT> posteo <DOT> de>
AuthorDate: Thu Feb 18 10:16:08 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Feb 18 10:16:48 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=13095e02

.github/workflows/duplicates.yml: update/reformat

 - add self as maintainer
 - update variable names
 - un-nest for loops
 - check for matching package name before starting loops
 - speed improvements: ~3s vs 5m

Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Theo Anderson <telans <AT> posteo.de>

 scripts/check-duplicates.sh | 108 ++++++++++++++++++++++----------------------
 1 file changed, 53 insertions(+), 55 deletions(-)

diff --git a/scripts/check-duplicates.sh b/scripts/check-duplicates.sh
index 66d1bb9a..fe86a89e 100755
--- a/scripts/check-duplicates.sh
+++ b/scripts/check-duplicates.sh
@@ -1,75 +1,73 @@
-#!/usr/bin/env bash
+#! /usr/bin/env bash
 # Maintainer: Andrew Ammerlaan <andrewammerlaan@riseup.net>
+# Maintainer: Theo Anderson <telans@posteo.de>
 #
-# This checks if packages in ::guru are also in ::gentoo
-#
+# This checks for potential and exact package matches within ::guru & ::gentoo
 # Note that this is not going to be 100% accurate
 #
-#
-
-printf "\nChecking for duplicates....\n"
-
-gentoo_location="/var/db/repos/gentoo"
-guru_location="."
 
-gentoo_packs=$(find ${gentoo_location} -mindepth 2 -maxdepth 2 -printf "%P\n" | sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/")
-guru_packs=$(find ${guru_location} -mindepth 2 -maxdepth 2 -printf "%P\n" | sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/")
+GENTOO_DIR="/var/db/repos/gentoo"
+GENTOO_PACKAGES=(
+	$(find ${GENTOO_DIR} -mindepth 2 -maxdepth 2 -printf "%P\n" \
+		| sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/"
+	)
+)
+GURU_PACKAGES=(
+	$(find . -mindepth 2 -maxdepth 2 -printf "%P\n" \
+		| sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/"
+	)
+)
 
-pack_overrides="" pack_close_match_in_cat="" pack_close_match=""
-for guru_pack in ${guru_packs}; do
-	# separate category and packages
-	guru_pack_cat="${guru_pack%%/*}"
-	guru_pack_name="${guru_pack##*/}"
+printf "\nChecking for duplicates...\n"
 
-	# convert all to lowercase
-	guru_pack_name="${guru_pack_name,,}"
-
-	# stip all numbers, dashes, underscores and pluses
-	guru_pack_name="${guru_pack_name/[0-9-_+]}"
-
-	for gentoo_pack in ${gentoo_packs}; do
-		# separate category and packages
-		gentoo_pack_cat="${gentoo_pack%%/*}"
-		gentoo_pack_name="${gentoo_pack##*/}"
+for GENTOO_PKG in ${GENTOO_PACKAGES[@]}; do
+	GENTOO_CATEGORIES+=( ${GENTOO_PKG%%/*} )	# Separate category
+	GENTOO_PKG_NAME=${GENTOO_PKG##*/}			# Separate name
+	GENTOO_PKG_NAME=${GENTOO_PKG_NAME,,}		# Force lower case
+	GENTOO_PKG_NAMES+=( ${GENTOO_PKG_NAME} )
+done
 
-		# convert all to lowercase
-		gentoo_pack_name="${gentoo_pack_name,,}"
+printf "Testing ${#GURU_PACKAGES[@]} GURU packages against ${#GENTOO_PKG_NAMES[@]} Gentoo packages\n"
 
-		# stip all numbers, dashes, underscores and pluses
-		gentoo_pack_name="${gentoo_pack_name/[0-9-_+]}"
+for GURU_PKG in ${GURU_PACKAGES[@]}; do
+	GURU_PKG_CATEGORY=${GURU_PKG%%/*}
+	GURU_PKG_NAME=${GURU_PKG##*/}
+	GURU_PKG_NAME=${GURU_PKG_NAME,,}
 
-		#TODO: check DESCRIPTION, HOMEPAGE and SRC_URI for close matches
+	if [[ ${GENTOO_PKG_NAMES[@]} =~ " ${GURU_PKG_NAME} " ]]; then	# Check for a matcing name in the Gentoo tree,
+		for (( i=0; i<${#GENTOO_PKG_NAMES[@]}; i++ )); do			# otherwise there is no need to continue
+			[[ ${GENTOO_PKG_NAMES[$i]} == ${GURU_PKG_NAME} ]] && index+=( $i ) # Find the category/index for multiple matching names
+		done
 
-		if [[ "${gentoo_pack_name}" == "${guru_pack_name}" ]]; then
-			if [[ "${gentoo_pack_cat}" == "${guru_pack_cat}" ]]; then
-				if [[ "${gentoo_pack}" == "${guru_pack}" ]]; then
-					pack_overrides+="\t${guru_pack}::guru exact match of ${gentoo_pack}::gentoo\n"
-				else
-					pack_close_match_in_cat+="\t${guru_pack}::guru possible duplicate of ${gentoo_pack}::gentoo\n"
-				fi
-			else
-				pack_close_match+="\t${guru_pack}::guru possible duplicate of ${gentoo_pack}::gentoo\n"
+		for i in ${index[@]}; do	# For each possible match
+			if [[ ${GENTOO_PACKAGES[$i]} == ${GURU_PKG} ]]; then
+				PKG_EXACT_MATCH+="\t${GURU_PKG}::guru exact match of ${GENTOO_PACKAGES[$i]}::gentoo\n"
+				break	# An exact match is fatal, no need to continue
+			elif [[ ${GENTOO_CATEGORIES[$i]} == ${GURU_PKG_CATEGORY} ]]; then # Possible match within the same category
+				PKG_CATEGORY_MATCH+="\t${GURU_PKG}::guru possible duplicate of ${GENTOO_PACKAGES[$i]}::gentoo\n"
+			else # Possible match in a different category
+				PKG_SPECULATIVE_MATCH+="\t${GURU_PKG}::guru possible duplicate of ${GENTOO_PACKAGES[$i]}::gentoo\n"
 			fi
-		fi
-	done
+		done
+		unset index
+	fi
 done
 
-if [ -n "${pack_close_match}" ]; then
-	printf "\nWARNING: The following packages closely match packages in the main Gentoo repository\n"
-	printf "${pack_close_match}"
-	printf "Please check these manually\n"
+if [[ -n ${PKG_SPECULATIVE_MATCH} ]]; then
+	printf "\nWARNING: The following packages closely match packages in the main Gentoo repository:\n"
+	printf "${PKG_SPECULATIVE_MATCH}"
+	printf "Please check these manually.\n"
 fi
 
-if [ -n "${pack_close_match_in_cat}" ]; then
-	printf "\nWARNING: The following packages closely match packages in the main Gentoo repository in the same category\n"
-	printf "${pack_close_match_in_cat}"
-	printf "Please check these manually\n"
+if [[ -n ${PKG_CATEGORY_MATCH} ]]; then
+	printf "\nWARNING: The following packages closely match packages in the main Gentoo repository, in the same category:\n"
+	printf "${PKG_CATEGORY_MATCH}"
+	printf "Please check these manually.\n"
 fi
 
-if [ -n "${pack_overrides}" ]; then
-	printf "\nERROR: The following packages override packages in the main Gentoo repository\n"
-	printf "${pack_overrides}"
-	printf "Please remove these packages\n"
+if [[ -n ${PKG_EXACT_MATCH} ]]; then
+	printf "\nERROR: The following packages override packages in the main Gentoo repository:\n"
+	printf "${PKG_EXACT_MATCH}"
+	printf "Please remove these packages.\n"
 	exit 1
 fi
-exit 0


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [gentoo-commits] repo/proj/guru:master commit in: scripts/
@ 2021-02-19 10:14 Michał Górny
  0 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2021-02-19 10:14 UTC (permalink / raw
  To: gentoo-commits

commit:     04573fbb57a934aae0e23369b013c31f1a3e4969
Author:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Thu Feb 18 10:51:33 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Feb 18 10:51:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=04573fbb

scripts/check-duplicates.sh: read repo-name from profiles/

- also match foo-bar and foo_bar

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>

 scripts/check-duplicates.sh | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/scripts/check-duplicates.sh b/scripts/check-duplicates.sh
index fe86a89e..85af7839 100755
--- a/scripts/check-duplicates.sh
+++ b/scripts/check-duplicates.sh
@@ -2,7 +2,7 @@
 # Maintainer: Andrew Ammerlaan <andrewammerlaan@riseup.net>
 # Maintainer: Theo Anderson <telans@posteo.de>
 #
-# This checks for potential and exact package matches within ::guru & ::gentoo
+# This checks for potential and exact package matches within an overlay & ::gentoo
 # Note that this is not going to be 100% accurate
 #
 
@@ -12,41 +12,45 @@ GENTOO_PACKAGES=(
 		| sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/"
 	)
 )
-GURU_PACKAGES=(
+REPO_PACKAGES=(
 	$(find . -mindepth 2 -maxdepth 2 -printf "%P\n" \
 		| sort | grep -Ev "^(.git|.github|metadata|profiles|scripts)/"
 	)
 )
 
+REPO_NAME="$(cat profiles/repo_name)"
+
 printf "\nChecking for duplicates...\n"
 
 for GENTOO_PKG in ${GENTOO_PACKAGES[@]}; do
 	GENTOO_CATEGORIES+=( ${GENTOO_PKG%%/*} )	# Separate category
 	GENTOO_PKG_NAME=${GENTOO_PKG##*/}			# Separate name
-	GENTOO_PKG_NAME=${GENTOO_PKG_NAME,,}		# Force lower case
+	GENTOO_PKG_NAME=${GENTOO_PKG_NAME,,}		# Force lower case, e.g. to match foobar and FooBar
+	GENTOO_PKG_NAME=${GENTOO_PKG_NAME/[-_]}		# Remove underscores and dashes, e.g. to match foo-bar and foo_bar
 	GENTOO_PKG_NAMES+=( ${GENTOO_PKG_NAME} )
 done
 
-printf "Testing ${#GURU_PACKAGES[@]} GURU packages against ${#GENTOO_PKG_NAMES[@]} Gentoo packages\n"
+printf "Testing ${#REPO_PACKAGES[@]} ${REPO_NAME^} packages against ${#GENTOO_PKG_NAMES[@]} Gentoo packages\n"
 
-for GURU_PKG in ${GURU_PACKAGES[@]}; do
-	GURU_PKG_CATEGORY=${GURU_PKG%%/*}
-	GURU_PKG_NAME=${GURU_PKG##*/}
-	GURU_PKG_NAME=${GURU_PKG_NAME,,}
+for REPO_PKG in ${REPO_PACKAGES[@]}; do
+	REPO_PKG_CATEGORY=${REPO_PKG%%/*}
+	REPO_PKG_NAME=${REPO_PKG##*/}
+	REPO_PKG_NAME=${REPO_PKG_NAME,,}
+	REPO_PKG_NAME=${REPO_PKG_NAME/[-_]}
 
-	if [[ ${GENTOO_PKG_NAMES[@]} =~ " ${GURU_PKG_NAME} " ]]; then	# Check for a matcing name in the Gentoo tree,
+	if [[ ${GENTOO_PKG_NAMES[@]} =~ " ${REPO_PKG_NAME} " ]]; then	# Check for a matcing name in the Gentoo tree,
 		for (( i=0; i<${#GENTOO_PKG_NAMES[@]}; i++ )); do			# otherwise there is no need to continue
-			[[ ${GENTOO_PKG_NAMES[$i]} == ${GURU_PKG_NAME} ]] && index+=( $i ) # Find the category/index for multiple matching names
+			[[ ${GENTOO_PKG_NAMES[$i]} == ${REPO_PKG_NAME} ]] && index+=( $i ) # Find the category/index for multiple matching names
 		done
 
 		for i in ${index[@]}; do	# For each possible match
-			if [[ ${GENTOO_PACKAGES[$i]} == ${GURU_PKG} ]]; then
-				PKG_EXACT_MATCH+="\t${GURU_PKG}::guru exact match of ${GENTOO_PACKAGES[$i]}::gentoo\n"
+			if [[ ${GENTOO_PACKAGES[$i]} == ${REPO_PKG} ]]; then
+				PKG_EXACT_MATCH+="\t${REPO_PKG}::${REPO_NAME} exact match of ${GENTOO_PACKAGES[$i]}::gentoo\n"
 				break	# An exact match is fatal, no need to continue
-			elif [[ ${GENTOO_CATEGORIES[$i]} == ${GURU_PKG_CATEGORY} ]]; then # Possible match within the same category
-				PKG_CATEGORY_MATCH+="\t${GURU_PKG}::guru possible duplicate of ${GENTOO_PACKAGES[$i]}::gentoo\n"
+			elif [[ ${GENTOO_CATEGORIES[$i]} == ${REPO_PKG_CATEGORY} ]]; then # Possible match within the same category
+				PKG_CATEGORY_MATCH+="\t${REPO_PKG}::${REPO_NAME} possible duplicate of ${GENTOO_PACKAGES[$i]}::gentoo\n"
 			else # Possible match in a different category
-				PKG_SPECULATIVE_MATCH+="\t${GURU_PKG}::guru possible duplicate of ${GENTOO_PACKAGES[$i]}::gentoo\n"
+				PKG_SPECULATIVE_MATCH+="\t${REPO_PKG}::${REPO_NAME} possible duplicate of ${GENTOO_PACKAGES[$i]}::gentoo\n"
 			fi
 		done
 		unset index


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-17  5:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-17  4:51 [gentoo-commits] repo/proj/guru:dev commit in: scripts/ Theo Anderson
2021-06-17  5:55 ` [gentoo-commits] repo/proj/guru:master " Theo Anderson
  -- strict thread matches above, loose matches on Subject: below --
2021-06-15  6:56 [gentoo-commits] repo/proj/guru:dev " Andrew Ammerlaan
2021-06-15  7:11 ` [gentoo-commits] repo/proj/guru:master " Andrew Ammerlaan
2021-02-19 10:20 Andrew Ammerlaan
2021-02-19 10:14 Michał Górny
2021-02-19 10:14 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox