Diff of /trunk/wharfie/wharfie.py [r15] .. [r16]  Maximize  Restore

Switch to side-by-side view

--- a/trunk/wharfie/wharfie.py
+++ b/trunk/wharfie/wharfie.py
@@ -83,12 +83,13 @@
 
 
 import os
+import re
 import sys
-import re
 import binascii
 import argparse
 from lib import makefile as make
 from lib import actions
+from lib import files
 
 regexCommand = '^[ \t]*(RUN HOST|RUN|FROM|TOOLCHAIN|TO|ADD|SOURCE|LICENSE|ENV|[a-zA-Z0-9]+)([^\n]*)';
 g_depend = '';
@@ -117,7 +118,11 @@
 
         # FROM
         if cmd[0] == 'FROM':
-            g_depend = cmd[1] + ".tar";
+            # special handling for debootstrap
+            if cmd[1].lstrip().startswith("debian_"):
+                g_depend = cmd[1] + ".tar";
+            else:
+                g_depend = files.input_file(cmd[1]);
 
         # ENV
         elif cmd[0] == 'ENV':
@@ -164,6 +169,7 @@
             g_depend = '';
 
         else:
+            print ('error: parse error in Wharfile');
             print ('error: unknown command: "%s %s"' % (cmd[0], cmd[1]));
             exit(-1);
 
@@ -190,7 +196,7 @@
     else:
         print("error: Wharfile '%s' not found." % args.wharfile)
         exit(1)
-    
+
     if os.path.isfile(os.path.abspath(os.path.dirname(sys.argv[0])) + "/wharfie.mk"):
         make.write_makefile('Makefile', args.dry_run, os.path.dirname(sys.argv[0]));
     else: