Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [wip] common: disable creation of noarch packages.
@ 2020-08-19  6:51 fosslinux
  2020-08-19 12:23 ` ericonr
                   ` (87 more replies)
  0 siblings, 88 replies; 89+ messages in thread
From: fosslinux @ 2020-08-19  6:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]

There is a new pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages noarch
https://github.com/void-linux/void-packages/pull/24357

[wip] common: disable creation of noarch packages.
This change disables the creation of noarch packages.

I believe that most package maintainers are of the same opinion that noarch causes far more problems than it solves. For some time on IRC there has been continued discussion about disabling it. This is what this PR attempts to achieve.

This still supports `archs=noarch` but IMO this is misleading if it dosen't actually create a package with the noarch arch. This is why I have made `archs=noarch` just mean `noarch=yes`. This is how I think all future packages should declare noarch: `noarch=yes`. I also considered `data_only=yes` or `arch_independent=yes` but I don't really like either of those.

The reason noarch even still exists is because it is a useful shorthand for `nodebug=yes`, `nostrip=yes`, etc etc.

The removed 32-bit block about noarch is useless because noarch already forces `noshlibprovides`.

NB: Right now, this is a MVP and still needs some more work.

Pinging @q66 @the-maldridge 

A patch file from https://github.com/void-linux/void-packages/pull/24357.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-noarch-24357.patch --]
[-- Type: text/x-diff, Size: 6315 bytes --]

From fde6fca179d381aa5e422b96faeba1ddbf55a1a3 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Wed, 19 Aug 2020 16:44:41 +1000
Subject: [PATCH] common: disable creation of noarch packages.

---
 common/hooks/do-pkg/00-gen-pkg.sh                    |  6 ++----
 common/hooks/post-install/06-strip-and-debug-pkgs.sh |  2 +-
 common/hooks/post-pkg/00-register-pkg.sh             |  6 ++----
 common/hooks/pre-pkg/04-generate-runtime-deps.sh     |  2 +-
 common/hooks/pre-pkg/05-prepare-32bit.sh             |  9 +--------
 common/hooks/pre-pkg/06-shlib-provides.sh            |  2 +-
 common/xbps-src/shutils/common.sh                    | 11 +++++------
 common/xbps-src/shutils/pkgtarget.sh                 |  2 +-
 8 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/common/hooks/do-pkg/00-gen-pkg.sh b/common/hooks/do-pkg/00-gen-pkg.sh
index e6285b6e4ff..b06ba3692bb 100644
--- a/common/hooks/do-pkg/00-gen-pkg.sh
+++ b/common/hooks/do-pkg/00-gen-pkg.sh
@@ -99,14 +99,12 @@ hook() {
 	local arch= binpkg= repo= _pkgver= _desc= _pkgn= _pkgv= _provides= \
 		_replaces= _reverts= f= found_dbg_subpkg=
 
-	if [ "${archs// /}" = "noarch" ]; then
-		arch=noarch
-	elif [ -n "$XBPS_TARGET_MACHINE" ]; then
+	if [ -n "$XBPS_TARGET_MACHINE" ]; then
 		arch=$XBPS_TARGET_MACHINE
 	else
 		arch=$XBPS_MACHINE
 	fi
-	if [ "${archs// /}" != "noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
+	if [ -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
 		arch=${XBPS_ARCH}
 	fi
 
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index 44d8a51fe93..84b8569f37f 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -59,7 +59,7 @@ create_debug_pkg() {
 hook() {
 	local fname= x= f= _soname= STRIPCMD=
 
-	if [ -n "$nostrip" -o "${archs// /}" = "noarch" ]; then
+	if [ -n "$nostrip" -o "$noarch" ]; then
 		return 0
 	fi
 
diff --git a/common/hooks/post-pkg/00-register-pkg.sh b/common/hooks/post-pkg/00-register-pkg.sh
index 5dc28c999c9..ce641cfc850 100644
--- a/common/hooks/post-pkg/00-register-pkg.sh
+++ b/common/hooks/post-pkg/00-register-pkg.sh
@@ -13,14 +13,12 @@ registerpkg() {
 hook() {
 	local arch= binpkg= pkgdir=
 
-	if [ "${archs// /}" = "noarch" ]; then
-		arch=noarch
-	elif [ -n "$XBPS_TARGET_MACHINE" ]; then
+	if [ -n "$XBPS_TARGET_MACHINE" ]; then
 		arch=$XBPS_TARGET_MACHINE
 	else
 		arch=$XBPS_MACHINE
 	fi
-	if [ "${archs// /}" != "noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
+	if [ -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
 		arch=${XBPS_ARCH}
 	fi
 	if [ -n "$repository" ]; then
diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index 6e45b7dd3c3..9845d6937bf 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -56,7 +56,7 @@ hook() {
 
     mapshlibs=$XBPS_COMMONDIR/shlibs
 
-    if [ "${archs// /}" = "noarch" -o -n "$noverifyrdeps" ]; then
+    if [ "$noarch" -o -n "$noverifyrdeps" ]; then
         store_pkgdestdir_rundeps
         return 0
     fi
diff --git a/common/hooks/pre-pkg/05-prepare-32bit.sh b/common/hooks/pre-pkg/05-prepare-32bit.sh
index fd6fdf88217..f860c8f9926 100644
--- a/common/hooks/pre-pkg/05-prepare-32bit.sh
+++ b/common/hooks/pre-pkg/05-prepare-32bit.sh
@@ -21,7 +21,7 @@ hook() {
 		return
 	fi 
 	# Ignore noarch pkgs.
-	if [ "${archs// /}" = "noarch" ]; then
+	if [ "$noarch" ]; then
 		return
 	fi
 	if [ -z "$lib32mode" ]; then
@@ -106,13 +106,6 @@ hook() {
 				printf "${pkgn}-32bit${pkgv} " >> ${destdir32}/rdeps
 				continue
 			fi
-			# If dependency is noarch do not change it to 32bit.
-			_arch=$($XBPS_QUERY_CMD -R --property=architecture "$f")
-			if [ "${_arch}" = "noarch" ]; then
-				echo "   RDEP: $f -> ${pkgn}${pkgv} (noarch)"
-				printf "${pkgn}${pkgv} " >> ${destdir32}/rdeps
-				continue
-			fi
 			# If dependency does not have "shlib-provides" do not
 			# change it to 32bit.
 			for x in ${subpackages}; do
diff --git a/common/hooks/pre-pkg/06-shlib-provides.sh b/common/hooks/pre-pkg/06-shlib-provides.sh
index cdc94de3bc9..e1dff9e562b 100644
--- a/common/hooks/pre-pkg/06-shlib-provides.sh
+++ b/common/hooks/pre-pkg/06-shlib-provides.sh
@@ -45,7 +45,7 @@ collect_sonames() {
 hook() {
 	local _destdir32=${XBPS_DESTDIR}/${pkgname}-32bit-${version}
 
-	if [ -z "$shlib_provides" -a "${archs// /}" = "noarch" -o -n "$noshlibprovides" ]; then
+	if [ -z "$shlib_provides" -a "$noarch" -o -n "$noshlibprovides" ]; then
 		return 0
 	fi
 
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index e8bcf577c6b..c8c3147c37d 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -395,6 +395,10 @@ setup_pkg() {
         source_file ${XBPS_SRCPKGDIR}/${basepkg}/template
     fi
 
+    if [ "${archs// /}" = "noarch" ]; then
+        export noarch=yes
+        export archs=
+    fi
 
     # Check if required vars weren't set.
     _vars="pkgname version short_desc revision homepage license"
@@ -457,12 +461,7 @@ setup_pkg() {
     fi
     makejobs="-j$XBPS_MAKEJOBS"
 
-    # strip whitespaces to make "  noarch  " valid too.
-    if [ "${archs// /}" = "noarch" ]; then
-        arch="noarch"
-    else
-        arch="$XBPS_TARGET_MACHINE"
-    fi
+    arch="$XBPS_TARGET_MACHINE"
     if [ -n "$XBPS_BINPKG_EXISTS" ]; then
         local _binpkgver="$($XBPS_QUERY_XCMD -R -ppkgver $pkgver 2>/dev/null)"
         if [ "$_binpkgver" = "$pkgver" ]; then
diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh
index 090ec5c1a3e..fa70816fe24 100644
--- a/common/xbps-src/shutils/pkgtarget.sh
+++ b/common/xbps-src/shutils/pkgtarget.sh
@@ -3,7 +3,7 @@
 check_pkg_arch() {
     local cross="$1" _arch f match nonegation
 
-    if [ -n "$archs" -a "${archs// /}" != "noarch" ]; then
+    if [ -n "$archs" ]; then
         if [ -n "$cross" ]; then
             _arch="$XBPS_TARGET_MACHINE"
         elif [ -n "$XBPS_ARCH" ]; then

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

end of thread, other threads:[~2021-01-20 21:47 UTC | newest]

Thread overview: 89+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19  6:51 [PR PATCH] [wip] common: disable creation of noarch packages fosslinux
2020-08-19 12:23 ` ericonr
2020-08-19 12:38 ` ahesford
2020-08-19 12:46 ` ahesford
2020-08-19 13:03 ` Chocimier
2020-08-19 14:48 ` q66
2020-08-19 15:24 ` ahesford
2020-08-19 15:43 ` q66
2020-08-19 15:45 ` q66
2020-08-19 16:10 ` ahesford
2020-08-19 17:15 ` q66
2020-08-19 17:17 ` ericonr
2020-08-19 17:19 ` q66
2020-08-19 23:05 ` fosslinux
2020-08-19 23:10 ` fosslinux
2020-08-19 23:21 ` the-maldridge
2020-08-19 23:28 ` fosslinux
2020-08-19 23:30 ` the-maldridge
2020-08-20  0:24 ` q66
2020-08-20  0:38 ` fosslinux
2020-08-20  0:44 ` sgn
2020-08-20  0:44 ` sgn
2020-08-20  0:46 ` ericonr
2020-08-20  0:51 ` sgn
2020-08-20  0:56 ` fosslinux
2020-08-20  1:00 ` ahesford
2020-08-20  1:08 ` ericonr
2020-08-20  2:05 ` the-maldridge
2020-08-20  6:29 ` fosslinux
2020-08-20  6:32 ` fosslinux
2020-08-20 12:52 ` ericonr
2020-08-20 17:55 ` the-maldridge
2020-08-20 23:09 ` fosslinux
2020-08-21 22:26 ` [PR PATCH] [Updated] " fosslinux
2020-08-21 22:27 ` fosslinux
2020-08-21 22:29 ` [PR PATCH] [Updated] " fosslinux
2020-08-21 22:29 ` fosslinux
2020-08-24 23:49 ` fosslinux
2020-08-24 23:50 ` fosslinux
2020-08-24 23:50 ` fosslinux
2020-08-25 19:47 ` [PR REVIEW] " Chocimier
2020-08-25 19:49 ` Chocimier
2020-08-25 20:02 ` ericonr
2020-08-25 20:19 ` [PR REVIEW] " Chocimier
2020-08-25 22:55 ` fosslinux
2020-08-25 22:58 ` fosslinux
2020-08-27  7:22 ` [PR PATCH] [Updated] " fosslinux
2020-08-27  7:22 ` fosslinux
2020-08-27  7:23 ` fosslinux
2020-08-27 20:21 ` [PR REVIEW] " Chocimier
2020-08-27 20:28 ` Chocimier
2020-08-28  0:41 ` [PR REVIEW] " fosslinux
2020-08-28  0:43 ` fosslinux
2020-08-28  0:45 ` sgn
2020-08-28  1:07 ` fosslinux
2020-09-02  0:40 ` fosslinux
2020-09-02  0:40 ` fosslinux
2020-09-02  0:40 ` [PR REVIEW] " fosslinux
2020-09-03 23:47 ` fosslinux
2020-09-04 11:41 ` fosslinux
2020-09-04 11:44 ` fosslinux
2020-09-04 13:24 ` ahesford
2020-09-04 22:59 ` fosslinux
2020-09-04 23:17 ` fosslinux
2020-09-04 23:19 ` [PR PATCH] [Updated] " fosslinux
2020-09-04 23:19 ` [PR REVIEW] " fosslinux
2020-09-05  7:00 ` Chocimier
2020-09-05  7:16 ` fosslinux
2020-10-31  6:49 ` fosslinux
2020-10-31  6:49 ` fosslinux
2020-10-31  6:49 ` fosslinux
2020-10-31  6:49 ` fosslinux
2020-11-30 14:57 ` sgn
2020-11-30 16:37 ` sgn
2020-12-01 12:47 ` sgn
2020-12-05 10:17 ` sgn
2020-12-05 10:17 ` sgn
2020-12-15 11:26 ` fosslinux
2020-12-26  2:47 ` sgn
2020-12-26  2:48 ` sgn
2020-12-26  2:48 ` sgn
2020-12-26  2:48 ` sgn
2020-12-26  6:34 ` sgn
2020-12-26  6:42 ` sgn
2020-12-26 11:04 ` sgn
2020-12-26 11:04 ` sgn
2020-12-27 14:31 ` sgn
2021-01-20 12:34 ` [PR PATCH] [Closed]: " q66
2021-01-20 21:47 ` fosslinux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).