r4560 - trunk/src/host/opkg-utils

tick at docs.openmoko.org tick at docs.openmoko.org
Mon Jul 28 12:29:45 CEST 2008


Author: tick
Date: 2008-07-28 12:29:45 +0200 (Mon, 28 Jul 2008)
New Revision: 4560

Modified:
   trunk/src/host/opkg-utils/arfile.py
   trunk/src/host/opkg-utils/makePackage
   trunk/src/host/opkg-utils/opkg-build
   trunk/src/host/opkg-utils/opkg-buildpackage
   trunk/src/host/opkg-utils/opkg-diff
   trunk/src/host/opkg-utils/opkg-extract-file
   trunk/src/host/opkg-utils/opkg-list-fields
   trunk/src/host/opkg-utils/opkg-make-index
   trunk/src/host/opkg-utils/opkg-unbuild
   trunk/src/host/opkg-utils/opkg.py
Log:
opkg-util make .opk as the default file extension 

"opkg-build -i ..."  means creating .ipk file for backward support



Modified: trunk/src/host/opkg-utils/arfile.py
===================================================================
--- trunk/src/host/opkg-utils/arfile.py	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/arfile.py	2008-07-28 10:29:45 UTC (rev 4560)
@@ -111,7 +111,7 @@
     if len(sys.argv) > 1:
         dir = sys.argv[1]
     for f in os.listdir(dir):
-        if not f.endswith(".ipk"): continue
+        if not f.endswith(".opk") and not f.endswith(".ipk"): continue
 
         print "=== %s ===" % f
         f = open(dir + "/" + f, "rb")

Modified: trunk/src/host/opkg-utils/makePackage
===================================================================
--- trunk/src/host/opkg-utils/makePackage	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/makePackage	2008-07-28 10:29:45 UTC (rev 4560)
@@ -4,7 +4,7 @@
 #   Run tar to extract control from control.tar.gz from the package.
 #   Insert the filename, size, and md5 lines before the description.
 # Call it like this:
-#  find . -name \*.ipk | xargs -n 1 makePackage > Packages
+#  find . -name \*.opk | xargs -n 1 makePackage > Packages
 
 import sys
 import opkg

Modified: trunk/src/host/opkg-utils/opkg-build
===================================================================
--- trunk/src/host/opkg-utils/opkg-build	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/opkg-build	2008-07-28 10:29:45 UTC (rev 4560)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# opkg-build -- construct a .ipk from a directory
+# opkg-build -- construct a .opk from a directory
 # Carl Worth <cworth at east.isi.edu>
 # based on a script by Steve Redler IV, steve at sr-tech.com 5-21-2001
 # 2003-04-25 rea at sr.unh.edu
@@ -112,7 +112,7 @@
 	    echo "The Source field contain the URL's or filenames of the source code and any patches" 
 	    echo "used to build this package.  Either gnu-style tarballs or Debian source packages "
 	    echo "are acceptable.  Relative filenames may be used if they are distributed in the same"
-	    echo "directory as the .ipk file."
+	    echo "directory as the .opk file."
 	fi
 
 	disallowed_filename=`disallowed_field Filename`
@@ -158,7 +158,8 @@
 ogargs=""
 outer=ar
 noclean=0
-usage="Usage: $0 [-c] [-C] [-o owner] [-g group] <pkg_directory> [<destination_directory>]"
+ipkext=0
+usage="Usage: $0 [-c] [-C] [-i] [-o owner] [-g group] <pkg_directory> [<destination_directory>]"
 while getopts "cg:ho:v" opt; do
     case $opt in
 	o ) owner=$OPTARG
@@ -171,11 +172,17 @@
             ;;
         C ) noclean=1
             ;;
+	i ) ipkext=1
+	    ;;
 	v ) echo $version
 	    exit 0
 	    ;;
-	h ) 	echo $usage  >&2 ;;
-	\? ) 	echo $usage  >&2
+	h ) 	
+	    echo $usage  >&2 
+	    exit 0
+	    ;;
+	\? ) 	
+	    echo $usage  >&2
 	esac
 done
 
@@ -232,7 +239,12 @@
 
 echo "2.0" > $tmp_dir/debian-binary
 
-pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
+if (( $ipkext == 1)); then 
+	pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
+else
+	pkg_file=$dest_dir/${pkg}_${version}_${arch}.opk
+fi
+
 rm -f $pkg_file
 if [ "$outer" = "ar" ] ; then
   ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )

Modified: trunk/src/host/opkg-utils/opkg-buildpackage
===================================================================
--- trunk/src/host/opkg-utils/opkg-buildpackage	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/opkg-buildpackage	2008-07-28 10:29:45 UTC (rev 4560)
@@ -23,7 +23,7 @@
 #   * clean cleans ;-)
 #
 # You should run this with fakeroot (1) or as root.
-# If all went well, you will find a diff file and an *.ipk file in the
+# If all went well, you will find a diff file and an *.opk file in the
 # directory above.
 
 set -e
@@ -206,7 +206,7 @@
 	fi
 done
 
-# build the ipk package
+# build the opk package
 owd=`pwd`
 cd ..
 opkg-build /tmp/${pkg} || exit 1

Modified: trunk/src/host/opkg-utils/opkg-diff
===================================================================
--- trunk/src/host/opkg-utils/opkg-diff	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/opkg-diff	2008-07-28 10:29:45 UTC (rev 4560)
@@ -1,10 +1,10 @@
 #!/bin/sh
 
 pkg1=$1
-dir1=`echo $pkg1 | sed s/.ipk//`
+dir1=`echo $pkg1 | sed s/.opk//`
 dir1=`basename $dir1` 
 pkg2=$2
-dir2=`echo $pkg2 | sed s/.ipk//`
+dir2=`echo $pkg2 | sed s/.opk//`
 dir2=`basename $dir2` 
 
 opkg-unbuild $pkg2

Modified: trunk/src/host/opkg-utils/opkg-extract-file
===================================================================
--- trunk/src/host/opkg-utils/opkg-extract-file	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/opkg-extract-file	2008-07-28 10:29:45 UTC (rev 4560)
@@ -3,7 +3,7 @@
 set -e
 
 if [ $# -lt 1 ]; then
-	echo "usage: $0: package.ipk filename ..."
+	echo "usage: $0: package.opk filename ..."
 	exit 1
 fi
 
@@ -32,7 +32,7 @@
 tmpdir=/tmp/opkg-extract-$$
 mkdir $tmpdir
 
-pkgdir=$tmpdir/`basename $opkgfilename | sed 's/.*\///;s/.ipk$//;s/.deb$//'`
+pkgdir=$tmpdir/`basename $opkgfilename | sed 's/.*\///;s/.opk$//;s/.deb$//;s/.ipk$//'`
 
 mkdir -p $pkgdir/CONTROL
 

Modified: trunk/src/host/opkg-utils/opkg-list-fields
===================================================================
--- trunk/src/host/opkg-utils/opkg-list-fields	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/opkg-list-fields	2008-07-28 10:29:45 UTC (rev 4560)
@@ -3,7 +3,7 @@
 import sys, opkg
 
 def usage():
-     sys.stderr.write("%s ipk\n" % (sys.argv[0],))
+     sys.stderr.write("%s opk\n" % (sys.argv[0],))
      sys.exit(-1)
 
 if (len(sys.argv) < 2):

Modified: trunk/src/host/opkg-utils/opkg-make-index
===================================================================
--- trunk/src/host/opkg-utils/opkg-make-index	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/opkg-make-index	2008-07-28 10:29:45 UTC (rev 4560)
@@ -93,7 +93,7 @@
 
 if (verbose):
      sys.stderr.write("Reading in all the package info from %s\n" % (pkg_dir, ))
-files=glob(pkg_dir + '/*.ipk') + glob(pkg_dir + '/*.deb')
+files=glob(pkg_dir + '/*.opk') + glob(pkg_dir + '/*.deb') + glob(pkg_dir + '/*.ipk')
 files.sort()
 for filename in files:
      basename = os.path.basename(filename)

Modified: trunk/src/host/opkg-utils/opkg-unbuild
===================================================================
--- trunk/src/host/opkg-utils/opkg-unbuild	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/opkg-unbuild	2008-07-28 10:29:45 UTC (rev 4560)
@@ -3,13 +3,13 @@
 import sys, os, re
 
 if (len(sys.argv) == 0):
-    print 'usage: %s: package.ipk' % sys.argv[0]
+    print 'usage: %s: package.opk' % sys.argv[0]
     sys.exit(1)
 
 for filename in sys.argv[1:]:
     m = re.match('((.*/)*)(.*)', filename)
     pkg = m.group(3)
-    m = re.match('(.*)((.ipk)|(.deb))', filename)
+    m = re.match('(.*)((.opk)|(.deb)|(.ipk))', filename)
     if m:
         pkg = m.group(1)
 

Modified: trunk/src/host/opkg-utils/opkg.py
===================================================================
--- trunk/src/host/opkg-utils/opkg.py	2008-07-28 09:50:19 UTC (rev 4559)
+++ trunk/src/host/opkg-utils/opkg.py	2008-07-28 10:29:45 UTC (rev 4560)
@@ -355,7 +355,7 @@
 
                 bits = bits + " data.tar.gz"
 
-        file = "%s_%s_%s.ipk" % (self.package, self.version, self.architecture)
+        file = "%s_%s_%s.opk" % (self.package, self.version, self.architecture)
         cmd = "cd %s ; tar cvfz %s/%s %s" % (self.scratch_dir,
                                              dirname,
                                              file,





More information about the commitlog mailing list