GNU bug report logs - #24215
command=`rm`: how to script responses?

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: parted; Reported by: bug-parted@HIDDEN, Tom Roche <Tom_Roche@HIDDEN>; Keywords: patch; merged with #22167; dated Fri, 12 Aug 2016 23:22:02 UTC; Maintainer for parted is bug-parted@HIDDEN.
Merged 22167 24215. Request was from Phil Susi <psusi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) patch. Request was from Sunil Mohan Adapa <sunil@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 24215 <at> debbugs.gnu.org:


Received: (at 24215) by debbugs.gnu.org; 3 Apr 2017 15:28:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 03 11:28:29 2017
Received: from localhost ([127.0.0.1]:59290 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cv3u5-0002yV-NL
	for submit <at> debbugs.gnu.org; Mon, 03 Apr 2017 11:28:29 -0400
Received: from mout.perfora.net ([74.208.4.196]:60288)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sunil@HIDDEN>)
 id 1cuyn3-0001Eu-Cj; Mon, 03 Apr 2017 06:00:50 -0400
Received: from [10.136.22.155] ([121.244.62.198]) by mrelay.perfora.net
 (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MYMPn-1cZLBJ0xMn-00V8xZ; 
 Mon, 03 Apr 2017 12:00:41 +0200
To: 24215 <at> debbugs.gnu.org, 22167 <at> debbugs.gnu.org, control <at> debbugs.gnu.org
From: Sunil Mohan Adapa <sunil@HIDDEN>
Subject: Don't interactively ask questions in script mode
Message-ID: <856e21e3-7577-1c47-8054-e0d3f2656896@HIDDEN>
Date: Mon, 3 Apr 2017 15:30:29 +0530
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="01woBlp4NhHNoJ0wJ1vd26PIhhGUsweGH"
X-Provags-ID: V03:K0:J0W/X3SvuYJAwnXfQNyrx39zdTa8oSA4BvWGiMmMyVYG48pP6OE
 1jKO5HgNC9hM71QKe3OAU9vIA46UTtb/4i2BMZnONKnQYWbQMXD+w6mEjml6EnGgeCHInPd
 r4aYoGGG7dV87ATB2moEQHw42r5LUoCKpIzFbxRQA8646VlI3Q+Q/rMCakwissF3jlqmGUs
 Dq5qgvhV05pqErGwIRb8g==
X-UI-Out-Filterresults: notjunk:1;V01:K0:8/QRHFekxzc=:VqowUU3nS9XEvVgHRPfQIJ
 rAD2QZh200HdS6TDVtJf/b0e86xVqUO7ICxjMB7wdKI7e5dY1U2LToe7XZzU4uemPHIJWjK86
 xJNhr8AJ4dM3FJHUHtVvzaJQOnb4/UeiwDEx4JXncKJ9cMSjsyQa/i+0MJ/DNXqc+CmRfqhkT
 p+deyjR5VUoOHt18OTgJciQ6f7MBpzxp+WzRdry9xogGsEZ+gmRj4Ciee0ls2Obqyhz9h0A/y
 2bzdcUYyTPS6rTFeuT4cpmNSu/tbYO51gheJkdgov8QI8q4b9cPDc2kfR3FehZG5HG70D5dJ2
 5j6O9GBhFCtIKIQqWw+kNtw4s1WdCpeIT00JDEAGrajSju2NYfeNlLKddLHYxVzXfuoeVgcgW
 nhWzLcbzvROU/EirVUZkGAfSAQ5AsSvr7hOSib3ygXlKmgOMeVmTeL4wb8XQrKPj/jqFNFVI0
 tgss7BoyreCo8Pf22bQQe5y5gu80tfr4p470FhZ6VNWNGvpjOTZDGMnHPPLPuIkHMVLhX7GGg
 YIJ/J+4BA+zniuMvIYx1pIVUMxslixJyVeRY7eZrAG4GwIEXtFmz7+AzQP1bSAUjVe1r6DxS4
 w14E2WL2L/13Xy9FhCjUC3ndvgKhCl/QMPTVc1PJLkbyaM4zfYY56sPUkMGzKbQzWNEW9qsre
 Q7kDkzw+nsMSq0wywbs2DU8U+M1hM6CzM77zjtAwWuEQ4SdwQFR2I7R6l00qzFQyhdPU=
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 24215
X-Mailman-Approved-At: Mon, 03 Apr 2017 11:28:16 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--01woBlp4NhHNoJ0wJ1vd26PIhhGUsweGH
Content-Type: multipart/mixed; boundary="dsit0hFK2awpdMUrhwGBHIa3PBFnLhRIG";
 protected-headers="v1"
From: Sunil Mohan Adapa <sunil@HIDDEN>
To: 24215 <at> debbugs.gnu.org, 22167 <at> debbugs.gnu.org, control <at> debbugs.gnu.org
Message-ID: <856e21e3-7577-1c47-8054-e0d3f2656896@HIDDEN>
Subject: Don't interactively ask questions in script mode

--dsit0hFK2awpdMUrhwGBHIa3PBFnLhRIG
Content-Type: multipart/mixed;
 boundary="------------2C5F1859BD551FFB00366B4D"

This is a multi-part message in MIME format.
--------------2C5F1859BD551FFB00366B4D
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

tags 24215 + patch
tags 22167 + patch

Hello,

The attached patches should fix these issues where interactive prompts
are shown when one tries to perform 'rm' or 'resizepart' operations with
mounted partitions.  This avoid workarounds[1].

The proposal is to not ask for confirmation during 'rm' and 'resizepart'
operations when run in script mode.  The answer is assumed to be 'yes'
in both cases.

Links:

1) https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1270203

--=20
Sunil

--------------2C5F1859BD551FFB00366B4D
Content-Type: text/x-patch;
 name="0001-parted-Don-t-warn-partition-busy-in-script-mode.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename*0="0001-parted-Don-t-warn-partition-busy-in-script-mode.patch"

=46rom 73b874f1c21f89623f0fc13f5ea0484b4bd02639 Mon Sep 17 00:00:00 2001
From: Sunil Mohan Adapa <sunil@HIDDEN>
Date: Mon, 3 Apr 2017 14:31:43 +0530
Subject: [PATCH 1/6] parted: Don't warn partition busy in script mode

Script mode promises not to ask for input interactively.  However,
during 'rm' and 'resizepart' operations, then a partition is mounted,
parted asks for confirmation on the terminal.  Since upon confirmation
parted allows the actual operations to proceed allow scripts to do
this as well by assuming 'yes' in both the cases.

Fixes the following issues:
 - #22167
 - #24215
 - lpbug #1270203

Signed-off-by: Sunil Mohan Adapa <sunil@HIDDEN>
---
 parted/parted.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/parted/parted.c b/parted/parted.c
index 7e6c266..27e3615 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1549,7 +1549,7 @@ do_resizepart (PedDevice** dev, PedDisk** diskp)
=20
         if (!command_line_get_partition (_("Partition number?"), disk, &=
part))
                 goto error;
-        if (!_partition_warn_busy (part))
+        if (!opt_script_mode && !_partition_warn_busy (part))
                 goto error;
=20
         start =3D part->geom.start;
@@ -1597,7 +1597,7 @@ do_rm (PedDevice** dev, PedDisk** diskp)
=20
         if (!command_line_get_partition (_("Partition number?"), *diskp,=
 &part))
                 goto error;
-        if (!_partition_warn_busy (part))
+        if (!opt_script_mode && !_partition_warn_busy (part))
                 goto error;
=20
         ped_disk_delete_partition (*diskp, part);
--=20
2.11.0


--------------2C5F1859BD551FFB00366B4D
Content-Type: text/x-patch;
 name="0002-tests-t1701-rescue-fs.sh-Wait-for-device-to-appear.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename*0="0002-tests-t1701-rescue-fs.sh-Wait-for-device-to-appear.patc";
 filename*1="h"

=46rom 416e2fd8b2c4fa11d1d9d3673857ac80e53bc573 Mon Sep 17 00:00:00 2001
From: Sunil Mohan Adapa <sunil@HIDDEN>
Date: Mon, 3 Apr 2017 14:57:09 +0530
Subject: [PATCH 2/6] tests: t1701-rescue-fs.sh: Wait for device to appear=


Wait for device to appear before trying to create a filesystem in a
freshly created partition.

Signed-off-by: Sunil Mohan Adapa <sunil@HIDDEN>
---
 tests/t1701-rescue-fs.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/t1701-rescue-fs.sh b/tests/t1701-rescue-fs.sh
index 9b726cf..4e1c981 100644
--- a/tests/t1701-rescue-fs.sh
+++ b/tests/t1701-rescue-fs.sh
@@ -30,6 +30,7 @@ scsi_dev=3D$(cat dev-name)
     || { warn_ "$ME: no ext4 support"; Exit $fail; }
=20
 parted -s $scsi_dev mklabel msdos mkpart primary ext2 1m 100%
+wait_for_dev_to_appear_ ${scsi_dev}1 || fail_ ${scsi_dev}1 did not appea=
r
 mkfs.ext4 ${scsi_dev}1 || { warn_ $ME: mkfs.ext4 failed; fail=3D1; Exit =
$fail; }
=20
 # remove the partition
--=20
2.11.0


--------------2C5F1859BD551FFB00366B4D
Content-Type: text/x-patch;
 name="0003-tests-t1101-busy-partition.sh-Update-tests-for-scrip.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*0="0003-tests-t1101-busy-partition.sh-Update-tests-for-scrip.pa";
 filename*1="tch"

RnJvbSBjZmIxM2Y2YjVhMmE2ZTNmZmY4NGY2NjRjZTIzOTZlNDExMjQ5Y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GlvbiBtdXN0IHN1
Y2NlZWQgaW4gc2NyaXB0IG1vZGUuCitwYXJ0ZWQgLXMgIiRkZXYiIHJtIDIgPiBvdXQgMj4m
MSB8fCBmYWlsPTEKK2NhdCA8PEVPRiA+IGV4cC1lcnJvciB8fCBmcmFtZXdvcmtfZmFpbHVy
ZQorRXJyb3I6IFBhcnRpdGlvbihzKSAyIG9uIC9kZXYvc2RiIGhhdmUgYmVlbiB3cml0dGVu
LCBidXQgd2UgaGF2ZSBiZWVuIHVuYWJsZSB0byBpbmZvcm0gdGhlIGtlcm5lbCBvZiB0aGUg
Y2hhbmdlLCBwcm9iYWJseSBiZWNhdXNlIGl0L3RoZXkgYXJlIGluIHVzZS4gIEFzIGEgcmVz
dWx0LCB0aGUgb2xkIHBhcnRpdGlvbihzKSB3aWxsIHJlbWFpbiBpbiB1c2UuICBZb3Ugc2hv
dWxkIHJlYm9vdCBub3cgYmVmb3JlIG1ha2luZyBmdXJ0aGVyIGNoYW5nZXMuCitFT0YKIGNv
bXBhcmUgZXhwLWVycm9yIG91dCB8fCBmYWlsPTEKIAogRXhpdCAkZmFpbAotLSAKMi4xMS4w
Cgo=
--------------2C5F1859BD551FFB00366B4D
Content-Type: text/x-patch;
 name="0004-tests-t6002-Fix-expectation-of-rm-on-mounted-partiti.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename*0="0004-tests-t6002-Fix-expectation-of-rm-on-mounted-partiti.pa";
 filename*1="tch"

=46rom 286ea7b717eeaa49059dc2c8fd35e0157c2eec6a Mon Sep 17 00:00:00 2001
From: Sunil Mohan Adapa <sunil@HIDDEN>
Date: Mon, 3 Apr 2017 15:05:27 +0530
Subject: [PATCH 4/6] tests: t6002: Fix expectation of 'rm' on mounted
 partitions

Removing a mounted partition only fails in non-script mode.

Signed-off-by: Sunil Mohan Adapa <sunil@HIDDEN>
---
 tests/t6002-dm-busy.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/t6002-dm-busy.sh b/tests/t6002-dm-busy.sh
index 723dd30..5dfb9d4 100644
--- a/tests/t6002-dm-busy.sh
+++ b/tests/t6002-dm-busy.sh
@@ -75,7 +75,7 @@ mount "${dev}p2" "$mount_point" || fail=3D1
 parted -s "$dev" rm 1 > /dev/null 2>&1 || fail=3D1
=20
 # Removal of mounted partition must fail.
-parted -s "$dev" rm 2 > /dev/null 2>&1 && fail=3D1
+parted "$dev" rm 2 < /dev/null > /dev/null 2>&1 && fail=3D1
=20
 parted -m -s "$dev" u s print > out 2>&1 || fail=3D1
 sed "s,^$dev,DEV," out > k; mv k out
--=20
2.11.0


--------------2C5F1859BD551FFB00366B4D
Content-Type: text/x-patch;
 name="0005-tests-t9041-Fix-expectation-of-rm-on-mounted-partiti.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*0="0005-tests-t9041-Fix-expectation-of-rm-on-mounted-partiti.pa";
 filename*1="tch"

RnJvbSBlZGNjNjMxMjIwYzdjOGUyNDQ4MjBkMjY1MWY1MzdmZjFmODI5YzdhIE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBTdW5pbCBNb2hhbiBBZGFwYSA8c3VuaWxAbWVkaGFz
Lm9yZz4KRGF0ZTogTW9uLCAzIEFwciAyMDE3IDE1OjA4OjI3ICswNTMwClN1YmplY3Q6IFtQ
QVRDSCA1LzZdIHRlc3RzOiB0OTA0MTogRml4IGV4cGVjdGF0aW9uIG9mICdybScgb24gbW91
bnRlZAogcGFydGl0aW9ucwoKUmVtb3ZpbmcgYSBtb3VudGVkIHBhcnRpdGlvbiBvbmx5IGZh
aWxzIGluIG5vbi1zY3JpcHQgbW9kZS4KClNpZ25lZC1vZmYtYnk6IFN1bmlsIE1vaGFuIEFk
YXBhIDxzdW5pbEBtZWRoYXMub3JnPgotLS0KIHRlc3RzL3Q5MDQxLXVuZGV0ZWN0ZWQtaW4t
dXNlLTE2dGgtcGFydGl0aW9uLnNoIHwgNyArKysrLS0tCiAxI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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIA0nIFwKICAgICA+IGV4cC1lcnJvciB8fCBmcmFtZXdvcmtfZmFpbHVyZV8K
IAogICAjIGV4cGVjdCBlcnJvcgotLSAKMi4xMS4wCgo=
--------------2C5F1859BD551FFB00366B4D
Content-Type: text/x-patch;
 name="0006-tests-t1102-Fix-expectation-of-rm-on-mounted-partiti.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*0="0006-tests-t1102-Fix-expectation-of-rm-on-mounted-partiti.pa";
 filename*1="tch"

RnJvbSBmYzI1YzFiN2UyYTgyMzIzNmIwYTcwNWExZTA1Y2U1MWExZjcyY2I4IE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBTdW5pbCBNb2hhbiBBZGFwYSA8c3VuaWxAbWVkaGFz
Lm9yZz4KRGF0ZTogTW9uLCAzIEFwciAyMDE3IDE1OjEwOjExICswNTMwClN1YmplY3Q6IFtQ
QVRDSCA2LzZdIHRlc3RzOiB0MTEwMjogRml4IGV4cGVjdGF0aW9uIG9mICdybScgb24gbW91
bnRlZAogcGFydGl0aW9ucwoKUmVtb3ZpbmcgYSBtb3VudGVkIHBhcnRpdGlvbiBvbmx5IGZh
aWxzIGluIG5vbi1zY3JpcHQgbW9kZS4KClNpZ25lZC1vZmYtYnk6IFN1bmlsIE1vaGFuIEFk
YXBhIDxzdW5pbEBtZWRoYXMub3JnPgotLS0KIHRlc3RzL3QxMTAyLWxvb3AtbGFiZWwuc2gg
fCA1ICsrKy0tCiAxIGZpbGUgY2hhbmdlZCwgMyBpbnNlcnRpb25zKCspLCAyIGRlbGV0aW9u
cygtKQoKZGlmZiAtLWdpdCBhL3Rlc3RzL3QxMTAyLWxvb3AtbGFiZWwuc2ggYi90ZXN0cy90
MTEwMi1sb29wLWxhYmVsLnNoCmluZGV4IDY4YjlhZjQuLmY5YjMzZWUgMTAwNjQ0Ci0tLSB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-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCAAvFiEE5xPDY9ZyWnWupXSBQ+oc/wqnxfIFAljiHUARHHN1bmlsQG1l
ZGhhcy5vcmcACgkQQ+oc/wqnxfLnPg//ccfg6UcqyaaLwns9JklOUv8Cd3p9AwVg
P1mL745+zxL6ED0hX4sk1WpeSxsf3i1iDZqnoRTxKbmj45EJ167whRvaOWI4Krm8
RPMI1oZzgipeOV162vmjjrzrXKXBHEN/BwVLsl2QOSWzP1YEzeIZg0ewPmFWQYak
slaC0sGrNRar68k6J2MHp8nYKTClAC829XKEcnvl8M163Bpamb3r0XdtirYjJ5El
aNJzLK4lz//v4bXN7js0fRIKkLSmhHFWc8/C656fgJBQV7jiwnvM5+J9ecjc4SB1
q+4EQzXL+CTccIPkzaTSOWRC5WS1s9YdL5DyW3JytqqUMAta8lwtsW0Dx1R7H1c7
F3FWpydKEpXi/lMqla3r6KcyxmELARU7KK/nFulWraYOw3bWmfkucr1737yh7o7y
krrmCe/R3N1pA902OmEMOn1CoZzTtjkHOmy9OEJPs+AqItDDUe9YKgrWQKVobBSI
J+XwGhIT7zwyRp1bhHt+X88n6lNijYySv2j7TjYNlLyVYYdD0uDKVwANRLsiOJr7
AvVCkJF5xY7nKY3SgiSD0Pj3A4Puewss/5FEv5wORmb65xJ8l1Lxd6/e7anVCd1r
tRaiIzHdhtW3zgaE3TdadqmR8jR949lDKZwEdJQiNTG+4/KJPef+09ayEWOJq64t
reRQa27/Mgc=
=afb/
-----END PGP SIGNATURE-----

--01woBlp4NhHNoJ0wJ1vd26PIhhGUsweGH--




Information forwarded to bug-parted@HIDDEN:
bug#24215; Package parted. Full text available.

Message received at 24215 <at> debbugs.gnu.org:


Received: (at 24215) by debbugs.gnu.org; 31 Aug 2016 21:07:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 31 17:07:38 2016
Received: from localhost ([127.0.0.1]:45688 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bfCjS-0001bx-7f
	for submit <at> debbugs.gnu.org; Wed, 31 Aug 2016 17:07:38 -0400
Received: from mail-ua0-f173.google.com ([209.85.217.173]:34537)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillsusi@HIDDEN>) id 1bfCjQ-0001bi-O2
 for 24215 <at> debbugs.gnu.org; Wed, 31 Aug 2016 17:07:37 -0400
Received: by mail-ua0-f173.google.com with SMTP id q42so52784356uaq.1
 for <24215 <at> debbugs.gnu.org>; Wed, 31 Aug 2016 14:07:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding;
 bh=XjJ5U8zyuiSaSK1h77+ZRvLmmtu5are1P3daeXB2Wv4=;
 b=yjn8vb05tIiJu8rC1ISTKEXYpa3fFxvbgcjk7th95VgPr0PEx9Qxj5+aFvF7a4C8GR
 ZUgKVAUIJtqBZUTHOGg+qpnX7yNMFIjSQhNP6UIFJYfvol8akiwMXA1pswvq/6DKwULV
 ab9QBvO3rebc3DMZPzG/ywkAFd9waI+hIiBc5dIcex8ULvQDDXZp5ctOypSTK0hOhJ36
 caVtwCbwe+lVgoFurhsdEjyT8NRwucQS15WPTP0p59riQZcSB3ju6QDZb7RBuPZO9T2C
 KNLT+ByGJKucrymcHElDoiVI1ucsFngqr5wYLv4TmdvEguSJXlPzAyjCik8cgjYY83LR
 jdGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-transfer-encoding;
 bh=XjJ5U8zyuiSaSK1h77+ZRvLmmtu5are1P3daeXB2Wv4=;
 b=k5mapCwswK/gnqjQlNRZCbur5ewXYb6mhHlEscjQrru10R0vRdhDXkehT1ClCE65ua
 Y55ILobJKloCtNUop3kuWDCC4iahmFWzuR9BgCRat9+8WABV8CCMcgXRChv+eFK33Mwe
 dvmNKWaPZ1qhD3Pm86LVOBspvXCPZ2wcn85hdW+mHPvu/zkrvRTdLPd39mYpDKJ9USA9
 BfIbCLxHtS5uiogS27Yl+VQSjg3W+GKMWKdRPiNgRJhVSNeIKRlOoGQcDhd+eTr4Ayqo
 UKJ+7tPfkXdKKwEe79WtvBOuZ3HRJYTmBKOocUrEhTBf9zPC13jwgmF2Dnqgt+UJzyBk
 Zk8Q==
X-Gm-Message-State: AE9vXwPDvuH+oIvkCr6T6AK60D30Ljz/hpvQ76fh/sZziCbE6pdWxJoOYEhzjYTvxx6ySg==
X-Received: by 10.159.39.166 with SMTP id b35mr352187uab.137.1472677651165;
 Wed, 31 Aug 2016 14:07:31 -0700 (PDT)
Received: from [10.1.1.184] (fl-67-77-88-12.sta.embarqhsd.net. [67.77.88.12])
 by smtp.googlemail.com with ESMTPSA id
 b92sm292007uab.21.2016.08.31.14.07.30
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 31 Aug 2016 14:07:30 -0700 (PDT)
Subject: Re: bug#24215: command=`rm`: how to script responses?
To: Tom Roche <Tom_Roche@HIDDEN>, 24215 <at> debbugs.gnu.org
References: <878tw1fuaf.fsf@HIDDEN>
From: Phil Susi <psusi@HIDDEN>
Message-ID: <9a99d994-dc8f-eac8-959e-a4804487f764@HIDDEN>
Date: Wed, 31 Aug 2016 17:07:46 -0400
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <878tw1fuaf.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 24215
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

On 8/12/2016 7:21 PM, Tom Roche wrote:
> $ sudo parted ${DRIVE_DEV} --script -- rm 1
>> Warning: Partition /dev/sdb1 is being used. Are you sure you want to continue?
> 
> This seems wrong to me, in 2 ways:
> 
> 1. The manual[2] says quite clearly
>> ‘-s’
>> ‘--script’
>> never prompt the user

That is correct; it does not prompt the user.  You do still get the
warning that something is wrong though, and then parted exits with an error.

> So ISTM[3] either something is wrong with the code or with the manual. Am I missing something? 
> 
> 2. I can't find a way to script a response to the prompt. I have tried various permutations of
> 
>     echo 'yes' | sudo parted ${DRIVE_DEV} --script -- rm 1
>     yes | sudo parted ${DRIVE_DEV} --script -- rm 1
>     yes Y | sudo parted ${DRIVE_DEV} --script -- rm 1
>     sudo sh -c "yes yes | sudo parted ${DRIVE_DEV} --script -- rm 1"

Leave off the --script so that it prompts for a response, and then you
can give it the yes response on the command line, probably followed by
the ignore response to the error that is going to follow.

I've know about this class of problem for some time now but can't come
up with a satisfactory way to deal with it.  Something along the lines
of --yes-i-know-it-is-in-use to automatically answer that particular
response with a yes, if and only if it comes up would be ideal, but due
to the way the libparted api is designed, implementing such a thing is
difficult.





Information forwarded to bug-parted@HIDDEN:
bug#24215; Package parted. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Aug 2016 23:21:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 12 19:21:32 2016
Received: from localhost ([127.0.0.1]:55566 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bYLlb-0002jS-UW
	for submit <at> debbugs.gnu.org; Fri, 12 Aug 2016 19:21:32 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52081)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Tom_Roche@HIDDEN>) id 1bYLlZ-0002jE-Ts
 for submit <at> debbugs.gnu.org; Fri, 12 Aug 2016 19:21:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <Tom_Roche@HIDDEN>) id 1bYLlT-0005xG-H3
 for submit <at> debbugs.gnu.org; Fri, 12 Aug 2016 19:21:24 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:60698)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <Tom_Roche@HIDDEN>) id 1bYLlT-0005xA-E6
 for submit <at> debbugs.gnu.org; Fri, 12 Aug 2016 19:21:23 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43046)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <Tom_Roche@HIDDEN>) id 1bYLlR-0003Y4-1w
 for bug-parted@HIDDEN; Fri, 12 Aug 2016 19:21:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <Tom_Roche@HIDDEN>) id 1bYLlL-0005ww-Vk
 for bug-parted@HIDDEN; Fri, 12 Aug 2016 19:21:19 -0400
Received: from pb-smtp1.pobox.com ([64.147.108.70]:56830
 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <Tom_Roche@HIDDEN>) id 1bYLlL-0005wk-RO
 for bug-parted@HIDDEN; Fri, 12 Aug 2016 19:21:15 -0400
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 5A30C3441B;
 Fri, 12 Aug 2016 19:21:14 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to
 :subject:reply-to:date:message-id:mime-version:content-type
 :content-transfer-encoding; s=sasl; bh=JZo7Jy0KI9PABLj/xXpYnrGJ2
 UA=; b=L8wKQuWyPdBmWZwEO8Y6YAj3xfz9cL99/jJGhK6ahWz9++DAmk5xiWr2U
 gx+7fhV/LfEpocnEqGcIm8ZsVe6Ednw+w/9k5NlDIXfN2+xGW2IRodRavXwiSnYV
 hZim/1xftChtxHF3bQBbPyMYuwNXjHrwFO/oLXRjdzGIpPz1Po=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject
 :reply-to:date:message-id:mime-version:content-type
 :content-transfer-encoding; q=dns; s=sasl; b=KaD+bC5IHNHxOpN6L26
 BB5TwnzScddoKYuPvs2ODoM28+fX6CPizWH6zFvnE3XMTBnzdM4oO8i4f8M+Fu2k
 pDcl0ja3Y+fHb2jnVf7VM279ni+4bXY3SKCOpE7SivZGQ84FQc3G0NrbNJpZB/t2
 StoCgRgOEtytFrIMS2P0qyso=
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 4A1B73441A;
 Fri, 12 Aug 2016 19:21:14 -0400 (EDT)
Received: from tlrW510.pobox.com (unknown [173.20.44.153])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id A9CC134419;
 Fri, 12 Aug 2016 19:21:13 -0400 (EDT)
From: Tom Roche <Tom_Roche@HIDDEN>
To: bug-parted@HIDDEN, 
Subject: command=`rm`: how to script responses?
User-Agent: GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)
Date: Fri, 12 Aug 2016 16:21:12 -0700
Message-ID: <878tw1fuaf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Pobox-Relay-ID: 76356248-60E3-11E6-A393-89D312518317-07218935!pb-smtp1.pobox.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.4 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: bug-parted@HIDDEN, Tom Roche <Tom_Roche@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.4 (----)


[footnotes after .sig]

I am learning how to script `parted`, successfully insofar as the following=
 scriptlet WFM[1]:

    ORIG_DRIVE_LABEL=3D'D078BBB478BB97A4'
    ORIG_DRIVE_MOUNTPATH=3D"/media/$(whoami)/${ORIG_DRIVE_LABEL}"
    DRIVE_DEV=3D'/dev/sdb'

    date
    du -hs "${ORIG_DRIVE_MOUNTPATH}"
    df -h "${ORIG_DRIVE_MOUNTPATH}"
    sudo parted ${DRIVE_DEV} --script -- print
    # note following fails without specified ${DRIVE_DEV} ?!?
    sudo parted ${DRIVE_DEV} --script -- print devices

However I am unable to avoid--or, better yet, to script so as to satisfy--p=
rompts from=20

$ sudo parted ${DRIVE_DEV} --script -- rm 1
> Warning: Partition /dev/sdb1 is being used. Are you sure you want to cont=
inue?

This seems wrong to me, in 2 ways:

1. The manual[2] says quite clearly
> =E2=80=98-s=E2=80=99
> =E2=80=98--script=E2=80=99
> never prompt the user

So ISTM[3] either something is wrong with the code or with the manual. Am I=
 missing something?=20

2. I can't find a way to script a response to the prompt. I have tried vari=
ous permutations of

    echo 'yes' | sudo parted ${DRIVE_DEV} --script -- rm 1
    yes | sudo parted ${DRIVE_DEV} --script -- rm 1
    yes Y | sudo parted ${DRIVE_DEV} --script -- rm 1
    sudo sh -c "yes yes | sudo parted ${DRIVE_DEV} --script -- rm 1"

So ISTM one of 2 cases applies here:

1. `rm` is (deliberately) unscriptable. If so, ISTM this should be duly not=
ed in the manual, e.g. here[4]

2. `rm` is scriptable, or the user needs to make some configuration change =
if s/he wants to script `rm`. If so, how? and again, the necessary instruct=
ions should also be provided in the manual (same place[4]), since it's obvi=
ously non-trivial.

In case it matters, I'm running Debian 8 with up-to-date (for that distro) =
`bash` and `parted`, particularly

$ date; sudo parted --version | head -1
> Fri Aug 12 15:42:45 MST 2016
> parted (GNU parted) 3.2

TIA, Tom Roche <Tom_Roche@HIDDEN>

[1]: https://en.wiktionary.org/wiki/WFM
[2]: https://www.gnu.org/software/parted/manual/parted.html#Invoking-Parted
[3]: https://en.wiktionary.org/wiki/ISTM
[4]: https://www.gnu.org/software/parted/manual/parted.html#rm




Acknowledgement sent to bug-parted@HIDDEN, Tom Roche <Tom_Roche@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-parted@HIDDEN. Full text available.
Report forwarded to bug-parted@HIDDEN:
bug#24215; Package parted. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 19 Apr 2017 18:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.