* [PR PATCH] xbps-src: work around autodeps removal needing multiple passes
@ 2019-10-21 19:44 voidlinux-github
2019-10-21 19:47 ` [PR PATCH] [Updated] " voidlinux-github
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: voidlinux-github @ 2019-10-21 19:44 UTC (permalink / raw)
To: ml
[-- 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() {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Updated] xbps-src: work around autodeps removal needing multiple passes
2019-10-21 19:44 [PR PATCH] xbps-src: work around autodeps removal needing multiple passes voidlinux-github
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
2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-10-21 19:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 641 bytes --]
There is an updated 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: 2865 bytes --]
From ec109cbd26b8626d4992b2aa9da4b7353639ff80 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..68ed372ffc5 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 -c %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..090ec5c1a3e 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 -c %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 -c %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() {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Updated] xbps-src: work around autodeps removal needing multiple passes
2019-10-21 19:44 [PR PATCH] xbps-src: work around autodeps removal needing multiple passes voidlinux-github
@ 2019-10-21 19:47 ` voidlinux-github
2019-10-21 19:47 ` voidlinux-github
2019-10-25 21:53 ` [PR PATCH] [Merged]: " voidlinux-github
2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-10-21 19:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 641 bytes --]
There is an updated 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: 2865 bytes --]
From ec109cbd26b8626d4992b2aa9da4b7353639ff80 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..68ed372ffc5 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 -c %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..090ec5c1a3e 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 -c %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 -c %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() {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Merged]: xbps-src: work around autodeps removal needing multiple passes
2019-10-21 19:44 [PR PATCH] xbps-src: work around autodeps removal needing multiple passes voidlinux-github
2019-10-21 19:47 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-21 19:47 ` voidlinux-github
@ 2019-10-25 21:53 ` voidlinux-github
2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-10-25 21:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 482 bytes --]
There's a merged pull request on the void-packages repository
xbps-src: work around autodeps removal needing multiple passes
https://github.com/void-linux/void-packages/pull/15679
Description:
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-25 21:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 19:44 [PR PATCH] xbps-src: work around autodeps removal needing multiple passes voidlinux-github
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
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).