From: Fabian Groffen Date: Sat, 15 Nov 2008 16:25:53 +0000 (-0000) Subject: Merged from trunk -r11893:11913 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ad07223db1819505e6b85993309056e0aa0f27df;p=portage.git Merged from trunk -r11893:11913 | 11894 | Bug #244485 - Document SRC_URI arrows for output file | | zmedico | customization. | | 11896 | Having a leading ./ prefix on file paths can trigger a bug | | zmedico | in the cvs server when committing files to multiple | | | directories, so strip the prefix. Thanks to Robin H. Johnson | | | for reporting. | | 11898 | Bug #244485 - Document USE dependencies. | | zmedico | | | 11899 | Note that USE dependencies appear on the right hand side of | | zmedico | SLOT dependencies. | | 11900 | Add newlines so that first lines of tables display properly | | zmedico | with man2html. | | 11901 | Bug #244485 - Document the !!atom blocker syntax. | | zmedico | | | 11902 | Use a table to condense the docs for the default_* phase | | zmedico | functions. | | 11904 | * git support for repoman | | zmedico | | | 11907 | Add a --changelog-rev option that truncates the ChangeLog at | | zmedico | a specific revision. Also, add -i to the svn2cl options so | | | that the actual svn revision numbers are included in the | | | log. (trunk r11889) Use svn2cl --reparagraph option for | | | better ChangeLog formatting. (trunk r11906) | | 11909 | In dyn_package(), use the 'assert' macro (from | | zmedico | isolated-functions.sh) die if PIPESTATUS array contains a | | | non-zero exist status. | | 11911 | Exempt live ebuilds from KEYWORDS.missing and | | zmedico | KEYWORDS.dropped warnings. Thanks to Jorge Manuel B. S. | | | Vicetto for the suggestion. | | 11913 | Make the EbuildQuote check filter out matches that appear to | | zmedico | be an argument to a message command. For example: false || | | | ewarn "foo $WORKDIR/bar baz" Thanks to Diego 'Flameeyes' | | | Pettenò for reporting this issue (currently | | | triggered by ruby-prof-0.7.0.ebuild). | svn path=/main/branches/prefix/; revision=11945 --- diff --git a/NEWS b/NEWS index 6e9a53109..11d601c1e 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,7 @@ portage-2.2 remaining packages and any with unsatisfied dependencies are automatically dropped. The --skipfirst option automatically drops packages in the same way, and also drops any masked packages. -* Add subversion support for repoman. +* Add git and subversion support for repoman. * It is now possible to use `emerge ` to reinstall the package that installed a particular file. Package contents entries are indexed to improve performance. A command such as `emerge /lib/modules` can serve diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 7a17af14d..7753c65fa 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -747,8 +747,8 @@ dyn_package() { PORTAGE_BINPKG_TMPFILE="${PKGDIR}/${CATEGORY}/${PF}.tbz2" mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed" tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${D}" . | \ - bzip2 -f > "$PORTAGE_BINPKG_TMPFILE" || \ - die "Failed to create tarball" + bzip2 -f > "$PORTAGE_BINPKG_TMPFILE" + assert PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ python -c "from portage import xpak; t=xpak.tbz2('${PORTAGE_BINPKG_TMPFILE}'); t.recompose('${PORTAGE_BUILDDIR}/build-info')" if [ $? -ne 0 ]; then diff --git a/bin/repoman b/bin/repoman index f63c724aa..89dc322bf 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1106,6 +1106,7 @@ for x in scanlist: myaux = pkg.metadata eapi = myaux["EAPI"] inherited = pkg.inherited + live_ebuild = live_eclasses.intersection(inherited) if not src_uri_error: # Check that URIs don't reference a server from thirdpartymirrors. @@ -1153,6 +1154,8 @@ for x in scanlist: if catdir == "virtual" and \ missing_var in ("HOMEPAGE", "LICENSE"): continue + if live_ebuild and missing_var == "KEYWORDS": + continue myqakey=missingvars[pos]+".missing" stats[myqakey]=stats[myqakey]+1 fails[myqakey].append(x+"/"+y+".ebuild") @@ -1184,7 +1187,7 @@ for x in scanlist: previous_keywords = slot_keywords.get(myaux["SLOT"]) if previous_keywords is None: slot_keywords[myaux["SLOT"]] = set() - else: + elif not live_ebuild: dropped_keywords = previous_keywords.difference(ebuild_archs) if dropped_keywords: stats["KEYWORDS.dropped"] += 1 @@ -1210,7 +1213,7 @@ for x in scanlist: Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should not be allowed to be marked stable """ - if live_eclasses.intersection(pkg.inherited): + if live_ebuild: bad_stable_keywords = [] for keyword in keywords: if not keyword.startswith("~") and \ @@ -1878,6 +1881,11 @@ else: print green("------------------------------------------------------------------------------") print + # Having a leading ./ prefix on file paths can trigger a bug in + # the cvs server when committing files to multiple directories, + # so strip the prefix. + myfiles = [f.lstrip("./") for f in myfiles] + retval = None if options.pretend: if vcs == "cvs": diff --git a/doc/package/ebuild/eapi/2.docbook b/doc/package/ebuild/eapi/2.docbook index 849d29857..c658a8237 100644 --- a/doc/package/ebuild/eapi/2.docbook +++ b/doc/package/ebuild/eapi/2.docbook @@ -68,6 +68,10 @@
USE Dependencies + + When used together with SLOT dependencies, USE dependencies + appear on the right hand side of SLOT dependencies. +
Unconditional USE Dependencies Syntax Examples diff --git a/man/ebuild.5 b/man/ebuild.5 index d01b14f63..76cd27e68 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -157,6 +157,10 @@ the EAPI to which this package conforms. Contains a list of URI's for the required source files. It can contain multiple URI's for a single source file. The list is processed in order if the file was not found on any of the \fIGENTOO_MIRRORS\fR. +Beginning with \fBEAPI 2\fR, the output file name of a given URI may be +customized with a "->" operator on the right hand side, followed by the +desired output file name. All tokens, including the operator and output +file name, should be separated by whitespace. .TP \fBHOMEPAGE\fR = \fI"http://happy.com/"\fR Should contain a list of URL's for the sources main sites and other further @@ -256,10 +260,16 @@ examples you may find in the portage tree: =dev\-libs/glib\-2\fI*\fR \fI!\fR=net\-fs/samba\-2\fI*\fR \fI~\fRnet\-libs/libnet\-1.0.2a +\fI!!\fR=\fRx11\-libs/qt-3.3.8:3 \fI=\fRx11\-libs/qt-3.3*:3 .fi +.TP +.B Atom USE +Beginning with \fBEAPI 2\fR, any atom can be constrained to match specific +\fBUSE\fR flag settings. When used together with \fBSLOT\fR dependencies, +\fBUSE\fR dependencies appear on the right hand side of \fBSLOT\fR +dependencies. + +.RS +.TP +.B Unconditional USE Dependencies +.TS +l l +__ +l l. +Example Meaning + +foo[bar] foo must have bar enabled +foo[bar,baz] foo must have both bar and baz enabled +foo[\-bar,baz] foo must have bar disabled and baz enabled +.TE + +.TP +.B Conditional USE Dependencies +.TS +l l +__ +l l. +Compact Form Equivalent Expanded Form + +foo[bar?] bar? ( foo[bar] ) !bar? ( foo ) +foo[!bar?] bar? ( foo ) !bar? ( foo[\-bar] ) +foo[bar=] bar? ( foo[bar] ) !bar? ( foo[\-bar] ) +foo[!bar=] bar? ( foo[\-bar] ) !bar? ( foo[bar] ) +.TE +.RE .RE .TP .B Dynamic DEPENDs @@ -539,29 +584,28 @@ Initial working directory of $PWD. Calls the default phase function implementation for the currently executing phase. This function is supported beginning with \fBEAPI 2\fR. .TP -.B default_pkg_nofetch -Calls the default pkg_nofetch phase function implementation. -This function is supported beginning with \fBEAPI 2\fR. -.TP -.B default_src_unpack -Calls the default src_unpack phase function implementation. -This function is supported beginning with \fBEAPI 2\fR. -.TP -.B default_src_prepare -Calls the default src_prepare phase function implementation. -This function is supported beginning with \fBEAPI 2\fR. -.TP -.B default_src_configure -Calls the default src_configure phase function implementation. -This function is supported beginning with \fBEAPI 2\fR. -.TP -.B default_src_compile -Calls the default src_compile phase function implementation. -This function is supported beginning with \fBEAPI 2\fR. -.TP -.B default_src_test -Calls the default src_test phase function implementation. -This function is supported beginning with \fBEAPI 2\fR. +.B default_* +Beginning with \fBEAPI 2\fR, the default pkg_nofetch and src_* phase +functions are accessible via a function having a name that begins with +default_ and ends with the respective phase function name. For example, +a call to a function with the name default_src_compile is equivalent to +a call to the default src_compile implementation. + +.RS +.TS +l +_ +l. +Default Phase Functions + +default_pkg_nofetch +default_src_unpack +default_src_prepare +default_src_configure +default_src_compile +default_src_test +.TE +.RE .SH "HELPER FUNCTIONS: GENERAL" .TP \fBdie\fR \fI[reason]\fR diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index dd81d8716..c9415b759 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -83,8 +83,11 @@ class EbuildQuote(LineCheck): """Ensure ebuilds have valid quoting around things like D,FILESDIR, etc...""" repoman_check_name = 'ebuild.minorsyn' - _ignored_commands = ["echo", "local", "export"] - _ignored_commands += ["eerror", "einfo", "elog", "eqawarn", "ewarn"] + _message_commands = ["die", "echo", "eerror", + "einfo", "elog", "eqawarn", "ewarn"] + _message_re = re.compile(r'\s(' + "|".join(_message_commands) + \ + r')\s+"[^"]*"\s*$') + _ignored_commands = ["local", "export"] + _message_commands ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)' + \ r'|(^\s*(' + "|".join(_ignored_commands) + r')\s+)') var_names = ["D", "DISTDIR", "FILESDIR", "S", "T", "ROOT", "WORKDIR"] @@ -125,6 +128,15 @@ class EbuildQuote(LineCheck): if self.var_reference.search(group) is None: continue + # Filter matches that appear to be an + # argument to a message command. + # For example: false || ewarn "foo $WORKDIR/bar baz" + message_match = self._message_re.search(line) + if message_match is not None and \ + message_match.start() < pos and \ + message_match.end() > pos: + break + # This is an attempt to avoid false positives without getting # too complex, while possibly allowing some (hopefully # unlikely) violations to slip through. We just assume