Debian Bug report logs - #97290
cp and mv are missing from 0.52-2

version graph

Package: busybox; Maintainer for busybox is Debian Install System Team <debian-boot@lists.debian.org>; Source for busybox is src:busybox.

Reported by: David Whedon <dwhedon@debian.org>

Date: Sat, 12 May 2001 22:18:09 UTC

Severity: critical

Found in version 0.52-2

Fixed in version busybox/1:0.51-3

Done: Erik Andersen <andersee@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Erik Andersen <andersee@debian.org>:
Bug#97290; Package busybox. Full text and rfc822 format available.

Acknowledgement sent to David Whedon <dwhedon@debian.org>:
New Bug report received and forwarded. Copy sent to Erik Andersen <andersee@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: David Whedon <dwhedon@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: cp and mv are missing from 0.52-2
Date: Sat, 12 May 2001 15:16:49 -0700
Package: busybox
Version: 0.52-2
Severity: critical

Version numbers are a bit messed up, but this is the one that was uploaded
today, it is missing mv and cp. The problem appears to be related to the fact
that applets.h is still using BB_CP_MV, but other things have changed to use
B_CP and BB_MV, plus, I odn't see the funciton mv_main().

I took a look at 0.51-1 vs. 0.52-2 and cp and mv are the only tools missing.


BusyBox v0.51 (2001.05.12-18:03+0000) multi-call binary

Usage: busybox [function] [arguments]...
   or: [function] [arguments]...

	BusyBox is a multi-call binary that combines many common Unix
	utilities into a single executable.  Most people will create a
	link to busybox for each function they wish to use, and BusyBox
	will act like whatever it was invoked as.

Currently defined functions:
	ar, basename, busybox, cat, chgrp, chmod, chown, chroot, chvt,
	clear, cut, date, dd, df, dirname, dmesg, du, echo, false, find,
	free, grep, gunzip, gzip, halt, head, id, init, kill, killall,
	klogd, linuxrc, ln, loadkmap, logger, ls, lsmod, md5sum, mkdir,
	mknod, mkswap, more, mount, ping, poweroff, ps, pwd, reboot, reset,
	rm, rmdir, sed, sh, sleep, sort, swapoff, swapon, sync, syslogd,
	tail, tar, telnet, touch, tr, true, tty, umount, uname, uniq,
	uptime, wc, wget, which, whoami, xargs, yes, zcat



-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux ruff 2.2.17 #2 Sat Dec 30 11:46:38 PST 2000 i686




Information forwarded to debian-bugs-dist@lists.debian.org, Erik Andersen <andersee@debian.org>:
Bug#97290; Package busybox. Full text and rfc822 format available.

Acknowledgement sent to David Whedon <dwhedon@debian.org>:
Extra info received and forwarded to list. Copy sent to Erik Andersen <andersee@debian.org>. Full text and rfc822 format available.

Message #10 received at 97290@bugs.debian.org (full text, mbox):

From: David Whedon <dwhedon@debian.org>
To: 97290@bugs.debian.org
Subject: [PATCH] Re: cp and mv are missing from 0.52-2
Date: Sat, 12 May 2001 15:33:18 -0700
This appears to fix it, at least cp and mv now work on my host, I haven't
rebuilt boot-floppies with this yet.  Needed to fix applets.h and include mv.c.


David




diff -uNr busybox-0.51/applets.h /woody/home/dwhedon/busybox-0.52-2/applets.h
--- busybox-0.51/applets.h	Wed Apr  4 10:31:15 2001
+++ /woody/home/dwhedon/busybox-0.52-2/applets.h	Sat May 12 15:21:25 2001
@@ -80,8 +80,8 @@
 #ifdef BB_CMP
 	APPLET(cmp, cmp_main, _BB_DIR_USR_BIN)
 #endif
-#ifdef BB_CP_MV
-	APPLET(cp, cp_mv_main, _BB_DIR_BIN)
+#ifdef BB_CP
+	APPLET(cp, cp_main, _BB_DIR_BIN)
 #endif
 #ifdef BB_CUT
 	APPLET(cut, cut_main, _BB_DIR_USR_BIN)
@@ -269,8 +269,8 @@
 #ifdef BB_MT
 	APPLET(mt, mt_main, _BB_DIR_BIN)
 #endif
-#ifdef BB_CP_MV
-	APPLET(mv, cp_mv_main, _BB_DIR_BIN)
+#ifdef BB_MV
+	APPLET(mv, mv_main, _BB_DIR_BIN)
 #endif
 #ifdef BB_NC
 	APPLET(nc, nc_main, _BB_DIR_USR_BIN)
diff -uNr busybox-0.51/debian/Config.h-deb /woody/home/dwhedon/busybox-0.52-2/debian/Config.h-deb
diff -uNr busybox-0.51/mv.c /woody/home/dwhedon/busybox-0.52-2/mv.c
--- busybox-0.51/mv.c	Wed Dec 31 16:00:00 1969
+++ /woody/home/dwhedon/busybox-0.52-2/mv.c	Sat May 12 15:20:32 2001
@@ -0,0 +1,168 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Mini mv implementation for busybox
+ *
+ *
+ * Copyright (C) 2000 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#include "busybox.h"
+
+static int flags;
+
+static int manual_rename(const char *source, const char *dest)
+{
+	struct stat source_stat;
+	struct stat dest_stat;
+	int source_exists = 1;
+	int dest_exists = 1;
+
+	if (stat(source, &source_stat) < 0) {
+		if (errno != ENOENT) {
+			perror_msg("unable to stat `%s'", source);
+			return -1;
+		}
+		source_exists = 0;
+	}
+
+	if (stat(dest, &dest_stat) < 0) {
+		if (errno != ENOENT) {
+			perror_msg("unable to stat `%s'", dest);
+			return -1;
+		}
+		dest_exists = 0;
+	}
+
+	if (dest_exists) {
+		if (S_ISDIR(dest_stat.st_mode) &&
+			  (!source_exists || !S_ISDIR(source_stat.st_mode))) {
+			error_msg("cannot overwrite directory with non-directory");
+			return -1;
+		}
+
+		if (!S_ISDIR(dest_stat.st_mode) && source_exists &&
+				S_ISDIR(source_stat.st_mode)) {
+			error_msg("cannot overwrite non-directory with directory");
+			return -1;
+		}
+
+		if (unlink(dest) < 0) {
+			perror_msg("cannot remove `%s'", dest);
+			return -1;
+		}
+	}
+
+	if (copy_file(source, dest, FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS |
+			FILEUTILS_PRESERVE_SYMLINKS) < 0)
+		return -1;
+
+	if (remove_file(source, FILEUTILS_RECUR | FILEUTILS_FORCE) < 0)
+		return -1;
+
+	return 0;
+}
+
+static int move_file(const char *source, const char *dest)
+{
+	struct stat dest_stat;
+	int dest_exists = 1;
+
+	if (stat(dest, &dest_stat) < 0) {
+		if (errno != ENOENT) {
+			perror_msg("unable to stat `%s'", dest);
+			return -1;
+		}
+		dest_exists = 0;
+	}
+
+	if (dest_exists && !(flags & FILEUTILS_FORCE) &&
+			((access(dest, W_OK) < 0 && isatty(0)) ||
+			 (flags & FILEUTILS_INTERACTIVE))) {
+		fprintf(stderr, "mv: overwrite `%s'? ", dest);
+		if (!ask_confirmation())
+			return 0;
+	}
+
+	if (rename(source, dest) < 0) {
+		if (errno == EXDEV)
+			return manual_rename(source, dest);
+
+		perror_msg("unable to rename `%s'", source);
+		return -1;
+	}
+	
+	return 0;
+}
+
+extern int mv_main(int argc, char **argv)
+{
+	int status = 0;
+	int opt;
+	int i;
+
+	while ((opt = getopt(argc, argv, "fi")) != -1)
+		switch (opt) {
+		case 'f':
+			flags &= ~FILEUTILS_INTERACTIVE;
+			flags |= FILEUTILS_FORCE;
+			break;
+		case 'i':
+			flags &= ~FILEUTILS_FORCE;
+			flags |= FILEUTILS_INTERACTIVE;
+			break;
+		default:
+			show_usage();
+		}
+
+	if (optind + 2 > argc)
+		show_usage();
+
+	if (optind + 2 == argc) {
+		struct stat dest_stat;
+		int dest_exists = 1;
+
+		if (stat(argv[optind + 1], &dest_stat) < 0) {
+			if (errno != ENOENT)
+				perror_msg_and_die("unable to stat `%s'", argv[optind + 1]);
+			dest_exists = 0;
+		}
+
+		if (!dest_exists || !S_ISDIR(dest_stat.st_mode)) {
+			if (move_file(argv[optind], argv[optind + 1]) < 0)
+				status = 1;
+			return status;
+		}
+	}
+
+	for (i = optind; i < argc - 1; i++) {
+		char *dest = concat_path_file(argv[argc - 1],
+				get_last_path_component(argv[i]));
+		if (move_file(argv[i], dest) < 0)
+			status = 1;
+		free(dest);
+	}
+
+	return status;
+}



Information forwarded to debian-bugs-dist@lists.debian.org, Erik Andersen <andersee@debian.org>:
Bug#97290; Package busybox. Full text and rfc822 format available.

Acknowledgement sent to andersen@codepoet.org:
Extra info received and forwarded to list. Copy sent to Erik Andersen <andersee@debian.org>. Full text and rfc822 format available.

Message #15 received at submit@bugs.debian.org (full text, mbox):

From: Erik Andersen <andersen@codepoet.org>
To: 97290@bugs.debian.org
Cc: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: Bug#97290: cp and mv are missing from 0.52-2
Date: Sat, 12 May 2001 17:48:29 -0600
On Sat May 12, 2001 at 03:16:49PM -0700, David Whedon wrote:
> Package: busybox
> Version: 0.52-2
> Severity: critical
> 
> Version numbers are a bit messed up, but this is the one that was uploaded
> today, it is missing mv and cp. The problem appears to be related to the fact
> that applets.h is still using BB_CP_MV, but other things have changed to use
> B_CP and BB_MV, plus, I odn't see the funciton mv_main().
> 

Doh!  I am an idiot.   I am uploading a new package now.

 -Erik

--
Erik B. Andersen   email:  andersee@debian.org, andersen@lineo.com
--This message was written using 73% post-consumer electrons--



Information forwarded to debian-bugs-dist@lists.debian.org, Erik Andersen <andersee@debian.org>:
Bug#97290; Package busybox. Full text and rfc822 format available.

Acknowledgement sent to andersen@codepoet.org:
Extra info received and forwarded to list. Copy sent to Erik Andersen <andersee@debian.org>. Full text and rfc822 format available.

Reply sent to Erik Andersen <andersee@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to David Whedon <dwhedon@debian.org>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #25 received at 97290-close@bugs.debian.org (full text, mbox):

From: Erik Andersen <andersee@debian.org>
To: 97290-close@bugs.debian.org
Subject: Bug#97290: fixed in busybox 1:0.51-3
Date: Sun, 13 May 2001 14:53:27 -0400
We believe that the bug you reported is fixed in the latest version of
busybox, which has been installed in the Debian FTP archive:

busybox_0.51-3.tar.gz
  to pool/main/b/busybox/busybox_0.51-3.tar.gz
busybox-udeb_0.51-3_i386.udeb
  to pool/main/b/busybox/busybox-udeb_0.51-3_i386.udeb
busybox-static_0.51-3_i386.deb
  to pool/main/b/busybox/busybox-static_0.51-3_i386.deb
busybox_0.51-3.dsc
  to pool/main/b/busybox/busybox_0.51-3.dsc
busybox_0.51-3_i386.deb
  to pool/main/b/busybox/busybox_0.51-3_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 97290@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Erik Andersen <andersee@debian.org> (supplier of updated busybox package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 12 May 2001 17:35:58 -0600
Source: busybox
Binary: busybox-udeb busybox-static busybox
Architecture: source i386
Version: 1:0.51-3
Distribution: unstable
Urgency: low
Maintainer: Erik Andersen <andersee@debian.org>
Changed-By: Erik Andersen <andersee@debian.org>
Description: 
 busybox    - Tiny utilities for small and embedded systems.
 busybox-static - Provides a stand alone rescue shell with tons of builtin utilitie
Closes: 97290
Changes: 
 busybox (1:0.51-3) unstable; urgency=low
 .
   * This is the "I am an idiot" release.
   * Make cp and mv work again (closes: #97290)
   * Fix the version number.
Files: 
 6eb319da19ab7ffb707d8ab123b25bd8 594 - optional busybox_0.51-3.dsc
 c2a20de8c3d58f1266060d14a637e0ed 640151 - optional busybox_0.51-3.tar.gz
 9ddb6046f2a0d83f1385c676fe13b966 225470 utils optional busybox_0.51-3_i386.deb
 053fe05ef6c1d07befec0cd75576f339 442964 shells optional busybox-static_0.51-3_i386.deb
 fd0c3b0369da5eac8de55262dc094157 63908 debian-installer standard busybox-udeb_0.51-3_i386.udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6/dBqX5tkPjDTkFcRAjGvAJ9phRclXnvi43bNZ7RO6gaRzdPkDACeL3nQ
BC08kDos23Oo/Ze/rF9jOk4=
=qPzN
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 10:50:18 2014; Machine Name: buxtehude.debian.org

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