[Crosstoolchain-logs] [device-tree-compiler] 155/198: guess output	file format
    Hector Oron 
    zumbi at moszumanska.debian.org
       
    Thu Dec  8 17:07:04 UTC 2016
    
    
  
This is an automated email from the git hooks/post-receive script.
zumbi pushed a commit to branch upstream/1.4.x
in repository device-tree-compiler.
commit f6dbc6ca9618391e4f30c415a0a09b7af35f7647
Author: Andre Przywara <osp at andrep.de>
Date:   Wed Jul 1 00:31:28 2015 +0100
    guess output file format
    
    If no output file type is specified via the -O parameter, guess the
    desired file type by looking at the file name extension.
    If that provides no useful hints, assume "dtb" as long as the input
    type is "dts". Any other input type will lead to "dts" being used as
    the guessed output type.
    Any explicit specification of the output type will skip this guessing.
    
    Signed-off-by: Andre Przywara <osp at andrep.de>
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 dtc.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dtc.c b/dtc.c
index 53793bf..5fa23c4 100644
--- a/dtc.c
+++ b/dtc.c
@@ -155,7 +155,7 @@ int main(int argc, char *argv[])
 {
 	struct boot_info *bi;
 	const char *inform = NULL;
-	const char *outform = "dts";
+	const char *outform = NULL;
 	const char *outname = "-";
 	const char *depname = NULL;
 	bool force = false, sort = false;
@@ -262,6 +262,15 @@ int main(int argc, char *argv[])
 
 	if (inform == NULL)
 		inform = guess_input_format(arg, "dts");
+	if (outform == NULL) {
+		outform = guess_type_by_name(outname, NULL);
+		if (outform == NULL) {
+			if (streq(inform, "dts"))
+				outform = "dtb";
+			else
+				outform = "dts";
+		}
+	}
 	if (streq(inform, "dts"))
 		bi = dt_from_source(arg);
 	else if (streq(inform, "fs"))
-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git
    
    
More information about the Crosstoolchain-logs
mailing list