* Merge Siegfried-Angel Gevatter Pujals' branch.

This commit is contained in:
Luke Yelavich 2007-08-04 22:10:08 +10:00
commit 350af7a68c
12 changed files with 201 additions and 70 deletions

View File

@ -1,4 +1,9 @@
#!/usr/bin/python #!/usr/bin/python
# The author of this script is unknown
# License: Public Domain
#
# This script is used to check in what components ("main", "restricted",
# "universe" or "multiverse") the dependencies of a package are.
import subprocess import subprocess
import sys import sys

View File

@ -4,3 +4,5 @@ Albin Tonnerre <lut1n.tne@gmail.com>
Michael Bienia <geser@ubuntu.com> Michael Bienia <geser@ubuntu.com>
Kees Cook <kees@ubuntu.com> Kees Cook <kees@ubuntu.com>
Martin Pitt <martin.pitt@ubuntu.com> Martin Pitt <martin.pitt@ubuntu.com>
Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
Jamin W. Collins <jcollins@asgardsrealm.net>

44
README
View File

@ -1,6 +1,42 @@
Ubuntu Development Tools =====================
== Ubuntu Development Tools ==
=====================
404main <package>
... will check in what components the dependencies of <package> are.
check-symbols <package> [<directory>] check-symbols <package> [<directory>]
... will compare and give you a diff of the exported symbols of all ... will compare and give you a diff of the exported symbols of all .so
.so files in all binary packages of <package>. files in all binary packages of <package>.
<directory> is not mandatory and /var/cache/pbuilder/result by default. <directory> is not mandatory and set to /var/cache/pbuilder/result by default.
dch-repeat [--help]
... will repeat a change log into an older release.
get-branches <directory> <team> [checkout|branch]
... will branch / checkout all the Bazaar branches in a Launchpad team.
mk-sbuild-lv
... will create LVM snapshot chroots via schroot and sbuild. It assumes that
sbuild has not be installed and configured before.
pbuilder-dist [create|update|build|clean|login|execute]
... is a wrapper to use pbuilder with many different distributions / versions.
It has to be renamed to something like pbuilder-feisty, pbuilder-gutsy, etc.
pull-debian-debdiff <package> <version>
... will attempt to find and download a specific version of a Debian package
and its immediate parent to generate a debdiff.
suspicious-source
... will output a list of files which are not common source files. This should be
run in the root of a source tree to find files which might not be the "prefered
form of modification" that the GPL and other licenses require.
update-maintainer
... will update the maintainer field of an Ubuntu package to match the
DebianMaintainerField specification.
what-patch
... will check what patching system is used by a package.
You need to be in it's source directory in order that it works.

View File

@ -1,41 +1,62 @@
#!/bin/bash #!/bin/bash
# (C) Daniel Holbach (2006-2007), Licensed under the GPL 2 # Copyright 2006-2007 (C) Daniel Holbach <daniel.holbach@ubuntu.com>
# Modified by Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# License: GPLv2
#
# This script is used to get a diff of the exported symbols of all .so files in
# every binary package of package $1.
PACKAGES="`apt-cache showsrc $1 | grep ^Binary | sed 's/Binary\:\ //g;s/\,//g' | sort -u`" PACKAGES="`apt-cache showsrc $1 | grep ^Binary | sed 's/Binary\:\ //g;s/\,//g' | sort -u`"
DEBLINE="" DEBLINE=""
DEBUG=False
if [ -z $1 ]; then \ if [[ -z $1 ]]; then
echo "Missing argument: source package name."; \ echo "Missing argument: source package name.";
exit; \ exit;
fi fi
if [ -z $2 ]; then \ if [[ -z $2 ]]; then
DEBDIR="/var/cache/pbuilder/result"; \ DEBDIR="/var/cache/pbuilder/result";
else \ else
DEBDIR="$2"; \ DEBDIR="$2";
fi fi
for pack in $PACKAGES; \ for pack in $PACKAGES;
do \ do
for lib in `dpkg -L $pack | grep -E "\.so$" | sort -u`; \ for lib in `dpkg -L $pack | grep -E "\.so$" | sort -u`;
do \ do
LIBNAME=$(basename $lib); \ LIBNAME=$(basename $lib);
nm -D $lib | cut -d' ' -f3 | sort -u > /tmp/$LIBNAME.1; \ nm -D $lib | cut -d' ' -f3 | sort -u > /tmp/$LIBNAME.1;
done; \ done;
DEBLINE="$DEBLINE $DEBDIR/$pack*.deb "; DEBLINE="$DEBLINE $DEBDIR/$pack*.deb ";
done done
if [[ -z $DEBLINE ]]; then
echo "Package doesn't exist: $1."; exit
fi
NOFILE=True
for filename in $DEBLINE; do
if [[ ${filename: -5} != "*.deb" ]]; then
NOFILE=False
[[ $DEBUG != True ]] || echo "Found binary file: $filename"
fi
done
if [[ $NOFILE == True ]]; then
echo "No matching binary files found in «$DEBDIR»."; exit
fi
sudo dpkg -i $DEBLINE; sudo dpkg -i $DEBLINE;
for pack in $PACKAGES; \ for pack in $PACKAGES;
do \ do
for lib in `dpkg -L $pack | grep -E "\.so$" | sort -u`; \ for lib in `dpkg -L $pack | grep -E "\.so$" | sort -u`;
do \ do
LIBNAME=$(basename $lib); \ LIBNAME=$(basename $lib);
nm -D $lib | cut -d' ' -f3 | sort -u > /tmp/$LIBNAME.2; \ nm -D $lib | cut -d' ' -f3 | sort -u > /tmp/$LIBNAME.2;
echo "Checking: $lib"; \ echo "Checking: $lib";
diff -u /tmp/$LIBNAME.{1,2}; \ diff -u /tmp/$LIBNAME.{1,2};
rm /tmp/$LIBNAME.{1,2}; \ rm /tmp/$LIBNAME.{1,2};
done; \ done;
done done

View File

@ -1,6 +1,7 @@
#!/usr/bin/perl #!/usr/bin/perl
# Copyright 2007, Kees Cook <kees@ubuntu.com> # Copyright 2007 (C) Kees Cook <kees@ubuntu.com>
# License: GPLv2 # License: GPLv2
#
# This script is used to repeat a change log into an older release. It # This script is used to repeat a change log into an older release. It
# expects that --build-tree is layed out with each Ubuntu release as a # expects that --build-tree is layed out with each Ubuntu release as a
# separate directory ("feisty", "edgy", etc). # separate directory ("feisty", "edgy", etc).
@ -9,6 +10,7 @@
# $TREE/feisty/gimp-2.2.13, running "dch-repeat" in # $TREE/feisty/gimp-2.2.13, running "dch-repeat" in
# $TREE/edgy/gimp-2.2.13 would pull in the latest changelog from the Feisty # $TREE/edgy/gimp-2.2.13 would pull in the latest changelog from the Feisty
# build. # build.
use strict; use strict;
use warnings; use warnings;
use Getopt::Long; use Getopt::Long;

View File

@ -1,8 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright 2007 (C) Canonical Ltd.
# (C) 2007, Canonical # Created by Daniel Holbach <daniel.holbach@ubuntu.com>
# Daniel Holbach # License: GPLv3
# GPLv3 #
# This script is used to checkout or branch all the Bazaar branches
# in a Launchpad team.
import urllib2 import urllib2
import sys import sys
@ -65,4 +67,3 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@ -1,9 +1,13 @@
#!/bin/bash #!/bin/bash
# Script to create LVM snapshot chroots via schroot and sbuild. # Copyright 2006-2007 (C) Canonical Ltd.
# Created by Kees Cook <kees@ubuntu.com>
# License: GPLv2
#
# This script creates LVM snapshot chroots via schroot and sbuild.
# Much love to "man sbuild-setup", https://wiki.ubuntu.com/PbuilderHowto, # Much love to "man sbuild-setup", https://wiki.ubuntu.com/PbuilderHowto,
# and https://help.ubuntu.com/community/SbuildLVMHowto. # and https://help.ubuntu.com/community/SbuildLVMHowto.
# #
# This script assumes that sbuild has not be installed and configured before. # It assumes that sbuild has not be installed and configured before.
# #
# If using schroot earlier than 1.1.4-1, it's a good idea to apply the # If using schroot earlier than 1.1.4-1, it's a good idea to apply the
# process-cleaning patch to /etc/schroot/setup.d/10mount. Without this, any # process-cleaning patch to /etc/schroot/setup.d/10mount. Without this, any
@ -17,9 +21,7 @@
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392992 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392992
# #
# Version: 0.11 # Version: 0.11
#
# Copyright 2006-2007, Canonical Ltd, Kees Cook <kees@ubuntu.com>
# License: GPLv2
set -e set -e
# Make sure we've got a regular user # Make sure we've got a regular user

View File

@ -1,19 +1,30 @@
#!/bin/sh #!/bin/sh
# script from Jamin W. Collins BTS: #255165 # Copyright (C) Jamin W. Collins <jcollins@asgardsrealm.net>
# name this script 'pbuilder-dapper', 'pbuilder-edgy', 'pbuilder-feisty' etc. # License: Public Domain
# #
# The only variable you really might need to change is BASE_DIR if you don't want pbuilder stuff in ~/ # This script is a wrapper to use pbuilder with many different
# distributions / versions.
#
# Name this script 'pbuilder-dapper', 'pbuilder-feisty', 'pbuilder-gutsy', etc.
#
# The only variable you really might need to change is BASE_DIR, if you
# don't want pbuilder stuff in your home directory.
#
# BTS: #255165
BASE_DIR="$HOME/pbuilder"
OPERATION=$1 OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'` DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false PROCEED=false
BASE_DIR="$HOME/pbuilder"
case $OPERATION in case $OPERATION in
create|update|build|clean|login|execute ) create|update|build|clean|login|execute )
PROCEED=true PROCEED=true
;; ;;
esac esac
if [ $PROCEED = true ]; then
if [[ $PROCEED = true ]]; then
shift shift
if [ ! -d $BASE_DIR/${DISTRIBUTION}_result ] if [ ! -d $BASE_DIR/${DISTRIBUTION}_result ]
then mkdir -p $BASE_DIR/${DISTRIBUTION}_result/ then mkdir -p $BASE_DIR/${DISTRIBUTION}_result/

View File

@ -1,12 +1,16 @@
#!/usr/bin/perl #!/usr/bin/perl
# Copyright 2007 Kees Cook <kees@ubuntu.com> # Copyright 2007 (C) Kees Cook <kees@ubuntu.com>
# License GPLv2 # License: GPLv2
#
# This script attempts to find and download a specific version of a Debian # This script attempts to find and download a specific version of a Debian
# package and its immediate parent to generate a debdiff. # package and its immediate parent to generate a debdiff.
# Requires: devscripts diffstat dpkg-dev #
# Requirements: devscripts diffstat dpkg-dev
#
# Cleanups needed: # Cleanups needed:
# - general cleanup # - general cleanup
# - parse diff.gz/orig.tar.gz from .dsc file instead of guessing version # - parse diff.gz/orig.tar.gz from .dsc file instead of guessing version
use strict; use strict;
use warnings; use warnings;
@ -90,7 +94,6 @@ sub download_source
} }
my $pkg = $ARGV[0]; my $pkg = $ARGV[0];
my $version = $ARGV[1]; my $version = $ARGV[1];
my $skip = $ARGV[2] || 1; my $skip = $ARGV[2] || 1;

View File

@ -1,12 +1,47 @@
#!/bin/sh -e #!/bin/bash
# Copyright 2007 (C) Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# Author: Martin Pitt <martin.pitt@ubuntu.com> # Based upon a script by Martin Pitt <martin.pitt@ubuntu.com>
# License: GPL v2 or later # License: GPL v3 or later
# #
# Output a list of files which are not common source files. This # This script outputs a list of files which are not common source files. This
# should be run in the root of a source tree to find files which might # should be run in the root of a source tree to find files which might not be
# not be the 'prefered form of modification' that the GPL and other # the "prefered form of modification" that the GPL and other licenses require.
# licenses require.
find -type f ! \( -name '*.h' -o -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name Makefile -o -name configure -o -name '*.3' -o -name '*.html' -o -name '*.txt' -o -name '*.xml' -o -name Makefile.am -o -name Makefile.in -o -name '*.m4' -o -name config.sub -o -name config.guess -o -name ltmain.sh -o -name depcomp -o -name configure.ac -o -name *.py -o -name NEWS -o -name README -o -name INSTALL -o -name TODO -o -name ChangeLog -o -name '*.docbook' -o -name '*.png' -o -name '*.desktop' -o -name '*.ui' -o -name '*.po' -o -name '*.py' -o -name '*.svg' -o -name '*.bmp' -o -name '*.gif' -o -name '*.pot' -o -name '*.xpm' -o -name '*.glade' -o -name '*.gladep' \) FILES="*.h *.c *.cc *.cpp *.py *.sh *.txt *.text *.3 *.m4 *.xml *.html *.php *.php3 *.php4 \
*.class *.form *.module *.cfg *.conf *.config *.odt *.odp *.tex *.sla *.scd \
Makefile Makefile.am Makefile.in configure configure.ac *.diff *.debdiff *.patch *.dpatch \
config.sub config.guess depcomp *.docbook *.desktop *.menu \
AUTHORS INSTALL NEWS README TODO COPYING LICENSE ChangeLog \
*.ui *.glade *.gladep *.po *.pot *.ts *.pro *.svg *.png *.bmp *.gif *.xpm"
IGNORE=".bzr CVS .svn debian"
COMMAND=(find ! \( )
firstDone=False
for pattern in $FILES
do
if [[ $firstDone != True ]]; then
COMMAND+=( -name $pattern); firstDone=True
else
COMMAND+=( -o -name $pattern)
fi
done
COMMAND+=( \) \( )
firstDone=False
for pattern in $IGNORE
do
if [[ $firstDone != True ]]; then
COMMAND+=( -name $pattern -prune); firstDone=True
else
COMMAND+=( -o -name $pattern -prune)
fi
done
COMMAND+=( -o -type f -print \))
COMMAND="${COMMAND[@]}"
$COMMAND # Execute the command

View File

@ -1,8 +1,9 @@
#!/bin/bash #!/bin/bash
#update-maintainer # Copyright 2007 (C) Albin Tonnerre (Lutin) <lut1n.tne@gmail.com>
#small - thus not perfect - script to update maintainer field in ubuntu packages # License: GPLv2
#written and (c) 2007 by Albin Tonnerre <lut1n.tne@gmail.com> (Lutin) #
#this code is under the GNU GPL V2 licence # This script is used to update the maintainer field of an Ubuntu package
# to match the DebianMaintainerField specification.
if [ ${#@} -ge 1 ]; then if [ ${#@} -ge 1 ]; then
for argv in "$@"; do for argv in "$@"; do
@ -25,14 +26,14 @@ if [ -f debian/control -a -f debian/changelog ]; then
elif [ -f control -a -f changelog ]; then elif [ -f control -a -f changelog ]; then
DEBIANDIR=. DEBIANDIR=.
else else
echo "Please run that script in the source folder" >&2 && exit 1 echo "Please run that script in the source folder." >&2 && exit 1
fi fi
IGNORE_DOMAINS="ubuntu\.com|ubuntu\.com\.au" IGNORE_DOMAINS="ubuntu\.com|ubuntu\.com\.au"
[ -n "`head -n 1 $DEBIANDIR/changelog | grep -E "\(*ubuntu.*\)"`" ] && [ -n "`head -n 1 $DEBIANDIR/changelog | grep -E "\(*ubuntu.*\)"`" ] &&
[ -z "`grep -E "^Maintainer: .*($IGNORE_DOMAINS)>" $DEBIANDIR/control`" ] || \ [ -z "`grep -E "^Maintainer: .*($IGNORE_DOMAINS)>" $DEBIANDIR/control`" ] || \
{ echo "Not an ubuntu package or already maintained by the ubuntu team" >&2 && \ { echo "Not an Ubuntu package or already maintained by the Ubuntu team." >&2 && \
exit 1; } exit 1; }
mail=$(grep -E "^Maintainer" $DEBIANDIR/control | sed -r 's/.*<(.*)>/\1/') mail=$(grep -E "^Maintainer" $DEBIANDIR/control | sed -r 's/.*<(.*)>/\1/')
@ -46,7 +47,7 @@ if [ -z "$email" ]; then
DISTRO=$(head -n 1 $DEBIANDIR/changelog|sed -r 's/.*\) (.*);.*/\1/' | cut -d'-' -f1) DISTRO=$(head -n 1 $DEBIANDIR/changelog|sed -r 's/.*\) (.*);.*/\1/' | cut -d'-' -f1)
pkgline=$(apt-cache madison `head -n 1 $DEBIANDIR/changelog | cut -d' ' \ pkgline=$(apt-cache madison `head -n 1 $DEBIANDIR/changelog | cut -d' ' \
-f1`| grep -m 1 "$DISTRO.*Sources") -f1`| grep -m 1 "$DISTRO.*Sources")
[ -z "$pkgline" ] && echo "You don't have $DISTRO in your source repos" \ [ -z "$pkgline" ] && echo "You don't have $DISTRO in your source repos." \
>&2 && exit 1 >&2 && exit 1
section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted") section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted")
fi fi
@ -59,5 +60,5 @@ fi
sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/control sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/control
[ -f $DEBIANDIR/control.in ] && sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/control.in [ -f $DEBIANDIR/control.in ] && sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/control.in
dch "Modify Maintainer value to match Debian-Maintainer-Field Spec" dch "Modify Maintainer value to match the DebianMaintainerField specification."
echo "Maintainer changed to $email" echo "Maintainer changed to $email."

View File

@ -1,6 +1,18 @@
#!/bin/bash #!/bin/bash
# Copyright 2006,2007 (C) Kees Cook <kees@ubuntu.com> # Copyright 2006-2007 (C) Kees Cook <kees@ubuntu.com>
# Modified by Siegfried-A. Gevatter <rainct@ubuntuwire.com>
# License: GPLv2 # License: GPLv2
if [[ -d debian ]]; then
cd . # pass
elif [[ -d ../debian ]]; then
cd ..
elif [[ -d ../patches ]]; then
cd ../..
else
echo "Can't find debian/rules."; exit
fi
for filename in $(echo "debian/rules"; grep ^include debian/rules | fgrep -v '$(' | awk '{print $2}') for filename in $(echo "debian/rules"; grep ^include debian/rules | fgrep -v '$(' | awk '{print $2}')
do do
fgrep -q patchsys.mk "$filename" && { echo "cdbs"; exit; } fgrep -q patchsys.mk "$filename" && { echo "cdbs"; exit; }