All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] update script create-recipe
@ 2012-11-01  2:44 ` Kang Kai
  0 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2012-10-31  9:38 UTC (permalink / raw)
  To: yocto

Update create-recipe to fix some small bugs.

The following changes since commit e9e3285e1397cfd2d34f4eb7b5aa59311eea861d:

  openssl: Use ${CFLAGS} not ${FULL_OPTIMIZATION} (2012-10-30 11:06:38 +0000)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib kangkai/update-create-recipe
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/update-create-recipe

Kang Kai (1):
  create-recipe: update re pattern and output

 scripts/create-recipe |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

-- 
1.7.5.4



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] create-recipe: update re pattern and output
  2012-11-01  2:44 ` Kang Kai
@ 2012-11-01  2:44   ` Kang Kai
  -1 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2012-10-31  9:38 UTC (permalink / raw)
  To: yocto

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.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 scripts/create-recipe |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/scripts/create-recipe b/scripts/create-recipe
index aba9ac3..776c91d 100755
--- a/scripts/create-recipe
+++ b/scripts/create-recipe
@@ -35,7 +35,8 @@ use File::Basename qw(basename dirname);
 
 
 my $name = "";
-my $version = "TO BE FILLED IN";
+my $predef_version = "TO BE FILLED IN";
+my $version = $predef_version;
 my $description = "";
 my $summary = "";
 my $url = "";
@@ -809,7 +810,7 @@ sub process_configure_ac
 #					$name = $1;
 				}
 			}
-			if (defined($acinit[1])) {
+			if (defined($acinit[1]) and $version eq $predef_version) {
 				my $ver = $acinit[1];
 				$ver =~ s/\[//g;
 				$ver =~ s/\]//g;
@@ -835,7 +836,7 @@ sub process_configure_ac
 #					$name = $1;
 				}
 			}
-			if (defined($acinit[1])) {
+			if (defined($acinit[1]) and $version eq $predef_version) {
 				my $ver = $acinit[1];
 				$ver =~ s/\[//g;
 				$ver =~ s/\]//g;
@@ -1536,7 +1537,7 @@ sub guess_name_from_url {
 	}
 	my $tarfile = $spliturl[0];
 	
-	if ($tarfile =~ /(.*?)\-([0-9\.\-\~]+)[-\.].*?\.tar/) {
+	if ($tarfile =~ /(.*?)\-([0-9\.\-\~]+.*?)\.tar/) {
 		$name = $1;
 		$version = $2;
                 $version =~ s/\-/\_/g;
@@ -1687,8 +1688,8 @@ sub write_bbfile
 	print BBFILE "\"\n\n";
 
 	if (@license <= 0) {
-		print "Can NOT get license from package itself.\n";
-		print "Please update the license and license file manually.\n";
+		print "Can NOT get license from package source files.\n";
+		print "Please update the LICENSE and LIC_FILES_CHKSUM manually.\n";
 	}
 
 	if (@buildreqs > 0) {
@@ -1704,7 +1705,7 @@ sub write_bbfile
 	}
 	print BBFILE "\"\n\n";
 	print BBFILE "SRC_URI[md5sum] = \"$md5sum\"\n";
-	print BBFILE "SRC_URI[sha256sum] = \"$sha256sum\"\n";
+	print BBFILE "SRC_URI[sha256sum] = \"$sha256sum\"\n\n";
 
 	if (@inherits) {
 		print BBFILE "inherit ";
@@ -1800,9 +1801,17 @@ foreach (@tgzfiles) {
 # this is a step backwards in time that is just silly.
 #
 
+my @sourcetars = <$orgdir/$outputdir/*\.tar\.bz2 $orgdir/$outputdir/*\.tar\.gz>;
+if ( length @sourcetars == 0) {
+	print "Can NOT find source tarball. Exiting...\n";
+	exit (1);
+}
+if (defined($sourcetars[0]) and $sourcetars[0] =~ ".*\.tar\.bz2") {
+	system("cd $tmpdir; tar -jxf $sourcetars[0] &>/dev/null");
+} elsif (defined($sourcetars[0]) and $sourcetars[0] =~ ".*\.tar\.gz") {
+	system("cd $tmpdir; tar -zxf $sourcetars[0] &>/dev/null");
+}
 
-system("cd $tmpdir; tar -jxf $orgdir/$outputdir/*\.tar\.bz2 &>/dev/null");
-system("cd $tmpdir; tar -zxf $orgdir/$outputdir/*\.tar\.gz &>/dev/null");
 print "Parsing content    ....\n";
 my @dirs = <$tmpdir/*>;
 foreach (@dirs) {
@@ -1827,7 +1836,7 @@ if ( -e "$dir/configure" ) {
 	$configure = "";
 }
 
-my @files = <$dir/configure.*>;
+my @files = <$dir/configure\.*>;
 
 my $findoutput = `find $dir -name "configure.ac" 2>/dev/null`;
 my @findlist = split(/\n/, $findoutput);
-- 
1.7.5.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/1] update script create-recipe
  2012-11-01  2:44 ` Kang Kai
  (?)
  (?)
@ 2012-11-01  2:33 ` Kang Kai
  -1 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2012-11-01  2:33 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

On 2012?10?31? 17:38, Kang Kai wrote:
> Update create-recipe to fix some small bugs.
>
> The following changes since commit e9e3285e1397cfd2d34f4eb7b5aa59311eea861d:
>
>    openssl: Use ${CFLAGS} not ${FULL_OPTIMIZATION} (2012-10-30 11:06:38 +0000)
>
> are available in the git repository at:
>    git://git.pokylinux.org/poky-contrib kangkai/update-create-recipe
>    http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/update-create-recipe
>
> Kang Kai (1):
>    create-recipe: update re pattern and output
>
>   scripts/create-recipe |   29 +++++++++++++++++++----------
>   1 files changed, 19 insertions(+), 10 deletions(-)
>
Drop it, and this should be sent to oe-core list.
Sorry for disturbing you.

Kai

[-- Attachment #2: Type: text/html, Size: 1245 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 0/1] update script create-recipe
@ 2012-11-01  2:44 ` Kang Kai
  0 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2012-11-01  2:44 UTC (permalink / raw)
  To: Openembedded-core

Update create-recipe to fix some small bugs.

The following changes since commit e9e3285e1397cfd2d34f4eb7b5aa59311eea861d:

  openssl: Use ${CFLAGS} not ${FULL_OPTIMIZATION} (2012-10-30 11:06:38 +0000)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib kangkai/update-create-recipe
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/update-create-recipe

Kang Kai (1):
  create-recipe: update re pattern and output

 scripts/create-recipe |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] create-recipe: update re pattern and output
@ 2012-11-01  2:44   ` Kang Kai
  0 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2012-11-01  2:44 UTC (permalink / raw)
  To: Openembedded-core

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.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 scripts/create-recipe |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/scripts/create-recipe b/scripts/create-recipe
index aba9ac3..776c91d 100755
--- a/scripts/create-recipe
+++ b/scripts/create-recipe
@@ -35,7 +35,8 @@ use File::Basename qw(basename dirname);
 
 
 my $name = "";
-my $version = "TO BE FILLED IN";
+my $predef_version = "TO BE FILLED IN";
+my $version = $predef_version;
 my $description = "";
 my $summary = "";
 my $url = "";
@@ -809,7 +810,7 @@ sub process_configure_ac
 #					$name = $1;
 				}
 			}
-			if (defined($acinit[1])) {
+			if (defined($acinit[1]) and $version eq $predef_version) {
 				my $ver = $acinit[1];
 				$ver =~ s/\[//g;
 				$ver =~ s/\]//g;
@@ -835,7 +836,7 @@ sub process_configure_ac
 #					$name = $1;
 				}
 			}
-			if (defined($acinit[1])) {
+			if (defined($acinit[1]) and $version eq $predef_version) {
 				my $ver = $acinit[1];
 				$ver =~ s/\[//g;
 				$ver =~ s/\]//g;
@@ -1536,7 +1537,7 @@ sub guess_name_from_url {
 	}
 	my $tarfile = $spliturl[0];
 	
-	if ($tarfile =~ /(.*?)\-([0-9\.\-\~]+)[-\.].*?\.tar/) {
+	if ($tarfile =~ /(.*?)\-([0-9\.\-\~]+.*?)\.tar/) {
 		$name = $1;
 		$version = $2;
                 $version =~ s/\-/\_/g;
@@ -1687,8 +1688,8 @@ sub write_bbfile
 	print BBFILE "\"\n\n";
 
 	if (@license <= 0) {
-		print "Can NOT get license from package itself.\n";
-		print "Please update the license and license file manually.\n";
+		print "Can NOT get license from package source files.\n";
+		print "Please update the LICENSE and LIC_FILES_CHKSUM manually.\n";
 	}
 
 	if (@buildreqs > 0) {
@@ -1704,7 +1705,7 @@ sub write_bbfile
 	}
 	print BBFILE "\"\n\n";
 	print BBFILE "SRC_URI[md5sum] = \"$md5sum\"\n";
-	print BBFILE "SRC_URI[sha256sum] = \"$sha256sum\"\n";
+	print BBFILE "SRC_URI[sha256sum] = \"$sha256sum\"\n\n";
 
 	if (@inherits) {
 		print BBFILE "inherit ";
@@ -1800,9 +1801,17 @@ foreach (@tgzfiles) {
 # this is a step backwards in time that is just silly.
 #
 
+my @sourcetars = <$orgdir/$outputdir/*\.tar\.bz2 $orgdir/$outputdir/*\.tar\.gz>;
+if ( length @sourcetars == 0) {
+	print "Can NOT find source tarball. Exiting...\n";
+	exit (1);
+}
+if (defined($sourcetars[0]) and $sourcetars[0] =~ ".*\.tar\.bz2") {
+	system("cd $tmpdir; tar -jxf $sourcetars[0] &>/dev/null");
+} elsif (defined($sourcetars[0]) and $sourcetars[0] =~ ".*\.tar\.gz") {
+	system("cd $tmpdir; tar -zxf $sourcetars[0] &>/dev/null");
+}
 
-system("cd $tmpdir; tar -jxf $orgdir/$outputdir/*\.tar\.bz2 &>/dev/null");
-system("cd $tmpdir; tar -zxf $orgdir/$outputdir/*\.tar\.gz &>/dev/null");
 print "Parsing content    ....\n";
 my @dirs = <$tmpdir/*>;
 foreach (@dirs) {
@@ -1827,7 +1836,7 @@ if ( -e "$dir/configure" ) {
 	$configure = "";
 }
 
-my @files = <$dir/configure.*>;
+my @files = <$dir/configure\.*>;
 
 my $findoutput = `find $dir -name "configure.ac" 2>/dev/null`;
 my @findlist = split(/\n/, $findoutput);
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-01  2:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31  9:38 [PATCH 0/1] update script create-recipe Kang Kai
2012-11-01  2:44 ` Kang Kai
2012-10-31  9:38 ` [PATCH 1/1] create-recipe: update re pattern and output Kang Kai
2012-11-01  2:44   ` Kang Kai
2012-11-01  2:33 ` [PATCH 0/1] update script create-recipe Kang Kai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.