Package: ia32-libs
Version: 1.4
Severity: serious
Tags: patch

Hi,

I've updated the fetch-and-build script to work with current etch.
The current script didn't take care to fetch matching source and
binary packages so some rewriting was needed. I didn't check if the
existing ia32-libs has any of those mismatches but the current one
would have. Since missing source are a GPL violation I set the
severity to serious just in case.

MfG
        Goswin

PS: On top of this the packages/sources in locals should be removed
IMHO since even sarge i386 lacks them.

-- System Information:
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.8-frosties-2
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages ia32-libs depends on:
ii  lib32gcc1                     3.4.3-13   GCC support library (ia32)
ii  lsb-release                   1.4-8      LSB release command

-- no debconf information
diff -Nru /tmp/0lgFDsxpBX/ia32-libs-1.5.2/debian/changelog 
/tmp/VHwSjqR7Jg/ia32-libs-1.5.3/debian/changelog
--- /tmp/0lgFDsxpBX/ia32-libs-1.5.2/debian/changelog    2006-02-25 
21:52:07.000000000 +0100
+++ /tmp/VHwSjqR7Jg/ia32-libs-1.5.3/debian/changelog    2006-03-06 
23:30:45.000000000 +0100
@@ -1,3 +1,20 @@
+ia32-libs (1.5.3) unstable; urgency=low
+
+  * Update sources and debs
+    - xlibmesa-glu -> libglu1-xorg
+    - libxft1 -> libxft2
+    - libdps1 is no more
+    - libpam0g needed by vmware
+  * Rewrite fetch-and-build
+    - Don't fetch the first source building a package but the one
+      having the deb in Debian.
+    - Check that local sources are newer than or not in Debian.
+    - Download all debs in one go. They may not conflict so apt
+      can't fail or skip any.
+    - Sanity check all debs (including local) to have matching sources.
+
+ -- Goswin von Brederlow <[EMAIL PROTECTED]>  Mon,  6 Mar 2006 20:14:22 +0000
+
 ia32-libs (1.5.2) unstable; urgency=low
 
   * Don't mess with /etc/ld.so.conf but use /lib/ldconfig/ links.
diff -Nru /tmp/0lgFDsxpBX/ia32-libs-1.5.2/debian/control 
/tmp/VHwSjqR7Jg/ia32-libs-1.5.3/debian/control
--- /tmp/0lgFDsxpBX/ia32-libs-1.5.2/debian/control      2006-02-25 
20:23:23.000000000 +0100
+++ /tmp/VHwSjqR7Jg/ia32-libs-1.5.3/debian/control      2006-03-06 
21:31:47.000000000 +0100
@@ -2,7 +2,7 @@
 Section: libs
 Priority: optional
 Maintainer: Bdale Garbee <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>> 4.0.0), dpkg-dev (>= 1.10.23), lsb-release
+Build-Depends: debhelper (>> 4.0.0), dpkg-dev (>= 1.10.23), lsb-release, 
grep-dctrl
 Standards-Version: 3.6.2.0
 
 Package: ia32-libs
diff -Nru /tmp/0lgFDsxpBX/ia32-libs-1.5.2/fetch-and-build 
/tmp/VHwSjqR7Jg/ia32-libs-1.5.3/fetch-and-build
--- /tmp/0lgFDsxpBX/ia32-libs-1.5.2/fetch-and-build     2005-04-11 
23:14:14.000000000 +0200
+++ /tmp/VHwSjqR7Jg/ia32-libs-1.5.3/fetch-and-build     2006-03-06 
23:49:18.000000000 +0100
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-set -ex
+set -e
 
 # To just download from the sources listed in sources.list.deb and use
 # the binary packages, use BUILD=0 ./fetch-and-build .  Else, it will
@@ -15,15 +15,16 @@
 libbz2-1.0
 libc6
 libc6-dev
-libdps1
 libfreetype6
 libglib1.2
+libglu1-xorg
 libgtk1.2
 libgtk1.2-common
 libice6
 libjpeg62
 liblcms1
 libncurses5
+libpam0g
 libsm6
 libstdc++2.10-glibc2.2
 libstdc++2.9-glibc2.1
@@ -34,7 +35,7 @@
 libx11-6
 libxaw7
 libxext6
-libxft1
+libxft2
 libxi6
 libxml2
 libxmu6
@@ -47,7 +48,6 @@
 libxtst6
 xaw3dg
 xlibmesa-gl
-xlibmesa-glu
 xlibs-data
 zlib1g
 lesstif2
@@ -97,46 +97,108 @@
        -o Apt::Architecture=i386 \
        -o Dir::State::Status=$APTDIR/state/status"
 
-SRCS=""
-for i in $DEBS; do
-    if [ -e local/pkgs/${i}_*.deb ]; then
-        continue
+######################################################################
+# Sources
+
+# Fetch sources for all debs
+
+for DEB in $DEBS; do
+    # Filter out debs in local/pkgs
+    if [ -e local/pkgs/${DEB}_*.deb ]; then
+       # Make sure we don't ship an old version
+        if VER=$($APT_CACHE 2>/dev/null show $DEB | grep-dctrl "" -n -s 
Version); then
+            VER2=$(dpkg -I local/pkgs/${DEB}_*.deb | grep "^ Version:" | cut 
-b11-)
+           if dpkg --compare-versions "$VER" ">=" "$VER2"; then
+               echo >&2 "$DEB has older version in local than in Debian!"
+               exit 1
+           fi
+           echo >&2 "$DEB has newer version in local than in Debian"
+       fi
+    else
+       # Deb needs fetching
+        echo $DEB
     fi
-    src=`$APT_CACHE showsrc $i | grep '^Package: ' | head -n 1 | awk '{print 
$2}'`
-    case " $SRCS " in
-        *" $src "*) ;;
-        *) SRCS="$SRCS $src" ;;
+done \
+| xargs $APT_CACHE show \
+| grep-dctrl "" -s Package,Version,Source \
+| while read KEY VAL; do # ^ Get package information, needed fields and parse
+    # Source: is optional and may not contain a version
+    # Fill in missing information from Package and Version
+    case "$KEY" in
+      Package:) PKG="$VAL"; SRC="$VAL";;
+      Version:) VER="$VAL";;
+      Source:) case "$VAL" in
+                *\(*\)) SRC=$(echo "$VAL" | cut -d" " -f1)
+                        VER=$(echo "$VAL" | sed 's/.*(\(.*\))/\1/');;
+                "") ;;
+                *) SRC="$VAL";;
+              esac;;
+      "") echo >&2 "Fetching source $SRC $VER for $PKG"
+         echo "$SRC=$VER";;
     esac
-done
+  done \
+| sort -u | (cd srcs; xargs $APT_GET -d source) # Fetch source
 
-cd srcs
-$APT_GET -d source $SRCS
-cd ..
+######################################################################
+# Debs
 
 if [ "$BUILD" = 1 ]; then
+    # Build all debs from source
     cd build
-    for pkg in $SRCS; do
-    echo $pkg
-      dpkg-source -sn -x ../srcs/${pkg}_*.dsc
-      cd $pkg-*
+    for DSC in ../srcs/*.dsc; do
+      PKG=$(basename $DSC | cut -d_ -f1)
+      echo $PKG
+      dpkg-source -sn -x $DSC
+      cd $PKG-*
       dpkg-buildpackage -rfakeroot -uc -us -B
       cd ..
-      #rm -rf $pk
+      #rm -rf $PKG
     done
     cd ..
 else
+    # Or fetch prebuild debs
     for pkg in $DEBS; do
         if [ -e local/pkgs/${pkg}_*.deb ]; then
-            cp local/pkgs/${pkg}_*.deb build/
+            (cd build; ln -s ../local/pkgs/${pkg}_*.deb .)
         else
-            $APT_GET --download-only install $pkg
-            cp $APTDIR/cache/archives/$pkg_*.deb build/
+           echo $pkg
         fi
-    done
+    done | xargs $APT_GET --download-only install
+    cp $APTDIR/cache/archives/*.deb build/
 fi
 
+# Move only the wanted debs out of build and clean up
 for pkg in $DEBS; do
   mv build/${pkg}_*.deb pkgs/
 done
 rm -rf $APTDIR build
+
+# Sanity check that we have _matching_ source for every deb.
+# With debs in local this can happen.
+
+dpkg-scanpackages pkgs /dev/null 2>/dev/null \
+| grep-dctrl "" -s Package,Version,Source \
+| while read KEY VAL; do
+    case "$KEY" in
+      Package:) PKG="$VAL"; SRC="$VAL";;
+      Version:) VER="$VAL";;
+      Source:) case "$VAL" in
+                *\(*\)) SRC=$(echo "$VAL" | cut -d" " -f1)
+                        VER=$(echo "$VAL" | sed 's/.*(\(.*\))/\1/');;
+                "") ;;
+                *) SRC="$VAL";;
+              esac;;
+      "") echo "Testing source $SRC $VER for $PKG"
+         FVER=$(echo "$VER" | cut -d: -f2)
+         if [ ! -e "local/srcs/${SRC}_${FVER}.dsc" ]; then
+           if [ ! -e "srcs/${SRC}_${FVER}.dsc" ]; then
+             echo "Missing source $SRC $VER for $PKG!"
+             exit 1
+           fi
+         fi;;
+    esac
+  done
+
+echo All sources fetched, all packages build or fetched, all versions match.
+echo Enjoy.
 exit 0

Reply via email to