[SCM] Debian Qt/KDE packaging tools branch, master, updated. debian/0.5.3-45-g4ec5727
Modestas Vainius
modax at alioth.debian.org
Tue Jan 19 02:51:27 UTC 2010
The following commit has been merged in the master branch:
commit 8d474c8cac097d41e67e3e0371d7655b96505b2a
Author: Modestas Vainius <modestas at vainius.eu>
Date: Tue Jan 19 02:00:40 2010 +0200
Add pkgkde-debs2symbols utility.
pkgkde-debs2symbols is capable of auto-downloading library binary packages for
all architectures and creating raw arch-specific symbol files based on their
contents. This utility can be used as an alternative to Mole in order to get
symbol files for feeding them to `pkgkde-symbolshelper create`.
---
Makefile | 1 +
debian/changelog | 5 ++
symbolshelper/pkgkde-debs2symbols | 111 +++++++++++++++++++++++++++++++++++++
3 files changed, 117 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index ea2c3c6..29ebc66 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@ install:
cd $(SYMBOLSHELPER_DIR) && find Debian -type f -name "*.pm" -exec \
install -D -m 0644 {} $(DESTDIR)/$(PERLLIBDIR)/{} \;
install -m 0755 $(SYMBOLSHELPER_DIR)/pkgkde-symbolshelper $(BINDIR)/pkgkde-symbolshelper
+ install -m 0755 $(SYMBOLSHELPER_DIR)/pkgkde-debs2symbols $(BINDIR)/pkgkde-debs2symbols
# Improved Dpkg::Shlibs and dpkg-gensymbols
cd $(SYMBOLSHELPER_DIR) && find Dpkg -type f -name "*.pm" -exec \
diff --git a/debian/changelog b/debian/changelog
index 686b581..deb6e98 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,11 @@ pkg-kde-tools (0.6.0~pre7) UNRELEASED; urgency=low
* Switch to 3.0 (native) format: ignores VCS directories by default.
* Update my address in the code copyright notices.
* Update debian/copyright.
+ * Add pkgkde-debs2symbols utility which is capable of auto-downloading
+ library binary packages for all architectures and creating raw
+ arch-specific symbol files based on their contents. This utility can be
+ used as an alternative to Mole in order to get symbol files for feeding
+ them to `pkgkde-symbolshelper create`.
-- Modestas Vainius <modestas at vainius.eu> Sun, 06 Dec 2009 22:06:01 +0200
diff --git a/symbolshelper/pkgkde-debs2symbols b/symbolshelper/pkgkde-debs2symbols
new file mode 100755
index 0000000..8223e35
--- /dev/null
+++ b/symbolshelper/pkgkde-debs2symbols
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+set -e
+
+info() {
+ echo "---" "$@" >&2
+}
+
+info2() {
+ echo " ---" "$@" >&2
+}
+
+error() {
+ echo "$PROGNAME: error:" "$@" >&2
+ exit 1
+}
+
+warning() {
+ echo "$PROGNAME: warning:" "$@" >&2
+}
+
+usage() {
+ echo "$PROGNAME: usage:" "$0" package version "[ download_url ]" >&2
+}
+
+
+download() {
+ # Download debs
+ info "Downloading packages from $URL ..."
+ wget -e robots=off --timestamping --no-directories --directory-prefix="$debdir" \
+ --recursive --level=1 --no-parent --accept "$DEB_WILDCARD" "$URL"
+}
+
+process_deb() {
+ local deb tmpdir outdir
+ local arch package version outfile
+
+ deb="$1"
+ tmpdir="$2"
+ outdir="$3"
+
+ info2 "Extracting `basename $deb` ..."
+ dpkg-deb -e "$deb" "$tmpdir/DEBIAN"
+ dpkg-deb -x "$deb" "$tmpdir"
+
+ # Collection information about package
+ package=$(sed -n '/^Package:/ {s/[^:]\+:[[:space:]]*\(.\+\)/\1/; p; q}' "$tmpdir/DEBIAN/control")
+ version=$(sed -n '/^Version:/ {s/[^:]\+:[[:space:]]*\(.\+\)/\1/; p; q}' "$tmpdir/DEBIAN/control")
+ arch=$(sed -n '/^Architecture:/ {s/[^:]\+:[[:space:]]*\(.\+\)/\1/; p; q}' "$tmpdir/DEBIAN/control")
+
+ if [ "$arch" = "all" ]; then
+ error "it does not make sense to process arch:all package ($deb)"
+ fi
+
+ outfile="${package}_${arch}"
+ info2 "[$arch] Dumping symbol file as $outfile ..."
+ dpkg-gensymbols "-p$package" "-P$tmpdir" "-v$version" -c0 -I/dev/null "-O$outdir/$outfile"
+}
+
+# Process options
+PACKAGE="$1"
+VERSION="$2"
+URL="$3"
+
+DEB_WILDCARD="${PACKAGE}_${VERSION}_*.deb"
+PROGNAME=`basename "$0"`
+
+if [ -z "$PACKAGE" ] || [ -z "$VERSION" ]; then
+ usage
+ exit 2
+fi
+
+# Create directories to store downloaded debs and symbol files
+debdir="${PACKAGE}_${VERSION}_debs"
+symboldir="${PACKAGE}_${VERSION}_symbols"
+if [ ! -d "$symboldir" ]; then
+ mkdir "$symboldir"
+fi
+
+info "Selected directory for packages (*.deb):" "$debdir/"
+if [ -n "$URL" ]; then
+ if [ "${URL#http://}" != "$URL" ] || [ "${URL#ftp://}" != "$URL" ]; then
+ if [ ! -d "$debdir" ]; then
+ mkdir "$debdir"
+ fi
+ download
+ else
+ error "only http:// and ftp:// download URLs are supported"
+ fi
+fi
+
+# Extract and process debs
+c=0
+if [ -d "$debdir" ]; then
+ tmpdir=`mktemp -d --tmpdir=. tmpdeb.XXXXXX`
+ rmdir "$tmpdir"
+ info "Selected temporary directory:" "$tmpdir/"
+ info "Selected directory for symbol files:" "$symboldir/"
+ for deb in `ls -1 "$debdir"/$DEB_WILDCARD 2>/dev/null | sort`; do
+ mkdir "$tmpdir"
+ process_deb "$deb" "$tmpdir" "$symboldir"
+ rm -rf "$tmpdir"
+ c=$(($c+1))
+ done
+fi
+
+if [ $c -eq 0 ]; then
+ error "no '$DEB_WILDCARD' binary packages found in $debdir/"
+fi
+
+info "$c arch specific symbol files dumped successfully to $symboldir/"
--
Debian Qt/KDE packaging tools
More information about the pkg-kde-commits
mailing list