[SCM] Debian Qt/KDE packaging tools branch, master, updated. debian/0.5.3-53-gbac2493

Modestas Vainius modax at alioth.debian.org
Fri Jan 29 23:51:20 UTC 2010


The following commit has been merged in the master branch:
commit 014030cf40b01a91ae4688a3f5f3e6ed5815cab5
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Fri Jan 29 20:31:31 2010 +0200

    pkgkde-debs2symbols is now capable to generate symbol file diffs.
    
    Those dpkg-gensymbols diffs are generated betweem reference symbol file
    template and contents of the binary packages. They can later be fed to
    `pkgkde-symbolshelper patch` as needed.
---
 debian/changelog                  |   14 ++++++++----
 symbolshelper/pkgkde-debs2symbols |   41 +++++++++++++++++++++++++++++++-----
 2 files changed, 44 insertions(+), 11 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9d06541..2e3f59c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,11 +16,15 @@ pkg-kde-tools (0.6.0~pre8) 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`.
+  * Add pkgkde-debs2symbols utility which is capable of:
+    - auto-downloading library binary packages for all available architectures;
+    - creating raw arch-specific symbol files based on the contents of the
+      binary packages. Those symbol files can be later fed to
+      `pkgkde-symbolshelper create`;
+    - generating arch-specific dpkg-gensymbols diffs between the reference
+      symbol file template and actual contents of the (later) binary packages.
+      Like build logs, those patches can be later fed to `pkgkde-symbolshelper
+      patch`.
 
  -- Modestas Vainius <modestas at vainius.eu>  Sun, 06 Dec 2009 22:06:01 +0200
 
diff --git a/symbolshelper/pkgkde-debs2symbols b/symbolshelper/pkgkde-debs2symbols
index 8223e35..8a3b609 100755
--- a/symbolshelper/pkgkde-debs2symbols
+++ b/symbolshelper/pkgkde-debs2symbols
@@ -20,7 +20,7 @@ warning() {
 }
 
 usage() {
-    echo "$PROGNAME: usage:" "$0" package version "[ download_url ]" >&2
+    echo "$PROGNAME: usage:" "$0" "[ -i symbol_file ]" package version "[ download_url ]" >&2
 }
 
 
@@ -31,7 +31,7 @@ download() {
          --recursive --level=1 --no-parent --accept "$DEB_WILDCARD" "$URL"
 }
 
-process_deb() {
+extract_deb() {
     local deb tmpdir outdir
     local arch package version outfile
 
@@ -42,6 +42,15 @@ process_deb() {
     info2 "Extracting `basename $deb` ..."
     dpkg-deb -e "$deb" "$tmpdir/DEBIAN"
     dpkg-deb -x "$deb" "$tmpdir"
+}
+
+dump_symbols() {
+    local tmpdir outdir reffile
+    local arch package version outfile outpatch
+
+    tmpdir="$1"
+    outdir="$2"
+    reffile="$3"
 
     # Collection information about package
     package=$(sed -n '/^Package:/ {s/[^:]\+:[[:space:]]*\(.\+\)/\1/; p; q}' "$tmpdir/DEBIAN/control")
@@ -52,12 +61,31 @@ process_deb() {
         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"
+    if [ -n "$reffile" ]; then
+	outfile="${package}_${arch}.symbols"
+	outpatch="${package}_${arch}.patch"
+	info2 "[$arch] Dumping patch+symbol file as $outfile/$outpatch ..."
+	pkgkde-gensymbols "-p$package" "-P$tmpdir" "-v$version" "-a$arch" \
+	    -c1 "-I$reffile" -O"$outdir/$outfile" > "$outdir/$outpatch" || true
+    else
+	outfile="${package}_${arch}"
+	info2 "[$arch] Dumping symbol file as $outfile ..."
+	pkgkde-gensymbols "-p$package" "-P$tmpdir" "-v$version" "-a$arch" \
+	    -c0 -I/dev/null "-O$outdir/$outfile"
+    fi
 }
 
 # Process options
+REFFILE=""
+while getopts "i:" name; do
+    case "$name" in
+	i)  REFFILE="$OPTARG" ;;
+	\?)  usage; exit 2 ;;
+    esac
+done
+
+shift `expr $OPTIND - 1`
+
 PACKAGE="$1"
 VERSION="$2"
 URL="$3"
@@ -98,7 +126,8 @@ if [ -d "$debdir" ]; then
     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"
+        extract_deb "$deb" "$tmpdir" "$symboldir"
+        dump_symbols "$tmpdir" "$symboldir" "$REFFILE"
         rm -rf "$tmpdir"
         c=$(($c+1))
     done

-- 
Debian Qt/KDE packaging tools



More information about the pkg-kde-commits mailing list