}
_xdoins() {
+ local -i success=0 failed=0
while read -d $'\0' x ; do
_doins "$x" "${x%/*}"
+ if [[ $? -eq 0 ]] ; then
+ ((success|=1))
+ else
+ ((failed|=1))
+ fi
done
+ [[ $failed -ne 0 || $success -eq 0 ]] && return 1 || return 0
}
success=0
+failed=0
for x in "$@" ; do
if [[ $PRESERVE_SYMLINKS = n && -d $x ]] || \
fi
find "$x_orig" -type d -exec dodir "${INSDESTTREE}/{}" \;
find "$x_orig" \( -type f -or -type l \) -print0 | _xdoins
+ if [[ ${PIPESTATUS[1]} -eq 0 ]] ; then
+ ((success|=1))
+ else
+ ((failed|=1))
+ fi
if [[ $x != $x_orig ]] ; then
popd >/dev/null
mv "$TMP/1/$x_orig" "$x"
fi
while popd >/dev/null 2>&1 ; do true ; done
- ((success|=1))
else
- _doins "${x}" && ((success|=1))
+ _doins "${x}"
+ if [[ $? -eq 0 ]] ; then
+ ((success|=1))
+ else
+ ((failed|=1))
+ fi
fi
done
rm -rf "$TMP"
-[ $success -gt 0 ] && exit 0 || exit 1
+[[ $failed -ne 0 || $success -eq 0 ]] && exit 1 || exit 0
Can be used to define options for the install function used in
\fBdoins\fR. The default is \fI\-m0644\fR.
.TP
-\fBdoins\fR \fI<file> [list of more files]\fR
+\fBdoins\fR \fI[-r] <file> [list of more files]\fR
Installs files into the path controlled by \fBinsinto\fR. This function
uses \fBinstall\fR(1). Creates all necessary dirs.
+Setting -r sets recursive.
.TP
\fBexeinto\fR \fI[path]\fR
Sets the destination path for the \fBdoexe\fR function.
class JobStatusDisplay(object):
_bound_properties = ("curval", "failed", "running")
- _jobs_column_width = 48
# Don't update the display unless at least this much
# time has passed, in units of seconds.
object.__setattr__(self, "_changed", False)
object.__setattr__(self, "_displayed", False)
object.__setattr__(self, "_last_display_time", 0)
- object.__setattr__(self, "width", 80)
+
+ width = portage.output.get_term_size()[1]
+ if width <= 0 or width > 80:
+ width = 80
+ object.__setattr__(self, "width", width)
+ object.__setattr__(self, "_jobs_column_width", width - 32)
self.reset()
isatty = hasattr(self.out, "isatty") and self.out.isatty()
_selinux_merge = None
try:
import portage._selinux
+ # Make sure the _selinux attribute is correctly reinitialized after
+ # reload(portage) is called. See bug #298310.
+ _selinux = sys.modules['portage._selinux']
selinux = _unicode_module_wrapper(_selinux,
encoding=_encodings['fs'])
_selinux_merge = _unicode_module_wrapper(_selinux,
tests = [ ( "6.0", "5.0"), ("5.0","5"),
("1.0-r1", "1.0-r0"),
("1.0-r1", "1.0"),
- ("999999999999999999999999999999", "999999999999999999999999999998"),]
+ ("cvs.9999", "9999"),
+ ("999999999999999999999999999999", "999999999999999999999999999998"),
+ ("1.0.0", "1.0"),
+ ("1.0.0", "1.0b"),
+ ("1b", "1"),
+ ("1b_p1", "1_p1"),
+ ("1.1b", "1.1"),
+ ("12.2.5", "12.2b"),
+ ]
for test in tests:
self.failIf( vercmp( test[0], test[1] ) <= 0, msg="%s < %s? Wrong!" % (test[0],test[1]) )
("1.0_alpha2", "1.0_p2"),("1.0_alpha1", "1.0_beta1"),("1.0_beta3","1.0_rc3"),
("1.001000000000000000001", "1.001000000000000000002"),
("1.00100000000", "1.0010000000000000001"),
+ ("9999", "cvs.9999"),
("999999999999999999999999999998", "999999999999999999999999999999"),
("1.01", "1.1"),
("1.0-r0", "1.0-r1"),
- ("1.0", "1.0-r1")]
+ ("1.0", "1.0-r1"),
+ ("1.0", "1.0.0"),
+ ("1.0b", "1.0.0"),
+ ("1_p1", "1b_p1"),
+ ("1", "1b"),
+ ("1.1", "1.1b"),
+ ("12.2b", "12.2.5"),
+ ]
for test in tests:
self.failIf( vercmp( test[0], test[1]) >= 0, msg="%s > %s? Wrong!" % (test[0],test[1]))
tests = [ ("1","2"),("1.0_alpha","1.0_pre"),("1.0_beta","1.0_alpha"),
("0", "0.0"),
+ ("cvs.9999", "9999"),
("1.0-r0", "1.0-r1"),
("1.0-r1", "1.0-r0"),
("1.0", "1.0-r1"),
- ("1.0-r1", "1.0")]
+ ("1.0-r1", "1.0"),
+ ("1.0", "1.0.0"),
+ ("1_p1", "1b_p1"),
+ ("1b", "1"),
+ ("1.1b", "1.1"),
+ ("12.2b", "12.2"),
+ ]
for test in tests:
self.failIf( vercmp( test[0], test[1]) == 0, msg="%s == %s? Wrong!" % (test[0],test[1]))
list2 = [int(match2.group(2))]
# this part would greatly benefit from a fixed-length version pattern
- if len(match1.group(3)) or len(match2.group(3)):
+ if match1.group(3) or match2.group(3):
vlist1 = match1.group(3)[1:].split(".")
vlist2 = match2.group(3)[1:].split(".")
+
for i in range(0, max(len(vlist1), len(vlist2))):
# Implcit .0 is given a value of -1, so that 1.0.0 > 1.0, since it
# would be ambiguous if two versions that aren't literally equal
list2.append(int(vlist2[i].ljust(max_len, "0")))
# and now the final letter
+ # NOTE: Behavior changed in r2309 (between portage-2.0.x and portage-2.1).
+ # The new behavior is 12.2.5 > 12.2b which, depending on how you look at,
+ # may seem counter-intuitive. However, if you really think about it, it
+ # seems like it's probably safe to assume that this is the behavior that
+ # is intended by anyone who would use versions such as these.
if len(match1.group(5)):
list1.append(ord(match1.group(5)))
if len(match2.group(5)):