]> pilppa.com Git - familiar-h63xx-build.git/commitdiff
image_ipk.bbclass, familiar-feeds.inc, gpe-image, opie-image: rework feed handling...
authorRene Wagner <rw@handhelds.org>
Sun, 23 Jul 2006 20:25:05 +0000 (22:25 +0200)
committerRene Wagner <rw@handhelds.org>
Sun, 23 Jul 2006 20:25:05 +0000 (22:25 +0200)
If opie-aqpkg can't handle /etc/ipkg/*.conf, it will have to be fixed.

Signed-off-by: Rene Wagner <rw@handhelds.org>
org.handhelds.familiar/classes/image_ipk.bbclass
org.handhelds.familiar/conf/distro/familiar-feeds.inc
org.handhelds.familiar/packages/meta/gpe-image.bb
org.handhelds.familiar/packages/meta/opie-image.bb

index 37d4b338d6146f831de116eea788433e9439f407..293776dd393e3b00e178b7159df32d0812326eb1 100644 (file)
@@ -53,56 +53,55 @@ fakeroot do_rootfs () {
        ${IMAGE_POSTPROCESS_COMMAND}
 }
 
-DISTRO_LOCALE_FEEDS_PREFIXES ?= ""
-DISTRO_LOCALE_FEEDS_HEADER ?= ""
+DISTRO_FEEDS_FILE_PATTERN = "${IMAGE_ROOTFS}/etc/ipkg/${DISTRO}-${DISTRO_VERSION}-%s.conf"
 
 python __anonymous() {
-       prefixes = bb.data.getVar("DISTRO_LOCALE_FEEDS_PREFIXES", d, 1).split()
-       locale_feeds = bb.data.getVar("DISTRO_LOCALE_FEEDS_HEADER", d, 1)
-
-       # add template
-       locale_feeds += "# For each supported locale there is a subfeed in each of the feed folders.\n"
-       locale_feeds += "# You can use your webbrowser to check for valid locale codes.\n\n"
-       locale_feeds += "# To point ipkg at packages for your locale, replace <my_locale> with the\n"
-       locale_feeds += "# locale code in the template below and remove the leading '#' characters.\n\n"
-       for p in prefixes:
-               locale_feeds += "# src/gz %s-locale-<my_locale> %s/locale/<my_locale>\n" % (p.split('/')[-1], p)
+       m = bb.data.getVar("MACHINE", d, 1)
+       pattern = bb.data.getVar("DISTRO_FEEDS_FILE_PATTERN", d, 1)
+       pfx = bb.data.getVar("DISTRO_FEEDS_PREFIX", d, 1)
+       cs = bb.data.getVar("DISTRO_FEEDS_COLLECTIONS", d, 1).split()
        
-       # add feed for each IMAGE_LINGUA
-       linguas = bb.data.getVar("IMAGE_LINGUAS", d, 1).split()
-       for l in linguas:
-               fst = l.split('-')[0]
-               locale_feeds += "\n# %s locale feeds\n" % fst
-               for p in prefixes:
-                       locale_feeds += "src/gz %s-locale-%s %s/locale/%s\n" % (p.split('/')[-1], fst, p, fst)
-       
-       bb.data.setVar("DISTRO_LOCALE_FEEDS", locale_feeds, d)
+       cmds = ""
+       for c in cs:
+               file = pattern % c
+               cmds += "cat > %s <<EOF\n" % file
+
+               desc = bb.data.getVar("DISTRO_FEEDS_COLLECTION_DESC_%s" % c, d, 1)
+               cmds += "# %s\n\n" % desc
+
+               feeds = bb.data.getVar("DISTRO_FEEDS_IN_%s" % c, d, 1).split()
+               for f in feeds:
+                       desc = bb.data.getVar("DISTRO_FEEDS_FEED_DESC_%s" % f, d, 1)
+                       cmds += "# %s - %s\n" % (f, desc)
+                       cmds += "src/gz %s %s/%s/%s\n" % (f, pfx, c, f)
+                       cmds += "src/gz %s-%s %s/%s/%s/machine/%s\n\n" % (f, m, pfx, c, f, m)
+
+               # locale subfeeds
+
+               # add template
+               cmds += "\n# For each supported locale there is a subfeed in each of the feed folders.\n"
+               cmds += "# You can use your webbrowser to check for valid locale codes.\n\n"
+               cmds += "# To point ipkg at packages for your locale, replace <my_locale> with the\n"
+               cmds += "# locale code in the template below and remove the leading '#' characters.\n\n"
+               for f in feeds:
+                       cmds += "# src/gz %s-locale-<my_locale> %s/%s/locale/<my_locale>\n" % (f, pfx, f)
+               
+               # add feed for each IMAGE_LINGUA
+               linguas = bb.data.getVar("IMAGE_LINGUAS", d, 1).split()
+               for l in linguas:
+                       fst = l.split('-')[0]
+                       cmds += "\n# %s locale feeds\n" % fst
+                       for f in feeds:
+                               cmds += "src/gz %s-locale-%s %s/%s/locale/%s\n" % (f, fst, pfx, f, fst)
+               
+               cmds += "\nEOF\n"
+
+       bb.data.setVar("DISTRO_FEEDS_COMMANDS", cmds, d)
 }
 
 insert_feed_uris () {
        
        echo "Building feeds for [${DISTRO}].."
                
-       for line in ${FEED_URIS}
-       do
-               # strip leading and trailing spaces/tabs, then split into name and uri
-               line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
-               feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
-               feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"                                        
-               
-               echo "Added $feed_name feed with URL $feed_uri"
-               
-               # insert new feed-sources
-               echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg/${feed_name}-feed.conf
-       done                    
-
-       if [ -z ${FEED_URIS} ]; then
-cat > ${IMAGE_ROOTFS}/etc/ipkg/${DISTRO}-${DISTRO_VERSION}-feeds.conf <<EOF
-${DISTRO_FEEDS}
-EOF
-
-cat > ${IMAGE_ROOTFS}/etc/ipkg/${DISTRO}-${DISTRO_VERSION}-locale-feeds.conf <<EOF
-${DISTRO_LOCALE_FEEDS}
-EOF
-       fi
+${DISTRO_FEEDS_COMMANDS}
 }
index 411c97e742ef4c8649aa42ef2bf3bbb69646054d..4f1d9a0e080efa460fa3e72728a82ac9e3df483e 100644 (file)
@@ -1,24 +1,16 @@
-DISTRO_FEED_PREFIX = "http://ftp.handhelds.org/distributions/familiar/releases/${DISTRO_VERSION}/feed"
+DISTRO_FEEDS_PREFIX = "http://ftp.handhelds.org/distributions/familiar/releases/${DISTRO_VERSION}"
 
-DISTRO_FEEDS_prepend () {
-# Familiar ${DISTRO_VERSION} feeds
+DISTRO_FEEDS_COLLECTIONS = "feed universe"
+DISTRO_FEEDS_COLLECTION_DESC_feed = "Familiar ${DISTRO_VERSION} feeds"
+DISTRO_FEEDS_COLLECTION_DESC_universe = "Familiar ${DISTRO_VERSION} universe feeds"
 
-# base - essential packages
-src/gz base ${DISTRO_FEED_PREFIX}/base
-src/gz base-${MACHINE} ${DISTRO_FEED_PREFIX}/base/machine/${MACHINE}
+# opie and gpe images append to this
+DISTRO_FEEDS_IN_feed = "base updates common"
+DISTRO_FEEDS_IN_universe = "common"
 
-# updates - security and bugfix updates go in this feed
-src/gz updates ${DISTRO_FEED_PREFIX}/updates
-src/gz updates-${MACHINE} ${DISTRO_FEED_PREFIX}/updates/machine/${MACHINE}
+DISTRO_FEEDS_FEED_DESC_base = "essential packages"
+DISTRO_FEEDS_FEED_DESC_updates = "security updates"
+DISTRO_FEEDS_FEED_DESC_common = "additional packages not specific to any graphical environment"
+DISTRO_FEEDS_FEED_DESC_x11 = "additional packages specific to the x11 graphical environment"
+DISTRO_FEEDS_FEED_DESC_opie = "additional packages specific to the opie graphical environment"
 
-# common - additional packages not specific to any graphical environment
-src/gz common ${DISTRO_FEED_PREFIX}/common
-src/gz common-${MACHINE} ${DISTRO_FEED_PREFIX}/common/machine/${MACHINE}
-}
-
-DISTRO_LOCALE_FEEDS_PREFIXES = "${DISTRO_FEED_PREFIX}/base ${DISTRO_FEED_PREFIX}/updates ${DISTRO_FEED_PREFIX}/common"
-
-DISTRO_LOCALE_FEEDS_HEADER_prepend () {
-# Familiar ${DISTRO_VERSION} locale feeds
-
-}
index 7d37c4f4fc555d8eacbce1ce5049ba8663bba511..1532fc0f6138add7ef4209ab987f9591c9be60cb 100644 (file)
@@ -1,15 +1,5 @@
-FEED_URIS_append_openzaurus = " x11##http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/${DISTRO_VERSION}/feed/x11 "
-FEED_URIS_append_opensimpad = " x11##http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/${DISTRO_VERSION}/feed/x11 \
-                                gpe##http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/${DISTRO_VERSION}/feed/gpe"
-
-DISTRO_FEEDS_append_familiar () {
-
-# x11 - additional packages specific to the x11 graphical environment
-src/gz x11 ${DISTRO_FEED_PREFIX}/x11
-src/gz x11-${MACHINE} ${DISTRO_FEED_PREFIX}/x11/machine/${MACHINE}
-}
-
-DISTRO_LOCALE_FEEDS_PREFIXES_append_familiar = " ${DISTRO_FEED_PREFIX}/x11"
+DISTRO_FEEDS_IN_feed += "x11"
+DISTRO_FEEDS_IN_universe += "x11"
 
 PR = "r21"
 
index 5c30876dec3940bdf4e7618fd480ebf6f960b6d8..eec90ad0096f9d8122a7abdce5a8cd78e1581c32 100644 (file)
@@ -1,17 +1,8 @@
 export IMAGE_BASENAME = "opie-image"
 export IMAGE_LINGUAS = ""
 
-FEED_URIS_append_openzaurus = " opie##http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/${DISTRO_VERSION}/feed/opie"
-FEED_URIS_append_opensimpad = " opie##http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/${DISTRO_VERSION}/feed/opie"
-
-DISTRO_FEEDS_append_familiar () {
-
-# opie - additional packages specific to the opie graphical environment
-src/gz opie ${DISTRO_FEED_PREFIX}/opie
-src/gz opie-${MACHINE} ${DISTRO_FEED_PREFIX}/opie/machine/${MACHINE}
-}
-
-DISTRO_LOCALE_FEEDS_PREFIXES_append_familiar = " ${DISTRO_FEED_PREFIX}/opie"
+DISTRO_FEEDS_IN_feed += "opie"
+DISTRO_FEEDS_IN_universe += "opie"
 
 LICENSE = "MIT"
 PR = "r19"
@@ -30,50 +21,4 @@ INSTALL_PACKAGES = "task-bootstrap task-opie-base task-opie-base-applets \
 
 export IPKG_INSTALL = "${INSTALL_PACKAGES}"
 
-# merge feed-sources into ipkg.conf for opie-aqpkg as it can't handle feed-sources outside of ipkg.conf.
-merge_feeds() {
-
-        if ! test -z "${FEED_URIS}"
-        then
-                # Die gracefully if ipkg-collateral failed
-                if ! test -e "${IMAGE_ROOTFS}/etc/ipkg.conf"
-                then
-                        echo "[${IMAGE_ROOTFS}/etc/ipkg.conf] is missing!"
-                        exit 1
-                fi
-                
-                # comment out existing feed-sources inserted by ipkg-collateral
-                cat ${IMAGE_ROOTFS}/etc/ipkg.conf | sed "s/^src\ /#src\ /" > ${IMAGE_ROOTFS}/etc/ipkg.conf_
-                rm ${IMAGE_ROOTFS}/etc/ipkg.conf && mv ${IMAGE_ROOTFS}/etc/ipkg.conf_ ${IMAGE_ROOTFS}/etc/ipkg.conf
-                
-                # extract, then delete destinations
-                cat ${IMAGE_ROOTFS}/etc/ipkg.conf | egrep "^dest\ " > ${IMAGE_ROOTFS}/etc/ipkg.conf.dest
-                cat ${IMAGE_ROOTFS}/etc/ipkg.conf | egrep -v "^dest\ " > ${IMAGE_ROOTFS}/etc/ipkg.conf_
-                rm ${IMAGE_ROOTFS}/etc/ipkg.conf && mv ${IMAGE_ROOTFS}/etc/ipkg.conf_ ${IMAGE_ROOTFS}/etc/ipkg.conf
-
-
-                for line in ${FEED_URIS}
-                do
-                        # strip leading and trailing spaces/tabs, then split into name and uri
-                        line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
-                        feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
-                        feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"                
-
-                        # insert new feed-sources
-                        echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg.conf
-                done
-                
-                # remove temporary files and rebuild ipkg.conf
-                echo "" >> ${IMAGE_ROOTFS}/etc/ipkg.conf
-                cat ${IMAGE_ROOTFS}/etc/ipkg.conf.dest >> ${IMAGE_ROOTFS}/etc/ipkg.conf
-                rm ${IMAGE_ROOTFS}/etc/ipkg.conf.dest
-                
-                # remove -feed.conf files which are no longer needed
-                cd ${IMAGE_ROOTFS}/etc/ipkg/ && rm -- *-feed.conf                               
-        fi
-}
-
-# merge feed-sources into ipkg.conf and create /etc/timestamp from build date
-IMAGE_PREPROCESS_COMMAND = "merge_feeds; "
-
 inherit image_ipk