From 1aa340d8a2080737960552664fd06ecca2f73d33 Mon Sep 17 00:00:00 2001 From: Andreas Oberritter Date: Fri, 22 Apr 2016 00:50:13 +0200 Subject: apt-native: use sed to prepare apt.conf.sample Signed-off-by: Andreas Oberritter --- meta/recipes-devtools/apt/apt-native_1.2.31.bb | 35 ++++++--------------- meta/recipes-devtools/apt/apt/apt.conf.in | 42 ++++++++++++++++++++++++++ meta/recipes-devtools/apt/files/apt.conf | 42 -------------------------- 3 files changed, 51 insertions(+), 68 deletions(-) create mode 100644 meta/recipes-devtools/apt/apt/apt.conf.in delete mode 100644 meta/recipes-devtools/apt/files/apt.conf (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/apt/apt-native_1.2.31.bb b/meta/recipes-devtools/apt/apt-native_1.2.31.bb index 4680bd5779..80d7a92dbc 100644 --- a/meta/recipes-devtools/apt/apt-native_1.2.31.bb +++ b/meta/recipes-devtools/apt/apt-native_1.2.31.bb @@ -11,33 +11,11 @@ SRC_URI += "file://db_linking_hack.patch \ file://no-curl.patch \ file://gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch \ file://gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch \ - file://gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch" + file://gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch \ + file://apt.conf.in \ +" -python do_install () { - bb.build.exec_func('do_install_base', d) - bb.build.exec_func('do_install_config', d) -} - -python do_install_config () { - indir = os.path.dirname(d.getVar('FILE')) - infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r') - data = infile.read() - infile.close() - - data = d.expand(data) - - outdir = oe.path.join(d.getVar('D'), d.getVar('sysconfdir'), 'apt') - if not os.path.exists(outdir): - os.makedirs(outdir) - - outpath = oe.path.join(outdir, 'apt.conf.sample') - if not os.path.exists(outpath): - outfile = open(outpath, 'w') - outfile.write(data) - outfile.close() -} - -do_install_base () { +do_install() { install -d ${D}${bindir} install -m 0755 bin/apt-cdrom ${D}${bindir}/ install -m 0755 bin/apt-get ${D}${bindir}/ @@ -75,4 +53,9 @@ do_install_base () { do install -m 0644 $h ${D}${includedir}/apt-pkg done + + sed -e "s,@STAGING_DIR_NATIVE@,${STAGING_DIR_NATIVE},g" \ + -e "s,@STAGING_BINDIR_NATIVE@,${STAGING_BINDIR_NATIVE},g" \ + -e "s,@STAGING_LIBDIR@,${STAGING_LIBDIR},g" \ + < ${WORKDIR}/apt.conf.in > ${D}${sysconfdir}/apt/apt.conf.sample } diff --git a/meta/recipes-devtools/apt/apt/apt.conf.in b/meta/recipes-devtools/apt/apt/apt.conf.in new file mode 100644 index 0000000000..b8863a2b00 --- /dev/null +++ b/meta/recipes-devtools/apt/apt/apt.conf.in @@ -0,0 +1,42 @@ +Dir "@STAGING_DIR_NATIVE@/" +{ + State "var/lib/apt/" + { + Lists "#APTCONF#/lists/"; + status "#ROOTFS#/var/lib/dpkg/status"; + }; + Cache "var/cache/apt/" + { + Archives "archives/"; + pkgcache ""; + srcpkgcache ""; + }; + Bin "@STAGING_BINDIR_NATIVE@/" + { + methods "@STAGING_LIBDIR@/apt/methods/"; + gzip "/bin/gzip"; + dpkg "dpkg"; + dpkg-source "dpkg-source"; + dpkg-buildpackage "dpkg-buildpackage"; + apt-get "apt-get"; + apt-cache "apt-cache"; + }; + Etc "#APTCONF#" + { + Preferences "preferences"; + }; +}; + +APT +{ + Install-Recommends "true"; + Immediate-Configure "false"; + Architecture "i586"; + Get + { + Assume-Yes "true"; + Force-Yes "true" + }; +}; + +DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-force-overwrite";"--no-debsig";"--force-script-chrootless"}; diff --git a/meta/recipes-devtools/apt/files/apt.conf b/meta/recipes-devtools/apt/files/apt.conf deleted file mode 100644 index a6fe97d860..0000000000 --- a/meta/recipes-devtools/apt/files/apt.conf +++ /dev/null @@ -1,42 +0,0 @@ -Dir "${STAGING_DIR_NATIVE}/" -{ - State "var/lib/apt/" - { - Lists "#APTCONF#/lists/"; - status "#ROOTFS#/var/lib/dpkg/status"; - }; - Cache "var/cache/apt/" - { - Archives "archives/"; - pkgcache ""; - srcpkgcache ""; - }; - Bin "${STAGING_BINDIR_NATIVE}/" - { - methods "${STAGING_LIBDIR}/apt/methods/"; - gzip "/bin/gzip"; - dpkg "dpkg"; - dpkg-source "dpkg-source"; - dpkg-buildpackage "dpkg-buildpackage"; - apt-get "apt-get"; - apt-cache "apt-cache"; - }; - Etc "#APTCONF#" - { - Preferences "preferences"; - }; -}; - -APT -{ - Install-Recommends "true"; - Immediate-Configure "false"; - Architecture "i586"; - Get - { - Assume-Yes "true"; - Force-Yes "true" - }; -}; - -DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-force-overwrite";"--no-debsig";"--force-script-chrootless"}; -- cgit 1.2.3-korg