[Pkg-ocaml-maint-commits] r1496 - trunk/tools/opkg-buildpackage

Thomas Petazzoni tpetazzo-guest at costa.debian.org
Thu Jul 28 21:58:48 UTC 2005


Author: tpetazzo-guest
Date: 2005-07-28 21:58:48 +0000 (Thu, 28 Jul 2005)
New Revision: 1496

Modified:
   trunk/tools/opkg-buildpackage/opkg-editpatch
Log:
Fix severe issue when the directory in the tarball is not defined as
excepted. Use the opkg-buildpackage kludge to find the orig tarball
main directory



Modified: trunk/tools/opkg-buildpackage/opkg-editpatch
===================================================================
--- trunk/tools/opkg-buildpackage/opkg-editpatch	2005-07-28 21:57:05 UTC (rev 1495)
+++ trunk/tools/opkg-buildpackage/opkg-editpatch	2005-07-28 21:58:48 UTC (rev 1496)
@@ -34,6 +34,15 @@
 
 $tarball = "${package}_${upstreamversion}.orig.tar.gz";
 
+# get the name of the directory containing the orig sources
+if (! -r $tarball) {
+    print STDERR "can't read $tarball\n";
+    exit 1;
+}
+open(TARLIST, "tar tvfz $tarball |");
+($unpackdir) = (<TARLIST> =~ m/([^\s]*)\/\s*$/);
+close TARLIST;
+
 # First of all clean up everything
 system "opkg-cleanpackage";
 
@@ -41,7 +50,7 @@
 system "tar xvzf ${tarball}";
 
 # Rename to correct thing
-system "mv ${package}-${upstreamversion}.orig ${package}-${upstreamversion}";
+system "mv ${unpackdir} ${package}-${upstreamversion}";
 
 # Copy Debian directory
 system "cp -a debian/ ${package}-${upstreamversion}";




More information about the Pkg-ocaml-maint-commits mailing list