5 # Get the main upstream tarball URL and version via uscan.
7 if [ "${line#http://}" != "$line" -a "${line#* }" = "$line" ]; then
10 if [ "${line#Newest version }" != "$line" ]; then
11 version="${line#Newest version on remote site is }"
12 version="${version%, local version is *}"
14 done < <(LANG=C uscan --report --verbose)
15 test -n "$main_url" -a -n "$version"
17 # Get the document tarball URL and the filenames of the tarballs.
19 main_file=${main_url##*/}
20 doc_url=${main_url/ion/ion-doc}
21 doc_file=${doc_url##*/}
22 wget -O $main_file $main_url
23 wget -O $doc_file $doc_url
25 # Work out what directories we expect to be in them, and check this.
26 main_dir=${main_file%.tar.gz}
27 doc_dir=${doc_file%.tar.gz}
28 test -z "$(tar tzf $main_file | grep -v "^$main_dir/")"
29 test -z "$(tar tzf $doc_file | grep -v "^$doc_dir/")"
31 # Unpack, combine and repack.
34 mv $main_dir ion3-$version.orig
35 mv $doc_dir ion3-$version.orig/doc
36 tar cf - ion3-$version.orig | gzip -c9 > ion3_$version.orig.tar.gz
39 rm -rf $main_file $doc_file ion3-$version.orig