Skip to content

Commit

Permalink
10167 unable to check out illumos-gate on Windows
Browse files Browse the repository at this point in the history
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
gdamore committed Jul 18, 2019
1 parent 4c6a557 commit 955eb5e
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 11 deletions.
5 changes: 3 additions & 2 deletions usr/src/cmd/mailx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@
# Use is subject to license terms.
#
# Copyright 2018 Joyent, Inc.
# Copyright 2019 Garrett D'Amore <garrett@damore.org>
#
# cmd/mailx/Makefile

PROG= mailx

OBJS= myfopen.o aux.o cmd1.o cmd2.o cmd3.o \
OBJS= myfopen.o cmd1.o cmd2.o cmd3.o \
cmd4.o cmdtab.o collect.o config.o edit.o \
init.o fio.o getname.o head.o \
hostname.o lex.o list.o lock.o lpaths.o \
main.o names.o optim.o popen.o quit.o \
receipt.o send.o sigretro.o stralloc.o temp.o \
translate.o tty.o usg.local.o vars.o
translate.o tty.o usg.local.o util.o vars.o

SRCS= $(OBJS:.o=.c)

Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions usr/src/cmd/sendmail/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright 2019 Garrett D'Amore <garrett@damore.org>
#
# cmd/sendmail/Makefile
#
# Makefile for top level sendmail source directory
#

# static libraries (db, libsm, libsmdb, libsmutil) must be built before
# src and aux
SUBDIRS= cf lib db libsm libsmdb libsmutil .WAIT src aux
# src and util
SUBDIRS= cf lib db libsm libsmdb libsmutil .WAIT src util

include ../Makefile.cmd

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions usr/src/data/locale/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Copyright 2011 EveryCity Ltd. All rights reserved.
# Copyright 2013 DEY Storage Systems, Inc.
# Copyright 2016 Joyent, Inc.
# Copyright 2019 Garrett D'Amore <garrett@damore.org>
#

include $(SRC)/data/Makefile.data
Expand Down Expand Up @@ -128,6 +129,14 @@ locale/%.UTF-8/stamp: data/%.UTF-8.src data/UTF-8.cm data/common.UTF-8.src
$(LCDEF) -U -w data/widths.txt -f data/UTF-8.cm $(@D)
$(TOUCH) $@

# Special handling for zz_AA test locale
locale/zz_AA.UTF-8/stamp: data/en_US.UTF-8.src data/UTF-8.cm data/common.UTF-8.src
$(SED) \
-e '/^LC_CTYPE/,/^END LC_CTYPE/d' \
-e '$$r data/common.UTF-8.src' data/en_US.UTF-8.src | \
$(LCDEF) -U -w data/widths.txt -f data/UTF-8.cm $(@D)
$(TOUCH) $@

locale/%/$(DCOLL): locale/%/stamp
locale/%/$(DCTYPE): locale/%/stamp
locale/%/$(DMSGS): locale/%/stamp
Expand Down
1 change: 0 additions & 1 deletion usr/src/data/locale/data/zz_AA.UTF-8.src

This file was deleted.

83 changes: 77 additions & 6 deletions usr/src/tools/scripts/git-pbchk.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2008, 2012 Richard Lowe
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
# Copyright 2019 Garrett D'Amore <garrett@damore.org>
# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
# Copyright 2016 Nexenta Systems, Inc.
# Copyright (c) 2019, Joyent, Inc.
Expand Down Expand Up @@ -175,11 +175,14 @@ def not_check(root, cmd):
os.path.join(root, "exception_lists", cmd)]))
return Ignore.ignore(root, ignorefiles)

def gen_files(root, parent, paths, exclude):
def gen_files(root, parent, paths, exclude, filter=None):
"""Return a function producing file names, relative to the current
directory, of any file changed on this branch (limited to 'paths' if
requested), and excluding files for which exclude returns a true value """

if filter is None:
filter = lambda x: os.path.isfile(x)

# Taken entirely from Python 2.6's os.path.relpath which we would use if we
# could.
def relpath(path, here):
Expand All @@ -204,11 +207,18 @@ def ret(select=None):
# will be caught by other invocations of git().
continue
empty = not res
if (os.path.isfile(path) and not empty and
if (filter(path) and not empty and
select(path) and not exclude(abspath)):
yield path
return ret

def gen_links(root, parent, paths, exclude):
"""Return a function producing symbolic link names, relative to the current
directory, of any file changed on this branch (limited to 'paths' if
requested), and excluding files for which exclude returns a true value """

return gen_files(root, parent, paths, exclude, lambda x: os.path.islink(x))

def comchk(root, parent, flist, output):
output.write("Comments:\n")

Expand Down Expand Up @@ -300,7 +310,53 @@ def wscheck(root, parent, flist, output):
ret |= WsCheck.wscheck(fh, output=output)
return ret

def run_checks(root, parent, cmds, paths='', opts={}):
def symlinks(root, parent, flist, output):
ret = 0
output.write("Symbolic links:\n")
for f in flist():
output.write(" "+f+"\n")
ret |= 1
return ret

def iswinreserved(name):
reserved = [
'con', 'prn', 'aux', 'nul',
'com1', 'com2', 'com3', 'com4', 'com5',
'com6', 'com7', 'com8', 'com9', 'com0',
'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5',
'lpt6', 'lpt7', 'lpt8', 'lpt9', 'lpt0' ]
l = name.lower()
for r in reserved:
if l == r or l.startswith(r+"."):
return True
return False

def haswinspecial(name):
specials = '<>:"\\|?*'
for c in name:
if c in specials:
return True
return False

def winnames(root, parent, flist, output):
ret = 0
output.write("Illegal filenames (Windows):\n")
for f in flist():
if haswinspecial(f):
output.write(" "+f+": invalid character in name\n")
ret |= 1
continue

parts = f.split('/')
for p in parts:
if iswinreserved(p):
output.write(" "+f+": reserved file name\n")
ret |= 1
break

return ret

def run_checks(root, parent, cmds, scmds, paths='', opts={}):
"""Run the checks given in 'cmds', expected to have well-known signatures,
and report results for any which fail.
Expand All @@ -322,6 +378,17 @@ def run_checks(root, parent, cmds, paths='', opts={}):
if result != 0:
print(s.getvalue())

for cmd in scmds:
s = StringIO()

exclude = not_check(root, cmd.__name__)
result = cmd(root, parent, gen_links(root, parent, paths, exclude),
output=s)
ret |= result

if result != 0:
print(s.getvalue())

return ret

def nits(root, parent, paths):
Expand All @@ -332,8 +399,10 @@ def nits(root, parent, paths):
keywords,
manlint,
mapfilechk,
winnames,
wscheck]
run_checks(root, parent, cmds, paths)
scmds = [symlinks]
run_checks(root, parent, cmds, scmds, paths)

def pbchk(root, parent, paths):
cmds = [comchk,
Expand All @@ -344,8 +413,10 @@ def pbchk(root, parent, paths):
keywords,
manlint,
mapfilechk,
winnames,
wscheck]
run_checks(root, parent, cmds)
scmds = [symlinks]
run_checks(root, parent, cmds, scmds)

def main(cmd, args):
parent_branch = None
Expand Down

0 comments on commit 955eb5e

Please sign in to comment.