All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils
@ 2011-01-25  6:25 Khem Raj
  2011-01-25  6:25 ` [PATCH 1/9] classes/package_ipk.bbclass, classes/sourceipk.bbclass: Use opkg-utils-native instead of ipkg-utils-native Khem Raj
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

From: Khem Raj <raj.khem@gmail.com>                                                                  

These patches replace usage of ipkg-utils with opkg-utils
in OE. I have built a native-sdk-image successfully on
angstrom-2008.1 and minimal

Please review and provide your feedback

-Khem



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/9] classes/package_ipk.bbclass, classes/sourceipk.bbclass: Use opkg-utils-native instead of ipkg-utils-native
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25  6:25 ` [PATCH 2/9] recipes/meta recipes/tasks: Replace ipkg-utils with opkg-utils Khem Raj
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 classes/package_ipk.bbclass |    4 ++--
 classes/sourceipk.bbclass   |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass
index 97e5cd8..fea678d 100644
--- a/classes/package_ipk.bbclass
+++ b/classes/package_ipk.bbclass
@@ -70,7 +70,7 @@ do_package_update_index_ipk[lockfiles] = "${DEPLOY_DIR_IPK}.lock"
 do_package_update_index_ipk[nostamp] = "1"
 do_package_update_index_ipk[recrdeptask] += "do_package_write_ipk"
 do_package_update_index_ipk[recrdeptask] += "do_package_write_ipk"
-do_package_update_index_ipk[depends] += "ipkg-utils-native:do_populate_sysroot"
+do_package_update_index_ipk[depends] += "opkg-utils-native:do_populate_sysroot"
 
 #
 # Update the Packages index files in ${DEPLOY_DIR_IPK}
@@ -315,7 +315,7 @@ python do_package_ipk () {
 python () {
     if bb.data.getVar('PACKAGES', d, True) != '':
         deps = (bb.data.getVarFlag('do_package_write_ipk', 'depends', d) or "").split()
-        deps.append('ipkg-utils-native:do_populate_sysroot')
+        deps.append('opkg-utils-native:do_populate_sysroot')
         deps.append('fakeroot-native:do_populate_sysroot')
         bb.data.setVarFlag('do_package_write_ipk', 'depends', " ".join(deps), d)
 }
diff --git a/classes/sourceipk.bbclass b/classes/sourceipk.bbclass
index 17a7cdd..b443ef6 100644
--- a/classes/sourceipk.bbclass
+++ b/classes/sourceipk.bbclass
@@ -34,9 +34,9 @@
 # Need to figure out how to use ipkg-build in this class.
 # I tried adding it as a dependency for the do_create_srcipk
 # task using:
-#   do_create_srcipk[depends] += "ipkg-utils-native:do_populate_sysroot"
+#   do_create_srcipk[depends] += "opkg-utils-native:do_populate_sysroot"
 # But then there is a circular dependency between sourcipk.bbclass and
-# ipkg-utils-native.  Until I can figure out how to resolve this
+# opkg-utils-native.  Until I can figure out how to resolve this
 # circular dependency I am extracting the needed pieces from ipkg-build
 # into this class and building the source ipk myself.
 
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/9] recipes/meta recipes/tasks: Replace ipkg-utils with opkg-utils
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
  2011-01-25  6:25 ` [PATCH 1/9] classes/package_ipk.bbclass, classes/sourceipk.bbclass: Use opkg-utils-native instead of ipkg-utils-native Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25  6:25 ` [PATCH 3/9] slugos.inc: Dont lock SRCDATE for ipkg, its not used anymore Khem Raj
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 recipes/meta/canadian-sdk.bb         |    2 +-
 recipes/meta/foonas-packages.bb      |    2 +-
 recipes/meta/meta-toolchain.bb       |    2 +-
 recipes/meta/openprotium-packages.bb |    2 +-
 recipes/meta/oplinux-packages.bb     |    2 +-
 recipes/meta/package-index.bb        |    2 +-
 recipes/meta/slugos-packages.bb      |    2 +-
 recipes/tasks/task-sdk-sbox-gpe.bb   |    2 +-
 recipes/tasks/task-shr-feed.bb       |    2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/recipes/meta/canadian-sdk.bb b/recipes/meta/canadian-sdk.bb
index 701a02d..93b80b2 100644
--- a/recipes/meta/canadian-sdk.bb
+++ b/recipes/meta/canadian-sdk.bb
@@ -1,6 +1,6 @@
 DESCRIPTION = "Meta package for building a installable toolchain"
 LICENSE = "MIT"
-DEPENDS = "opkg-native ipkg-utils-native fakeroot-native sed-native zip-native"
+DEPENDS = "opkg-native opkg-utils-native fakeroot-native sed-native zip-native"
 PR = "r5"
 
 # NOTE: We need to save and restore PACKAGE_ARCHS, because sdk.bbclass
diff --git a/recipes/meta/foonas-packages.bb b/recipes/meta/foonas-packages.bb
index 2bd8437..570c26e 100644
--- a/recipes/meta/foonas-packages.bb
+++ b/recipes/meta/foonas-packages.bb
@@ -74,7 +74,7 @@ FOONAS_PACKAGES = "\
 	gtk-doc \
 	gzip \
 	hdparm \
-	ipkg-utils \
+	opkg-utils \
 	iptables \
 	ircp \
 	joe \
diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
index cb9e438..b8ea037 100644
--- a/recipes/meta/meta-toolchain.bb
+++ b/recipes/meta/meta-toolchain.bb
@@ -1,6 +1,6 @@
 DESCRIPTION = "Meta package for building a installable toolchain"
 LICENSE = "MIT"
-DEPENDS = "opkg-native ipkg-utils-native fakeroot-native sed-native"
+DEPENDS = "opkg-native opkg-utils-native fakeroot-native sed-native"
 
 inherit meta
 
diff --git a/recipes/meta/openprotium-packages.bb b/recipes/meta/openprotium-packages.bb
index 4b10ee2..a738f08 100644
--- a/recipes/meta/openprotium-packages.bb
+++ b/recipes/meta/openprotium-packages.bb
@@ -106,7 +106,7 @@ OPENPROTIUM_PACKAGES = "\
 	gzip \
 	hdparm \
 	ifupdown \
-	ipkg-utils \
+	opkg-utils \
 	iptables \
 	ircp \
 	joe \
diff --git a/recipes/meta/oplinux-packages.bb b/recipes/meta/oplinux-packages.bb
index d828eed..ab38c1d 100644
--- a/recipes/meta/oplinux-packages.bb
+++ b/recipes/meta/oplinux-packages.bb
@@ -201,7 +201,7 @@ PACKAGES_LIST = "\
         hydra \
 	ifupdown \
         iputils \
-	ipkg-utils \
+	opkg-utils \
 	iptables \
         intercom \
 	ircp \
diff --git a/recipes/meta/package-index.bb b/recipes/meta/package-index.bb
index 335970d..3ad1d10 100644
--- a/recipes/meta/package-index.bb
+++ b/recipes/meta/package-index.bb
@@ -1,6 +1,6 @@
 DESCRIPTION = "Rebuild the package index"
 LICENSE = "MIT"
-DEPENDS = "ipkg-utils-native"
+DEPENDS = "opkg-utils-native"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
diff --git a/recipes/meta/slugos-packages.bb b/recipes/meta/slugos-packages.bb
index fb8458a..3487c69 100644
--- a/recipes/meta/slugos-packages.bb
+++ b/recipes/meta/slugos-packages.bb
@@ -99,7 +99,7 @@ SLUGOS_PACKAGES = "\
 	ifupdown \
 	iozone3 \
 	iperf \
-	ipkg-utils \
+	opkg-utils \
 	iptables \
 	joe \
 	jpeg \
diff --git a/recipes/tasks/task-sdk-sbox-gpe.bb b/recipes/tasks/task-sdk-sbox-gpe.bb
index 315bddb..b8d1cce 100644
--- a/recipes/tasks/task-sdk-sbox-gpe.bb
+++ b/recipes/tasks/task-sdk-sbox-gpe.bb
@@ -11,7 +11,7 @@ RDEPENDS_${PN} = "\
     gdk-pixbuf-loader-xpm \
     intltool \
     intltool-dev \
-    ipkg-utils \
+    opkg-utils \
     gettext-dev \
     pkgconfig-dev \
     autoconf \
diff --git a/recipes/tasks/task-shr-feed.bb b/recipes/tasks/task-shr-feed.bb
index daec242..35e5f0b 100644
--- a/recipes/tasks/task-shr-feed.bb
+++ b/recipes/tasks/task-shr-feed.bb
@@ -79,7 +79,7 @@ RDEPENDS_${PN} += "\
 		mtpaint \
 		telepathy-python \
 		intone-video \
-		ipkg-utils \
+		opkg-utils \
 		mysql \
 		fltk-chess \
 		remoko \
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/9] slugos.inc: Dont lock SRCDATE for ipkg, its not used anymore
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
  2011-01-25  6:25 ` [PATCH 1/9] classes/package_ipk.bbclass, classes/sourceipk.bbclass: Use opkg-utils-native instead of ipkg-utils-native Khem Raj
  2011-01-25  6:25 ` [PATCH 2/9] recipes/meta recipes/tasks: Replace ipkg-utils with opkg-utils Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25  6:25 ` [PATCH 4/9] ipkg-utils: Remove the recipes Khem Raj
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 conf/distro/include/slugos.inc |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/conf/distro/include/slugos.inc b/conf/distro/include/slugos.inc
index e59d7f0..837e422 100644
--- a/conf/distro/include/slugos.inc
+++ b/conf/distro/include/slugos.inc
@@ -141,9 +141,6 @@ PREFERRED_PROVIDER_virtual/libx11-native        ?= "libx11-native"
 PREFERRED_PROVIDER_virtual/db			= "db"
 PREFERRED_PROVIDER_virtual/db-native		= "db-native"
 
-SRCDATE_ipkg-utils				?= "20060106"
-SRCDATE_ipkg-utils-native			?= "20060106"
-SRCDATE_ipkg-link				?= "20060106"
 SRCDATE_irssi					?= "20050930"
 
 # We want the newer util-linux package
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/9] ipkg-utils: Remove the recipes
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
                   ` (2 preceding siblings ...)
  2011-01-25  6:25 ` [PATCH 3/9] slugos.inc: Dont lock SRCDATE for ipkg, its not used anymore Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25  6:25 ` [PATCH 5/9] classes: Replace ipkg-make-index with opkg-make-index Khem Raj
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

* So that they are not accidently used in future

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 recipes/ipkg-utils/ipkg-link/link-vfat-libs.patch  |   34 --
 recipes/ipkg-utils/ipkg-link_1.6+cvs20050404.bb    |   20 --
 .../ipkg-utils-native_1.6+cvs20050404.bb           |   20 --
 .../ipkg-utils/arfile_even_alignment.patch         |   11 -
 .../ipkg-utils/arfile_header_split.patch           |   16 -
 recipes/ipkg-utils/ipkg-utils/fields_tweaks.patch  |   70 -----
 recipes/ipkg-utils/ipkg-utils/ipkg-env.patch       |   54 ----
 .../ipkg-utils/ipkg-make-index-track-stamps.patch  |   88 ------
 .../ipkg-utils/ipkg-py-sane-vercompare.patch       |   51 ----
 .../ipkg-utils/ipkg-utils/ipkg-py-tarfile.patch    |  316 --------------------
 recipes/ipkg-utils/ipkg-utils/ipkg-utils-fix.patch |   20 --
 recipes/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb   |   38 ---
 12 files changed, 0 insertions(+), 738 deletions(-)
 delete mode 100644 recipes/ipkg-utils/ipkg-link/link-vfat-libs.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-link_1.6+cvs20050404.bb
 delete mode 100644 recipes/ipkg-utils/ipkg-utils-native_1.6+cvs20050404.bb
 delete mode 100644 recipes/ipkg-utils/ipkg-utils/arfile_even_alignment.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-utils/arfile_header_split.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-utils/fields_tweaks.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-utils/ipkg-env.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-utils/ipkg-make-index-track-stamps.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-utils/ipkg-py-sane-vercompare.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-utils/ipkg-py-tarfile.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-utils/ipkg-utils-fix.patch
 delete mode 100644 recipes/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb

diff --git a/recipes/ipkg-utils/ipkg-link/link-vfat-libs.patch b/recipes/ipkg-utils/ipkg-link/link-vfat-libs.patch
deleted file mode 100644
index 7f495f9..0000000
--- a/recipes/ipkg-utils/ipkg-link/link-vfat-libs.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- ipkg-utils/ipkg-link.orig	2006-04-05 00:08:28.518992136 +0200
-+++ ipkg-utils/ipkg-link	2006-04-05 00:08:40.399186072 +0200
-@@ -58,6 +58,31 @@
- 				`ln -s "$PREFIX$line" "$line"`
- 			fi
- 		fi
-+		
-+		# The next function checks whether the _source_ file (ie: /media/card/something)
-+		# does actually exist. If it doesn't, it could by a library symlink (ie: libsomething.0.1 -> libsomething.0)
-+		# Since VFAT & friends do not support symlinks, these library links would not exist after installation
-+		# and trying to symlink them into the rootfs with ipkg-link results in unconnected symlinks in the rootfs.
-+		# So we use the real lib file in /media/card/whatever and create all needed symlinks in the rootfs
-+		# using the real file as source.
-+                               
-+		if [ ! -e "$PREFIX$line" ]; then
-+			if ( echo "$line" | grep -q "lib" ) ; then
-+				libsearchfile=$(echo $line | sed -e "s#[a-z0-9/.]*/##g")
-+				libfoundfiles=$(find $PREFIX -name "$libsearchfile*")
-+                      
-+				for liblinkfile in $libfoundfiles; do
-+					echo "Linking $line to $liblinkfile"
-+					# link will be pointing to nowhere
-+					if test -L $line; then
-+						rm -f $line
-+					fi
-+				ln -s $liblinkfile $line 
-+	                      done
-+			else
-+				echo "WARNING: Source file [$PREFIX$line] is missing!"
-+			fi
-+                fi
- 	done
- }
- 
diff --git a/recipes/ipkg-utils/ipkg-link_1.6+cvs20050404.bb b/recipes/ipkg-utils/ipkg-link_1.6+cvs20050404.bb
deleted file mode 100644
index 6a80d01..0000000
--- a/recipes/ipkg-utils/ipkg-link_1.6+cvs20050404.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SECTION = "base"
-DESCRIPTION = "Itsy Package Manager utilities link script"
-LICENSE = "GPLv2+"
-CONFLICTS = "ipkg-utils"
-SRCDATE = "20050930"
-PR = "r4"
-
-SRC_URI = "${HANDHELDS_CVS};module=ipkg-utils \
-	   file://link-vfat-libs.patch"
-
-S = "${WORKDIR}/ipkg-utils"
-
-do_compile() {
-	:
-}
-
-do_install() {
-	install -d ${D}${bindir}
-	install -m 0755 ipkg-link ${D}${bindir}
-}
diff --git a/recipes/ipkg-utils/ipkg-utils-native_1.6+cvs20050404.bb b/recipes/ipkg-utils/ipkg-utils-native_1.6+cvs20050404.bb
deleted file mode 100644
index 3a6aaed..0000000
--- a/recipes/ipkg-utils/ipkg-utils-native_1.6+cvs20050404.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-require ipkg-utils_${PV}.bb
-
-RDEPENDS_${PN} = ""
-PR = "r25"
-
-inherit native
-
-NATIVE_INSTALL_WORKS = "1"
-
-# Avoid circular dependencies from package_ipk.bbclass
-PACKAGES = ""
-FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/ipkg-utils"
-INSTALL += "arfile.py"
-
-do_install() {
-	install -d ${D}${bindir}
-        for i in ${INSTALL}; do
-                install -m 0755 $i ${D}${bindir}
-        done
-}
diff --git a/recipes/ipkg-utils/ipkg-utils/arfile_even_alignment.patch b/recipes/ipkg-utils/ipkg-utils/arfile_even_alignment.patch
deleted file mode 100644
index 3ab133f..0000000
--- a/recipes/ipkg-utils/ipkg-utils/arfile_even_alignment.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ipkg-utils/arfile.py.orig	2008-06-11 21:07:01.000000000 -0500
-+++ ipkg-utils/arfile.py	2008-06-14 19:56:04.000000000 -0500
-@@ -86,6 +86,8 @@
-                 return FileSection(self.f, self.f.tell(), size)
- 
-             # Skip data and loop
-+            if size % 2:
-+                size = size + 1
-             data = self.f.seek(size, 1)
- #            print hex(f.tell())
- 
diff --git a/recipes/ipkg-utils/ipkg-utils/arfile_header_split.patch b/recipes/ipkg-utils/ipkg-utils/arfile_header_split.patch
deleted file mode 100644
index ce1993b..0000000
--- a/recipes/ipkg-utils/ipkg-utils/arfile_header_split.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- ipkg-utils/arfile.py.orig	2010-09-29 13:38:15.000000000 -0700
-+++ ipkg-utils/arfile.py	2010-10-01 16:06:00.000000000 -0700
-@@ -74,7 +74,12 @@
-             if l == "\n":
-                 l = self.f.readline()
-                 if not l: break
--            descriptor = l.split()
-+            # Field lengths from /usr/include/ar.h:
-+            ar_field_lens = [ 16, 12, 6, 6, 8, 10, 2 ]
-+            descriptor = []
-+            for field_len in ar_field_lens:
-+                descriptor.append(l[:field_len].strip())
-+                l = l[field_len:]
- #            print descriptor
-             size = int(descriptor[5])
-             memberName = descriptor[0][:-1]
diff --git a/recipes/ipkg-utils/ipkg-utils/fields_tweaks.patch b/recipes/ipkg-utils/ipkg-utils/fields_tweaks.patch
deleted file mode 100644
index 2b08e47..0000000
--- a/recipes/ipkg-utils/ipkg-utils/fields_tweaks.patch
+++ /dev/null
@@ -1,70 +0,0 @@
----
- Makefile         |    2 ++
- ipkg-list-fields |   13 +++++++++++++
- ipkg.py          |    8 +++++++-
- 3 files changed, 22 insertions(+), 1 deletion(-)
-
-Index: ipkg-utils/Makefile
-===================================================================
---- ipkg-utils.orig/Makefile	2007-06-13 22:45:47.000000000 +0100
-+++ ipkg-utils/Makefile	2007-06-13 22:46:50.000000000 +0100
-@@ -15,6 +15,8 @@ install: ${UTILS}
- 	python setup.py install
- 	chmod agu+rx ipkg-make-index
- 	cp -f ipkg-make-index $(PREFIX)/bin
-+	chmod agu+rx ipkg-list-fields
-+	cp -f ipkg-list-fields $(PREFIX)/bin
- 
- binary: build
- 	mkdir -p ipkg-build-binary/usr/bin
-Index: ipkg-utils/ipkg-list-fields
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ ipkg-utils/ipkg-list-fields	2007-06-13 22:43:32.000000000 +0100
-@@ -0,0 +1,13 @@
-+#!/usr/bin/python
-+
-+import sys, ipkg
-+
-+def usage():
-+     sys.stderr.write("%s ipk\n" % (sys.argv[0],))
-+     sys.exit(-1)
-+
-+if (len(sys.argv) < 2):
-+     usage()
-+
-+print ipkg.Package(sys.argv[1])
-+
-Index: ipkg-utils/ipkg.py
-===================================================================
---- ipkg-utils.orig/ipkg.py	2007-06-13 22:44:50.000000000 +0100
-+++ ipkg-utils/ipkg.py	2007-06-13 22:39:44.000000000 +0100
-@@ -139,6 +139,9 @@ class Package:
-         self.installed_size = None
-         self.filename = None
-         self.isdeb = 0
-+        self.homepage = None
-+        self.oe = None
-+        self.priority = None
-         self.fn = fn
- 
- 	if fn:
-@@ -211,7 +214,7 @@ class Package:
-                 elif self.__dict__.has_key(name):
-                     self.__dict__[name] = value
- 		else:
--		    #print "Lost field %s, %s" % (name,value)
-+		    print "Lost field %s, %s" % (name,value)
-                     pass
- 
-                 if line and line[0] == '\n':
-@@ -402,6 +405,9 @@ class Package:
-         if self.filename: out = out + "Filename: %s\n" % (self.filename)
-         if self.source: out = out + "Source: %s\n" % (self.source)
-         if self.description: out = out + "Description: %s\n" % (self.description)
-+        if self.oe: out = out + "OE: %s\n" % (self.oe)
-+        if self.homepage: out = out + "HomePage: %s\n" % (self.homepage)
-+        if self.priority: out = out + "Priority: %s\n" % (self.priority)
- 	out = out + "\n"
- 
- 	return out
diff --git a/recipes/ipkg-utils/ipkg-utils/ipkg-env.patch b/recipes/ipkg-utils/ipkg-utils/ipkg-env.patch
deleted file mode 100644
index 7d3025d..0000000
--- a/recipes/ipkg-utils/ipkg-utils/ipkg-env.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-diff -Nur ipkg-utils.orig/ipkg-list-fields ipkg-utils/ipkg-list-fields
---- ipkg-utils.orig/ipkg-list-fields	2009-01-17 21:52:36.000000000 +0100
-+++ ipkg-utils/ipkg-list-fields	2009-01-17 21:55:08.000000000 +0100
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/env python
- 
- import sys, ipkg
- 
-diff -Nur ipkg-utils.orig/ipkg-make-index ipkg-utils/ipkg-make-index
---- ipkg-utils.orig/ipkg-make-index	2009-01-17 21:52:36.000000000 +0100
-+++ ipkg-utils/ipkg-make-index	2009-01-17 21:55:13.000000000 +0100
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/env python
- # $Id: ipkg-make-index,v 1.22 2005/03/03 16:39:04 jamey Exp $
- 
- import sys, os, posixpath
-diff -Nur ipkg-utils.orig/ipkg-show-deps ipkg-utils/ipkg-show-deps
---- ipkg-utils.orig/ipkg-show-deps	2009-01-17 21:52:36.000000000 +0100
-+++ ipkg-utils/ipkg-show-deps	2009-01-17 21:55:21.000000000 +0100
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/env python
- # $Id: ipkg-show-deps,v 1.2 2004/03/06 13:08:33 pb Exp $
- 
- import sys, os, posixpath
-diff -Nur ipkg-utils.orig/ipkg-unbuild ipkg-utils/ipkg-unbuild
---- ipkg-utils.orig/ipkg-unbuild	2009-01-17 21:52:35.000000000 +0100
-+++ ipkg-utils/ipkg-unbuild	2009-01-17 21:55:24.000000000 +0100
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/env python
- 
- import sys, os, re
- 
-diff -Nur ipkg-utils.orig/ipkg-update-index ipkg-utils/ipkg-update-index
---- ipkg-utils.orig/ipkg-update-index	2009-01-17 21:52:36.000000000 +0100
-+++ ipkg-utils/ipkg-update-index	2009-01-17 21:55:29.000000000 +0100
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2.1
-+#!/usr/bin/env python
- 
- import sys, os
- from glob import glob
-diff -Nur ipkg-utils.orig/ipkg-upload ipkg-utils/ipkg-upload
---- ipkg-utils.orig/ipkg-upload	2009-01-17 21:52:36.000000000 +0100
-+++ ipkg-utils/ipkg-upload	2009-01-17 21:55:33.000000000 +0100
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/env python
- 
- import sys, os, os.path, re
- 
diff --git a/recipes/ipkg-utils/ipkg-utils/ipkg-make-index-track-stamps.patch b/recipes/ipkg-utils/ipkg-utils/ipkg-make-index-track-stamps.patch
deleted file mode 100644
index 68758ed..0000000
--- a/recipes/ipkg-utils/ipkg-utils/ipkg-make-index-track-stamps.patch
+++ /dev/null
@@ -1,88 +0,0 @@
----
- ipkg-make-index |   31 +++++++++++++++++++++++++++----
- 1 file changed, 27 insertions(+), 4 deletions(-)
-
-Index: ipkg-utils/ipkg-make-index
-===================================================================
---- ipkg-utils.orig/ipkg-make-index	2007-05-26 23:45:56.000000000 +0100
-+++ ipkg-utils/ipkg-make-index	2007-05-26 23:47:25.000000000 +0100
-@@ -40,6 +40,7 @@ def to_locale(filename, locale):
- old_filename = None
- packages_filename = None
- filelist_filename = "Packages.filelist"
-+stamplist_filename = "Packages.stamps"
- opt_s = 0
- opt_m = 0
- (opts, remaining_args) = getopt.getopt(sys.argv[1:], "hl:p:vsmr:L:")
-@@ -50,6 +51,7 @@ for (optkey, optval) in opts:
-           opt_s = 1
-      if optkey == '-p': 
-           packages_filename = optval
-+          stamplist_filename = optval + ".stamps"
-      if optkey == '-l':
-           filelist_filename = optval
-      if optkey == '-v':
-@@ -72,6 +74,7 @@ old_pkg_hash = {}
- if packages_filename and not old_filename and os.path.exists(packages_filename):
-      old_filename = packages_filename
- 
-+pkgsStamps = {}
- if old_filename:
-      if (verbose):
-           sys.stderr.write("Reading package list from " + old_filename + "\n")
-@@ -80,6 +83,14 @@ if old_filename:
-      for k in old_packages.packages.keys():
-           p = old_packages.packages[k]
-           old_pkg_hash[p.filename] = p
-+     try:
-+        f = open(stamplist_filename, "r")
-+        for l in f:
-+            l = l.strip()
-+            s, f = l.split(" ", 1)
-+            pkgsStamps[f] = int(s)
-+     except IOError:
-+        pass
- 
- if (verbose):
-      sys.stderr.write("Reading in all the package info from %s\n" % (pkg_dir, ))
-@@ -87,11 +98,17 @@ files=glob(pkg_dir + '/*.ipk') + glob(pk
- files.sort()
- for filename in files:
-      basename = os.path.basename(filename)
-+     pkg = None
-+     fnameStat = os.stat(filename)
-      if old_pkg_hash.has_key(basename):
--          if (verbose):
-+          if pkgsStamps.has_key(basename) and int(fnameStat.st_mtime) == pkgsStamps[basename]:
-+            if (verbose):
-                sys.stderr.write("Found %s in Packages\n" % (filename,))
--          pkg = old_pkg_hash[basename]
--     else:
-+            pkg = old_pkg_hash[basename]
-+          else:
-+               sys.stderr.write("Found %s in Packages, but mtime differs - re-reading\n" % (filename,))
-+
-+     if not pkg:
-           if (verbose):
-                sys.stderr.write("Reading info for package %s\n" % (filename,))
-           pkg = ipkg.Package(filename)
-@@ -101,6 +118,7 @@ for filename in files:
-      else:
-           old_filename = ""
-      s = packages.add_package(pkg)
-+     pkgsStamps[basename] = fnameStat.st_mtime
-      if s == 0:
-           if old_filename:
-                # old package was displaced by newer
-@@ -114,6 +132,11 @@ for filename in files:
-           if opt_s:
-                print filename
- 
-+pkgsStampsFile = open(stamplist_filename, "w")
-+for f in pkgsStamps.keys():
-+    pkgsStampsFile.write("%d %s\n" % (pkgsStamps[f], f))
-+pkgsStampsFile.close()
-+
- if opt_s:
-      sys.exit(0)
- 
diff --git a/recipes/ipkg-utils/ipkg-utils/ipkg-py-sane-vercompare.patch b/recipes/ipkg-utils/ipkg-utils/ipkg-py-sane-vercompare.patch
deleted file mode 100644
index 00ee391..0000000
--- a/recipes/ipkg-utils/ipkg-utils/ipkg-py-sane-vercompare.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Only in ipkg-utils: ipkg-py-sane-vercompare.patch
-diff -ur ipkg-utils.org/ipkg.py ipkg-utils/ipkg.py
---- ipkg-utils.org/ipkg.py	2005-01-08 18:08:52.000000000 +0000
-+++ ipkg-utils/ipkg.py	2007-04-04 11:52:46.000000000 +0000
-@@ -48,9 +48,9 @@
-         self.epoch = epoch
-         self.version = version
- 
--    def _versioncompare(self, ref):
--        selfversion = self.version
--        refversion = ref.version
-+    def _versioncompare(self, selfversion, refversion):
-+        if not selfversion: selfversion = ""
-+        if not refversion: refversion = ""
-         while 1:
-             ## first look for non-numeric version component
-             selfm = re.match('([^0-9]*)(.*)', selfversion)
-@@ -89,7 +89,18 @@
-         elif (self.epoch < ref.epoch):
-             return -1
-         else:
--            return self._versioncompare(ref)
-+	    self_ver_comps = re.match(r"(.+?)(-r.+)?$", self.version)
-+	    ref_ver_comps = re.match(r"(.+?)(-r.+)?$", ref.version)
-+	    #print (self_ver_comps.group(1), self_ver_comps.group(2))
-+	    #print (ref_ver_comps.group(1), ref_ver_comps.group(2))
-+	    r = self._versioncompare(self_ver_comps.group(1), ref_ver_comps.group(1))
-+	    if r == 0:
-+		r = self._versioncompare(self_ver_comps.group(2), ref_ver_comps.group(2))
-+	    #print "compare: %s vs %s = %d" % (self, ref, r)
-+	    return r
-+
-+    def __str__(self):
-+        return str(self.epoch) + ":" + self.version
- 
- def parse_version(versionstr):
-     epoch = 0
-@@ -445,6 +456,13 @@
-         return self.packages[key]
- 
- if __name__ == "__main__":
-+
-+    assert Version(0, "1.2.2-r1").compare(Version(0, "1.2.3-r0")) == -1
-+    assert Version(0, "1.2.2-r0").compare(Version(0, "1.2.2+cvs20070308-r0")) == -1
-+    assert Version(0, "1.2.2+cvs20070308").compare(Version(0, "1.2.2-r0")) == 1
-+    assert Version(0, "1.2.2-r0").compare(Version(0, "1.2.2-r0")) == 0
-+    assert Version(0, "1.2.2-r5").compare(Version(0, "1.2.2-r0")) == 1
-+
-     package = Package()
- 
-     package.set_package("FooBar")
diff --git a/recipes/ipkg-utils/ipkg-utils/ipkg-py-tarfile.patch b/recipes/ipkg-utils/ipkg-utils/ipkg-py-tarfile.patch
deleted file mode 100644
index 10fdbe3..0000000
--- a/recipes/ipkg-utils/ipkg-utils/ipkg-py-tarfile.patch
+++ /dev/null
@@ -1,316 +0,0 @@
-Index: ipkg-utils/arfile.py
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ ipkg-utils/arfile.py	2008-05-30 15:33:49.000000000 +0100
-@@ -0,0 +1,124 @@
-+"""
-+arfile - A module to parse GNU ar archives.
-+
-+Copyright (c) 2006-7 Paul Sokolovsky
-+This file is released under the terms 
-+of GNU General Public License v2 or later.
-+"""
-+import sys
-+import os
-+import tarfile 
-+
-+
-+class FileSection:
-+    "A class which allows to treat portion of file as separate file object."
-+
-+    def __init__(self, f, offset, size):
-+        self.f = f
-+        self.offset = offset
-+        self.size = size
-+        self.seek(0, 0)
-+
-+    def seek(self, offset, whence = 0):
-+#        print "seek(%x, %d)" % (offset, whence)
-+        if whence == 0:
-+            return self.f.seek(offset + self.offset, whence)
-+        elif whence == 1:
-+            return self.f.seek(offset, whence)
-+        elif whence == 2:
-+            return self.f.seek(self.offset + self.size + offset, 0)
-+        else:
-+            assert False
-+
-+    def tell(self):
-+#        print "tell()"
-+        return self.f.tell() - self.offset
-+
-+    def read(self, size = -1):
-+#        print "read(%d)" % size
-+        return self.f.read(size)
-+
-+class ArFile:
-+
-+    def __init__(self, f):
-+        self.f = f
-+        self.directory = {}
-+        self.directoryRead = False
-+
-+        signature = self.f.readline()
-+        assert signature == "!<arch>\n"
-+        self.directoryOffset = self.f.tell()
-+
-+    def open(self, fname):
-+        if self.directory.has_key(fname):
-+            return FileSection(self.f, self.directory[fname][-1], int(self.directory[fname][5]))
-+
-+        if self.directoryRead:
-+            raise IOError, (2, "AR member not found: " + fname)
-+
-+        f = self._scan(fname)
-+        if f == None:
-+            raise IOError, (2, "AR member not found: " + fname)
-+        return f
-+
-+
-+    def _scan(self, fname):
-+        self.f.seek(self.directoryOffset, 0)
-+
-+        while True:
-+            l = self.f.readline()
-+            if not l: 
-+                self.directoryRead = True
-+                return None
-+
-+            if l == "\n":
-+                l = self.f.readline()
-+                if not l: break
-+            descriptor = l.split()
-+#            print descriptor
-+            size = int(descriptor[5])
-+            memberName = descriptor[0][:-1]
-+            self.directory[memberName] = descriptor + [self.f.tell()]
-+#            print "read:", memberName
-+            if memberName == fname or (memberName.startswith("`") and memberName[1:] == fname):
-+                # Record directory offset to start from next time
-+                self.directoryOffset = self.f.tell() + size
-+                return FileSection(self.f, self.f.tell(), size)
-+
-+            # Skip data and loop
-+            data = self.f.seek(size, 1)
-+#            print hex(f.tell())
-+
-+
-+if __name__ == "__main__":
-+    if None:
-+        f = open(sys.argv[1], "rb")
-+
-+        ar = ArFile(f)
-+        tarStream = ar.open("data.tar.gz")
-+        print "--------"
-+        tarStream = ar.open("data.tar.gz")
-+        print "--------"
-+        tarStream = ar.open("control.tar.gz")
-+        print "--------"
-+        tarStream = ar.open("control.tar.gz2")
-+
-+        sys.exit(0)
-+
-+
-+    dir = "."
-+    if len(sys.argv) > 1:
-+        dir = sys.argv[1]
-+    for f in os.listdir(dir):
-+        if not f.endswith(".ipk"): continue
-+
-+        print "=== %s ===" % f
-+        f = open(dir + "/" + f, "rb")
-+
-+        ar = ArFile(f)
-+        tarStream = ar.open("control.tar.gz")
-+        tarf = tarfile.open("control.tar.gz", "r", tarStream)
-+        #tarf.list()
-+
-+        f2 = tarf.extractfile("control")
-+        print f2.read()
-Index: ipkg-utils/ipkg.py
-===================================================================
---- ipkg-utils.orig/ipkg.py	2008-05-30 15:33:49.000000000 +0100
-+++ ipkg-utils/ipkg.py	2008-05-30 15:35:58.000000000 +0100
-@@ -41,6 +41,8 @@
- import string
- import commands
- from stat import ST_SIZE
-+import arfile
-+import tarfile
- 
- class Version:
-     """A class for holding parsed package version information."""
-@@ -131,78 +133,63 @@
- 	self.section = None
-         self.filename_header = None
- 	self.file_list = []
--        self.md5 = None
-+        # md5 is lazy attribute, computed on demand
-+        #self.md5 = None
-         self.size = None
-         self.installed_size = None
-         self.filename = None
-         self.isdeb = 0
-+        self.fn = fn
- 
- 	if fn:
-             # see if it is deb format
--            f = open(fn, "r")
-+            f = open(fn, "rb")
-             magic = f.read(4)
--            f.close()
-+            f.seek(0, 0)
-             if (magic == "!<ar"):
-                 self.isdeb = 1
- 
--            # compute the MD5.
--            f = open(fn, "r")
--            sum = md5.new()
--            while 1:
--                data = f.read(1024)
--                if not data: break
--                sum.update(data)
--            f.close()
--            if sys.version[:1] > '2':
--                # when using Python 2.0 or newer
--                self.md5 = sum.hexdigest() 
--            else:
--                self.md5 = string.join(map((lambda x:"%02x" % ord(x)),sum.digest()),'')
-             stat = os.stat(fn)
--            self.size = stat[ST_SIZE]
-+            self.size = stat[ST_SIZE]    
-             self.filename = os.path.basename(fn)
- 	    ## sys.stderr.write("  extracting control.tar.gz from %s\n"% (fn,)) 
--            if self.isdeb:
--                control = os.popen("ar p "+fn+" control.tar.gz | tar xfzO - './control'","r")
--            else:
--                control = os.popen("tar xfzO "+fn+" 'control.tar.gz' | tar xfzO - './control'","r")
--            line = control.readline()
--            while 1:
--                if not line: break
--                line = string.rstrip(line)
--                lineparts = re.match(r'([\w-]*?):\s*(.*)', line)
--		if lineparts:
--                    name = string.lower(lineparts.group(1))
--		    value = lineparts.group(2)
--		    while 1:
--			line = control.readline()
--			if not line: break
--			if line[0] != ' ': break
--                        line = string.rstrip(line)
--			value = value + '\n' + line
--                    # don't allow package to override its own filename
--                    if name == "filename":
--                        self.filename_header = value
--                    else:
--                        if self.__dict__.has_key(name):
--                            self.__dict__[name] = value
--                else:
--                    line = control.readline()
-+	    if self.isdeb:
-+        	ar = arfile.ArFile(f)
-+        	tarStream = ar.open("control.tar.gz")
-+        	tarf = tarfile.open("control.tar.gz", "r", tarStream)
-+
-+        	try:
-+        	    control = tarf.extractfile("control")
-+        	except KeyError:
-+        	    control = tarf.extractfile("./control")
-+	    else:
-+		control = os.popen("tar --wildcards -xzO -f " + fn + " '*control.tar.gz' | tar xfzO - './control'", "r")
-+
-+            self.read_control(control)
-             control.close()
--            if self.isdeb:
--                data = os.popen("ar p "+fn+" data.tar.gz | tar tfz -","r")
--            else:
--                data = os.popen("tar xfzO "+fn+" '*data.tar.gz' | tar tfz -","r")
--            while 1:
--                line = data.readline()
--                if not line: break
--                self.file_list.append(string.rstrip(line))
--            data.close()
- 
- 	self.scratch_dir = None
- 	self.file_dir = None
- 	self.meta_dir = None
- 
-+    def __getattr__(self, name):
-+        if name == "md5":
-+            self._computeFileMD5()
-+            return self.md5
-+        else:
-+            raise AttributeError, name
-+
-+    def _computeFileMD5(self):
-+        # compute the MD5.
-+        f = open(self.fn, "rb")
-+        sum = md5.new()
-+        while 1:
-+            data = f.read(1024)
-+            if not data: break
-+            sum.update(data)
-+        f.close()
-+        self.md5 = sum.hexdigest()
-+
-     def read_control(self, control):
-         import os
- 
-@@ -221,9 +208,15 @@
-                     value = value + '\n' + line
-                 if name == 'size':
-                     self.size = int(value)
-+	        elif name == 'md5sum':
-+                    self.md5 = value
-                 elif self.__dict__.has_key(name):
-                     self.__dict__[name] = value
--                if line[0] == '\n':
-+		else:
-+		    #print "Lost field %s, %s" % (name,value)
-+                    pass
-+
-+                if line and line[0] == '\n':
-                     return # consumes one blank line at end of package descriptoin
-             else:
-                 line = control.readline()
-@@ -314,7 +307,27 @@
- 	return self.section
- 
-     def get_file_list(self):
--	return self.file_list
-+        if not self.fn:
-+            return []
-+	
-+	if self.isdeb:
-+    	    f = open(self.fn, "rb")
-+    	    ar = arfile.ArFile(f)
-+    	    tarStream = ar.open("data.tar.gz")
-+    	    tarf = tarfile.open("data.tar.gz", "r", tarStream)
-+    	    self.file_list = tarf.getnames()
-+    	    f.close()
-+	else:
-+            f = os.popen("tar xfzO " + self.fn + " '*data.tar.gz' | tar tfz -","r") 
-+            while 1: 
-+                line = f.readline() 
-+                if not line: break 
-+                self.file_list.append(string.rstrip(line)) 
-+            f.close() 
-+
-+        # Make sure that filelist has consistent format regardless of tar version
-+        self.file_list = map(lambda a: ["./", ""][a.startswith("./")] + a, self.file_list)
-+        return self.file_list
- 
-     def write_package(self, dirname):
-         buf = self.render_control()
-Index: ipkg-utils/setup.py
-===================================================================
---- ipkg-utils.orig/setup.py	2005-03-03 16:40:17.000000000 +0000
-+++ ipkg-utils/setup.py	2008-05-30 15:33:49.000000000 +0100
-@@ -16,6 +16,6 @@
- 		      platforms = 'POSIX',
- 		      keywords = 'ipkg familiar',
-                       url = 'http://www.handhelds.org/sources.html/',
--                      py_modules = [ 'ipkg' ],
-+                      py_modules = [ 'ipkg', 'arfile' ],
- 		      scripts = ['ipkg-compare-indexes', 'ipkg-make-index', 'ipkg-update-index', 'ipkg-build', 'ipkg-unbuild', 'ipkg-upload']
-                       )
diff --git a/recipes/ipkg-utils/ipkg-utils/ipkg-utils-fix.patch b/recipes/ipkg-utils/ipkg-utils/ipkg-utils-fix.patch
deleted file mode 100644
index b3e0d62..0000000
--- a/recipes/ipkg-utils/ipkg-utils/ipkg-utils-fix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
----
- ipkg.py |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-Index: ipkg-utils/ipkg.py
-===================================================================
---- ipkg-utils.orig/ipkg.py	2007-05-26 23:49:05.000000000 +0100
-+++ ipkg-utils/ipkg.py	2007-05-26 23:49:23.000000000 +0100
-@@ -152,9 +152,9 @@ class Package:
-             self.filename = os.path.basename(fn)
- 	    ## sys.stderr.write("  extracting control.tar.gz from %s\n"% (fn,)) 
-             if self.isdeb:
--                control = os.popen("ar p "+fn+" control.tar.gz | tar xfzO - '*control'","r")
-+                control = os.popen("ar p "+fn+" control.tar.gz | tar xfzO - './control'","r")
-             else:
--                control = os.popen("tar xfzO "+fn+" '*control.tar.gz' | tar xfzO - '*control'","r")
-+                control = os.popen("tar xfzO "+fn+" 'control.tar.gz' | tar xfzO - './control'","r")
-             line = control.readline()
-             while 1:
-                 if not line: break
diff --git a/recipes/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb b/recipes/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb
deleted file mode 100644
index 26584e9..0000000
--- a/recipes/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-DESCRIPTION = "Itsy Package Manager utilities"
-SECTION = "base"
-PRIORITY = "optional"
-LICENSE = "GPLv2+"
-CONFLICTS = "ipkg-link"
-RDEPENDS_${PN} = "python"
-SRCDATE = "20050930"
-PR = "r28"
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-SRC_URI = "${HANDHELDS_CVS};module=ipkg-utils \
-           file://ipkg-utils-fix.patch \
-           file://ipkg-py-sane-vercompare.patch \
-           file://ipkg-py-tarfile.patch \
-           file://arfile_even_alignment.patch \
-           file://ipkg-make-index-track-stamps.patch \
-           file://fields_tweaks.patch \
-           file://ipkg-env.patch \
-           file://arfile_header_split.patch \
-	   "
-
-S = "${WORKDIR}/ipkg-utils"
-
-INSTALL = "ipkg-build ipkg-deb-unbuild ipkg-unbuild ipkg-compare-versions ipkg-upload ipkg-make-index ipkg-link ipkg.py ipkg-list-fields"
-
-do_compile() {
-	oe_runmake ipkg-compare-versions
-}
-
-do_install() {
-	install -d ${D}${bindir}
-	for i in ${INSTALL}
-	do
-		install -m 0755 $i ${D}${bindir}
-	done
-}
-
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/9] classes: Replace ipkg-make-index with opkg-make-index
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
                   ` (3 preceding siblings ...)
  2011-01-25  6:25 ` [PATCH 4/9] ipkg-utils: Remove the recipes Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25  6:25 ` [PATCH 6/9] bitbake.conf, nylon.conf, openwrt-sdk.conf: Use opkg-build instead of ipkg-build Khem Raj
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

* STAGE_PKGMANAGER use opkg
* rename IPKGBUILDCMD to OPKGBUILDCMD
* Use opkg-build instead of ipkg-build

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 classes/package_ipk.bbclass      |   14 +++++++-------
 classes/packaged-staging.bbclass |    4 ++--
 classes/sourceipk.bbclass        |    4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass
index fea678d..a68d208 100644
--- a/classes/package_ipk.bbclass
+++ b/classes/package_ipk.bbclass
@@ -54,7 +54,7 @@ python package_ipk_install () {
 
 	if (not os.access(os.path.join(ipkdir,"Packages"), os.R_OK) or
 		not os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),os.R_OK)):
-		ret = os.system('ipkg-make-index -p %s %s ' % (os.path.join(ipkdir, "Packages"), ipkdir))
+		ret = os.system('opkg-make-index -p %s %s ' % (os.path.join(ipkdir, "Packages"), ipkdir))
 		if (ret != 0 ):
 			raise bb.build.FuncFailed
 		f = open(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),"w")
@@ -86,20 +86,20 @@ do_package_update_index_ipk () {
 
 	mkdir -p ${DEPLOY_DIR_IPK}
 	touch ${DEPLOY_DIR_IPK}/Packages
-	ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
+	opkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
 
 	for arch in $ipkgarchs; do
 		if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then 
 			touch ${DEPLOY_DIR_IPK}/$arch/Packages
-			ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/
+			opkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/
 		fi
 		if [ -e ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/ ] ; then 
 			touch ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages
-			ipkg-make-index -r ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages -p ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages -l ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages.filelist -m ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/
+			opkg-make-index -r ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages -p ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages -l ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages.filelist -m ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/
 		fi
 		if [ -e ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/ ] ; then
 			touch ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages
-			ipkg-make-index -r ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages -p ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages -l ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/
+			opkg-make-index -r ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages -p ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages -l ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/
 		fi
 	done
 }
@@ -303,10 +303,10 @@ python do_package_ipk () {
 
 		os.chdir(basedir)
 		ret = os.system("PATH=\"%s\" %s %s %s" % (bb.data.getVar("PATH", localdata, 1), 
-                                                          bb.data.getVar("IPKGBUILDCMD",d,1), pkg, pkgoutdir))
+                                                          bb.data.getVar("OPKGBUILDCMD",d,1), pkg, pkgoutdir))
 		if ret != 0:
 			bb.utils.unlockfile(lf)
-			raise bb.build.FuncFailed("ipkg-build execution failed")
+			raise bb.build.FuncFailed("opkg-build execution failed")
 
 		bb.utils.prunedir(controldir)
 		bb.utils.unlockfile(lf)
diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass
index 83e77c9..f217aee 100644
--- a/classes/packaged-staging.bbclass
+++ b/classes/packaged-staging.bbclass
@@ -92,9 +92,9 @@ python __anonymous() {
 
 PSTAGE_MACHCONFIG   = "${PSTAGE_WORKDIR}/opkg.conf"
 
-PSTAGE_PKGMANAGER = "stage-manager-ipkg"
+PSTAGE_PKGMANAGER = "stage-manager-opkg"
 
-PSTAGE_BUILD_CMD        = "stage-manager-ipkg-build -o 0 -g 0"
+PSTAGE_BUILD_CMD        = "stage-manager-opkg-build -o 0 -g 0"
 PSTAGE_INSTALL_CMD      = "${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -force-depends -o ${TMPDIR} install"
 PSTAGE_UPDATE_CMD       = "${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -o ${TMPDIR} update"
 PSTAGE_REMOVE_CMD       = "${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -force-depends -o ${TMPDIR} remove"
diff --git a/classes/sourceipk.bbclass b/classes/sourceipk.bbclass
index b443ef6..75e7a14 100644
--- a/classes/sourceipk.bbclass
+++ b/classes/sourceipk.bbclass
@@ -31,13 +31,13 @@
 # CREATE_SRCIPK_pn-<package name> = "1" in your local.conf
 #
 #TODO: 
-# Need to figure out how to use ipkg-build in this class.
+# Need to figure out how to use opkg-build in this class.
 # I tried adding it as a dependency for the do_create_srcipk
 # task using:
 #   do_create_srcipk[depends] += "opkg-utils-native:do_populate_sysroot"
 # But then there is a circular dependency between sourcipk.bbclass and
 # opkg-utils-native.  Until I can figure out how to resolve this
-# circular dependency I am extracting the needed pieces from ipkg-build
+# circular dependency I am extracting the needed pieces from opkg-build
 # into this class and building the source ipk myself.
 
 
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 6/9] bitbake.conf, nylon.conf, openwrt-sdk.conf: Use opkg-build instead of ipkg-build
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
                   ` (4 preceding siblings ...)
  2011-01-25  6:25 ` [PATCH 5/9] classes: Replace ipkg-make-index with opkg-make-index Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25  6:25 ` [PATCH 7/9] angstrom/personal-feed.sh, angstrom/sort.sh: Replace ipkg-make-index with opkg-make-index Khem Raj
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

* Rename IPKGBUILDCMD to OPKGBUILDCMD

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 conf/bitbake.conf            |    2 +-
 conf/distro/nylon.conf       |    2 +-
 conf/distro/openwrt-sdk.conf |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 042a06c..ad2e721 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -663,7 +663,7 @@ export PATCH_GET="0"
 
 # Program to be used to build ipkg packages
 
-IPKGBUILDCMD = "ipkg-build -o 0 -g 0"
+OPKGBUILDCMD = "opkg-build -o 0 -g 0"
 
 ##################################################################
 # Not sure about the rest of this yet.
diff --git a/conf/distro/nylon.conf b/conf/distro/nylon.conf
index ae8d064..6b9d3d9 100644
--- a/conf/distro/nylon.conf
+++ b/conf/distro/nylon.conf
@@ -52,7 +52,7 @@ CXXFLAGS := ${fixedCxxflags}
 DISTRO_FEATURES = "nfs smbfs wifi pcmcia ppp ext2 vfat usbhost pci"
 
 # FIXME: cannot build linux-libc-headers unless this is set.
-IPKGBUILDCMD = "stage-manager-ipkg-build -o 0 -g 0"
+OPKGBUILDCMD = "stage-manager-opkg-build -o 0 -g 0"
 
 #############################################################################
 # PREFERRED VERSIONS
diff --git a/conf/distro/openwrt-sdk.conf b/conf/distro/openwrt-sdk.conf
index 0646b17..0c96b12 100644
--- a/conf/distro/openwrt-sdk.conf
+++ b/conf/distro/openwrt-sdk.conf
@@ -21,7 +21,7 @@ DISTRO_NAME = "OpenWRT"
 DISTRO_REVISION = "2"
 
 # Build ipk's wrapped with tar.gz instead of ar, like OpenWRT has them
-IPKGBUILDCMD = "ipkg-build -c -o 0 -g 0"
+OPKGBUILDCMD = "opkg-build -c -o 0 -g 0"
 
 # This is what lives in SDK
 ASSUME_PROVIDED += "virtual/${TARGET_PREFIX}gcc virtual/libc"
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 7/9] angstrom/personal-feed.sh, angstrom/sort.sh: Replace ipkg-make-index with opkg-make-index
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
                   ` (5 preceding siblings ...)
  2011-01-25  6:25 ` [PATCH 6/9] bitbake.conf, nylon.conf, openwrt-sdk.conf: Use opkg-build instead of ipkg-build Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25  6:25 ` [PATCH 8/9] stage-manager: Use opkg utilities Khem Raj
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 contrib/angstrom/personal-feed.sh |    2 +-
 contrib/angstrom/sort.sh          |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/contrib/angstrom/personal-feed.sh b/contrib/angstrom/personal-feed.sh
index 1951c27..2896ec6 100644
--- a/contrib/angstrom/personal-feed.sh
+++ b/contrib/angstrom/personal-feed.sh
@@ -45,7 +45,7 @@ echo "Starting rsync..."
 rsync -vz --partial --copy-links --progress --files-from=files-trans upload-queue/ personal-feed/
 
 echo "Generating index for your personal feed..."
-( cd personal-feed ; PATH=$PATH:$(find ../../../sysroots/$(uname -m)* -name "ipkg-make-index" | sed s:/ipkg-make-index::g) ipkg-make-index -p Packages -m . >& /dev/null )
+( cd personal-feed ; PATH=$PATH:$(find ../../../sysroots/$(uname -m)* -name "opkg-make-index" | sed s:/opkg-make-index::g) opkg-make-index -p Packages -m . >& /dev/null )
 
 
 # Clean up temporary files
diff --git a/contrib/angstrom/sort.sh b/contrib/angstrom/sort.sh
index e879d8c..893d928 100755
--- a/contrib/angstrom/sort.sh
+++ b/contrib/angstrom/sort.sh
@@ -164,7 +164,7 @@ for i in ../* ; do
   if [ -d $i ]; then
       cd $i
       echo -n "building index for $i:" |sed s:\.\./::
-      ${ipkg_tools_path}/ipkg-make-index -m -p Packages -l Packages.filelist  -L ../locales  . >& /tmp/index-log
+      ${ipkg_tools_path}/opkg-make-index -m -p Packages -l Packages.filelist  -L ../locales  . >& /tmp/index-log
       echo " DONE"
   fi
 done
@@ -175,7 +175,7 @@ echo -n "building index for locales:"
 for i in ../* ; do
   if [ -d $i ]; then
    echo -n " $i" |sed s:\.\./::
-   ${ipkg_tools_path}/ipkg-make-index -m -p Packages -l Packages.filelist . >& /dev/null;
+   ${ipkg_tools_path}/opkg-make-index -m -p Packages -l Packages.filelist . >& /dev/null;
    cd $i
   fi
  done
@@ -189,7 +189,7 @@ for i in ./* ; do
   if [ -d $i ]; then
      cd $i
      echo -n "building index for machine $i:"
-     ${ipkg_tools_path}/ipkg-make-index -m -p Packages -l Packages.filelist . >& /dev/null
+     ${ipkg_tools_path}/opkg-make-index -m -p Packages -l Packages.filelist . >& /dev/null
      echo " DONE"
      cd ../
   fi
@@ -200,10 +200,10 @@ cd ${BPWD}
 
 echo "Processing 'all' feed"
 for i in `find . -name  "*.ipk"| grep _all` ; do mkdir -p ../all/ || true ;mv $i ../all/ ; done
- (mkdir -p ../all ; cd ../all && ${ipkg_tools_path}/ipkg-make-index -p Packages -m . >& /dev/null ; touch Packages.sig )
+ (mkdir -p ../all ; cd ../all && ${ipkg_tools_path}/opkg-make-index -p Packages -m . >& /dev/null ; touch Packages.sig )
 
 mkdir -p ../sdk ; mv *sdk.ipk ../sdk/ || true
- (mkdir -p ../sdk ; cd ../sdk && ${ipkg_tools_path}/ipkg-make-index -p Packages -m . >& /dev/null ; touch Packages.sig )
+ (mkdir -p ../sdk ; cd ../sdk && ${ipkg_tools_path}/opkg-make-index -p Packages -m . >& /dev/null ; touch Packages.sig )
 
 for arch in 486sx armv4t armv4 armv5teb armv5te armv6-novfp armv6 armv7a-vfp armv7a avr32 bfin geode i486 i586 i686 iwmmxt mips mipsel powerpc ppc405 ppc440e ppc603e ppce300c2 ppce300c3 ppce500v2 ppce500 ppce600 sh4 sparc x86_64 x86; do
 	do_sort
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 8/9] stage-manager: Use opkg utilities
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
                   ` (6 preceding siblings ...)
  2011-01-25  6:25 ` [PATCH 7/9] angstrom/personal-feed.sh, angstrom/sort.sh: Replace ipkg-make-index with opkg-make-index Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25  6:25 ` [PATCH 9/9] Recipes: Replace ipkg-utils with opkg-utils Khem Raj
  2011-01-25 13:38 ` [PATCH 0/9 v2] " Koen Kooi
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

* Rename stage-manager-ipkg -> stage-manager-opkg
* Rename stage-manager-ipkg-build -> stage-manager-opkg-build

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 recipes/stage-manager/files/stage-manager-ipkg     | 1209 --------------------
 .../stage-manager/files/stage-manager-ipkg-build   |  246 ----
 recipes/stage-manager/files/stage-manager-opkg     | 1209 ++++++++++++++++++++
 .../stage-manager/files/stage-manager-opkg-build   |  246 ++++
 recipes/stage-manager/stagemanager-native_0.0.1.bb |    8 +-
 5 files changed, 1459 insertions(+), 1459 deletions(-)
 delete mode 100755 recipes/stage-manager/files/stage-manager-ipkg
 delete mode 100755 recipes/stage-manager/files/stage-manager-ipkg-build
 create mode 100755 recipes/stage-manager/files/stage-manager-opkg
 create mode 100755 recipes/stage-manager/files/stage-manager-opkg-build

diff --git a/recipes/stage-manager/files/stage-manager-ipkg b/recipes/stage-manager/files/stage-manager-ipkg
deleted file mode 100755
index 105ea54..0000000
--- a/recipes/stage-manager/files/stage-manager-ipkg
+++ /dev/null
@@ -1,1209 +0,0 @@
-#!/bin/sh
-# ipkg - the itsy package management system
-#
-# Copyright (C) 2001 Carl D. Worth
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-set -e
-
-# Uncomment for debugging
-#set -x
-
-# By default do not do globbing. Any command wanting globbing should
-# explicitly enable it first and disable it afterwards.
-set -o noglob
-
-ipkg_srcs() {
-	local srcre="$1"
-	sed -ne "s/^src[[:space:]]\+$srcre[[:space:]]\+//p" < $IPKG_CONF
-}
-
-ipkg_src_names() {
-	sed -ne "s/^src[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
-}
-
-ipkg_src_byname() {
-	local src="$1"
-	ipkg_srcs $src | head -n1
-}
-
-ipkg_dests() {
-	local destre=`echo $1 | ipkg_protect_slashes`
-	sed -ne "/^dest[[:space:]]\+$destre/{
-s/^dest[[:space:]]\+[^[:space:]]\+[[:space:]]\+//
-s/^/`echo $IPKG_OFFLINE_ROOT | ipkg_protect_slashes`/
-p
-}" < $IPKG_CONF
-}
-
-ipkg_dest_names() {
-	sed -ne "s/^dest[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
-}
-
-ipkg_dests_all() {
-	ipkg_dests '.*'
-}
-
-ipkg_state_dirs() {
-	ipkg_dests_all | sed "s|\$|/$IPKG_DIR_PREFIX|"
-}
-
-ipkg_dest_default() {
-	ipkg_dests_all | head -n1
-}
-
-ipkg_dest_default_name() {
-	ipkg_dest_names | head -n1
-}
-
-ipkg_dest_byname() {
-	local dest="$1"
-	ipkg_dests $dest | head -n1
-}
-
-ipkg_option() {
-	local option="$1"
-	sed -ne "s/^option[[:space:]]\+$option[[:space:]]\+//p" < $IPKG_CONF
-}
-
-ipkg_load_configuration() {
-	if [ -z "$IPKG_CONF_DIR" ]; then
-		IPKG_CONF_DIR=/etc
-	fi
-
-	if [ -z "$IPKG_CONF" ]; then
-		IPKG_CONF=$IPKG_CONF_DIR/ipkg.conf
-	fi
-
-	if [ -z "$IPKG_OFFLINE_ROOT" ]; then
-	    IPKG_OFFLINE_ROOT=`ipkg_option offline_root`
-	fi
-	# Export IPKG_OFFLINE_ROOT for use by update-alternatives
-	export IPKG_OFFLINE_ROOT
-	if [ -n "$DEST_NAME" ]; then
-		IPKG_ROOT=`ipkg_dest_byname $DEST_NAME`
-		if [ -z "$IPKG_ROOT" ]; then
-			if [ -d "$IPKG_OFFLINE_ROOT$DEST_NAME" ]; then
-				IPKG_ROOT="$IPKG_OFFLINE_ROOT$DEST_NAME";
-			else
-				echo "ipkg: invalid destination specification: $DEST_NAME
-Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&2
-				ipkg_dest_names >&2
-				return 1
-			fi
-		fi
-	else
-		IPKG_ROOT=`ipkg_dest_default`
-	fi
-
-	# Global ipkg state directories
-	IPKG_DIR_PREFIX=usr/lib/ipkg
-	IPKG_LISTS_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/lists
-	IPKG_PENDING_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/pending
-
-	# test for bsd mktemp and pass -t <prefix> when needed
-	if (mktemp -V) ; then
-		IPKG_TMP=`mktemp -d`
-	else
-		IPKG_TMP=`mktemp -d -t ipkg`
-	fi
-
-	if [ ! -d "$IPKG_TMP" ]; then
-		echo "Error, could not create a temp directory"
-		return 1
-	fi
-
-	# Destination specific ipkg meta-data directory
-	IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX
-
-	# Proxy Support
-	IPKG_PROXY_USERNAME=`ipkg_option proxy_username`
-	IPKG_PROXY_PASSWORD=`ipkg_option proxy_password`
-	IPKG_HTTP_PROXY=`ipkg_option http_proxy`
-	IPKG_FTP_PROXY=`ipkg_option ftp_proxy`
-	IPKG_NO_PROXY=`ipkg_option no_proxy`
-	if [ -n "$IPKG_HTTP_PROXY" ]; then 
-		export http_proxy="$IPKG_HTTP_PROXY"
-	fi
-
-	if [ -n "$IPKG_FTP_PROXY" ]; then 
-		export ftp_proxy="$IPKG_FTP_PROXY"
-	fi
-
-	if [ -n "$IPKG_NO_PROXY" ]; then 
-		export no_proxy="$IPKG_NO_PROXY"
-	fi
-
-	IPKG_STATUS_FIELDS='\(Package\|Status\|Essential\|Version\|Conffiles\|Root\)'
-}
-
-ipkg_usage() {
-	[ $# -gt 0 ] && echo "ipkg: $*"
-	echo "
-usage: ipkg [options...] sub-command [arguments...]
-where sub-command is one of:
-
-Package Manipulation:
-	update  		Update list of available packages
-	upgrade			Upgrade all installed packages to latest version
-	install <pkg>		Download and install <pkg> (and dependencies)
-	install <file.ipk>	Install package <file.ipk>
-	install <file.deb>	Install package <file.deb>
-	remove <pkg>		Remove package <pkg>
-
-Informational Commands:
-	list    		List available packages and descriptions
-	files <pkg>		List all files belonging to <pkg>
-	search <file>		Search for a packaging providing <file>
-	info [pkg [<field>]]	Display all/some info fields for <pkg> or all
-	status [pkg [<field>]]	Display all/some status fields for <pkg> or all
-	depends <pkg>		Print uninstalled package dependencies for <pkg>
-
-Options:
-	-d <dest_name>          Use <dest_name> as the the root directory for
-	-dest <dest_name>	package installation, removal, upgrading.
-				<dest_name> should be a defined dest name from the
-				configuration file, (but can also be a directory
-				name in a pinch).
-        -o <offline_root>       Use <offline_root> as the root for offline installation.
-        -offline <offline_root> 				
-
-Force Options (use when ipkg is too smart for its own good):
-	-force-depends          Make dependency checks warnings instead of errors
-	-force-defaults         Use default options for questions asked by ipkg.
-                                (no prompts). Note that this will not prevent
-                                package installation scripts from prompting.
-" >&2
-	exit 1
-}
-
-ipkg_dir_part() {
-	local dir=`echo $1 | sed -ne 's/\(.*\/\).*/\1/p'`
-	if [ -z "$dir" ]; then
-		dir="./"
-	fi
-	echo $dir
-}
-
-ipkg_file_part() {
-	echo $1 | sed 's/.*\///'
-}
-
-ipkg_protect_slashes() {
-	sed -e 's/\//\\\//g'
-}
-
-ipkg_download() {
-	local src="$1"
-	local dest="$2"
-
-	local src_file=`ipkg_file_part $src`
-	local dest_dir=`ipkg_dir_part $dest`
-	if [ -z "$dest_dir" ]; then
-		dest_dir="$IPKG_TMP"
-	fi
-
-	local dest_file=`ipkg_file_part $dest`
-	if [ -z "$dest_file" ]; then
-		dest_file="$src_file"
-	fi
-
-	# Proxy support
-	local proxyuser=""
-	local proxypassword=""
-	local proxyoption=""
-		
-	if [ -n "$IPKG_PROXY_USERNAME" ]; then
-		proxyuser="--proxy-user=\"$IPKG_PROXY_USERNAME\""
-		proxypassword="--proxy-passwd=\"$IPKG_PROXY_PASSWORD\""
-	fi
-
-	if [ -n "$IPKG_PROXY_HTTP" -o -n "$IPKG_PROXY_FTP" ]; then
-		proxyoption="--proxy=on"
-	fi
-
-	echo "Downloading $src ..."
-	rm -f $IPKG_TMP/$src_file
-	case "$src" in
-	http://* | ftp://*)
-		if ! wget --passive-ftp -nd $proxyoption $proxyuser $proxypassword -P $IPKG_TMP $src; then
-			echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err"
-			return 1
-		fi
-		mv $IPKG_TMP/$src_file $dest_dir/$dest_file 2>/dev/null
-		;;
-	file:/* )
-		ln -s `echo $src | sed 's/^file://'` $dest_dir/$dest_file 2>/dev/null
-		;;
-	*)
-	echo "DEBUG: $src"
-		;;
-	esac
-
-	echo "Done."
-	return 0
-}
-
-ipkg_update() {
-	if [ ! -e "$IPKG_LISTS_DIR" ]; then
-		mkdir -p $IPKG_LISTS_DIR
-	fi
-
-	local err=
-	for src_name in `ipkg_src_names`; do
-		local src=`ipkg_src_byname $src_name`
-		if ! ipkg_download $src/Packages $IPKG_LISTS_DIR/$src_name; then
-			echo "ipkg_update: Error downloading $src/Packages to $IPKG_LISTS_DIR/$src_name" >&2
-			err=t
-		else
-			echo "Updated list of available packages in $IPKG_LISTS_DIR/$src_name"
-		fi
-	done
-
-	[ -n "$err" ] && return 1
-
-	return 0
-}
-
-ipkg_list() {
-	for src in `ipkg_src_names`; do
-		if ipkg_require_list $src; then 
-# black magic...
-sed -ne "
-/^Package:/{
-s/^Package:[[:space:]]*\<\([a-z0-9.+-]*$1[a-z0-9.+-]*\).*/\1/
-h
-}
-/^Description:/{
-s/^Description:[[:space:]]*\(.*\)/\1/
-H
-g
-s/\\
-/ - /
-p
-}
-" $IPKG_LISTS_DIR/$src
-		fi
-	done
-}
-
-ipkg_extract_paragraph() {
-	local pkg="$1"
-	sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/p"
-}
-
-ipkg_extract_field() {
-	local field="$1"
-# blacker magic...
-	sed -ne "
-: TOP
-/^$field:/{
-p
-n
-b FIELD
-}
-d
-: FIELD
-/^$/b TOP
-/^[^[:space:]]/b TOP
-p
-n
-b FIELD
-"
-}
-
-ipkg_extract_value() {
-	sed -e "s/^[^:]*:[[:space:]]*//"
-}
-
-ipkg_require_list() {
-	[ $# -lt 1 ] && return 1
-	local src="$1"
-	if [ ! -f "$IPKG_LISTS_DIR/$src" ]; then
-		echo "ERROR: File not found: $IPKG_LISTS_DIR/$src" >&2
-		echo "       You probably want to run \`ipkg update'" >&2
-		return 1
-	fi
-	return 0
-}
-
-ipkg_info() {
-	for src in `ipkg_src_names`; do
-		if ipkg_require_list $src; then
-			case $# in
-			0)
-				cat $IPKG_LISTS_DIR/$src
-				;;	
-			1)
-				ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src
-				;;
-			*)
-				ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src | ipkg_extract_field $2
-				;;
-			esac
-		fi
-	done
-}
-
-ipkg_status_sd() {
-	[ $# -lt 1 ] && return 0
-	sd="$1"
-	shift
-	if [ -f $sd/status ]; then
-		case $# in
-		0)
-			cat $sd/status
-			;;
-		1)
-			ipkg_extract_paragraph $1 < $sd/status
-			;;
-		*)
-			ipkg_extract_paragraph $1 < $sd/status | ipkg_extract_field $2
-			;;
-		esac
-	fi
-	return 0
-}
-
-ipkg_status_all() {
-	for sd in `ipkg_state_dirs`; do
-		ipkg_status_sd $sd $*
-	done
-}
-
-ipkg_status() {
-	if [ -n "$DEST_NAME" ]; then
-		ipkg_status_sd $IPKG_STATE_DIR $*
-	else
-		ipkg_status_all $*
-	fi
-}
-
-ipkg_status_matching_sd() {
-	local sd="$1"
-	local re="$2"
-	if [ -f $sd/status ]; then
-		sed -ne "
-: TOP
-/^Package:/{
-s/^Package:[[:space:]]*//
-s/[[:space:]]*$//
-h
-}
-/$re/{
-g
-p
-b NEXT
-}
-d
-: NEXT
-/^$/b TOP
-n
-b NEXT
-" < $sd/status
-	fi
-	return 0
-}
-
-ipkg_status_matching_all() {
-	for sd in `ipkg_state_dirs`; do
-		ipkg_status_matching_sd $sd $*
-	done
-}
-
-ipkg_status_matching() {
-	if [ -n "$DEST_NAME" ]; then
-		ipkg_status_matching_sd $IPKG_STATE_DIR $*
-	else
-		ipkg_status_matching_all $*
-	fi
-}
-
-ipkg_status_installed_sd() {
-	local sd="$1"
-	local pkg="$2"
-	ipkg_status_sd $sd $pkg Status | grep -q "Status: install user installed"
-}
-
-ipkg_status_installed_all() {
-	local ret=1
-	for sd in `ipkg_state_dirs`; do
-		if `ipkg_status_installed_sd $sd $*`; then
-			ret=0
-		fi
-	done
-	return $ret
-}
-
-ipkg_status_mentioned_sd() {
-	local sd="$1"
-	local pkg="$2"
-	[ -n "`ipkg_status_sd $sd $pkg Status`" ]
-}
-
-ipkg_files() {
-	local pkg="$1"
-	if [ -n "$DEST_NAME" ]; then
-		dests=$IPKG_ROOT
-	else
-		dests=`ipkg_dests_all`
-	fi
-	for dest in $dests; do
-		if [ -f $dest/$IPKG_DIR_PREFIX/info/$pkg.list ]; then
-			dest_sed=`echo $dest | ipkg_protect_slashes`
-			sed -e "s/^/$dest_sed/" < $dest/$IPKG_DIR_PREFIX/info/$pkg.list
-		fi
-	done
-}
-
-ipkg_search() {
-	local pattern="$1"
-
-	for dest_name in `ipkg_dest_names`; do
-		dest=`ipkg_dest_byname $dest_name`
-		dest_sed=`echo $dest | ipkg_protect_slashes`
-
-		set +o noglob
-		local list_files=`ls -1 $dest/$IPKG_DIR_PREFIX/info/*.list 2>/dev/null`
-		set -o noglob
-		for file in $list_files; do
-			if sed "s/^/$dest_sed/" $file | grep -q $pattern; then
-				local pkg=`echo $file | sed "s/^.*\/\(.*\)\.list/\1/"`
-				[ "$dest_name" != `ipkg_dest_default_name` ] && pkg="$pkg ($dest_name)"
-				sed "s/^/$dest_sed/" $file | grep $pattern | sed "s/^/$pkg: /"
-			fi
-		done
-	done
-}
-
-ipkg_status_remove_sd() {
-	local sd="$1"
-	local pkg="$2"
-
-	if [ ! -f $sd/status ]; then
-		mkdir -p $sd
-		touch $sd/status
-	fi
-	sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/!p" < $sd/status > $sd/status.new
-	mv $sd/status.new $sd/status
-}
-
-ipkg_status_remove_all() {
-	for sd in `ipkg_state_dirs`; do
-		ipkg_status_remove_sd $sd $*
-	done
-}
-
-ipkg_status_remove() {
-	if [ -n "$DEST_NAME" ]; then
-		ipkg_status_remove_sd $IPKG_STATE_DIR $*
-	else
-		ipkg_status_remove_all $*
-	fi
-}
-
-ipkg_status_update_sd() {
-	local sd="$1"
-	local pkg="$2"
-
-	ipkg_status_remove_sd $sd $pkg
-	ipkg_extract_field "$IPKG_STATUS_FIELDS" >> $sd/status
-	echo "" >> $sd/status
-}
-
-ipkg_status_update() {
-	ipkg_status_update_sd $IPKG_STATE_DIR $*
-}
-
-ipkg_unsatisfied_dependences() {
-    local pkg=$1
-    local deps=`ipkg_get_depends $pkg`
-    local remaining_deps=
-    for dep in $deps; do
-	local installed=`ipkg_get_installed $dep`
-	if [ "$installed" != "installed" ] ; then
-	    remaining_deps="$remaining_deps $dep"
-	fi
-    done
-    ## echo "ipkg_unsatisfied_dependences pkg=$pkg $remaining_deps" > /dev/console
-    echo $remaining_deps
-}
-
-ipkg_safe_pkg_name() {
-	local pkg=$1
-	local spkg=`echo pkg_$pkg | sed -e y/-+./___/`
-	echo $spkg
-}
-
-ipkg_set_depends() {
-	local pkg=$1; shift 
-	local new_deps="$*"
-	pkg=`ipkg_safe_pkg_name $pkg`
-	## setvar ${pkg}_depends "$new_deps"
-	echo $new_deps > $IPKG_TMP/${pkg}.depends
-}
-
-ipkg_get_depends() {
-	local pkg=$1
-	pkg=`ipkg_safe_pkg_name $pkg`
-	cat $IPKG_TMP/${pkg}.depends
-	## eval "echo \$${pkg}_depends"
-}
-
-ipkg_set_installed() {
-	local pkg=$1
-	pkg=`ipkg_safe_pkg_name $pkg`
-	echo installed > $IPKG_TMP/${pkg}.installed
-	## setvar ${pkg}_installed "installed"
-}
-
-ipkg_set_uninstalled() {
-	local pkg=$1
-	pkg=`ipkg_safe_pkg_name $pkg`
-	### echo ipkg_set_uninstalled $pkg > /dev/console
-	echo uninstalled > $IPKG_TMP/${pkg}.installed
-	## setvar ${pkg}_installed "uninstalled"
-}
-
-ipkg_get_installed() {
-	local pkg=$1
-	pkg=`ipkg_safe_pkg_name $pkg`
-	if [ -f $IPKG_TMP/${pkg}.installed ]; then
-		cat $IPKG_TMP/${pkg}.installed
-	fi
-	## eval "echo \$${pkg}_installed"
-}
-
-ipkg_depends() {
-	local new_pkgs="$*"
-	local all_deps=
-	local installed_pkgs=`ipkg_status_matching_all 'Status:.*[[:space:]]installed'`
-	for pkg in $installed_pkgs; do
-	    ipkg_set_installed $pkg
-	done
-	while [ -n "$new_pkgs" ]; do
-		all_deps="$all_deps $new_pkgs"
-		local new_deps=
-		for pkg in $new_pkgs; do
-			if echo $pkg | grep -q '[^a-z0-9.+-]'; then
-				echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [a-z0-9.+-])" >&2
-				return 1
-			fi
-			# TODO: Fix this. For now I am ignoring versions and alternations in dependencies.
-			new_deps="$new_deps "`ipkg_info $pkg '\(Pre-\)\?Depends' | ipkg_extract_value | sed -e 's/([^)]*)//g
-s/\(|[[:space:]]*[a-z0-9.+-]\+[[:space:]]*\)\+//g
-s/,/ /g
-s/ \+/ /g'`
-			ipkg_set_depends $pkg $new_deps
-		done
-
-		new_deps=`echo $new_deps | sed -e 's/[[:space:]]\+/\\
-/g' | sort | uniq`
-
-		local maybe_new_pkgs=
-		for pkg in $new_deps; do
-			if ! echo $installed_pkgs | grep -q "\<$pkg\>"; then
-				maybe_new_pkgs="$maybe_new_pkgs $pkg"
-			fi
-		done
-
-		new_pkgs=
-		for pkg in $maybe_new_pkgs; do
-			if ! echo $all_deps | grep -q "\<$pkg\>"; then
-				if [ -z "`ipkg_info $pkg`" ]; then
-					echo "ipkg_depends: Warning: $pkg mentioned in dependency but no package found in $IPKG_LISTS_DIR" >&2
-					ipkg_set_installed $pkg
-				else
-					new_pkgs="$new_pkgs $pkg"
-					ipkg_set_uninstalled $pkg
-				fi
-			else
-				ipkg_set_uninstalled $pkg
-			fi
-		done
-	done
-
-	echo $all_deps
-}
-
-ipkg_get_install_dest() {
-	local dest="$1"
-	shift
-	local sd=$dest/$IPKG_DIR_PREFIX
-	local info_dir=$sd/info
-
-        local requested_pkgs="$*"
-	local pkgs=`ipkg_depends $*`
-
-	mkdir -p $info_dir
-	for pkg in $pkgs; do
-		if ! ipkg_status_mentioned_sd $sd $pkg; then
-			echo "Package: $pkg
-Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg
-		fi
-	done
-        ## mark the packages that we were directly requested to install as uninstalled
-        for pkg in $requested_pkgs; do ipkg_set_uninstalled $pkg; done
-
-	local new_pkgs=
-	local pkgs_installed=0
-	while [ -n "pkgs" ]; do
-		curcheck=0
-		## echo "pkgs to install: {$pkgs}" > /dev/console
-		for pkg in $pkgs; do
-			curcheck=`expr $curcheck + 1`
-			local is_installed=`ipkg_get_installed $pkg`
-			if [ "$is_installed" = "installed" ]; then
-				echo "$pkg is installed" > /dev/console
-				continue
-			fi
-
-			local remaining_deps=`ipkg_unsatisfied_dependences $pkg`
-			if [ -n "$remaining_deps" ]; then
-				new_pkgs="$new_pkgs $pkg"
-				### echo "Dependences not satisfied for $pkg: $remaining_deps"
-				if [ $curcheck -ne `echo  $pkgs|wc -w` ]; then
-			        	continue
-				fi
-			fi
-
-			local filename=
-			for src in `ipkg_src_names`; do
-				if ipkg_require_list $src; then
-					filename=`ipkg_extract_paragraph $pkg < $IPKG_LISTS_DIR/$src | ipkg_extract_field Filename | ipkg_extract_value`
-					[ -n "$filename" ] && break
-				fi
-			done
-
-			if [ -z "$filename" ]; then
-				echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR"
-				echo "ipkg_get_install:        Check the spelling and maybe run \`ipkg update'."
-				ipkg_status_remove_sd $sd $pkg
-				return 1;
-			fi
-
-			echo ""
-			local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $filename`
-			if ! ipkg_download `ipkg_src_byname $src`/$filename $tmp_pkg_file; then
-				echo "ipkg_get_install: Perhaps you need to run \`ipkg update'?"
-				return 1
-			fi
-
-			if ! ipkg_install_file_dest $dest $tmp_pkg_file; then
-				echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file"
-				echo "ipkg_get_install: I'll leave it there for you to try a manual installation"
-				return 1
-			fi
-
-			ipkg_set_installed $pkg
-			pkgs_installed=`expr $pkgs_installed + 1`
-			rm $tmp_pkg_file
-		done
-		### echo "Installed $pkgs_installed package(s) this round"
-		if [ $pkgs_installed -eq 0 ]; then
-			if [ -z "$new_pkgs" ]; then
-			    break
-			fi
-		fi
-		pkgs_installed=0
-		pkgs="$new_pkgs"
-		new_pkgs=
-		curcheck=0
-        done
-}
-
-ipkg_get_install() {
-	ipkg_get_install_dest $IPKG_ROOT $*
-}
-
-ipkg_install_file_dest() {
-	local dest="$1"
-	local filename="$2"
-	local sd=$dest/$IPKG_DIR_PREFIX
-	local info_dir=$sd/info
-
-	if [ ! -f "$filename" ]; then
-		echo "ipkg_install_file: ERROR: File $filename not found"
-		return 1
-	fi
-
-	local pkg=`ipkg_file_part $filename | sed 's/\([a-z0-9.+-]\+\)_.*/\1/'`
-	local ext=`echo $filename | sed 's/.*\.//'`
-	local pkg_extract_stdout
-	#if [ "$ext" = "ipk" ]; then
-	#	pkg_extract_stdout="tar -xzOf"
-	#elif [ "$ext" = "deb" ]; then
-		pkg_extract_stdout="ar p"
-	#else
-	#	echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)"
-	#	return 1
-	#fi
-
-	# Check dependencies
-	local depends=`ipkg_depends $pkg | sed -e "s/\<$pkg\>//"`
-
-	# Don't worry about deps that are scheduled for installation
-	local missing_deps=
-	for dep in $depends; do
-		if ! ipkg_status_all $dep | grep -q 'Status:[[:space:]]install'; then
-			missing_deps="$missing_deps $dep"
-		fi
-	done
-
-	if [ ! -z "$missing_deps" ]; then
-		if [ -n "$FORCE_DEPENDS" ]; then
-			echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps"
-		else
-			echo "ipkg_install_file: ERROR: $pkg depends on the following uninstalled programs:
-	$missing_deps"
-			echo "ipkg_install_file: You may want to use \`ipkg install' to install these."
-			return 1
-		fi
-	fi
-
-	mkdir -p $IPKG_TMP/$pkg/control
-	mkdir -p $IPKG_TMP/$pkg/data
-	mkdir -p $info_dir
-
-# In certain some versions of Ubuntu, or at least Ubuntu 9.10, tar has some
-# signal handling problems.  The symptom is a sigpipe signal to gzip when
-# using the -z option on tar.  Here and in subsequent sections, we get around
-# this by using temp files instead of the tar -z option or piping straight
-# from gzip.
-
-	rm -f $IPKG_TMP/control.tar.gz $IPKG_TMP/control.tar
-	if ! { $pkg_extract_stdout $filename control.tar.gz > $IPKG_TMP/control.tar.gz &&
-	       gzip -d $IPKG_TMP/control.tar.gz &&
-	       tar -C $IPKG_TMP/$pkg/control -xf $IPKG_TMP/control.tar ; } ; then
-		echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename"
-		return 1
-	fi
-	rm -f $IPKG_TMP/control.tar.gz $IPKG_TMP/control.tar
-
-	if [ -n "$IPKG_OFFLINE_ROOT" ]; then
-		if grep -q '^InstallsOffline:[[:space:]]*no' $IPKG_TMP/$pkg/control/control; then
-			echo "*** Warning: Package $pkg may not be installed in offline mode"
-			echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)"
-			echo "Package: $pkg
-Status: install ok pending" | ipkg_status_update_sd $sd $pkg
-			mkdir -p $IPKG_PENDING_DIR
-			cp $filename $IPKG_PENDING_DIR
-			rm -r $IPKG_TMP/$pkg/control
-			rm -r $IPKG_TMP/$pkg/data
-			rmdir $IPKG_TMP/$pkg
-			return 0
-		fi
-	fi
-
-
-	echo -n "Unpacking $pkg..."
-	set +o noglob
-	for file in $IPKG_TMP/$pkg/control/*; do
-		local base_file=`ipkg_file_part $file`
-		mv $file $info_dir/$pkg.$base_file
-	done
-	set -o noglob
-	rm -r $IPKG_TMP/$pkg/control
-
-	rm -f $IPKG_TMP/data.tar.gz $IPKG_TMP/data.tar
-	if ! { $pkg_extract_stdout $filename ./data.tar.gz > $IPKG_TMP/data.tar.gz &&
-	       gzip -d $IPKG_TMP/data.tar.gz &&
-	       tar -C $IPKG_TMP/$pkg/data -xf $IPKG_TMP/data.tar ; } ; then
-		echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename"
-		return 1
-	fi
-	rm -f $IPKG_TMP/data.tar.gz $IPKG_TMP/data.tar
-	echo "Done."
-
-	echo -n "Configuring $pkg..."
-	export PKG_ROOT=$dest
-	if [ -x "$info_dir/$pkg.preinst" ]; then
-		if ! $info_dir/$pkg.preinst install; then
-			echo "$info_dir/$pkg.preinst failed. Aborting installation of $pkg"
-			rm -rf $IPKG_TMP/$pkg/data
-			rmdir $IPKG_TMP/$pkg
-			return 1
-		fi
-	fi
-
-	local old_conffiles=`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`
-	local new_conffiles=
-	if [ -f "$info_dir/$pkg.conffiles" ]; then
-		for conffile in `cat $info_dir/$pkg.conffiles`; do
-			if [ -f "$dest/$conffile" ] && ! echo " $old_conffiles " | grep -q " $conffile "`md5sum $dest/$conffile | sed 's/ .*//'`; then
-				local use_maintainers_conffile=
-				if [ -z "$FORCE_DEFAULTS" ]; then
-					while true; do
-						echo -n "Configuration file \`$conffile'
- ==> File on system created by you or by a script.
- ==> File also in package provided by package maintainer.
-   What would you like to do about it ?  Your options are:
-    Y or I  : install the package maintainer's version
-    N or O  : keep your currently-installed version
-      D     : show the differences between the versions (if diff is installed)
- The default action is to keep your current version.
-*** `ipkg_file_part $conffile` (Y/I/N/O/D) [default=N] ? "
-						read response
-						case "$response" in
-						[YyIi] | [Yy][Ee][Ss])
-							use_maintainers_conffile=t
-							break
-						;;
-						[Dd])
-							echo "
-diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile"
-							diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile || true
-							echo "[Press ENTER to continue]"
-							read junk
-						;;
-						*)
-							break
-						;;
-						esac
-					done
-				fi
-				if [ -n "$use_maintainers_conffile" ]; then
-					local md5sum=`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`
-					new_conffiles="$new_conffiles $conffile $md5sum"
-				else
-					new_conffiles="$new_conffiles $conffile <custom>"
-					rm $IPKG_TMP/$pkg/data/$conffile
-				fi
-			else
-				md5sum=`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`
-				new_conffiles="$new_conffiles $conffile $md5sum"
-			fi
-		done
-	fi
-
-	local owd=`pwd`
-	(cd $IPKG_TMP/$pkg/data/; tar cf - . | (cd $owd; cd $dest; tar xf -))		
-	rm -rf $IPKG_TMP/$pkg/data
-	rmdir $IPKG_TMP/$pkg
-	rm -f $IPKG_TMP/data.tar.gz $IPKG_TMP/data.tar
-	$pkg_extract_stdout $filename ./data.tar.gz > $IPKG_TMP/data.tar.gz
-	tar tzf $IPKG_TMP/data.tar.gz | sed -e 's/^\.//' > $info_dir/$pkg.list
-	rm -f $IPKG_TMP/data.tar.gz $IPKG_TMP/data.tar
-
-	if [ -x "$info_dir/$pkg.postinst" ]; then
-		$info_dir/$pkg.postinst configure
-	fi
-
-	if [ -n "$new_conffiles" ]; then
-		new_conffiles='Conffiles: '`echo $new_conffiles | ipkg_protect_slashes`
-	fi
-	local sed_safe_root=`echo $dest | sed -e "s#^${IPKG_OFFLINE_ROOT}##" | ipkg_protect_slashes`
-	sed -e "s/\(Package:.*\)/\1\\
-Status: install ok installed\\
-Root: ${sed_safe_root}\\
-${new_conffiles}/" $info_dir/$pkg.control | ipkg_status_update_sd $sd $pkg
-
-	rm -f $info_dir/$pkg.control
-	rm -f $info_dir/$pkg.conffiles
-	rm -f $info_dir/$pkg.preinst
-	rm -f $info_dir/$pkg.postinst
-
-	echo "Done."
-}
-
-ipkg_install_file() {
-	ipkg_install_file_dest $IPKG_ROOT $*
-}
-
-ipkg_install() {
-
-	while [ $# -gt 0 ]; do
-		local pkg="$1"
-		shift
-	
-		case "$pkg" in
-		http://* | ftp://*)
-			local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $pkg`
-			if ipkg_download $pkg $tmp_pkg_file; then
-				ipkg_install_file $tmp_pkg_file
-				rm $tmp_pkg_file
-			fi
-			;;
-		file:/*.ipk  | file://*.deb)
-				local ipkg_filename="`echo $pkg|sed 's/^file://'`"
-				ipkg_install_file $ipkg_filename
-			;;
-		*.ipk  | *.deb)
-			if [ -f "$pkg" ]; then
-				ipkg_install_file $pkg
-			else
-				echo "File not found $pkg" >&2
-			fi
-			;;
-		*)
-			ipkg_get_install $pkg || true
-			;;
-		esac
-	done
-}
-
-ipkg_install_pending() {
-	[ -n "$IPKG_OFFLINE_ROOT" ] && return 0
-
-	if [ -d "$IPKG_PENDING_DIR" ]; then
-		set +o noglob
-		local pending=`ls -1d $IPKG_PENDING_DIR/*.ipk 2> /dev/null` || true
-		set -o noglob
-		if [ -n "$pending" ]; then
-			echo "The following packages in $IPKG_PENDING_DIR will now be installed:"
-			echo $pending
-			for filename in $pending; do
-				if ipkg_install_file $filename; then
-					rm $filename
-				fi
-			done
-		fi
-	fi
-	return 0
-}
-
-ipkg_install_wanted() {
-	local wanted=`ipkg_status_matching 'Status:[[:space:]]*install.*not-installed'`
-
-	if [ -n "$wanted" ]; then
-		echo "The following package were previously requested but have not been installed:"
-		echo $wanted
-
-		if [ -n "$FORCE_DEFAULTS" ]; then
-			echo "Installing them now."
-		else
-			echo -n "Install them now [Y/n] ? "
-			read response
-			case "$response" in
-			[Nn] | [Nn][Oo])
-				return 0
-				;;
-			esac
-		fi
-
-		ipkg_install $wanted
-	fi
-
-	return 0
-}
-
-ipkg_upgrade_pkg() {
-	local pkg="$1"
-	local avail_ver=`ipkg_info $pkg Version | ipkg_extract_value | head -n1`
-
-	is_installed=
-	for dest_name in `ipkg_dest_names`; do
-		local dest=`ipkg_dest_byname $dest_name`
-		local sd=$dest/$IPKG_DIR_PREFIX
-		local inst_ver=`ipkg_status_sd $sd $pkg Version | ipkg_extract_value`
-		if [ -n "$inst_ver" ]; then
-			is_installed=t
-
-			if [ -z "$avail_ver" ]; then
-				echo "Assuming locally installed package $pkg ($inst_ver) is up to date"
-				return 0
-			fi
-
-			if [ "$avail_ver" = "$inst_ver" ]; then 
-				echo "Package $pkg ($inst_ver) installed in $dest_name is up to date"
-			elif ipkg-compare-versions $avail_ver '>>' $inst_ver; then
-				echo "Upgrading $pkg ($dest_name) from $inst_ver to $avail_ver"
-				ipkg_get_install_dest $dest $pkg
-			else
-				echo "Not downgrading package $pkg from $inst_ver to $avail_ver"
-			fi
-		fi
-	done
-
-	if [ -z "$is_installed" ]; then
-		echo "Package $pkg does not appear to be installed"
-		return 0
-	fi
-
-}
-
-ipkg_upgrade() {
-	if [ $# -lt 1 ]; then
-		local pkgs=`ipkg_status_matching 'Status:.*[[:space:]]installed'`
-	else
-		pkgs="$*"
-	fi
-	
-	for pkg in $pkgs; do
-		ipkg_upgrade_pkg $pkg
-	done
-}
-
-ipkg_remove_pkg_dest() {
-	local dest="$1"
-	local pkg="$2"
-	local sd=$dest/$IPKG_DIR_PREFIX
-	local info_dir=$sd/info
-
-	if ! ipkg_status_installed_sd $sd $pkg; then
-		echo "ipkg_remove: Package $pkg does not appear to be installed in $dest"
-		if ipkg_status_mentioned_sd $sd $pkg; then
-			echo "Purging mention of $pkg from the ipkg database"
-			ipkg_status_remove_sd $sd $pkg
-		fi
-		return 1
-	fi
-
-	echo "ipkg_remove: Removing $pkg... "
-
-	local files=`cat $info_dir/$pkg.list`
-
-	export PKG_ROOT=$dest
-	if [ -x "$info_dir/$pkg.prerm" ]; then
-		$info_dir/$pkg.prerm remove
-	fi
-
-	local conffiles=`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`
-
-	local dirs_to_remove=
-	for file in $files; do
-		if [ -d "$dest/$file" ]; then
-			dirs_to_remove="$dirs_to_remove $dest/$file"
-		else
-			if echo " $conffiles " | grep -q " $file "; then
-				if echo " $conffiles " | grep -q " $file "`md5sum $dest/$file | sed 's/ .*//'`; then
-					rm -f $dest/$file
-				fi
-			else
-				rm -f $dest/$file
-			fi
-		fi
-	done
-
-	local removed_a_dir=t
-	while [ -n "$removed_a_dir" ]; do
-		removed_a_dir=
-		local new_dirs_to_remove=
-		for dir in $dirs_to_remove; do
-			if rmdir $dir >/dev/null 2>&1; then
-				removed_a_dir=t
-			else
-				new_dirs_to_remove="$new_dirs_to_remove $dir"
-			fi
-		done
-		dirs_to_remove="$new_dirs_to_remove"
-	done
-
-	if [ -n "$dirs_to_remove" ]; then
-		echo "ipkg_remove: Warning: Not removing the following directories since they are not empty:" >&2
-		echo "$dirs_to_remove" | sed -e 's/\/[/]\+/\//g' >&2
-	fi
-
-	if [ -x "$info_dir/$pkg.postrm" ]; then
-		$info_dir/$pkg.postrm remove
-	fi
-
-	ipkg_status_remove_sd $sd $pkg
-	set +o noglob
-	rm -f $info_dir/$pkg.*
-	set -o noglob
-
-	echo "Done."
-}
-
-ipkg_remove_pkg() {
-	local pkg="$1"
-	for dest in `ipkg_dests_all`; do
-		local sd=$dest/$IPKG_DIR_PREFIX
-		if ipkg_status_mentioned_sd $sd $pkg; then
-			ipkg_remove_pkg_dest $dest $pkg
-		fi
-	done
-}
-
-ipkg_remove() {
-	while [ $# -gt 0 ]; do
-		local pkg="$1"
-		shift
-		if [ -n "$DEST_NAME" ]; then
-			ipkg_remove_pkg_dest $IPKG_ROOT $pkg
-		else
-			ipkg_remove_pkg $pkg
-		fi
-	done
-}
-
-ipkg_list_installed() {
-	echo `ipkg_status_matching 'Status:.*[[:space:]]installed'`
-}
-###########
-# ipkg main
-###########
-
-# Parse options
-while [ $# -gt 0 ]; do
-	arg="$1"
-	case $arg in
-	-d | -dest)
-		[ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-		DEST_NAME="$2"
-		shift
-		;;
-	-o | -offline)
-		[ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-		IPKG_OFFLINE_ROOT="$2"
-		shift
-		;;
-	-force-depends)
-		FORCE_DEPENDS=t
-		;;
-	-force-defaults)
-		FORCE_DEFAULTS=t
-		;;
-	-f)
-		[ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-		IPKG_CONF="$2"
-		shift
-		;;
-	-*)
-		ipkg_usage "unknown option $arg"
-		;;
-	*)
-		break
-		;;
-	esac
-	shift
-done
-
-[ $# -lt 1 ] && ipkg_usage "ipkg must have one sub-command argument"
-cmd="$1"
-shift
-
-ipkg_load_configuration
-
-case "$cmd" in
-update|upgrade|list|info|status|install_pending|list_installed)
-	;;
-install|depends|remove|files|search)
-	[ $# -lt 1 ] && ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument"
-	;;
-*)
-	echo "ERROR: unknown sub-command \`$cmd'"
-	ipkg_usage
-	;;
-esac
-
-# Only install pending if we have an interactive sub-command
-case "$cmd" in
-upgrade|install)
-	ipkg_install_pending
-	ipkg_install_wanted
-	;;
-esac
-
-ipkg_$cmd $*
-rm -rf $IPKG_TMP
diff --git a/recipes/stage-manager/files/stage-manager-ipkg-build b/recipes/stage-manager/files/stage-manager-ipkg-build
deleted file mode 100755
index 77367ac..0000000
--- a/recipes/stage-manager/files/stage-manager-ipkg-build
+++ /dev/null
@@ -1,246 +0,0 @@
-#!/bin/sh
-
-# ipkg-build -- construct a .ipk 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
-#   Updated to work on Familiar Pre0.7rc1, with busybox tar.
-#   Note it Requires: binutils-ar (since the busybox ar can't create)
-#   For UID debugging it needs a better "find".
-set -e
-
-version=1.0
-
-ipkg_extract_value() {
-	sed -e "s/^[^:]*:[[:space:]]*//"
-}
-
-required_field() {
-	field=$1
-
-	value=`grep "^$field:" < $CONTROL/control | ipkg_extract_value`
-	if [ -z "$value" ]; then
-		echo "*** Error: $CONTROL/control is missing field $field" >&2
-		return 1
-	fi
-	echo $value
-	return 0
-}
-
-disallowed_field() {
-	field=$1
-
-	value=`grep "^$field:" < $CONTROL/control | ipkg_extract_value`
-	if [ -n "$value" ]; then
-		echo "*** Error: $CONTROL/control contains disallowed field $field" >&2
-		return 1
-	fi
-	echo $value
-	return 0
-}
-
-pkg_appears_sane() {
-	local pkg_dir=$1
-
-	local owd=`pwd`
-	cd $pkg_dir
-
-	PKG_ERROR=0
-
-	tilde_files=`find . -name '*~'`
-	if [ -n "$tilde_files" ]; then
-	    if [ "$noclean" = "1" ]; then
-		echo "*** Warning: The following files have names ending in '~'.
-You probably want to remove them: " >&2
-		ls -ld $tilde_files
-		echo >&2
-	    else
-		echo "*** Removing the following files: $tilde_files"
-		rm -f "$tilde_files"
-	    fi
-	fi
-
-	large_uid_files=`find . -uid +99 || true`
-
-	if [ "$ogargs" = "" ]  && [ -n "$large_uid_files" ]; then
-		echo "*** Warning: The following files have a UID greater than 99.
-You probably want to chown these to a system user: " >&2
-		ls -ld $large_uid_files
-		echo >&2
-	fi
-	    
-
-	if [ ! -f "$CONTROL/control" ]; then
-		echo "*** Error: Control file $pkg_dir/$CONTROL/control not found." >&2
-		cd $owd
-		return 1
-	fi
-
-	pkg=`required_field Package`
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-
-	version=`required_field Version | sed 's/Version://; s/^.://g;'`
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-
-	arch=`required_field Architecture`
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-
-	required_field Maintainer >/dev/null
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-
-	required_field Description >/dev/null
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-
-	section=`required_field Section`
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-	if [ -z "$section" ]; then
-	    echo "The Section field should have one of the following values:" >&2
-	    echo "admin, base, comm, editors, extras, games, graphics, kernel, libs, misc, net, text, web, x11" >&2
-	fi
-
-	priority=`required_field Priority`
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-	if [ -z "$priority" ]; then
-	    echo "The Priority field should have one of the following values:" >&2
-	    echo "required, important, standard, optional, extra." >&2
-	    echo "If you don't know which priority value you should be using, then use \`optional'" >&2
-	fi
-
-	source=`required_field Source`
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-	if [ -z "$source" ]; then
-	    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."
-	fi
-
-	disallowed_filename=`disallowed_field Filename`
-	[ "$?" -ne 0 ] && PKG_ERROR=1
-
-	if echo $pkg | grep '[^a-z0-9.+-]'; then
-		echo "*** Error: Package name $name contains illegal characters, (other than [a-z0-9.+-])" >&2
-		PKG_ERROR=1;
-	fi
-
-	local bad_fields=`sed -ne 's/^\([^[:space:]][^:[:space:]]\+[[:space:]]\+\)[^:].*/\1/p' < $CONTROL/control | sed -e 's/\\n//'`
-	if [ -n "$bad_fields" ]; then
-		bad_fields=`echo $bad_fields`
-		echo "*** Error: The following fields in $CONTROL/control are missing a ':'" >&2
-		echo "	$bad_fields" >&2
-		echo "ipkg-build: This may be due to a missing initial space for a multi-line field value" >&2
-		PKG_ERROR=1
-	fi
-
-	for script in $CONTROL/preinst $CONTROL/postinst $CONTROL/prerm $CONTROL/postrm; do
-		if [ -f $script -a ! -x $script ]; then
-			echo "*** Error: package script $script is not executable" >&2
-			PKG_ERROR=1
-		fi
-	done
-
-	if [ -f $CONTROL/conffiles ]; then
-		for cf in `cat $CONTROL/conffiles`; do
-			if [ ! -f ./$cf ]; then
-				echo "*** Error: $CONTROL/conffiles mentions conffile $cf which does not exist" >&2
-				PKG_ERROR=1
-			fi
-		done
-	fi
-
-	cd $owd
-	return $PKG_ERROR
-}
-
-###
-# ipkg-build "main"
-###
-ogargs=""
-outer=ar
-noclean=0
-usage="Usage: $0 [-c] [-C] [-o owner] [-g group] <pkg_directory> [<destination_directory>]"
-while getopts "cg:ho:v" opt; do
-    case $opt in
-	o ) owner=$OPTARG
-	    ogargs="--owner=$owner"
-	    ;;
-	g ) group=$OPTARG
-	    ogargs="$ogargs --group=$group"
-	    ;;
-        c ) outer=tar
-            ;;
-        C ) noclean=1
-            ;;
-	v ) echo $version
-	    exit 0
-	    ;;
-	h ) 	echo $usage  >&2 ;;
-	\? ) 	echo $usage  >&2
-	esac
-done
-
-
-shift $(($OPTIND - 1))
-
-# continue on to process additional arguments
-
-case $# in
-1)
-	dest_dir=$PWD
-	;;
-2)
-	dest_dir=$2
-	if [ "$dest_dir" = "." -o "$dest_dir" = "./" ] ; then
-	    dest_dir=$PWD
-	fi
-	;;
-*)
-	echo $usage >&2
-	exit 1 
-	;;
-esac
-
-pkg_dir=$1
-
-if [ ! -d $pkg_dir ]; then
-	echo "*** Error: Directory $pkg_dir does not exist" >&2
-	exit 1
-fi
-
-# CONTROL is second so that it takes precedence
-CONTROL=
-[ -d $pkg_dir/DEBIAN ] && CONTROL=DEBIAN
-[ -d $pkg_dir/CONTROL ] && CONTROL=CONTROL
-if [ -z "$CONTROL" ]; then
-	echo "*** Error: Directory $pkg_dir has no CONTROL subdirectory." >&2
-	exit 1
-fi
-
-if ! pkg_appears_sane $pkg_dir; then
-	echo >&2
-	echo "ipkg-build: Please fix the above errors and try again." >&2
-	exit 1
-fi
-
-tmp_dir=$dest_dir/IPKG_BUILD.$$
-mkdir $tmp_dir
-
-echo $CONTROL > $tmp_dir/tarX
-( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -czf $tmp_dir/data.tar.gz . )
-( cd $pkg_dir/$CONTROL && tar $ogargs -czf $tmp_dir/control.tar.gz . )
-rm $tmp_dir/tarX
-
-echo "2.0" > $tmp_dir/debian-binary
-
-pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
-rm -f $pkg_file
-if [ "$outer" = "ar" ] ; then
-  ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
-else
-  ( cd $tmp_dir && tar -zcf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
-fi
-
-rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
-rmdir $tmp_dir
-
-echo "Packaged contents of $pkg_dir into $pkg_file"
diff --git a/recipes/stage-manager/files/stage-manager-opkg b/recipes/stage-manager/files/stage-manager-opkg
new file mode 100755
index 0000000..5a2347a
--- /dev/null
+++ b/recipes/stage-manager/files/stage-manager-opkg
@@ -0,0 +1,1209 @@
+#!/bin/sh
+# ipkg - the itsy package management system
+#
+# Copyright (C) 2001 Carl D. Worth
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+set -e
+
+# Uncomment for debugging
+#set -x
+
+# By default do not do globbing. Any command wanting globbing should
+# explicitly enable it first and disable it afterwards.
+set -o noglob
+
+ipkg_srcs() {
+	local srcre="$1"
+	sed -ne "s/^src[[:space:]]\+$srcre[[:space:]]\+//p" < $IPKG_CONF
+}
+
+ipkg_src_names() {
+	sed -ne "s/^src[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
+}
+
+ipkg_src_byname() {
+	local src="$1"
+	ipkg_srcs $src | head -n1
+}
+
+ipkg_dests() {
+	local destre=`echo $1 | ipkg_protect_slashes`
+	sed -ne "/^dest[[:space:]]\+$destre/{
+s/^dest[[:space:]]\+[^[:space:]]\+[[:space:]]\+//
+s/^/`echo $IPKG_OFFLINE_ROOT | ipkg_protect_slashes`/
+p
+}" < $IPKG_CONF
+}
+
+ipkg_dest_names() {
+	sed -ne "s/^dest[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
+}
+
+ipkg_dests_all() {
+	ipkg_dests '.*'
+}
+
+ipkg_state_dirs() {
+	ipkg_dests_all | sed "s|\$|/$IPKG_DIR_PREFIX|"
+}
+
+ipkg_dest_default() {
+	ipkg_dests_all | head -n1
+}
+
+ipkg_dest_default_name() {
+	ipkg_dest_names | head -n1
+}
+
+ipkg_dest_byname() {
+	local dest="$1"
+	ipkg_dests $dest | head -n1
+}
+
+ipkg_option() {
+	local option="$1"
+	sed -ne "s/^option[[:space:]]\+$option[[:space:]]\+//p" < $IPKG_CONF
+}
+
+ipkg_load_configuration() {
+	if [ -z "$IPKG_CONF_DIR" ]; then
+		IPKG_CONF_DIR=/etc
+	fi
+
+	if [ -z "$IPKG_CONF" ]; then
+		IPKG_CONF=$IPKG_CONF_DIR/ipkg.conf
+	fi
+
+	if [ -z "$IPKG_OFFLINE_ROOT" ]; then
+	    IPKG_OFFLINE_ROOT=`ipkg_option offline_root`
+	fi
+	# Export IPKG_OFFLINE_ROOT for use by update-alternatives
+	export IPKG_OFFLINE_ROOT
+	if [ -n "$DEST_NAME" ]; then
+		IPKG_ROOT=`ipkg_dest_byname $DEST_NAME`
+		if [ -z "$IPKG_ROOT" ]; then
+			if [ -d "$IPKG_OFFLINE_ROOT$DEST_NAME" ]; then
+				IPKG_ROOT="$IPKG_OFFLINE_ROOT$DEST_NAME";
+			else
+				echo "ipkg: invalid destination specification: $DEST_NAME
+Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&2
+				ipkg_dest_names >&2
+				return 1
+			fi
+		fi
+	else
+		IPKG_ROOT=`ipkg_dest_default`
+	fi
+
+	# Global ipkg state directories
+	IPKG_DIR_PREFIX=usr/lib/ipkg
+	IPKG_LISTS_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/lists
+	IPKG_PENDING_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/pending
+
+	# test for bsd mktemp and pass -t <prefix> when needed
+	if (mktemp -V) ; then
+		IPKG_TMP=`mktemp -d`
+	else
+		IPKG_TMP=`mktemp -d -t ipkg`
+	fi
+
+	if [ ! -d "$IPKG_TMP" ]; then
+		echo "Error, could not create a temp directory"
+		return 1
+	fi
+
+	# Destination specific ipkg meta-data directory
+	IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX
+
+	# Proxy Support
+	IPKG_PROXY_USERNAME=`ipkg_option proxy_username`
+	IPKG_PROXY_PASSWORD=`ipkg_option proxy_password`
+	IPKG_HTTP_PROXY=`ipkg_option http_proxy`
+	IPKG_FTP_PROXY=`ipkg_option ftp_proxy`
+	IPKG_NO_PROXY=`ipkg_option no_proxy`
+	if [ -n "$IPKG_HTTP_PROXY" ]; then 
+		export http_proxy="$IPKG_HTTP_PROXY"
+	fi
+
+	if [ -n "$IPKG_FTP_PROXY" ]; then 
+		export ftp_proxy="$IPKG_FTP_PROXY"
+	fi
+
+	if [ -n "$IPKG_NO_PROXY" ]; then 
+		export no_proxy="$IPKG_NO_PROXY"
+	fi
+
+	IPKG_STATUS_FIELDS='\(Package\|Status\|Essential\|Version\|Conffiles\|Root\)'
+}
+
+ipkg_usage() {
+	[ $# -gt 0 ] && echo "ipkg: $*"
+	echo "
+usage: ipkg [options...] sub-command [arguments...]
+where sub-command is one of:
+
+Package Manipulation:
+	update  		Update list of available packages
+	upgrade			Upgrade all installed packages to latest version
+	install <pkg>		Download and install <pkg> (and dependencies)
+	install <file.ipk>	Install package <file.ipk>
+	install <file.deb>	Install package <file.deb>
+	remove <pkg>		Remove package <pkg>
+
+Informational Commands:
+	list    		List available packages and descriptions
+	files <pkg>		List all files belonging to <pkg>
+	search <file>		Search for a packaging providing <file>
+	info [pkg [<field>]]	Display all/some info fields for <pkg> or all
+	status [pkg [<field>]]	Display all/some status fields for <pkg> or all
+	depends <pkg>		Print uninstalled package dependencies for <pkg>
+
+Options:
+	-d <dest_name>          Use <dest_name> as the the root directory for
+	-dest <dest_name>	package installation, removal, upgrading.
+				<dest_name> should be a defined dest name from the
+				configuration file, (but can also be a directory
+				name in a pinch).
+        -o <offline_root>       Use <offline_root> as the root for offline installation.
+        -offline <offline_root> 				
+
+Force Options (use when ipkg is too smart for its own good):
+	-force-depends          Make dependency checks warnings instead of errors
+	-force-defaults         Use default options for questions asked by ipkg.
+                                (no prompts). Note that this will not prevent
+                                package installation scripts from prompting.
+" >&2
+	exit 1
+}
+
+ipkg_dir_part() {
+	local dir=`echo $1 | sed -ne 's/\(.*\/\).*/\1/p'`
+	if [ -z "$dir" ]; then
+		dir="./"
+	fi
+	echo $dir
+}
+
+ipkg_file_part() {
+	echo $1 | sed 's/.*\///'
+}
+
+ipkg_protect_slashes() {
+	sed -e 's/\//\\\//g'
+}
+
+ipkg_download() {
+	local src="$1"
+	local dest="$2"
+
+	local src_file=`ipkg_file_part $src`
+	local dest_dir=`ipkg_dir_part $dest`
+	if [ -z "$dest_dir" ]; then
+		dest_dir="$IPKG_TMP"
+	fi
+
+	local dest_file=`ipkg_file_part $dest`
+	if [ -z "$dest_file" ]; then
+		dest_file="$src_file"
+	fi
+
+	# Proxy support
+	local proxyuser=""
+	local proxypassword=""
+	local proxyoption=""
+		
+	if [ -n "$IPKG_PROXY_USERNAME" ]; then
+		proxyuser="--proxy-user=\"$IPKG_PROXY_USERNAME\""
+		proxypassword="--proxy-passwd=\"$IPKG_PROXY_PASSWORD\""
+	fi
+
+	if [ -n "$IPKG_PROXY_HTTP" -o -n "$IPKG_PROXY_FTP" ]; then
+		proxyoption="--proxy=on"
+	fi
+
+	echo "Downloading $src ..."
+	rm -f $IPKG_TMP/$src_file
+	case "$src" in
+	http://* | ftp://*)
+		if ! wget --passive-ftp -nd $proxyoption $proxyuser $proxypassword -P $IPKG_TMP $src; then
+			echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err"
+			return 1
+		fi
+		mv $IPKG_TMP/$src_file $dest_dir/$dest_file 2>/dev/null
+		;;
+	file:/* )
+		ln -s `echo $src | sed 's/^file://'` $dest_dir/$dest_file 2>/dev/null
+		;;
+	*)
+	echo "DEBUG: $src"
+		;;
+	esac
+
+	echo "Done."
+	return 0
+}
+
+ipkg_update() {
+	if [ ! -e "$IPKG_LISTS_DIR" ]; then
+		mkdir -p $IPKG_LISTS_DIR
+	fi
+
+	local err=
+	for src_name in `ipkg_src_names`; do
+		local src=`ipkg_src_byname $src_name`
+		if ! ipkg_download $src/Packages $IPKG_LISTS_DIR/$src_name; then
+			echo "ipkg_update: Error downloading $src/Packages to $IPKG_LISTS_DIR/$src_name" >&2
+			err=t
+		else
+			echo "Updated list of available packages in $IPKG_LISTS_DIR/$src_name"
+		fi
+	done
+
+	[ -n "$err" ] && return 1
+
+	return 0
+}
+
+ipkg_list() {
+	for src in `ipkg_src_names`; do
+		if ipkg_require_list $src; then 
+# black magic...
+sed -ne "
+/^Package:/{
+s/^Package:[[:space:]]*\<\([a-z0-9.+-]*$1[a-z0-9.+-]*\).*/\1/
+h
+}
+/^Description:/{
+s/^Description:[[:space:]]*\(.*\)/\1/
+H
+g
+s/\\
+/ - /
+p
+}
+" $IPKG_LISTS_DIR/$src
+		fi
+	done
+}
+
+ipkg_extract_paragraph() {
+	local pkg="$1"
+	sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/p"
+}
+
+ipkg_extract_field() {
+	local field="$1"
+# blacker magic...
+	sed -ne "
+: TOP
+/^$field:/{
+p
+n
+b FIELD
+}
+d
+: FIELD
+/^$/b TOP
+/^[^[:space:]]/b TOP
+p
+n
+b FIELD
+"
+}
+
+ipkg_extract_value() {
+	sed -e "s/^[^:]*:[[:space:]]*//"
+}
+
+ipkg_require_list() {
+	[ $# -lt 1 ] && return 1
+	local src="$1"
+	if [ ! -f "$IPKG_LISTS_DIR/$src" ]; then
+		echo "ERROR: File not found: $IPKG_LISTS_DIR/$src" >&2
+		echo "       You probably want to run \`ipkg update'" >&2
+		return 1
+	fi
+	return 0
+}
+
+ipkg_info() {
+	for src in `ipkg_src_names`; do
+		if ipkg_require_list $src; then
+			case $# in
+			0)
+				cat $IPKG_LISTS_DIR/$src
+				;;	
+			1)
+				ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src
+				;;
+			*)
+				ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src | ipkg_extract_field $2
+				;;
+			esac
+		fi
+	done
+}
+
+ipkg_status_sd() {
+	[ $# -lt 1 ] && return 0
+	sd="$1"
+	shift
+	if [ -f $sd/status ]; then
+		case $# in
+		0)
+			cat $sd/status
+			;;
+		1)
+			ipkg_extract_paragraph $1 < $sd/status
+			;;
+		*)
+			ipkg_extract_paragraph $1 < $sd/status | ipkg_extract_field $2
+			;;
+		esac
+	fi
+	return 0
+}
+
+ipkg_status_all() {
+	for sd in `ipkg_state_dirs`; do
+		ipkg_status_sd $sd $*
+	done
+}
+
+ipkg_status() {
+	if [ -n "$DEST_NAME" ]; then
+		ipkg_status_sd $IPKG_STATE_DIR $*
+	else
+		ipkg_status_all $*
+	fi
+}
+
+ipkg_status_matching_sd() {
+	local sd="$1"
+	local re="$2"
+	if [ -f $sd/status ]; then
+		sed -ne "
+: TOP
+/^Package:/{
+s/^Package:[[:space:]]*//
+s/[[:space:]]*$//
+h
+}
+/$re/{
+g
+p
+b NEXT
+}
+d
+: NEXT
+/^$/b TOP
+n
+b NEXT
+" < $sd/status
+	fi
+	return 0
+}
+
+ipkg_status_matching_all() {
+	for sd in `ipkg_state_dirs`; do
+		ipkg_status_matching_sd $sd $*
+	done
+}
+
+ipkg_status_matching() {
+	if [ -n "$DEST_NAME" ]; then
+		ipkg_status_matching_sd $IPKG_STATE_DIR $*
+	else
+		ipkg_status_matching_all $*
+	fi
+}
+
+ipkg_status_installed_sd() {
+	local sd="$1"
+	local pkg="$2"
+	ipkg_status_sd $sd $pkg Status | grep -q "Status: install user installed"
+}
+
+ipkg_status_installed_all() {
+	local ret=1
+	for sd in `ipkg_state_dirs`; do
+		if `ipkg_status_installed_sd $sd $*`; then
+			ret=0
+		fi
+	done
+	return $ret
+}
+
+ipkg_status_mentioned_sd() {
+	local sd="$1"
+	local pkg="$2"
+	[ -n "`ipkg_status_sd $sd $pkg Status`" ]
+}
+
+ipkg_files() {
+	local pkg="$1"
+	if [ -n "$DEST_NAME" ]; then
+		dests=$IPKG_ROOT
+	else
+		dests=`ipkg_dests_all`
+	fi
+	for dest in $dests; do
+		if [ -f $dest/$IPKG_DIR_PREFIX/info/$pkg.list ]; then
+			dest_sed=`echo $dest | ipkg_protect_slashes`
+			sed -e "s/^/$dest_sed/" < $dest/$IPKG_DIR_PREFIX/info/$pkg.list
+		fi
+	done
+}
+
+ipkg_search() {
+	local pattern="$1"
+
+	for dest_name in `ipkg_dest_names`; do
+		dest=`ipkg_dest_byname $dest_name`
+		dest_sed=`echo $dest | ipkg_protect_slashes`
+
+		set +o noglob
+		local list_files=`ls -1 $dest/$IPKG_DIR_PREFIX/info/*.list 2>/dev/null`
+		set -o noglob
+		for file in $list_files; do
+			if sed "s/^/$dest_sed/" $file | grep -q $pattern; then
+				local pkg=`echo $file | sed "s/^.*\/\(.*\)\.list/\1/"`
+				[ "$dest_name" != `ipkg_dest_default_name` ] && pkg="$pkg ($dest_name)"
+				sed "s/^/$dest_sed/" $file | grep $pattern | sed "s/^/$pkg: /"
+			fi
+		done
+	done
+}
+
+ipkg_status_remove_sd() {
+	local sd="$1"
+	local pkg="$2"
+
+	if [ ! -f $sd/status ]; then
+		mkdir -p $sd
+		touch $sd/status
+	fi
+	sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/!p" < $sd/status > $sd/status.new
+	mv $sd/status.new $sd/status
+}
+
+ipkg_status_remove_all() {
+	for sd in `ipkg_state_dirs`; do
+		ipkg_status_remove_sd $sd $*
+	done
+}
+
+ipkg_status_remove() {
+	if [ -n "$DEST_NAME" ]; then
+		ipkg_status_remove_sd $IPKG_STATE_DIR $*
+	else
+		ipkg_status_remove_all $*
+	fi
+}
+
+ipkg_status_update_sd() {
+	local sd="$1"
+	local pkg="$2"
+
+	ipkg_status_remove_sd $sd $pkg
+	ipkg_extract_field "$IPKG_STATUS_FIELDS" >> $sd/status
+	echo "" >> $sd/status
+}
+
+ipkg_status_update() {
+	ipkg_status_update_sd $IPKG_STATE_DIR $*
+}
+
+ipkg_unsatisfied_dependences() {
+    local pkg=$1
+    local deps=`ipkg_get_depends $pkg`
+    local remaining_deps=
+    for dep in $deps; do
+	local installed=`ipkg_get_installed $dep`
+	if [ "$installed" != "installed" ] ; then
+	    remaining_deps="$remaining_deps $dep"
+	fi
+    done
+    ## echo "ipkg_unsatisfied_dependences pkg=$pkg $remaining_deps" > /dev/console
+    echo $remaining_deps
+}
+
+ipkg_safe_pkg_name() {
+	local pkg=$1
+	local spkg=`echo pkg_$pkg | sed -e y/-+./___/`
+	echo $spkg
+}
+
+ipkg_set_depends() {
+	local pkg=$1; shift 
+	local new_deps="$*"
+	pkg=`ipkg_safe_pkg_name $pkg`
+	## setvar ${pkg}_depends "$new_deps"
+	echo $new_deps > $IPKG_TMP/${pkg}.depends
+}
+
+ipkg_get_depends() {
+	local pkg=$1
+	pkg=`ipkg_safe_pkg_name $pkg`
+	cat $IPKG_TMP/${pkg}.depends
+	## eval "echo \$${pkg}_depends"
+}
+
+ipkg_set_installed() {
+	local pkg=$1
+	pkg=`ipkg_safe_pkg_name $pkg`
+	echo installed > $IPKG_TMP/${pkg}.installed
+	## setvar ${pkg}_installed "installed"
+}
+
+ipkg_set_uninstalled() {
+	local pkg=$1
+	pkg=`ipkg_safe_pkg_name $pkg`
+	### echo ipkg_set_uninstalled $pkg > /dev/console
+	echo uninstalled > $IPKG_TMP/${pkg}.installed
+	## setvar ${pkg}_installed "uninstalled"
+}
+
+ipkg_get_installed() {
+	local pkg=$1
+	pkg=`ipkg_safe_pkg_name $pkg`
+	if [ -f $IPKG_TMP/${pkg}.installed ]; then
+		cat $IPKG_TMP/${pkg}.installed
+	fi
+	## eval "echo \$${pkg}_installed"
+}
+
+ipkg_depends() {
+	local new_pkgs="$*"
+	local all_deps=
+	local installed_pkgs=`ipkg_status_matching_all 'Status:.*[[:space:]]installed'`
+	for pkg in $installed_pkgs; do
+	    ipkg_set_installed $pkg
+	done
+	while [ -n "$new_pkgs" ]; do
+		all_deps="$all_deps $new_pkgs"
+		local new_deps=
+		for pkg in $new_pkgs; do
+			if echo $pkg | grep -q '[^a-z0-9.+-]'; then
+				echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [a-z0-9.+-])" >&2
+				return 1
+			fi
+			# TODO: Fix this. For now I am ignoring versions and alternations in dependencies.
+			new_deps="$new_deps "`ipkg_info $pkg '\(Pre-\)\?Depends' | ipkg_extract_value | sed -e 's/([^)]*)//g
+s/\(|[[:space:]]*[a-z0-9.+-]\+[[:space:]]*\)\+//g
+s/,/ /g
+s/ \+/ /g'`
+			ipkg_set_depends $pkg $new_deps
+		done
+
+		new_deps=`echo $new_deps | sed -e 's/[[:space:]]\+/\\
+/g' | sort | uniq`
+
+		local maybe_new_pkgs=
+		for pkg in $new_deps; do
+			if ! echo $installed_pkgs | grep -q "\<$pkg\>"; then
+				maybe_new_pkgs="$maybe_new_pkgs $pkg"
+			fi
+		done
+
+		new_pkgs=
+		for pkg in $maybe_new_pkgs; do
+			if ! echo $all_deps | grep -q "\<$pkg\>"; then
+				if [ -z "`ipkg_info $pkg`" ]; then
+					echo "ipkg_depends: Warning: $pkg mentioned in dependency but no package found in $IPKG_LISTS_DIR" >&2
+					ipkg_set_installed $pkg
+				else
+					new_pkgs="$new_pkgs $pkg"
+					ipkg_set_uninstalled $pkg
+				fi
+			else
+				ipkg_set_uninstalled $pkg
+			fi
+		done
+	done
+
+	echo $all_deps
+}
+
+ipkg_get_install_dest() {
+	local dest="$1"
+	shift
+	local sd=$dest/$IPKG_DIR_PREFIX
+	local info_dir=$sd/info
+
+        local requested_pkgs="$*"
+	local pkgs=`ipkg_depends $*`
+
+	mkdir -p $info_dir
+	for pkg in $pkgs; do
+		if ! ipkg_status_mentioned_sd $sd $pkg; then
+			echo "Package: $pkg
+Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg
+		fi
+	done
+        ## mark the packages that we were directly requested to install as uninstalled
+        for pkg in $requested_pkgs; do ipkg_set_uninstalled $pkg; done
+
+	local new_pkgs=
+	local pkgs_installed=0
+	while [ -n "pkgs" ]; do
+		curcheck=0
+		## echo "pkgs to install: {$pkgs}" > /dev/console
+		for pkg in $pkgs; do
+			curcheck=`expr $curcheck + 1`
+			local is_installed=`ipkg_get_installed $pkg`
+			if [ "$is_installed" = "installed" ]; then
+				echo "$pkg is installed" > /dev/console
+				continue
+			fi
+
+			local remaining_deps=`ipkg_unsatisfied_dependences $pkg`
+			if [ -n "$remaining_deps" ]; then
+				new_pkgs="$new_pkgs $pkg"
+				### echo "Dependences not satisfied for $pkg: $remaining_deps"
+				if [ $curcheck -ne `echo  $pkgs|wc -w` ]; then
+			        	continue
+				fi
+			fi
+
+			local filename=
+			for src in `ipkg_src_names`; do
+				if ipkg_require_list $src; then
+					filename=`ipkg_extract_paragraph $pkg < $IPKG_LISTS_DIR/$src | ipkg_extract_field Filename | ipkg_extract_value`
+					[ -n "$filename" ] && break
+				fi
+			done
+
+			if [ -z "$filename" ]; then
+				echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR"
+				echo "ipkg_get_install:        Check the spelling and maybe run \`ipkg update'."
+				ipkg_status_remove_sd $sd $pkg
+				return 1;
+			fi
+
+			echo ""
+			local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $filename`
+			if ! ipkg_download `ipkg_src_byname $src`/$filename $tmp_pkg_file; then
+				echo "ipkg_get_install: Perhaps you need to run \`ipkg update'?"
+				return 1
+			fi
+
+			if ! ipkg_install_file_dest $dest $tmp_pkg_file; then
+				echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file"
+				echo "ipkg_get_install: I'll leave it there for you to try a manual installation"
+				return 1
+			fi
+
+			ipkg_set_installed $pkg
+			pkgs_installed=`expr $pkgs_installed + 1`
+			rm $tmp_pkg_file
+		done
+		### echo "Installed $pkgs_installed package(s) this round"
+		if [ $pkgs_installed -eq 0 ]; then
+			if [ -z "$new_pkgs" ]; then
+			    break
+			fi
+		fi
+		pkgs_installed=0
+		pkgs="$new_pkgs"
+		new_pkgs=
+		curcheck=0
+        done
+}
+
+ipkg_get_install() {
+	ipkg_get_install_dest $IPKG_ROOT $*
+}
+
+ipkg_install_file_dest() {
+	local dest="$1"
+	local filename="$2"
+	local sd=$dest/$IPKG_DIR_PREFIX
+	local info_dir=$sd/info
+
+	if [ ! -f "$filename" ]; then
+		echo "ipkg_install_file: ERROR: File $filename not found"
+		return 1
+	fi
+
+	local pkg=`ipkg_file_part $filename | sed 's/\([a-z0-9.+-]\+\)_.*/\1/'`
+	local ext=`echo $filename | sed 's/.*\.//'`
+	local pkg_extract_stdout
+	#if [ "$ext" = "ipk" ]; then
+	#	pkg_extract_stdout="tar -xzOf"
+	#elif [ "$ext" = "deb" ]; then
+		pkg_extract_stdout="ar p"
+	#else
+	#	echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)"
+	#	return 1
+	#fi
+
+	# Check dependencies
+	local depends=`ipkg_depends $pkg | sed -e "s/\<$pkg\>//"`
+
+	# Don't worry about deps that are scheduled for installation
+	local missing_deps=
+	for dep in $depends; do
+		if ! ipkg_status_all $dep | grep -q 'Status:[[:space:]]install'; then
+			missing_deps="$missing_deps $dep"
+		fi
+	done
+
+	if [ ! -z "$missing_deps" ]; then
+		if [ -n "$FORCE_DEPENDS" ]; then
+			echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps"
+		else
+			echo "ipkg_install_file: ERROR: $pkg depends on the following uninstalled programs:
+	$missing_deps"
+			echo "ipkg_install_file: You may want to use \`ipkg install' to install these."
+			return 1
+		fi
+	fi
+
+	mkdir -p $IPKG_TMP/$pkg/control
+	mkdir -p $IPKG_TMP/$pkg/data
+	mkdir -p $info_dir
+
+# In certain some versions of Ubuntu, or at least Ubuntu 9.10, tar has some
+# signal handling problems.  The symptom is a sigpipe signal to gzip when
+# using the -z option on tar.  Here and in subsequent sections, we get around
+# this by using temp files instead of the tar -z option or piping straight
+# from gzip.
+
+	rm -f $IPKG_TMP/control.tar.gz $IPKG_TMP/control.tar
+	if ! { $pkg_extract_stdout $filename control.tar.gz > $IPKG_TMP/control.tar.gz &&
+	       gzip -d $IPKG_TMP/control.tar.gz &&
+	       tar -C $IPKG_TMP/$pkg/control -xf $IPKG_TMP/control.tar ; } ; then
+		echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename"
+		return 1
+	fi
+	rm -f $IPKG_TMP/control.tar.gz $IPKG_TMP/control.tar
+
+	if [ -n "$IPKG_OFFLINE_ROOT" ]; then
+		if grep -q '^InstallsOffline:[[:space:]]*no' $IPKG_TMP/$pkg/control/control; then
+			echo "*** Warning: Package $pkg may not be installed in offline mode"
+			echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)"
+			echo "Package: $pkg
+Status: install ok pending" | ipkg_status_update_sd $sd $pkg
+			mkdir -p $IPKG_PENDING_DIR
+			cp $filename $IPKG_PENDING_DIR
+			rm -r $IPKG_TMP/$pkg/control
+			rm -r $IPKG_TMP/$pkg/data
+			rmdir $IPKG_TMP/$pkg
+			return 0
+		fi
+	fi
+
+
+	echo -n "Unpacking $pkg..."
+	set +o noglob
+	for file in $IPKG_TMP/$pkg/control/*; do
+		local base_file=`ipkg_file_part $file`
+		mv $file $info_dir/$pkg.$base_file
+	done
+	set -o noglob
+	rm -r $IPKG_TMP/$pkg/control
+
+	rm -f $IPKG_TMP/data.tar.gz $IPKG_TMP/data.tar
+	if ! { $pkg_extract_stdout $filename ./data.tar.gz > $IPKG_TMP/data.tar.gz &&
+	       gzip -d $IPKG_TMP/data.tar.gz &&
+	       tar -C $IPKG_TMP/$pkg/data -xf $IPKG_TMP/data.tar ; } ; then
+		echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename"
+		return 1
+	fi
+	rm -f $IPKG_TMP/data.tar.gz $IPKG_TMP/data.tar
+	echo "Done."
+
+	echo -n "Configuring $pkg..."
+	export PKG_ROOT=$dest
+	if [ -x "$info_dir/$pkg.preinst" ]; then
+		if ! $info_dir/$pkg.preinst install; then
+			echo "$info_dir/$pkg.preinst failed. Aborting installation of $pkg"
+			rm -rf $IPKG_TMP/$pkg/data
+			rmdir $IPKG_TMP/$pkg
+			return 1
+		fi
+	fi
+
+	local old_conffiles=`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`
+	local new_conffiles=
+	if [ -f "$info_dir/$pkg.conffiles" ]; then
+		for conffile in `cat $info_dir/$pkg.conffiles`; do
+			if [ -f "$dest/$conffile" ] && ! echo " $old_conffiles " | grep -q " $conffile "`md5sum $dest/$conffile | sed 's/ .*//'`; then
+				local use_maintainers_conffile=
+				if [ -z "$FORCE_DEFAULTS" ]; then
+					while true; do
+						echo -n "Configuration file \`$conffile'
+ ==> File on system created by you or by a script.
+ ==> File also in package provided by package maintainer.
+   What would you like to do about it ?  Your options are:
+    Y or I  : install the package maintainer's version
+    N or O  : keep your currently-installed version
+      D     : show the differences between the versions (if diff is installed)
+ The default action is to keep your current version.
+*** `ipkg_file_part $conffile` (Y/I/N/O/D) [default=N] ? "
+						read response
+						case "$response" in
+						[YyIi] | [Yy][Ee][Ss])
+							use_maintainers_conffile=t
+							break
+						;;
+						[Dd])
+							echo "
+diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile"
+							diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile || true
+							echo "[Press ENTER to continue]"
+							read junk
+						;;
+						*)
+							break
+						;;
+						esac
+					done
+				fi
+				if [ -n "$use_maintainers_conffile" ]; then
+					local md5sum=`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`
+					new_conffiles="$new_conffiles $conffile $md5sum"
+				else
+					new_conffiles="$new_conffiles $conffile <custom>"
+					rm $IPKG_TMP/$pkg/data/$conffile
+				fi
+			else
+				md5sum=`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`
+				new_conffiles="$new_conffiles $conffile $md5sum"
+			fi
+		done
+	fi
+
+	local owd=`pwd`
+	(cd $IPKG_TMP/$pkg/data/; tar cf - . | (cd $owd; cd $dest; tar xf -))		
+	rm -rf $IPKG_TMP/$pkg/data
+	rmdir $IPKG_TMP/$pkg
+	rm -f $IPKG_TMP/data.tar.gz $IPKG_TMP/data.tar
+	$pkg_extract_stdout $filename ./data.tar.gz > $IPKG_TMP/data.tar.gz
+	tar tzf $IPKG_TMP/data.tar.gz | sed -e 's/^\.//' > $info_dir/$pkg.list
+	rm -f $IPKG_TMP/data.tar.gz $IPKG_TMP/data.tar
+
+	if [ -x "$info_dir/$pkg.postinst" ]; then
+		$info_dir/$pkg.postinst configure
+	fi
+
+	if [ -n "$new_conffiles" ]; then
+		new_conffiles='Conffiles: '`echo $new_conffiles | ipkg_protect_slashes`
+	fi
+	local sed_safe_root=`echo $dest | sed -e "s#^${IPKG_OFFLINE_ROOT}##" | ipkg_protect_slashes`
+	sed -e "s/\(Package:.*\)/\1\\
+Status: install ok installed\\
+Root: ${sed_safe_root}\\
+${new_conffiles}/" $info_dir/$pkg.control | ipkg_status_update_sd $sd $pkg
+
+	rm -f $info_dir/$pkg.control
+	rm -f $info_dir/$pkg.conffiles
+	rm -f $info_dir/$pkg.preinst
+	rm -f $info_dir/$pkg.postinst
+
+	echo "Done."
+}
+
+ipkg_install_file() {
+	ipkg_install_file_dest $IPKG_ROOT $*
+}
+
+ipkg_install() {
+
+	while [ $# -gt 0 ]; do
+		local pkg="$1"
+		shift
+	
+		case "$pkg" in
+		http://* | ftp://*)
+			local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $pkg`
+			if ipkg_download $pkg $tmp_pkg_file; then
+				ipkg_install_file $tmp_pkg_file
+				rm $tmp_pkg_file
+			fi
+			;;
+		file:/*.ipk  | file://*.deb)
+				local ipkg_filename="`echo $pkg|sed 's/^file://'`"
+				ipkg_install_file $ipkg_filename
+			;;
+		*.ipk  | *.deb)
+			if [ -f "$pkg" ]; then
+				ipkg_install_file $pkg
+			else
+				echo "File not found $pkg" >&2
+			fi
+			;;
+		*)
+			ipkg_get_install $pkg || true
+			;;
+		esac
+	done
+}
+
+ipkg_install_pending() {
+	[ -n "$IPKG_OFFLINE_ROOT" ] && return 0
+
+	if [ -d "$IPKG_PENDING_DIR" ]; then
+		set +o noglob
+		local pending=`ls -1d $IPKG_PENDING_DIR/*.ipk 2> /dev/null` || true
+		set -o noglob
+		if [ -n "$pending" ]; then
+			echo "The following packages in $IPKG_PENDING_DIR will now be installed:"
+			echo $pending
+			for filename in $pending; do
+				if ipkg_install_file $filename; then
+					rm $filename
+				fi
+			done
+		fi
+	fi
+	return 0
+}
+
+ipkg_install_wanted() {
+	local wanted=`ipkg_status_matching 'Status:[[:space:]]*install.*not-installed'`
+
+	if [ -n "$wanted" ]; then
+		echo "The following package were previously requested but have not been installed:"
+		echo $wanted
+
+		if [ -n "$FORCE_DEFAULTS" ]; then
+			echo "Installing them now."
+		else
+			echo -n "Install them now [Y/n] ? "
+			read response
+			case "$response" in
+			[Nn] | [Nn][Oo])
+				return 0
+				;;
+			esac
+		fi
+
+		ipkg_install $wanted
+	fi
+
+	return 0
+}
+
+ipkg_upgrade_pkg() {
+	local pkg="$1"
+	local avail_ver=`ipkg_info $pkg Version | ipkg_extract_value | head -n1`
+
+	is_installed=
+	for dest_name in `ipkg_dest_names`; do
+		local dest=`ipkg_dest_byname $dest_name`
+		local sd=$dest/$IPKG_DIR_PREFIX
+		local inst_ver=`ipkg_status_sd $sd $pkg Version | ipkg_extract_value`
+		if [ -n "$inst_ver" ]; then
+			is_installed=t
+
+			if [ -z "$avail_ver" ]; then
+				echo "Assuming locally installed package $pkg ($inst_ver) is up to date"
+				return 0
+			fi
+
+			if [ "$avail_ver" = "$inst_ver" ]; then 
+				echo "Package $pkg ($inst_ver) installed in $dest_name is up to date"
+			elif opkg-compare-versions $avail_ver '>>' $inst_ver; then
+				echo "Upgrading $pkg ($dest_name) from $inst_ver to $avail_ver"
+				ipkg_get_install_dest $dest $pkg
+			else
+				echo "Not downgrading package $pkg from $inst_ver to $avail_ver"
+			fi
+		fi
+	done
+
+	if [ -z "$is_installed" ]; then
+		echo "Package $pkg does not appear to be installed"
+		return 0
+	fi
+
+}
+
+ipkg_upgrade() {
+	if [ $# -lt 1 ]; then
+		local pkgs=`ipkg_status_matching 'Status:.*[[:space:]]installed'`
+	else
+		pkgs="$*"
+	fi
+	
+	for pkg in $pkgs; do
+		ipkg_upgrade_pkg $pkg
+	done
+}
+
+ipkg_remove_pkg_dest() {
+	local dest="$1"
+	local pkg="$2"
+	local sd=$dest/$IPKG_DIR_PREFIX
+	local info_dir=$sd/info
+
+	if ! ipkg_status_installed_sd $sd $pkg; then
+		echo "ipkg_remove: Package $pkg does not appear to be installed in $dest"
+		if ipkg_status_mentioned_sd $sd $pkg; then
+			echo "Purging mention of $pkg from the ipkg database"
+			ipkg_status_remove_sd $sd $pkg
+		fi
+		return 1
+	fi
+
+	echo "ipkg_remove: Removing $pkg... "
+
+	local files=`cat $info_dir/$pkg.list`
+
+	export PKG_ROOT=$dest
+	if [ -x "$info_dir/$pkg.prerm" ]; then
+		$info_dir/$pkg.prerm remove
+	fi
+
+	local conffiles=`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`
+
+	local dirs_to_remove=
+	for file in $files; do
+		if [ -d "$dest/$file" ]; then
+			dirs_to_remove="$dirs_to_remove $dest/$file"
+		else
+			if echo " $conffiles " | grep -q " $file "; then
+				if echo " $conffiles " | grep -q " $file "`md5sum $dest/$file | sed 's/ .*//'`; then
+					rm -f $dest/$file
+				fi
+			else
+				rm -f $dest/$file
+			fi
+		fi
+	done
+
+	local removed_a_dir=t
+	while [ -n "$removed_a_dir" ]; do
+		removed_a_dir=
+		local new_dirs_to_remove=
+		for dir in $dirs_to_remove; do
+			if rmdir $dir >/dev/null 2>&1; then
+				removed_a_dir=t
+			else
+				new_dirs_to_remove="$new_dirs_to_remove $dir"
+			fi
+		done
+		dirs_to_remove="$new_dirs_to_remove"
+	done
+
+	if [ -n "$dirs_to_remove" ]; then
+		echo "ipkg_remove: Warning: Not removing the following directories since they are not empty:" >&2
+		echo "$dirs_to_remove" | sed -e 's/\/[/]\+/\//g' >&2
+	fi
+
+	if [ -x "$info_dir/$pkg.postrm" ]; then
+		$info_dir/$pkg.postrm remove
+	fi
+
+	ipkg_status_remove_sd $sd $pkg
+	set +o noglob
+	rm -f $info_dir/$pkg.*
+	set -o noglob
+
+	echo "Done."
+}
+
+ipkg_remove_pkg() {
+	local pkg="$1"
+	for dest in `ipkg_dests_all`; do
+		local sd=$dest/$IPKG_DIR_PREFIX
+		if ipkg_status_mentioned_sd $sd $pkg; then
+			ipkg_remove_pkg_dest $dest $pkg
+		fi
+	done
+}
+
+ipkg_remove() {
+	while [ $# -gt 0 ]; do
+		local pkg="$1"
+		shift
+		if [ -n "$DEST_NAME" ]; then
+			ipkg_remove_pkg_dest $IPKG_ROOT $pkg
+		else
+			ipkg_remove_pkg $pkg
+		fi
+	done
+}
+
+ipkg_list_installed() {
+	echo `ipkg_status_matching 'Status:.*[[:space:]]installed'`
+}
+###########
+# ipkg main
+###########
+
+# Parse options
+while [ $# -gt 0 ]; do
+	arg="$1"
+	case $arg in
+	-d | -dest)
+		[ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
+		DEST_NAME="$2"
+		shift
+		;;
+	-o | -offline)
+		[ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
+		IPKG_OFFLINE_ROOT="$2"
+		shift
+		;;
+	-force-depends)
+		FORCE_DEPENDS=t
+		;;
+	-force-defaults)
+		FORCE_DEFAULTS=t
+		;;
+	-f)
+		[ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
+		IPKG_CONF="$2"
+		shift
+		;;
+	-*)
+		ipkg_usage "unknown option $arg"
+		;;
+	*)
+		break
+		;;
+	esac
+	shift
+done
+
+[ $# -lt 1 ] && ipkg_usage "ipkg must have one sub-command argument"
+cmd="$1"
+shift
+
+ipkg_load_configuration
+
+case "$cmd" in
+update|upgrade|list|info|status|install_pending|list_installed)
+	;;
+install|depends|remove|files|search)
+	[ $# -lt 1 ] && ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument"
+	;;
+*)
+	echo "ERROR: unknown sub-command \`$cmd'"
+	ipkg_usage
+	;;
+esac
+
+# Only install pending if we have an interactive sub-command
+case "$cmd" in
+upgrade|install)
+	ipkg_install_pending
+	ipkg_install_wanted
+	;;
+esac
+
+ipkg_$cmd $*
+rm -rf $IPKG_TMP
diff --git a/recipes/stage-manager/files/stage-manager-opkg-build b/recipes/stage-manager/files/stage-manager-opkg-build
new file mode 100755
index 0000000..b7be3dc
--- /dev/null
+++ b/recipes/stage-manager/files/stage-manager-opkg-build
@@ -0,0 +1,246 @@
+#!/bin/sh
+
+# opkg-build -- construct a .ipk 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
+#   Updated to work on Familiar Pre0.7rc1, with busybox tar.
+#   Note it Requires: binutils-ar (since the busybox ar can't create)
+#   For UID debugging it needs a better "find".
+set -e
+
+version=1.0
+
+opkg_extract_value() {
+	sed -e "s/^[^:]*:[[:space:]]*//"
+}
+
+required_field() {
+	field=$1
+
+	value=`grep "^$field:" < $CONTROL/control | opkg_extract_value`
+	if [ -z "$value" ]; then
+		echo "*** Error: $CONTROL/control is missing field $field" >&2
+		return 1
+	fi
+	echo $value
+	return 0
+}
+
+disallowed_field() {
+	field=$1
+
+	value=`grep "^$field:" < $CONTROL/control | opkg_extract_value`
+	if [ -n "$value" ]; then
+		echo "*** Error: $CONTROL/control contains disallowed field $field" >&2
+		return 1
+	fi
+	echo $value
+	return 0
+}
+
+pkg_appears_sane() {
+	local pkg_dir=$1
+
+	local owd=`pwd`
+	cd $pkg_dir
+
+	PKG_ERROR=0
+
+	tilde_files=`find . -name '*~'`
+	if [ -n "$tilde_files" ]; then
+	    if [ "$noclean" = "1" ]; then
+		echo "*** Warning: The following files have names ending in '~'.
+You probably want to remove them: " >&2
+		ls -ld $tilde_files
+		echo >&2
+	    else
+		echo "*** Removing the following files: $tilde_files"
+		rm -f "$tilde_files"
+	    fi
+	fi
+
+	large_uid_files=`find . -uid +99 || true`
+
+	if [ "$ogargs" = "" ]  && [ -n "$large_uid_files" ]; then
+		echo "*** Warning: The following files have a UID greater than 99.
+You probably want to chown these to a system user: " >&2
+		ls -ld $large_uid_files
+		echo >&2
+	fi
+	    
+
+	if [ ! -f "$CONTROL/control" ]; then
+		echo "*** Error: Control file $pkg_dir/$CONTROL/control not found." >&2
+		cd $owd
+		return 1
+	fi
+
+	pkg=`required_field Package`
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+
+	version=`required_field Version | sed 's/Version://; s/^.://g;'`
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+
+	arch=`required_field Architecture`
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+
+	required_field Maintainer >/dev/null
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+
+	required_field Description >/dev/null
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+
+	section=`required_field Section`
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+	if [ -z "$section" ]; then
+	    echo "The Section field should have one of the following values:" >&2
+	    echo "admin, base, comm, editors, extras, games, graphics, kernel, libs, misc, net, text, web, x11" >&2
+	fi
+
+	priority=`required_field Priority`
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+	if [ -z "$priority" ]; then
+	    echo "The Priority field should have one of the following values:" >&2
+	    echo "required, important, standard, optional, extra." >&2
+	    echo "If you don't know which priority value you should be using, then use \`optional'" >&2
+	fi
+
+	source=`required_field Source`
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+	if [ -z "$source" ]; then
+	    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."
+	fi
+
+	disallowed_filename=`disallowed_field Filename`
+	[ "$?" -ne 0 ] && PKG_ERROR=1
+
+	if echo $pkg | grep '[^a-z0-9.+-]'; then
+		echo "*** Error: Package name $name contains illegal characters, (other than [a-z0-9.+-])" >&2
+		PKG_ERROR=1;
+	fi
+
+	local bad_fields=`sed -ne 's/^\([^[:space:]][^:[:space:]]\+[[:space:]]\+\)[^:].*/\1/p' < $CONTROL/control | sed -e 's/\\n//'`
+	if [ -n "$bad_fields" ]; then
+		bad_fields=`echo $bad_fields`
+		echo "*** Error: The following fields in $CONTROL/control are missing a ':'" >&2
+		echo "	$bad_fields" >&2
+		echo "opkg-build: This may be due to a missing initial space for a multi-line field value" >&2
+		PKG_ERROR=1
+	fi
+
+	for script in $CONTROL/preinst $CONTROL/postinst $CONTROL/prerm $CONTROL/postrm; do
+		if [ -f $script -a ! -x $script ]; then
+			echo "*** Error: package script $script is not executable" >&2
+			PKG_ERROR=1
+		fi
+	done
+
+	if [ -f $CONTROL/conffiles ]; then
+		for cf in `cat $CONTROL/conffiles`; do
+			if [ ! -f ./$cf ]; then
+				echo "*** Error: $CONTROL/conffiles mentions conffile $cf which does not exist" >&2
+				PKG_ERROR=1
+			fi
+		done
+	fi
+
+	cd $owd
+	return $PKG_ERROR
+}
+
+###
+# opkg-build "main"
+###
+ogargs=""
+outer=ar
+noclean=0
+usage="Usage: $0 [-c] [-C] [-o owner] [-g group] <pkg_directory> [<destination_directory>]"
+while getopts "cg:ho:v" opt; do
+    case $opt in
+	o ) owner=$OPTARG
+	    ogargs="--owner=$owner"
+	    ;;
+	g ) group=$OPTARG
+	    ogargs="$ogargs --group=$group"
+	    ;;
+        c ) outer=tar
+            ;;
+        C ) noclean=1
+            ;;
+	v ) echo $version
+	    exit 0
+	    ;;
+	h ) 	echo $usage  >&2 ;;
+	\? ) 	echo $usage  >&2
+	esac
+done
+
+
+shift $(($OPTIND - 1))
+
+# continue on to process additional arguments
+
+case $# in
+1)
+	dest_dir=$PWD
+	;;
+2)
+	dest_dir=$2
+	if [ "$dest_dir" = "." -o "$dest_dir" = "./" ] ; then
+	    dest_dir=$PWD
+	fi
+	;;
+*)
+	echo $usage >&2
+	exit 1 
+	;;
+esac
+
+pkg_dir=$1
+
+if [ ! -d $pkg_dir ]; then
+	echo "*** Error: Directory $pkg_dir does not exist" >&2
+	exit 1
+fi
+
+# CONTROL is second so that it takes precedence
+CONTROL=
+[ -d $pkg_dir/DEBIAN ] && CONTROL=DEBIAN
+[ -d $pkg_dir/CONTROL ] && CONTROL=CONTROL
+if [ -z "$CONTROL" ]; then
+	echo "*** Error: Directory $pkg_dir has no CONTROL subdirectory." >&2
+	exit 1
+fi
+
+if ! pkg_appears_sane $pkg_dir; then
+	echo >&2
+	echo "opkg-build: Please fix the above errors and try again." >&2
+	exit 1
+fi
+
+tmp_dir=$dest_dir/IPKG_BUILD.$$
+mkdir $tmp_dir
+
+echo $CONTROL > $tmp_dir/tarX
+( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -czf $tmp_dir/data.tar.gz . )
+( cd $pkg_dir/$CONTROL && tar $ogargs -czf $tmp_dir/control.tar.gz . )
+rm $tmp_dir/tarX
+
+echo "2.0" > $tmp_dir/debian-binary
+
+pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
+rm -f $pkg_file
+if [ "$outer" = "ar" ] ; then
+  ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
+else
+  ( cd $tmp_dir && tar -zcf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
+fi
+
+rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
+rmdir $tmp_dir
+
+echo "Packaged contents of $pkg_dir into $pkg_file"
diff --git a/recipes/stage-manager/stagemanager-native_0.0.1.bb b/recipes/stage-manager/stagemanager-native_0.0.1.bb
index 9577749..8ad73ef 100644
--- a/recipes/stage-manager/stagemanager-native_0.0.1.bb
+++ b/recipes/stage-manager/stagemanager-native_0.0.1.bb
@@ -2,8 +2,8 @@ DESCRIPTION = "Helper script for packaged-staging.bbclass"
 PR = "r15"
 
 SRC_URI = "file://stage-manager \
-           file://stage-manager-ipkg \
-           file://stage-manager-ipkg-build "
+           file://stage-manager-opkg \
+           file://stage-manager-opkg-build "
 LICENSE = "GPLv2"
 
 PACKAGE_ARCH = "all"
@@ -21,6 +21,6 @@ NATIVE_INSTALL_WORKS = "1"
 do_install() {
 	install -d ${STAGING_BINDIR}
 	install -m 0755 ${WORKDIR}/stage-manager ${STAGING_BINDIR}
-	install -m 0755 ${WORKDIR}/stage-manager-ipkg ${STAGING_BINDIR}
-	install -m 0755 ${WORKDIR}/stage-manager-ipkg-build ${STAGING_BINDIR}
+	install -m 0755 ${WORKDIR}/stage-manager-opkg ${STAGING_BINDIR}
+	install -m 0755 ${WORKDIR}/stage-manager-opkg-build ${STAGING_BINDIR}
 }
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 9/9] Recipes: Replace ipkg-utils with opkg-utils
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
                   ` (7 preceding siblings ...)
  2011-01-25  6:25 ` [PATCH 8/9] stage-manager: Use opkg utilities Khem Raj
@ 2011-01-25  6:25 ` Khem Raj
  2011-01-25 13:38 ` [PATCH 0/9 v2] " Koen Kooi
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-25  6:25 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../blueprobe/files/blueprobe-svn-Makefile.patch   |    4 ++--
 recipes/gpe-today/files/Makefile.dpkg_ipkg         |    2 +-
 recipes/gpe-today/files/Makefile.translation       |    4 ++--
 recipes/libxsettings/files/Makefile.dpkg_ipkg      |    2 +-
 recipes/libxsettings/files/Makefile.translation    |    4 ++--
 recipes/masqmail/masqmail_0.2.21.bb                |    2 +-
 recipes/meta/canadian-sdk.bb                       |    2 +-
 recipes/meta/meta-toolchain.bb                     |    2 +-
 recipes/meta/nylon-feed.bb                         |    2 +-
 recipes/xserver-common/files/Makefile.dpkg_ipkg    |    2 +-
 recipes/xserver-common/files/Makefile.translation  |    4 ++--
 11 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/recipes/blueprobe/files/blueprobe-svn-Makefile.patch b/recipes/blueprobe/files/blueprobe-svn-Makefile.patch
index b51b465..a6d4f24 100644
--- a/recipes/blueprobe/files/blueprobe-svn-Makefile.patch
+++ b/recipes/blueprobe/files/blueprobe-svn-Makefile.patch
@@ -99,7 +99,7 @@ diff -Naur blueprobe.orig/Makefile.dpkg_ipkg blueprobe/Makefile.dpkg_ipkg
 +	if test -e familiar/postrm;    then install familiar/postrm    familiar/dist/CONTROL; fi
 +	$(MAKE) DESTDIR=`pwd`/familiar/dist PREFIX=/usr prefix=/usr DEBUG=no install-program
 +	rm -rf familiar/dist.list
-+	ipkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
++	opkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
 +	if [ "x$(LINGUAS)" != "x" ]; then make translation-ipkg; tr ' ' '\n' < translation-ipkgs.txt >> familiar/dist.list; fi
 +	md5sum `cat familiar/dist.list` > $(PACKAGE)_$(VERSION).batch
 +	rm -rf familiar/dist familiar/dist.list
@@ -146,7 +146,7 @@ diff -Naur blueprobe.orig/Makefile.translation blueprobe/Makefile.translation
 +CONTROL = `if test -e familiar/control1; then echo control1; else echo control; fi`
 +
 +# use ipkg-build or ipkg-deb-build
-+IPKG_BUILD := ipkg-build
++IPKG_BUILD := opkg-build
 +
 +TRANSLATION_SITE := http://www.iro.umontreal.ca/~gnutra/maint
 +
diff --git a/recipes/gpe-today/files/Makefile.dpkg_ipkg b/recipes/gpe-today/files/Makefile.dpkg_ipkg
index 978b08d..ebf41fe 100644
--- a/recipes/gpe-today/files/Makefile.dpkg_ipkg
+++ b/recipes/gpe-today/files/Makefile.dpkg_ipkg
@@ -74,7 +74,7 @@ ipkg: check-source ipkg-prep clean
 	if test -e familiar/postrm;    then install familiar/postrm    familiar/dist/CONTROL; fi
 	$(MAKE) DESTDIR=`pwd`/familiar/dist PREFIX=/usr prefix=/usr DEBUG=no install-program
 	rm -rf familiar/dist.list
-	ipkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
+	opkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
 	if [ "x$(LINGUAS)" != "x" ]; then make translation-ipkg; tr ' ' '\n' < translation-ipkgs.txt >> familiar/dist.list; fi
 	md5sum `cat familiar/dist.list` > $(PACKAGE)_$(VERSION).batch
 	rm -rf familiar/dist familiar/dist.list
diff --git a/recipes/gpe-today/files/Makefile.translation b/recipes/gpe-today/files/Makefile.translation
index 1ca7d64..6ce30b4 100644
--- a/recipes/gpe-today/files/Makefile.translation
+++ b/recipes/gpe-today/files/Makefile.translation
@@ -2,8 +2,8 @@
 
 CONTROL = `if test -e familiar/control1; then echo control1; else echo control; fi`
 
-# use ipkg-build or ipkg-deb-build
-IPKG_BUILD := ipkg-build
+# use opkg-build or opkg-deb-build
+IPKG_BUILD := opkg-build
 
 TRANSLATION_SITE := http://www.iro.umontreal.ca/~gnutra/maint
 
diff --git a/recipes/libxsettings/files/Makefile.dpkg_ipkg b/recipes/libxsettings/files/Makefile.dpkg_ipkg
index 76c5321..771ed8b 100644
--- a/recipes/libxsettings/files/Makefile.dpkg_ipkg
+++ b/recipes/libxsettings/files/Makefile.dpkg_ipkg
@@ -74,7 +74,7 @@ ipkg: check-source ipkg-prep clean
 	if test -e familiar/postrm;    then install familiar/postrm    familiar/dist/CONTROL; fi
 	$(MAKE) DESTDIR=`pwd`/familiar/dist PREFIX=/usr prefix=/usr DEBUG=no install-program
 	rm -rf familiar/dist.list
-	ipkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
+	opkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
 	if [ "x$(LINGUAS)" != "x" ]; then make translation-ipkg; tr ' ' '\n' < translation-ipkgs.txt >> familiar/dist.list; fi
 	md5sum `cat familiar/dist.list` > $(PACKAGE)_$(VERSION).batch
 	rm -rf familiar/dist familiar/dist.list
diff --git a/recipes/libxsettings/files/Makefile.translation b/recipes/libxsettings/files/Makefile.translation
index 1ca7d64..6ce30b4 100644
--- a/recipes/libxsettings/files/Makefile.translation
+++ b/recipes/libxsettings/files/Makefile.translation
@@ -2,8 +2,8 @@
 
 CONTROL = `if test -e familiar/control1; then echo control1; else echo control; fi`
 
-# use ipkg-build or ipkg-deb-build
-IPKG_BUILD := ipkg-build
+# use opkg-build or opkg-deb-build
+IPKG_BUILD := opkg-build
 
 TRANSLATION_SITE := http://www.iro.umontreal.ca/~gnutra/maint
 
diff --git a/recipes/masqmail/masqmail_0.2.21.bb b/recipes/masqmail/masqmail_0.2.21.bb
index 94a742d..e632239 100644
--- a/recipes/masqmail/masqmail_0.2.21.bb
+++ b/recipes/masqmail/masqmail_0.2.21.bb
@@ -25,7 +25,7 @@ MAIL_GROUP ?= "mail"
 EXTRA_OECONF += "--with-user=$(id -u)"
 EXTRA_OECONF += "--with-group=$(id -g)"
 
-IPKGBUILDCMD = "ipkg-build -o ${MAIL_USER} -g ${MAIL_GROUP}"
+OPKGBUILDCMD = "opkg-build -o ${MAIL_USER} -g ${MAIL_GROUP}"
 
 SRC_URI[md5sum] = "7e989a8b0562054aea22c654507f2cb5"
 SRC_URI[sha256sum] = "2257099c760c12daf094744c6b2269d476e3bc6b523366168ad81bdd2ebd2445"
diff --git a/recipes/meta/canadian-sdk.bb b/recipes/meta/canadian-sdk.bb
index 93b80b2..0d914f7 100644
--- a/recipes/meta/canadian-sdk.bb
+++ b/recipes/meta/canadian-sdk.bb
@@ -91,7 +91,7 @@ do_populate_sdk() {
 			if [ -e $pkgnames ]; then
 				oenote "Found $pkgnames"
 				cp $pkgnames ${SDK_OUTPUT}/${prefix}/ipk/
-				orig_pkg=`ipkg-list-fields $pkgnames | grep OE: | cut -d ' ' -f2`
+				orig_pkg=`opkg-list-fields $pkgnames | grep OE: | cut -d ' ' -f2`
 				pkg_subdir=$arch${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) == ('' or 'custom')]}
 				mkdir -p ${SDK_OUTPUT}/${prefix}/pkgdata/$pkg_subdir/runtime
 				cp ${STAGING_DIR}/pkgdata/$pkg_subdir/$orig_pkg ${SDK_OUTPUT}/${prefix}/pkgdata/$pkg_subdir/
diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
index b8ea037..3462b2c 100644
--- a/recipes/meta/meta-toolchain.bb
+++ b/recipes/meta/meta-toolchain.bb
@@ -96,7 +96,7 @@ do_populate_sdk() {
 			if [ -e $pkgnames ]; then
 				oenote "Found $pkgnames"
 				cp $pkgnames ${SDK_OUTPUT2}/${SDKPATH}/ipk/
-				orig_pkg=`ipkg-list-fields $pkgnames | grep OE: | cut -d ' ' -f2`
+				orig_pkg=`opkg-list-fields $pkgnames | grep OE: | cut -d ' ' -f2`
 				pkg_subdir=$arch${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) == ('' or 'custom')]}
 				mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/$pkg_subdir/runtime
 				cp ${TMPDIR}/pkgdata/$pkg_subdir/$orig_pkg ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/$pkg_subdir/
diff --git a/recipes/meta/nylon-feed.bb b/recipes/meta/nylon-feed.bb
index d5759ae..d68f5f8 100644
--- a/recipes/meta/nylon-feed.bb
+++ b/recipes/meta/nylon-feed.bb
@@ -39,7 +39,7 @@ RDEPENDS = "${NYLON_FEED} \
 
 do_index() {
 	touch ${DEPLOY_DIR_IPK}/Packages
-	ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
+	opkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
 }
 
 addtask index before do_build after do_install
diff --git a/recipes/xserver-common/files/Makefile.dpkg_ipkg b/recipes/xserver-common/files/Makefile.dpkg_ipkg
index 76c5321..771ed8b 100644
--- a/recipes/xserver-common/files/Makefile.dpkg_ipkg
+++ b/recipes/xserver-common/files/Makefile.dpkg_ipkg
@@ -74,7 +74,7 @@ ipkg: check-source ipkg-prep clean
 	if test -e familiar/postrm;    then install familiar/postrm    familiar/dist/CONTROL; fi
 	$(MAKE) DESTDIR=`pwd`/familiar/dist PREFIX=/usr prefix=/usr DEBUG=no install-program
 	rm -rf familiar/dist.list
-	ipkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
+	opkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
 	if [ "x$(LINGUAS)" != "x" ]; then make translation-ipkg; tr ' ' '\n' < translation-ipkgs.txt >> familiar/dist.list; fi
 	md5sum `cat familiar/dist.list` > $(PACKAGE)_$(VERSION).batch
 	rm -rf familiar/dist familiar/dist.list
diff --git a/recipes/xserver-common/files/Makefile.translation b/recipes/xserver-common/files/Makefile.translation
index 1ca7d64..6ce30b4 100644
--- a/recipes/xserver-common/files/Makefile.translation
+++ b/recipes/xserver-common/files/Makefile.translation
@@ -2,8 +2,8 @@
 
 CONTROL = `if test -e familiar/control1; then echo control1; else echo control; fi`
 
-# use ipkg-build or ipkg-deb-build
-IPKG_BUILD := ipkg-build
+# use opkg-build or opkg-deb-build
+IPKG_BUILD := opkg-build
 
 TRANSLATION_SITE := http://www.iro.umontreal.ca/~gnutra/maint
 
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils
  2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
                   ` (8 preceding siblings ...)
  2011-01-25  6:25 ` [PATCH 9/9] Recipes: Replace ipkg-utils with opkg-utils Khem Raj
@ 2011-01-25 13:38 ` Koen Kooi
  2011-01-25 23:29   ` Graham Gower
  9 siblings, 1 reply; 13+ messages in thread
From: Koen Kooi @ 2011-01-25 13:38 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25-01-11 07:25, Khem Raj wrote:
> From: Khem Raj <raj.khem@gmail.com>                                                                  
> 
> These patches replace usage of ipkg-utils with opkg-utils
> in OE. I have built a native-sdk-image successfully on
> angstrom-2008.1 and minimal
> 
> Please review and provide your feedback

For the whole series:

Acked-by: Koen Kooi <koen@openembedded.org>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFNPtI/MkyGM64RGpERApe1AJ9F31kz2DOWvWXSoQ9JwgmZdqPbLgCffr2t
5vebzSlpQLioYXgRfq7jDwM=
=rokd
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils
  2011-01-25 13:38 ` [PATCH 0/9 v2] " Koen Kooi
@ 2011-01-25 23:29   ` Graham Gower
  2011-01-26  1:21     ` Khem Raj
  0 siblings, 1 reply; 13+ messages in thread
From: Graham Gower @ 2011-01-25 23:29 UTC (permalink / raw)
  To: openembedded-devel

On 26 January 2011 00:08, Koen Kooi <k.kooi@student.utwente.nl> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 25-01-11 07:25, Khem Raj wrote:
>> From: Khem Raj <raj.khem@gmail.com>
>>
>> These patches replace usage of ipkg-utils with opkg-utils
>> in OE. I have built a native-sdk-image successfully on
>> angstrom-2008.1 and minimal
>>
>> Please review and provide your feedback
>
> For the whole series:
>
> Acked-by: Koen Kooi <koen@openembedded.org>
>

Yes, the second patch series looks sane to me.

Acked-by: Graham Gower <graham.gower@gmail.com>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils
  2011-01-25 23:29   ` Graham Gower
@ 2011-01-26  1:21     ` Khem Raj
  0 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-01-26  1:21 UTC (permalink / raw)
  To: openembedded-devel

On Tue, Jan 25, 2011 at 3:29 PM, Graham Gower <graham.gower@gmail.com> wrote:
> On 26 January 2011 00:08, Koen Kooi <k.kooi@student.utwente.nl> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 25-01-11 07:25, Khem Raj wrote:
>>> From: Khem Raj <raj.khem@gmail.com>
>>>
>>> These patches replace usage of ipkg-utils with opkg-utils
>>> in OE. I have built a native-sdk-image successfully on
>>> angstrom-2008.1 and minimal
>>>
>>> Please review and provide your feedback
>>
>> For the whole series:
>>
>> Acked-by: Koen Kooi <koen@openembedded.org>
>>
>
> Yes, the second patch series looks sane to me.
>
> Acked-by: Graham Gower <graham.gower@gmail.com>
>


thanks. I have pushed the series. My testing hasnt failed thus far, I
have build on angstrom minimal and slugos
distros. There are packages like gpe-package which still use ipkg as
their backend. but it was broken before too

> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-01-26  1:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25  6:25 [PATCH 0/9 v2] Replace ipkg-utils with opkg-utils Khem Raj
2011-01-25  6:25 ` [PATCH 1/9] classes/package_ipk.bbclass, classes/sourceipk.bbclass: Use opkg-utils-native instead of ipkg-utils-native Khem Raj
2011-01-25  6:25 ` [PATCH 2/9] recipes/meta recipes/tasks: Replace ipkg-utils with opkg-utils Khem Raj
2011-01-25  6:25 ` [PATCH 3/9] slugos.inc: Dont lock SRCDATE for ipkg, its not used anymore Khem Raj
2011-01-25  6:25 ` [PATCH 4/9] ipkg-utils: Remove the recipes Khem Raj
2011-01-25  6:25 ` [PATCH 5/9] classes: Replace ipkg-make-index with opkg-make-index Khem Raj
2011-01-25  6:25 ` [PATCH 6/9] bitbake.conf, nylon.conf, openwrt-sdk.conf: Use opkg-build instead of ipkg-build Khem Raj
2011-01-25  6:25 ` [PATCH 7/9] angstrom/personal-feed.sh, angstrom/sort.sh: Replace ipkg-make-index with opkg-make-index Khem Raj
2011-01-25  6:25 ` [PATCH 8/9] stage-manager: Use opkg utilities Khem Raj
2011-01-25  6:25 ` [PATCH 9/9] Recipes: Replace ipkg-utils with opkg-utils Khem Raj
2011-01-25 13:38 ` [PATCH 0/9 v2] " Koen Kooi
2011-01-25 23:29   ` Graham Gower
2011-01-26  1:21     ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.