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'] = '<alsatool%s@alsa-project.org' % time()
+ msg['From'] = from1
+ msg['To'] = to[0]
+ if cc:
+ msg['Cc'] = cc.join(', ')
+ s = SMTP()
+ s.connect(config.SMTP_SERVER)
+ s.sendmail(from1, to, msg.as_string())
+ s.close()
def selectrepos(repos):
if repos is None or len(repos) == 0:
else:
neg = repos[0][0] == '-'
if neg:
- negres = config.REPOSITORIES
+ negres = config.REPOSITORIES[:]
for repo in repos:
if (neg and repo[0] != '-') or \
(not neg and repo[0] == '-'):
for repo in repos:
if not first:
print
- first = False
- print("%s" % repo)
- print("*"*len(repo))
- pull([repo])
- if git_system(repo, "--no-pager diff origin/master..master"):
- raise ValueError, "diff %s" % repo
+ first = False
+ print("%s" % repo)
+ print("*"*len(repo))
+ pull([repo])
+ if git_system(repo, "--no-pager diff origin/master..master"):
+ raise ValueError, "diff %s" % repo
def pull(argv=None):
repos = selectrepos(argv)
if git_system(repo, "checkout master"):
raise ValueError, "checkout %s" % repo
os.chdir(config.ROOT + '/' + repo)
- if git_system(repo, "%s pull origin master"):
+ if git_system(repo, "pull origin master"):
raise ValueError, "pull %s" % repo
def push(argv=None):
for repo in repos:
if repo == 'alsa':
continue
- res[repo] = []
- mytag = tag
- if not mytag:
- tags = version_sort(os.popen("%s tag" % git(repo)).readlines())
- if not tags:
- raise ValueError, "cannot obtain tags for repo %s" % repo
- mytag = tags[-1]
+ res[repo] = []
+ mytag = tag
+ if not mytag:
+ tags = version_sort(os.popen("%s tag" % git(repo)).readlines())
+ if not tags:
+ raise ValueError, "cannot obtain tags for repo %s" % repo
+ mytag = tags[-1]
fp = os.popen("%s diff --stat %s..HEAD" % (git(repo), mytag))
- while 1:
- line = fp.readline()
- if not line or line.find('|') <= 0:
- break
+ while 1:
+ line = fp.readline()
+ if not line or line.find('|') <= 0:
+ break
a, b = line.split('|')
a = a.strip()
if a in ['.hgignore', '.hgtags']:
- continue
+ continue
if a.endswith('.gitignore'):
- continue
- if VERBOSE:
- print(' ', line.strip())
+ continue
+ if config.VERBOSE:
+ print(' ', line.strip())
res[repo].append(a)
- del fp
+ del fp
return res
def showchanged(argv=None):
res = showchanges1(repos, tag)
for repo in res:
print('Repository %s has %s changed files' % (repo, len(res[repo])))
- if VERBOSE:
+ if config.VERBOSE:
print(' ', line.strip())
def release1(repo, tag):
while file != '':
result1 = mgo(file, module)
if result1 == 'ERROR':
- GERRORS += 1
+ config.GERRORS += 1
str = 'Cannot identify file "%s" from module %s' % (file, module)
fp = open("/tmp/changes-log.txt", "a+")
fp.write(str + "\n")
if not res[module].has_key(mem):
res[module][mem] = []
res[module][mem].append(change)
- if GERRORS > 0:
+ if config.GERRORS > 0:
print('Bailing out...')
sys.exit(1);
return res
sys.exit(1)
changes = []
- fullset = REPOSITORIES
+ fullset = config.REPOSITORIES
+
fromrev = {}
p = re.compile('.*[a-z]+')
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)
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('</text>')
print('</revision>')
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('')
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']:
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?"
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])):
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, '<GIT root dir>', 'Set GIT root directory (default is %s)' % config.ROOT],
- ['v', 'verbose', verbose, '', 'Set verbose mode']
+ ['v', 'verbose', verbose, '', 'Set verbose mode'],
+ [None, 'background', background, '<e-mail>', 'Run in background mode and send output to e-mail on error']
]
CMDS=[
['list', xlist, '', 'Show ALSA repository names'],
['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 += ':'
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:
['/README', 'Core'],
['/INSTALL', 'Core'],
['/include/gettext.h', 'IGNORE'],
+ ['/include/gettext_curses.h', 'IGNORE'],
['/po/.*', 'IGNORE'],
['/m4/.*', 'IGNORE'],
['/utils/alsa-utils.spec.in', 'Core'],
['/', 'ERROR'],
],
"alsa-driver": [
+ ['/include/sound/.*', 'Compatibility header files'],
['/include/cs8403.h', 'CS8403'],
['/include/mpu401.h', 'MPU401 UART'],
['/drivers/mpu401', 'MPU401 UART'],
['/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'],
['/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'],
['/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'],
['/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'],
['/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'],
['/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'],
['/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)'],
['/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'],