]> git.ipfire.org Git - pakfire.git/commitdiff
Move removing static libs from QA to pakfire.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Nov 2011 12:29:07 +0000 (13:29 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Nov 2011 12:48:37 +0000 (13:48 +0100)
po/pakfire.pot
python/pakfire/builder.py
python/pakfire/constants.py
scripts/Makefile
scripts/quality-agent.d/001-remove-static-libs [deleted file]
scripts/remove-static-libs [new file with mode: 0755]

index 3bd08653a511bdd9511ff8917b0f5890708a338b..3e7eae62f46fd76f9614dbf8704daf9527029bf0 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-10-25 21:03+0200\n"
+"POT-Creation-Date: 2011-11-02 11:14+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index ea3928340d7d4b1d0cec605df2cca73a8f062a58..5769cd86371a7bc44f8ee2cb3e865171212b1a6d 100644 (file)
@@ -685,6 +685,9 @@ class Builder(object):
                for stage in ("prepare", "build", "test", "install"):
                        self.build_stage(stage)
 
+               # Run post-build stuff.
+               self.post_remove_static_libs()
+
                # Package the result.
                # Make all these little package from the build environment.
                logging.info(_("Creating packages:"))
@@ -717,6 +720,16 @@ class Builder(object):
                        if os.path.exists(buildscript):
                                os.unlink(buildscript)
 
+       def post_remove_static_libs(self):
+               keep_libs = self.pkg.lexer.build.get_var("keep_libraries")
+               keep_libs = keep_libs.split()
+
+               try:
+                       self.do("%s/remove-static-libs %s %s" % \
+                               (SCRIPT_DIR, self.buildroot, " ".join(keep_libs)))
+               except Error, e:
+                       logging.warning(_("Could not remove static libraries: %s") % e)
+
        def cleanup(self):
                if os.path.exists(self.buildroot):
                        util.rm(self.buildroot)
index 3735418dc23c7ec521792b8f728d362bc4e2931e..76a9f0883e2e5639632a2eb13bb8cd610d2ed634 100644 (file)
@@ -28,6 +28,7 @@ from __version__ import PAKFIRE_VERSION
 PAKFIRE_LEAST_COMPATIBLE_VERSION = PAKFIRE_VERSION
 
 SYSCONFDIR = "/etc"
+SCRIPT_DIR = "/usr/lib/pakfire"
 
 CONFIG_DIR = os.path.join(SYSCONFDIR, "pakfire.repos.d")
 CONFIG_FILE = os.path.join(SYSCONFDIR, "pakfire.conf")
index b67dabf09f2ce20f192af7c82da29ed19974fb03..665a3b7da5e672f62ffa37f0bd283f9a0e785b66 100644 (file)
@@ -10,6 +10,7 @@ SCRIPTS_SHELL = \
        pakfire-multicall.py \
        py-compile \
        quality-agent \
+       remove-static-libs \
        $(wildcard functions-*) \
        $(wildcard *.prov) \
        $(wildcard *.req)
diff --git a/scripts/quality-agent.d/001-remove-static-libs b/scripts/quality-agent.d/001-remove-static-libs
deleted file mode 100755 (executable)
index 0356f63..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-. $(dirname ${0})/qa-include
-
-DESC="Removing unwanted files: *.a *.la"
-
-function check() {
-       for file in $(find ${BUILDROOT} -name "*.a" -or -name "*.la"); do
-       
-               # Don't remove libc_nonshared.a. It is used by gcc/ld.
-               [ "${file##*/}" = "libc_nonshared.a" ] && continue
-               [ "${file##*/}" = "libpthread_nonshared.a" ] && continue
-               [ "${file##*/}" = "libgcc.a" ] && continue
-               [ "${file##*/}" = "libgcc_eh.a" ] && continue
-               [ "${file##*/}" = "libfl_pic.a" ] && continue
-               [ "${file##*/}" = "libpython2.6.a" ] && continue
-               [ "${file##*/}" = "libiberty.a" ] && continue
-       
-               log DEBUG "  Removing: ${file}"
-               rm -f ${file} || exit $?
-       done
-}
-
-run
-
diff --git a/scripts/remove-static-libs b/scripts/remove-static-libs
new file mode 100755 (executable)
index 0000000..3e37f70
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+echo "Removing unwanted static libraries..."
+
+BUILDROOT=${1}
+shift
+
+for file in $(find ${BUILDROOT} -name "*.a" -or -name "*.la"); do
+       file=${file//${BUILDROOT}/}
+
+       keep=0
+       for skip in $@; do
+               if [ "${skip}" = "${file}" ]; then
+                       keep=1
+                       break
+               fi
+       done
+
+       if [ ${keep} -eq 0 ]; then
+               echo "  Removing ${file}..."
+               rm -f ${BUILDROOT}/${file}
+       fi
+done
+
+exit 0