Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 37123 Details for
Bug 59902
[Patch] Add epatch check to repoman
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for repoman to check epatch lines
repoman-epatchcheck.diff (text/plain), 3.16 KB, created by
Danny van Dyk (RETIRED)
on 2004-08-09 15:05:05 UTC
(
hide
)
Description:
Patch for repoman to check epatch lines
Filename:
MIME Type:
Creator:
Danny van Dyk (RETIRED)
Created:
2004-08-09 15:05:05 UTC
Size:
3.16 KB
patch
obsolete
>Index: repoman >=================================================================== >RCS file: /var/cvsroot/gentoo-src/portage/bin/repoman,v >retrieving revision 1.80 >diff -u -b -B -r1.80 repoman >--- repoman 5 Aug 2004 03:04:02 -0000 1.80 >+++ repoman 9 Aug 2004 20:28:18 -0000 >@@ -105,7 +105,9 @@ > "ebuild.minorsyn":"This ebuild has a minor syntax error that contravenes gentoo coding style", > "ebuild.badheader":"This ebuild has a malformed header", > "metadata.missing":"Missing metadata.xml files", >- "metadata.bad":"Bad metadata.xml files" >+ "metadata.bad":"Bad metadata.xml files", >+ "epatch.missing":"Missing patchfile", >+ "epatch.unknown":"Unknown variable in epatch instruction" > } > > qacats = qahelp.keys() >@@ -127,7 +129,8 @@ > "ebuild.minorsyn", > "ebuild.badheader", > "metadata.missing", >-"metadata.bad" >+"metadata.bad", >+"epatch.unknown" > ] > > missingvars=["KEYWORDS","LICENSE","DESCRIPTION","SLOT","IUSE"] >@@ -916,6 +920,7 @@ > gentoo_license = re.compile(r'^# Distributed under the terms of the GNU General Public License v2$') > cvs_header = re.compile(r'^#\s*\$Header.*\$$') > ignore_line = re.compile(r'(^$)|(^(\t)*#)') >+ epatch_line = re.compile(r'.*epatch') > leading_spaces = re.compile(r'^[\S\t]') > trailing_whitespace = re.compile(r'.*([\S]$)') > readonly_assignment = re.compile(r'^\s*(export\s+)?(A|P|PV|PN|PR|PVR|PF|D|WORKDIR|FILESDIR)=') >@@ -949,6 +954,40 @@ > else: > match = ignore_line.match(line) > if not match: >+ # Search for epatch commands with variable arguments >+ match = epatch_line.match(line) >+ if match: >+ #myargs = line.split("${FILESDIR}/")[1] # This is the argument to epatch >+ myargs = line.split("epatch")[1] >+ if len(myargs) > 0 and not myargs.find("${") == -1: # not empty _and_ vars to resolve! >+ myvars = {} >+ myvars["VARS"] = ["${FILESDIR}", "${DISTDIR}", "${P}", "${PN}" ,"${PV}"] >+ myvars["${FILESDIR}"] = checkdir + "/files" >+ myvars["${DISTDIR}"] = "/usr/portage/distfiles" #TODO: portage api call ! >+ myvars["${P}"] = myesplit[0] + "-" + myesplit[1] >+ myvars["${PN}"] = myesplit[0] >+ myvars["${PV}"] = myesplit[1] >+ for z in myvars["VARS"]: >+ myargs = myargs.replace(z, myvars[z]) >+ # no futher vars in arguments and argument not empty >+ if myargs.find("${") == -1 and not " ".join(myargs.split()) == "": >+ mypatch = myargs[0:-1].split()[0] >+ if mypatch[0] == "\"" and mypatch[-1] == "\"": >+ mypatch = mypatch[1:-1] >+ try: >+ about = os.stat(mypatch) >+ except OSError: >+ # Probably in distfile ? >+ if line.find("${DISTDIR}") == -1: >+ myerrormsg = "Patchfile missing: \n " + mypatch >+ stats["epatch.missing"] += 1 >+ fails["epatch.missing"].append(x+"/"+y+".ebuild: %s" % myerrormsg) >+ elif not " ".join(myargs.split()) == "": >+ myerrormsg = "Unknown epatch variable, you may proceed." >+ stats["epatch.unknown"] += 1 >+ fails["epatch.unknown"].append(x+"/"+y+".ebuild: %s" % myerrormsg) >+ #else: >+ # no vars in epatch path > # Excluded Blank lines and full line comments. Good! > # Leading Spaces Check > match = leading_spaces.match(line)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 59902
: 37123