Skip to content

Commit 4f40099

Browse files
committed
Add option for creating an asio release tarball.
1 parent 7961ae0 commit 4f40099

File tree

1 file changed

+61
-18
lines changed

1 file changed

+61
-18
lines changed

asio/release.pl

+61-18
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@
1515

1616
sub print_usage_and_exit
1717
{
18-
print("Usage: ./release.pl <version>\n");
19-
print(" Example: ./release.pl 1.2.0\n");
18+
print("usage: ./release.pl <version>\n");
19+
print(" or: ./release.pl --package-asio\n");
20+
print("\n");
21+
print("examples:\n");
22+
print(" create new version and build packages for asio and boost.asio:\n");
23+
print(" ./release.pl 1.2.0\n");
24+
print(" create packages for asio only:\n");
25+
print(" ./release.pl --package-asio\n");
2026
exit(1);
2127
}
2228

@@ -45,6 +51,22 @@ ($)
4551
}
4652
}
4753

54+
sub determine_version_from_configure()
55+
{
56+
my $from = "configure.ac";
57+
open(my $input, "<$from") or die("Can't open $from for reading");
58+
while (my $line = <$input>)
59+
{
60+
chomp($line);
61+
if ($line =~ /^AC_INIT\(asio.*\[(.*)\]\)$/)
62+
{
63+
our $asio_name = "asio-$1";
64+
our $boost_asio_name = "boost_asio_$1";
65+
last;
66+
}
67+
}
68+
}
69+
4870
sub update_configure_ac
4971
{
5072
# Open the files.
@@ -202,9 +224,11 @@ sub build_example_diffs
202224

203225
sub make_asio_packages
204226
{
227+
our $asio_name;
205228
system("./autogen.sh");
206229
system("./configure");
207230
system("make dist");
231+
system("tar tfz $asio_name.tar.gz | sed -e 's/^[^\\/]*//' | sort -df > asio.manifest");
208232
}
209233

210234
sub build_boost_asio_doc
@@ -361,29 +385,48 @@ sub create_boost_asio_content
361385

362386
sub make_boost_asio_packages
363387
{
388+
our $boost_asio_name;
364389
system("tar --format=ustar -chf - $boost_asio_name | gzip -c >$boost_asio_name.tar.gz");
365390
system("tar --format=ustar -chf - $boost_asio_name | bzip2 -9 -c >$boost_asio_name.tar.bz2");
366391
system("rm -f $boost_asio_name.zip");
367392
system("zip -rq $boost_asio_name.zip $boost_asio_name");
368393
system("rm -rf $boost_asio_name");
394+
system("tar tfz $boost_asio_name.tar.gz | sed -e 's/^[^\\/]*//' | sort -df > boost_asio.manifest");
369395
}
370396

371-
sub create_manifests
397+
(scalar(@ARGV) == 1) or print_usage_and_exit();
398+
my $new_version = 1;
399+
my $package_asio = 1;
400+
my $package_boost = 1;
401+
if ($ARGV[0] eq "--package-asio")
372402
{
373-
system("tar tfz $asio_name.tar.gz | sed -e 's/^[^\\/]*//' | sort -df > asio.manifest");
374-
system("tar tfz $boost_asio_name.tar.gz | sed -e 's/^[^\\/]*//' | sort -df > boost_asio.manifest");
403+
$new_version = 0;
404+
$package_boost = 0;
375405
}
376406

377-
(scalar(@ARGV) == 1) or print_usage_and_exit();
378-
determine_version($ARGV[0]);
379-
update_configure_ac();
380-
update_readme();
381-
update_asio_version_hpp();
382-
update_boost_asio_version_hpp();
383-
build_asio_doc();
384-
build_example_diffs();
385-
make_asio_packages();
386-
build_boost_asio_doc();
387-
create_boost_asio_content();
388-
make_boost_asio_packages();
389-
create_manifests();
407+
if ($new_version)
408+
{
409+
determine_version($ARGV[0]);
410+
update_configure_ac();
411+
update_readme();
412+
update_asio_version_hpp();
413+
update_boost_asio_version_hpp();
414+
}
415+
else
416+
{
417+
determine_version_from_configure();
418+
}
419+
420+
if ($package_asio)
421+
{
422+
build_asio_doc();
423+
build_example_diffs();
424+
make_asio_packages();
425+
}
426+
427+
if ($package_boost)
428+
{
429+
build_boost_asio_doc();
430+
create_boost_asio_content();
431+
make_boost_asio_packages();
432+
}

0 commit comments

Comments
 (0)