From 926f014e14986f32a6342895326c04366314d77a Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 18 Jan 2010 14:51:04 +0100 Subject: [PATCH] alsatool: added 'kmerge' command, more info to comments.py Signed-off-by: Jaroslav Kysela --- alsatool | 171 +++++++++++++++++++++++++++++++++++++++------------- comments.py | 53 +++++++++++++++- config.py | 13 +++- 3 files changed, 192 insertions(+), 45 deletions(-) diff --git a/alsatool b/alsatool index b32657f..9b4c846 100755 --- a/alsatool +++ b/alsatool @@ -24,6 +24,26 @@ from comments import COMMENT_MAP VERSION="2.0" PROGRAM = sys.argv[0] +BACKGROUND = None + +def sendmail(to, subj, body, cc=None, from1='noreply@alsa-project.org'): + from time import time + from smtplib import SMTP + from email.MIMEText import MIMEText + from email.Header import Header + if type(to) == type(''): + to = [to] + msg = MIMEText(body.encode('utf8'), 'plain', 'UTF-8') + msg['Subject'] = Header(subj.encode('utf8'), 'UTF-8') + msg['Message-Id'] = ' 0: + if config.GERRORS > 0: print('Bailing out...') sys.exit(1); return res @@ -483,7 +503,8 @@ def changes(argv): sys.exit(1) changes = [] - fullset = REPOSITORIES + fullset = config.REPOSITORIES + fromrev = {} p = re.compile('.*[a-z]+') @@ -559,7 +580,7 @@ def changes(argv): log = log[9:] elif log[:8] == 'Summary:': log = log[8:] - print(': %s' % esc(log[:-1])) + print(': %s' % esc(log)) for rev in groups: str = '=Detailed changelog between %s and %s releases=' % (rev_to_dot(rev), rev_to_dot(rev2)) print(str) @@ -579,7 +600,9 @@ def changes(argv): continue if l[:13] == "Patch-Level: ": continue - print(': %s %s' % (first, esc(l[:-1]))) + if l[:15].lower() == "signed-off-by: ": + continue + print(': %s %s' % (first, esc(l))) first = " " print('') print('') @@ -591,7 +614,8 @@ def usage(code=0, msg=''): print('Where options is:') for opt in OPTS: print - print("\t-%s %s" % (opt[0].replace(':', ''), opt[3])) + if opt[0]: + print("\t-%s %s" % (opt[0].replace(':', ''), opt[3])) print("\t--%s %s" % (opt[1].replace('=', ''), opt[3])) print("\t\t%s" % opt[4].replace('\n', '\t\t')) print('') @@ -612,8 +636,7 @@ def root(argv): config.ROOT=os.path.abspath(argv[0]) def verbose(argv): - global VERBOSE - VERBOSE=True + config.VERBOSE=True def extpick(argv, edit=False, sign=False, interactive=True): if argv[0] in ['-s', '--signoff']: @@ -804,14 +827,22 @@ def import_(argv): do_blacklist(l1) return 0 -def getorigin(repo = 'alsa-kernel'): +def getgitfile(url, file, size=1024): + from urllib import splithost from httplib import HTTP - h = HTTP('git.alsa-project.org') - h.putrequest('GET', 'http://git.alsa-project.org/http/%s.git/refs/heads/master' % repo) + if not url.startswith('http:'): + raise ValueError, "URL %s" % url + host, selector = splithost(url[5:]) + h = HTTP(host) + h.putrequest('GET', url + '/' + file) h.endheaders() h.getreply() - origin = h.getfile().read(1024) + res = h.getfile().read(size) h.close() + return res + +def getorigin(repo = 'alsa-kernel'): + origin = getgitfile('http://git.alsa-project.org/http/%s.git' % repo, 'refs/heads/master') origin = origin.strip() if len(origin) != 40: raise ValueError, "git.alsa-project.org is down?" @@ -909,7 +940,7 @@ def kimport(argv=None): for repo in repos: print('Trying to import patches from %s/%s' % (repo, repos[repo])) rev = os.popen("git rev-parse %s 2> /dev/null" % repo) - if rev: + if rev and not repos[repo] in ["-", "local"]: if os.system("git checkout %s" % repo): raise ValueError, "git checkout %s" % repo if os.system("git pull %s %s" % (repo, repos[repo])): @@ -998,10 +1029,43 @@ def ddiff(argv=''): branch = b return compare_trees('alsa-kmirror', 'master', repo, branch) +def kmerge(argv=''): + os.chdir(config.ROOT + '/alsa-kernel') + git0 = 'git ' + checkout = False + for url, branch, lbranch, web in config.GIT_MERGE_REPOS: + lbranch = 'alsamerge/' + lbranch + ref = getgitfile(web, 'refs/heads/' + branch) + try: + lref = open('.git/refs/heads/' + lbranch).read(1024) + except: + lref = '' + if not ref: + raise ValueError, 'get ref ' + web + if ref == lref: + continue + if not checkout: + mbranch = 'alsamerge/master' + if os.system(git0 + ' checkout ' + mbranch): + if os.system(git0 + ' checkout linux-2.6'): + raise ValueError, 'checkout linux-2.6' + if os.system(git0 + ' checkout -b ' + mbranch): + raise ValueError, 'checkout -b ' + mbranch + checkout = True + if os.system(git0 + ' pull ' + url + ' ' + branch): + raise ValueError, ' pull ' + url + ' ' + branch + if os.system(git0 + ' branch -f ' + lbranch + ' ' + ref): + raise ValueError, ' branch ' + lbranch + ' ' + ref + +def background(argv=''): + global BACKGROUND + BACKGROUND=argv + OPTS=[ ['h', 'help', usage, '', 'Print this help'], ['r', 'root', root, '', 'Set GIT root directory (default is %s)' % config.ROOT], - ['v', 'verbose', verbose, '', 'Set verbose mode'] + ['v', 'verbose', verbose, '', 'Set verbose mode'], + [None, 'background', background, '', 'Run in background mode and send output to e-mail on error'] ] CMDS=[ ['list', xlist, '', 'Show ALSA repository names'], @@ -1021,16 +1085,19 @@ CMDS=[ ['dimport', dimport, '[remote/branch]', 'Import changes to alsa-kmirror tree.'], ['ddiff', ddiff, '[remote/branch]', 'Show diff between alsa-kmirror tree and specified repo/branch.'], ['tolinus', tolinus, 'branch', 'Send a merge request for given branch to linus'], - ['compile', compile, '', 'Compile all ALSA packages from actual snapshot (compilation test)'] + ['compile', compile, '', 'Compile all ALSA packages from actual snapshot (compilation test)'], + ['kmerge', kmerge, '', 'Merge trees for all ALSA developers'] ] def main(): + keep_args = sys.argv[:] if os.path.exists(config.ROOT + '/../alsa-driver'): config.ROOT = os.path.abspath(config.ROOT + '/..') opts = '' lopts = [] for opt in OPTS: - opts += opt[0] + if opt[0]: + opts += opt[0] lopt = opt[1] if opt[3] != '': opts += ':' @@ -1042,11 +1109,31 @@ def main(): usage(1, msg) for opt, arg in opts: for xopt in OPTS: - if opt in ("-" + xopt[0], "-" + xopt[1]): + if xopt[0] and opt in ("-" + xopt[0], "--" + xopt[1]): + xopt[2](arg) + elif opt in ("--" + xopt[1]): xopt[2](arg) if not args: eprint("Command not specified, for help type '%s -h'" % PROGRAM[PROGRAM.rfind('/')+1:]) sys.exit(1) + if BACKGROUND: + args = keep_args + idx = 0 + while 1: + if args[idx].startswith('--background='): + del args[idx] + break + if args[idx].startswith('--background'): + del args[idx] + del args[idx] + break + idx += 1 + fp = os.popen(' '.join(args) + ' 2>&1') + res = fp.read(1024*1024) + code = fp.close() + if code and res: + sendmail(to=BACKGROUND, subj='**ALSA GIT Merge Problem**', body=res) + sys.exit(0) for cmd in CMDS: if cmd[0] == args[0]: if len(args) < 2: diff --git a/comments.py b/comments.py index b20587c..ecd09af 100644 --- a/comments.py +++ b/comments.py @@ -18,6 +18,7 @@ COMMENT_MAP = { ['/README', 'Core'], ['/INSTALL', 'Core'], ['/include/gettext.h', 'IGNORE'], + ['/include/gettext_curses.h', 'IGNORE'], ['/po/.*', 'IGNORE'], ['/m4/.*', 'IGNORE'], ['/utils/alsa-utils.spec.in', 'Core'], @@ -28,6 +29,7 @@ COMMENT_MAP = { ['/', 'ERROR'], ], "alsa-driver": [ + ['/include/sound/.*', 'Compatibility header files'], ['/include/cs8403.h', 'CS8403'], ['/include/mpu401.h', 'MPU401 UART'], ['/drivers/mpu401', 'MPU401 UART'], @@ -82,6 +84,7 @@ COMMENT_MAP = { ['/isa/sb/sb8.*', 'SB8 driver'], ['/isa/sb', 'SB drivers'], ['/isa/msnd', 'MSND driver'], + ['/include/aci.h', 'Opti9xx drivers'], ['/isa/opti9xx', 'Opti9xx drivers'], ['/include/yss225.h', 'Wavefront drivers'], ['/include/wavefront.*.h', 'Wavefront drivers'], @@ -171,6 +174,7 @@ COMMENT_MAP = { ['/pci/oxygen/.*', 'CMI8788 (Oxygen) driver'], ['/pci/aw2/.*', 'Emagic Audiowerk 2'], ['/pci/lx6464es/.*', 'LX6464ES'], + ['/pci/ctxfi/.*', 'Creative Sound Blaster X-Fi (20K1/20K2)'], ['/pci', 'ERROR'], ['/ppc/Makefile', 'PPC'], ['/ppc/Kconfig', 'PPC'], @@ -192,6 +196,8 @@ COMMENT_MAP = { ['/i2c/l3', 'L3 drivers'], ['/include/tea575x-tuner.h', 'TEA575x tuner'], ['/i2c/other/tea575x-tuner.c', 'TEA575x tuner'], + ['/include/ak4113.h', 'AK4113 receiver'], + ['/i2c/other/ak4113.c', 'AK4113 receiver'], ['/include/ak4114.h', 'AK4114 receiver'], ['/i2c/other/ak4114.c', 'AK4114 receiver'], ['/include/ak4117.h', 'AK4117 receiver'], @@ -250,36 +256,72 @@ COMMENT_MAP = { ['/soc/codecs/wm8350.(c|h)', 'SoC Codec WM8350'], ['/soc/codecs/wm8400.(c|h)', 'SoC Codec WM8400'], ['/soc/codecs/wm8510.(c|h)', 'SoC Codec WM8510'], + ['/soc/codecs/wm8523.(c|h)', 'SoC Codec WM8523'], ['/soc/codecs/wm8560.(c|h)', 'SoC Codec WM8560'], ['/soc/codecs/wm8580.(c|h)', 'SoC Codec WM8580'], + ['/soc/codecs/wm8711.(c|h)', 'SoC Codec WM8711'], + ['/soc/codecs/wm8727.(c|h)', 'SoC Codec WM8727'], ['/soc/codecs/wm8728.(c|h)', 'SoC Codec WM8728'], ['/soc/codecs/wm8731.(c|h)', 'SoC Codec WM8731'], ['/soc/codecs/wm8750.(c|h)', 'SoC Codec WM8750'], ['/soc/codecs/wm8753.(c|h)', 'SoC Codec WM8753'], + ['/soc/codecs/wm8776.(c|h)', 'SoC Codec WM8776'], + ['/soc/codecs/wm8794.(c|h)', 'SoC Codec WM8794'], ['/soc/codecs/wm8900.(c|h)', 'SoC Codec WM8900'], ['/soc/codecs/wm8903.(c|h)', 'SoC Codec WM8903'], + ['/include/wm8904.h', 'SoC Codec WM8904'], + ['/soc/codecs/wm8904.(c|h)', 'SoC Codec WM8904'], + ['/soc/codecs/wm8940.(c|h)', 'SoC Codec WM8940'], + ['/include/wm8955.h', 'SoC Codec WM8955'], + ['/soc/codecs/wm8955.(c|h)', 'SoC Codec WM8955'], + ['/soc/codecs/wm8960.(c|h)', 'SoC Codec WM8960'], + ['/soc/codecs/wm8961.(c|h)', 'SoC Codec WM8961'], ['/soc/codecs/wm8971.(c|h)', 'SoC Codec WM8971'], + ['/soc/codecs/wm8974.(c|h)', 'SoC Codec WM8974'], + ['/soc/codecs/wm8988.(c|h)', 'SoC Codec WM8988'], ['/soc/codecs/wm8990.(c|h)', 'SoC Codec WM8990'], + ['/soc/codecs/wm_hubs.(c|h)', 'SoC Codec WM8993/4'], + ['/include/wm8993.h', 'SoC Codec WM8993/4'], + ['/soc/codecs/wm8993.(c|h)', 'SoC Codec WM8993/4'], + ['/include/wm9081.h', 'SoC Codec WM9081'], + ['/soc/codecs/wm9081.(c|h)', 'SoC Codec WM9081'], ['/soc/codecs/wm9705.(c|h)', 'SoC Codec WM9705'], ['/soc/codecs/wm9712.(c|h)', 'SoC Codec WM9712'], ['/soc/codecs/wm9713.(c|h)', 'SoC Codec WM9713'], ['/soc/codecs/cs4270.(c|h)', 'SoC Codec CS4270'], + ['/soc/codecs/ad1836.(c|h)', 'SoC Codec AD1836'], + ['/soc/codecs/ad1938.(c|h)', 'SoC Codec AD1938'], + ['/soc/codecs/ad1963.(c|h)', 'SoC Codec AD1963'], ['/soc/codecs/ad1980.(c|h)', 'SoC Codec AD1980'], ['/soc/codecs/tlv320aic23.(c|h)', 'SoC Codec TLV320AIC23'], ['/soc/codecs/tlv320aic26.(c|h)', 'SoC Codec TLV320AIC26'], ['/soc/codecs/tlv320aic3x.(c|h)', 'SoC Codec TLV320AIC3X'], + ['/include/tlv320dac33-plat.h', 'SoC Codec TLV320DAC33'], + ['/soc/codecs/tlv320dac33.(c|h)', 'SoC Codec TLV320DAC33'], ['/soc/codecs/uda134x.(c|h)', 'SoC Codec Philips UDA134x'], ['/soc/codecs/uda1380.(c|h)', 'SoC Codec Philips UDA1380'], ['/soc/codecs/ak4104.(c|h)', 'SoC Codec AK4104'], ['/soc/codecs/ak4535.(c|h)', 'SoC Codec AK4535'], + ['/soc/codecs/ak4642.(c|h)', 'SoC Codec AK4642'], + ['/soc/codecs/ak4671.(c|h)', 'SoC Codec AK4671'], ['/soc/codecs/ssm2602.(c|h)', 'SoC Codec SSM2602'], ['/soc/codecs/ad73311.(c|h)', 'SoC Codec AD73311'], ['/soc/codecs/twl4030.(c|h)', 'SoC Codec TWL4030'], ['/soc/codecs/pcm3008.(c|h)', 'SoC Codec PCM3008'], + ['/soc/codecs/cx20442.(c|h)', 'SoC Codec CX20442'], + ['/soc/codecs/max9877.(c|h)', 'SoC Codec MAX9877'], + ['/soc/codecs/stac9766.(c|h)', 'SoC Codec STAC9766'], + ['/soc/codecs/spdif_transciever.(c|h)', 'SoC Codec DIT SPDI/F'], + ['/soc/codecs/ads117x.(c|h)', 'SoC Codec ads1174/8'], + ['/soc/codecs/da7210.(c|h)', 'SoC Codec DA7210'], + ['/include/tpa6130a2-plat.h', 'SoC Codec TPA6130A2'], + ['/soc/codecs/tpa6130a2.(c|h)', 'SoC Codec TPA6130A2'], ['/soc/codecs', 'ERROR'], ['/soc/atmel/.*', 'SoC Audio for the Atmel AT32/AT91 System-on-Chip'], ['/soc/at32/.*', 'SoC Audio for the Atmel AT32 System-on-Chip'], ['/soc/at91/.*', 'SoC Audio for the Atmel AT91 System-on-Chip'], + ['/soc/imx/.*', 'SoC Audio for Freecale i.MX1x i.MX2x CPUs'], + ['/soc/txx9/.*', 'SoC Audio for TXx9'], ['/soc/pxa/spitz.c', 'SoC PXA2xx Spitz'], ['/soc/pxa/corgi.c', 'SoC PXA2xx Corgi'], ['/soc/pxa/poodle.c', 'SoC PXA2xx Poodle'], @@ -293,8 +335,11 @@ COMMENT_MAP = { ['/soc/pxa/e750_wm9705.c', 'SoC PXA2xx E750'], ['/soc/pxa/mioa701_wm9713.c', 'SoC PXA2xx MIOA701'], ['/soc/pxa/magician.c', 'Soc PXA2xx Magician'], + ['/soc/pxa/imote2.c', 'Soc PXA2xx Imote 2'], + ['/soc/pxa/raumfeld.c', 'Soc PXA2xx Raumfeld'], ['/soc/pxa/Kconfig', 'SoC PXA2xx Core'], ['/soc/s3c24xx/.*', 'SoC Audio for the Samsung S3C24XX chips'], + ['/include/sh_fsi.h', 'SoC FSI SH7724'], ['/soc/sh/.*', 'SoC SH7760 AC97'], ['/soc/fsl/.*', 'SoC Freescale'], ['/soc/davinci/.*', 'SoC DaVinci'], @@ -302,8 +347,10 @@ COMMENT_MAP = { ['/soc/au1x/.*', 'Au12x0/Au1550 PSC ASoC'], ['/soc/blackfin/.*', 'SoC Blackfin'], ['/soc/s6000/.*', 'SoC S6000'], + ['/soc/soc-cache.*', 'SoC Layer'], ['/soc/soc-core.*', 'SoC Layer'], ['/soc/soc-jack.*', 'SoC Layer'], + ['/soc/soc-utils.*', 'SoC Layer'], ['/soc/Kconfig', 'SoC Layer'], ['/soc/soc-dapm.c', 'SoC Dynamic Audio Power Management'], ['/soc', 'ERROR'], @@ -317,6 +364,7 @@ COMMENT_MAP = { ['/usb/usbquirks.(c|h)', 'USB generic driver'], ['/usb/usbmixer_maps.c', 'USB generic driver'], ['/usb/usbcompat.h', 'USB generic driver'], + ['/usb/ua101.(c|h)', 'Edirol UA-101 driver'], ['/usb', 'ERROR'], ['/include/atmel-abdac.h', 'Atmel on-chip Audio Bitstream DAC (ABDAC)'], ['/include/atmel-ac97c.h', 'Atmel on-chip Audio Bitstream DAC (ABDAC)'], @@ -324,7 +372,10 @@ COMMENT_MAP = { ['/include/hal2.h', 'HAL2 driver'], ['/hal2/.*', 'HAL2 driver'], ['/aoa/.*', 'Apple Onboard Audio driver'], - ['/sh/.*', 'Dreamcast AICA sound (pcm) driver'], + ['/include/sh_dac_audio.h', 'SuperH DAC audio driver'], + ['/sh/sh_dac_audio.c', 'SuperH DAC audio driver'], + ['/sh/aica.*', 'Dreamcast AICA sound (pcm) driver'], + ['/sh/.*', 'SH platform core'], ['/core/ioctl32', 'IOCTL32 emulation'], ['/include/pcm_oss.h', 'ALSA<-OSS emulation'], ['/include/mixer_oss.h', 'ALSA<-OSS emulation'], diff --git a/config.py b/config.py index fbf31fc..7c884df 100644 --- a/config.py +++ b/config.py @@ -8,8 +8,17 @@ USER = os.getenv('USER') VERBOSE = False GERRORS = 0 TMPDIR = '/dev/shm/alsatool' -GIT_KERNEL_MERGE = 'v2.6.30' -GIT_DRIVER_MERGE = 'v1.0.19' +SMTP_SERVER = 'localhost' +GIT_KERNEL_MERGE = 'v2.6.32' +GIT_DRIVER_MERGE = 'v1.0.21' +GIT_MERGE_REPOS = [ + ('git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git', 'master', 'linux-2.6', 'http://www.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git'), + ('git@git.alsa-project.org:alsa-kernel.git', 'fixes', 'perex-fixes', 'http://git.alsa-project.org/http/alsa-kernel.git'), + ('git@git.alsa-project.org:alsa-kernel.git', 'devel', 'perex-devel', 'http://git.alsa-project.org/http/alsa-kernel.git'), + ('git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git', 'topic/misc', 'tiwai-topic-misc', 'http://www.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git'), + ('git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git', 'topic/hda', 'tiwai-topic-hda', 'http://www.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git'), + ('git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git', 'topic/asoc', 'tiwai-topic-asoc', 'http://www.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git') +] REPOSITORIES = [ 'alsa', 'alsa-driver', 'alsa-kmirror', 'alsa-lib', 'alsa-utils', 'alsa-tools', 'alsa-firmware', 'alsa-oss', 'alsa-plugins', -- 2.47.1