From: Rene Wagner Date: Sun, 23 Jul 2006 20:25:05 +0000 (+0200) Subject: image_ipk.bbclass, familiar-feeds.inc, gpe-image, opie-image: rework feed handling... X-Git-Tag: familiar-v0.8.4-rc3~10 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=823612adddcd10cfa50c0281d2a908dd5c29d860;p=familiar-h63xx-build.git image_ipk.bbclass, familiar-feeds.inc, gpe-image, opie-image: rework feed handling one more time. If opie-aqpkg can't handle /etc/ipkg/*.conf, it will have to be fixed. Signed-off-by: Rene Wagner --- diff --git a/org.handhelds.familiar/classes/image_ipk.bbclass b/org.handhelds.familiar/classes/image_ipk.bbclass index 37d4b33..293776d 100644 --- a/org.handhelds.familiar/classes/image_ipk.bbclass +++ b/org.handhelds.familiar/classes/image_ipk.bbclass @@ -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 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- %s/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 <> ${IMAGE_ROOTFS}/etc/ipkg/${feed_name}-feed.conf - done - - if [ -z ${FEED_URIS} ]; then -cat > ${IMAGE_ROOTFS}/etc/ipkg/${DISTRO}-${DISTRO_VERSION}-feeds.conf < ${IMAGE_ROOTFS}/etc/ipkg/${DISTRO}-${DISTRO_VERSION}-locale-feeds.conf < ${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