Package: fakechroot
Version:  2.16-1
Severity: minor
Tags: patch

Dear Maintainer,

running fakeroot with options inside fakechroot produces some error messages :

me@here:~$ fakechroot fakeroot -s save_file chroot my_wheezy_chroot/ ls -AF
basename: invalid option -- 's'
Try `basename --help' for more information.
/usr/bin/fakeroot: line 178: chroot: command not found

It seems that fakechroot.sh doesn't allow for options of fakeroot when setting 
the environment automatically.

With the patch below :

me@here:~$ fakechroot fakeroot -s save_file chroot my_wheezy_chroot/ ls -AF
bin/  boot/  dev@  etc/  home/  lib/  lib64/  media/  mnt/  opt/  proc@  root/  
run/  sbin/  selinux/  srv/  sys/  tmp/  usr/  var/

Thanks in advance for your comments and/or corrections.

Regards,
JH Chatenet

--- a/scripts/fakechroot.sh     2011-12-11 13:05:34.000000000 +0100
+++ b/scripts/fakechroot.sh     2013-08-12 11:38:52.000000000 +0200
@@ -26,6 +26,38 @@
 }
 
 
+next_cmd_fakechroot () {
+    if [ "$1" = "fakeroot" ]; then
+        shift
+        # skip the options
+        while [ $# -gt 0 ]; do
+            case "$1" in
+                -h|-v)
+                    break
+                    ;;
+                -u|--unknown-is-real)
+                    shift
+                    ;;
+                -l|--lib|--faked|-s|-i|-b)
+                    shift 2
+                    ;;
+                --)
+                    shift
+                    break
+                    ;;
+                *)
+                    break
+                    ;;
+            esac
+        done
+    fi
+
+    if [ -n "$1" -a "$1" != "-v" -a "$1" != "-h" ]; then
+        environment=`basename -- "$1"`
+    fi
+}
+
+
 if [ "$FAKECHROOT" = "true" ]; then
     die "fakechroot: nested operation is not supported"
 fi
@@ -96,11 +128,7 @@
 done
 
 if [ -z "$environment" ]; then
-    if [ "$1" = "fakeroot" ]; then
-        environment=`basename "$2"`
-    else
-        environment=`basename "$1"`
-    fi
+    next_cmd_fakechroot "$@"
 fi
 
 


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to