]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
apt-native: use sed to prepare apt.conf.sample
authorAndreas Oberritter <obi@opendreambox.org>
Thu, 21 Apr 2016 22:50:13 +0000 (00:50 +0200)
committerAndreas Oberritter <obi@opendreambox.org>
Thu, 2 Jul 2020 10:17:24 +0000 (12:17 +0200)
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
meta/recipes-devtools/apt/apt-native_1.2.31.bb
meta/recipes-devtools/apt/apt/apt.conf.in [moved from meta/recipes-devtools/apt/files/apt.conf with 87% similarity]

index 4680bd577908394edd029213f3e3355b95407f7f..80d7a92dbc812c21e3dba0ffc00f8dc4b04c272d 100644 (file)
@@ -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
 }
similarity index 87%
rename from meta/recipes-devtools/apt/files/apt.conf
rename to meta/recipes-devtools/apt/apt/apt.conf.in
index a6fe97d860904b2f0a783773958f34c4d8710b9d..b8863a2b004dba22d838f3b005ebf1129019d4c6 100644 (file)
@@ -1,4 +1,4 @@
-Dir "${STAGING_DIR_NATIVE}/"
+Dir "@STAGING_DIR_NATIVE@/"
 {
    State "var/lib/apt/"
    {
@@ -11,9 +11,9 @@ Dir "${STAGING_DIR_NATIVE}/"
       pkgcache "";
       srcpkgcache "";
    };
-   Bin "${STAGING_BINDIR_NATIVE}/"
+   Bin "@STAGING_BINDIR_NATIVE@/"
    {
-      methods "${STAGING_LIBDIR}/apt/methods/";
+      methods "@STAGING_LIBDIR@/apt/methods/";
       gzip "/bin/gzip";
       dpkg "dpkg";
       dpkg-source "dpkg-source";