Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] xbps-src: work around autodeps removal needing multiple passes
Date: Mon, 21 Oct 2019 21:44:18 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15679@inbox.vuxu.org> (raw)

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

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

https://github.com/void-ppc/void-packages obsolete-hack
https://github.com/void-linux/void-packages/pull/15679

xbps-src: work around autodeps removal needing multiple passes
This code is not good at all (it's a terrible hack), but for the time being it solves the issue with `xbps-remove` not removing all obsoletes and needing multiple passes. Proper solution should be done in xbps, but I thought this could at least mitigate the problems for the time being.

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

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

From 6556e62b5f77903d996e52c93fd8ff2ade142747 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 21 Oct 2019 20:58:31 +0200
Subject: [PATCH] xbps-src: work around autodeps removal needing multiple
 passes

---
 common/xbps-src/shutils/cross.sh     | 15 +++++++++++++--
 common/xbps-src/shutils/pkgtarget.sh | 19 ++++++++++++++-----
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/cross.sh b/common/xbps-src/shutils/cross.sh
index 0a4fa3028db..bd32ba32462 100644
--- a/common/xbps-src/shutils/cross.sh
+++ b/common/xbps-src/shutils/cross.sh
@@ -1,7 +1,7 @@
 # vim: set ts=4 sw=4 et:
 
 remove_pkg_cross_deps() {
-    local rval= tmplogf=
+    local rval= tmplogf= prevs=0
     [ -z "$XBPS_CROSS_BUILD" ] && return 0
 
     cd $XBPS_MASTERDIR || return 1
@@ -14,7 +14,18 @@ remove_pkg_cross_deps() {
     fi
 
     $XBPS_REMOVE_XCMD -Ryo > $tmplogf 2>&1
-    if [ $? -ne 0 ]; then
+    rval=$?
+    while [ $rval -eq 0 ]; do
+        local curs=$(stat --format=%s $tmplogf)
+        if [ $curs -eq $prevs ]; then
+            break
+        fi
+        prevs=$curs
+        $XBPS_REMOVE_XCMD -Ryo >> $tmplogf 2>&1
+        rval=$?
+    done
+
+    if [ $rval -ne 0 ]; then
         msg_red "${pkgver:-xbps-src}: failed to remove autocrossdeps:\n"
         cat $tmplogf && rm -f $tmplogf
         msg_error "${pkgver:-xbps-src}: cannot continue!\n"
diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh
index 7d3ed1c78f4..98ef177ffbb 100644
--- a/common/xbps-src/shutils/pkgtarget.sh
+++ b/common/xbps-src/shutils/pkgtarget.sh
@@ -44,27 +44,36 @@ pkg_available() {
 }
 
 remove_pkg_autodeps() {
-    local rval= tmplogf=
+    local rval= tmplogf= errlogf= prevs=
 
     cd $XBPS_MASTERDIR || return 1
     msg_normal "${pkgver:-xbps-src}: removing autodeps, please wait...\n"
     tmplogf=$(mktemp) || exit 1
+    errlogf=$(mktemp) || exit 1
 
     remove_pkg_cross_deps
     $XBPS_RECONFIGURE_CMD -a >> $tmplogf 2>&1
-    echo yes | $XBPS_REMOVE_CMD -Ryod >> $tmplogf 2>&1
+    prevs=$(stat --format=%s $tmplogf)
+    echo yes | $XBPS_REMOVE_CMD -Ryod 2>> $errlogf 1>> $tmplogf
     rval=$?
-    if [ $rval -eq 0 ]; then
-        echo yes | $XBPS_REMOVE_CMD -Ryod >> $tmplogf 2>&1
+    while [ $rval -eq 0 ]; do
+        local curs=$(stat --format=%s $tmplogf)
+        if [ $curs -eq $prevs ]; then
+            break
+        fi
+        prevs=$curs
+        echo yes | $XBPS_REMOVE_CMD -Ryod 2>> $errlogf 1>> $tmplogf
         rval=$?
-    fi
+    done
 
     if [ $rval -ne 0 ]; then
         msg_red "${pkgver:-xbps-src}: failed to remove autodeps: (returned $rval)\n"
         cat $tmplogf && rm -f $tmplogf
+        cat $errlogf && rm -f $errlogf
         msg_error "${pkgver:-xbps-src}: cannot continue!\n"
     fi
     rm -f $tmplogf
+    rm -f $errlogf
 }
 
 remove_pkg_wrksrc() {

             reply	other threads:[~2019-10-21 19:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 19:44 voidlinux-github [this message]
2019-10-21 19:47 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-21 19:47 ` voidlinux-github
2019-10-25 21:53 ` [PR PATCH] [Merged]: " voidlinux-github

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15679@inbox.vuxu.org \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).