summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKang Kai <kai.kang@windriver.com>2012-11-01 10:44:56 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-02 16:18:30 +0000
commite48fe4ed7aca0f16becd17ec6cc1978a4031c111 (patch)
treeb6319a5bd8fa95ce7f9a3ee381b2e2ddd58b3482 /scripts
parent7f6edde6af6451b811c1c45139f6eede525798ae (diff)
downloadpoky-e48fe4ed7aca0f16becd17ec6cc1978a4031c111.tar.gz
create-recipe: update re pattern and output
In the URL, there may be more than just digits in the version section, something like xz 5.1.2alpha. Update RE pattern to catch all the string after package name and before '.tar' in URL as package version. And error message which has been sent to /dev/null still shows on Ubuntu 12.10 with perl 5.14. Update the way to find source tar file to eraser the error message. configure files may rewrite the version section, and that is not necessary. Test when version section has been set, omit the version value from configure files. And tweak for output to bb file. (From OE-Core rev: 17f09ab713acc814ec0561b1c41fa87d9bf7b83f) Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-recipe29
1 files changed, 19 insertions, 10 deletions
diff --git a/scripts/create-recipe b/scripts/create-recipe
index aba9ac37d9..776c91dd9d 100755
--- a/scripts/create-recipe
+++ b/scripts/create-recipe
@@ -35,7 +35,8 @@ use File::Basename qw(basename dirname);
35 35
36 36
37my $name = ""; 37my $name = "";
38my $version = "TO BE FILLED IN"; 38my $predef_version = "TO BE FILLED IN";
39my $version = $predef_version;
39my $description = ""; 40my $description = "";
40my $summary = ""; 41my $summary = "";
41my $url = ""; 42my $url = "";
@@ -809,7 +810,7 @@ sub process_configure_ac
809# $name = $1; 810# $name = $1;
810 } 811 }
811 } 812 }
812 if (defined($acinit[1])) { 813 if (defined($acinit[1]) and $version eq $predef_version) {
813 my $ver = $acinit[1]; 814 my $ver = $acinit[1];
814 $ver =~ s/\[//g; 815 $ver =~ s/\[//g;
815 $ver =~ s/\]//g; 816 $ver =~ s/\]//g;
@@ -835,7 +836,7 @@ sub process_configure_ac
835# $name = $1; 836# $name = $1;
836 } 837 }
837 } 838 }
838 if (defined($acinit[1])) { 839 if (defined($acinit[1]) and $version eq $predef_version) {
839 my $ver = $acinit[1]; 840 my $ver = $acinit[1];
840 $ver =~ s/\[//g; 841 $ver =~ s/\[//g;
841 $ver =~ s/\]//g; 842 $ver =~ s/\]//g;
@@ -1536,7 +1537,7 @@ sub guess_name_from_url {
1536 } 1537 }
1537 my $tarfile = $spliturl[0]; 1538 my $tarfile = $spliturl[0];
1538 1539
1539 if ($tarfile =~ /(.*?)\-([0-9\.\-\~]+)[-\.].*?\.tar/) { 1540 if ($tarfile =~ /(.*?)\-([0-9\.\-\~]+.*?)\.tar/) {
1540 $name = $1; 1541 $name = $1;
1541 $version = $2; 1542 $version = $2;
1542 $version =~ s/\-/\_/g; 1543 $version =~ s/\-/\_/g;
@@ -1687,8 +1688,8 @@ sub write_bbfile
1687 print BBFILE "\"\n\n"; 1688 print BBFILE "\"\n\n";
1688 1689
1689 if (@license <= 0) { 1690 if (@license <= 0) {
1690 print "Can NOT get license from package itself.\n"; 1691 print "Can NOT get license from package source files.\n";
1691 print "Please update the license and license file manually.\n"; 1692 print "Please update the LICENSE and LIC_FILES_CHKSUM manually.\n";
1692 } 1693 }
1693 1694
1694 if (@buildreqs > 0) { 1695 if (@buildreqs > 0) {
@@ -1704,7 +1705,7 @@ sub write_bbfile
1704 } 1705 }
1705 print BBFILE "\"\n\n"; 1706 print BBFILE "\"\n\n";
1706 print BBFILE "SRC_URI[md5sum] = \"$md5sum\"\n"; 1707 print BBFILE "SRC_URI[md5sum] = \"$md5sum\"\n";
1707 print BBFILE "SRC_URI[sha256sum] = \"$sha256sum\"\n"; 1708 print BBFILE "SRC_URI[sha256sum] = \"$sha256sum\"\n\n";
1708 1709
1709 if (@inherits) { 1710 if (@inherits) {
1710 print BBFILE "inherit "; 1711 print BBFILE "inherit ";
@@ -1800,9 +1801,17 @@ foreach (@tgzfiles) {
1800# this is a step backwards in time that is just silly. 1801# this is a step backwards in time that is just silly.
1801# 1802#
1802 1803
1804my @sourcetars = <$orgdir/$outputdir/*\.tar\.bz2 $orgdir/$outputdir/*\.tar\.gz>;
1805if ( length @sourcetars == 0) {
1806 print "Can NOT find source tarball. Exiting...\n";
1807 exit (1);
1808}
1809if (defined($sourcetars[0]) and $sourcetars[0] =~ ".*\.tar\.bz2") {
1810 system("cd $tmpdir; tar -jxf $sourcetars[0] &>/dev/null");
1811} elsif (defined($sourcetars[0]) and $sourcetars[0] =~ ".*\.tar\.gz") {
1812 system("cd $tmpdir; tar -zxf $sourcetars[0] &>/dev/null");
1813}
1803 1814
1804system("cd $tmpdir; tar -jxf $orgdir/$outputdir/*\.tar\.bz2 &>/dev/null");
1805system("cd $tmpdir; tar -zxf $orgdir/$outputdir/*\.tar\.gz &>/dev/null");
1806print "Parsing content ....\n"; 1815print "Parsing content ....\n";
1807my @dirs = <$tmpdir/*>; 1816my @dirs = <$tmpdir/*>;
1808foreach (@dirs) { 1817foreach (@dirs) {
@@ -1827,7 +1836,7 @@ if ( -e "$dir/configure" ) {
1827 $configure = ""; 1836 $configure = "";
1828} 1837}
1829 1838
1830my @files = <$dir/configure.*>; 1839my @files = <$dir/configure\.*>;
1831 1840
1832my $findoutput = `find $dir -name "configure.ac" 2>/dev/null`; 1841my $findoutput = `find $dir -name "configure.ac" 2>/dev/null`;
1833my @findlist = split(/\n/, $findoutput); 1842my @findlist = split(/\n/, $findoutput);