opkg-util make .opk as the default file extension

"opkg-build -i ..."  means creating .ipk file for backward support
This commit is contained in:
Tick Chen
2008-07-28 10:29:45 +00:00
parent 234524f33d
commit 04e92b11ff
10 changed files with 31 additions and 19 deletions

View File

@@ -111,7 +111,7 @@ if __name__ == "__main__":
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")

View File

@@ -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

View File

@@ -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@east.isi.edu>
# based on a script by Steve Redler IV, steve@sr-tech.com 5-21-2001
# 2003-04-25 rea@sr.unh.edu
@@ -112,7 +112,7 @@ You probably want to chown these to a system user: " >&2
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 @@ You probably want to chown these to a system user: " >&2
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 @@ while getopts "cg:ho:v" opt; do
;;
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 @@ rm $tmp_dir/tarX
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 )

View File

@@ -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 @@ for i in ${files_optional} ; do
fi
done
# build the ipk package
# build the opk package
owd=`pwd`
cd ..
opkg-build /tmp/${pkg} || exit 1

View File

@@ -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

View File

@@ -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 @@ esac
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

View File

@@ -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):

View File

@@ -93,7 +93,7 @@ if old_filename:
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)

View File

@@ -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)

View File

@@ -355,7 +355,7 @@ class Package:
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,