737 Commits

Author SHA1 Message Date
espie
b0b59ea838 oops, prevent opening directories as files.
problem noticed by jca@, fixed patch.
2015-08-20 16:03:07 +00:00
espie
d89dbf2f77 interactive mode will have a different startup file, so that you can
configure it to not delete everything (particularly useful if you start
a dpb -i in another window while dpb is in session)
2015-08-16 08:39:23 +00:00
espie
33d8c81512 stub_out broken entries instead of deleting their info.
May help out with some warnings sebastia@ is seeing.
2015-08-16 08:36:53 +00:00
espie
4b4ca54be2 simplify/fix PrepareResults. Use setup to record the correct position in
the log file.

problem noticed and sleuthed by nigel@
2015-08-16 08:35:39 +00:00
espie
ae9c50e860 missing conversion. Problem noticed by sebastia@ on vax. 2015-08-11 22:39:57 +00:00
espie
8c58cabcdf open path files with logger user.
noticed by krw@
2015-07-28 09:20:54 +00:00
espie
587180b006 grab a few more things off our ports tree introspection. Locally PLIST_DB.
Distantly, WRKOBJDIR and LOCKDIR, so that we can pass these off to a startup
script to ensure correct user.

The distant stuff has to happen at the right moment, after whoami, so that
we don't try to use doas/sudo unnecessarily...
2015-07-27 17:19:46 +00:00
naddy
e6e7ddd42a switch dpb from sudo to doas (and env as required); ok sthen@ 2015-07-21 05:10:12 +00:00
espie
e2c3b93cb4 dont error out if we can't write into permanent log.
found out by naddy@
2015-07-20 20:14:45 +00:00
espie
be98f1e7a5 if _dpb exists, use it as a default unpriv_user 2015-07-18 08:35:37 +00:00
espie
f6c3f3f239 oopsie found by naddy. 2015-07-17 20:11:45 +00:00
espie
40ccf288f7 move the tracing code into its own file. save traces/warning message in
debug.log.
2015-07-15 14:30:26 +00:00
espie
3eec4383e0 make the default better. If dpb starts as root, use the owner of the ports
tree as a build_user.

Also shows all the users that dpb uses (locally).

(port_user is to be used by an interactive mode eventually).
2015-07-15 14:28:08 +00:00
espie
c02d57ff83 kill a bit of debug scaffolding, and log junk-proxy with 'J' as normal.
less complexity
2015-07-14 08:17:38 +00:00
espie
7c34de513e clean-up "force junking": do not prepare a host to be untainted with the
"wrong" port, but instead, create a pseudo-path that is just there to run
junk (will be logged as junk-proxy)

fix a bug in the task handling host locking (no next task -> unlock, duh).

do not log multiple K for several ports on the same basepkgpath.
2015-07-02 08:04:22 +00:00
espie
3b3b8b157b document there's probably still a problem, so I don't forget to fix it. 2015-06-23 14:22:50 +00:00
espie
26f5f459b3 repair forced junking
always go thru taint/untaint, so that source should always be correct
2015-06-23 09:01:56 +00:00
espie
c20f0c64fb remove debug scaffolding 2015-06-23 08:52:20 +00:00
espie
cff48ff52b tweak taintedness:
- fix actual bug in PortInfo
- restrict defined tags to !empty tags (shouldn't happen)
- track the source from locks as well.
2015-06-23 08:51:53 +00:00
espie
fab15b9291 future interactive option that does nothing whatsoever so far... 2015-06-22 12:20:06 +00:00
espie
f45103cfeb move the taint mechanism outside of "main" code.
more stringent checks... there's still a bug somewhere, hope to catch it
2015-06-22 12:19:38 +00:00
espie
ee1f6ec3ce expand on comments 2015-06-22 12:18:50 +00:00
espie
bbaa1424c3 expand on comments 2015-06-22 12:18:19 +00:00
espie
e776b6f373 expand on comments, reorder code.
better diagnostic if one distfile checksum isn't consistent.
2015-06-22 12:18:00 +00:00
espie
dbbaf40347 do an extra mode that will first scan the ports tree, and then extract only
the plists that are current.
took longer than expected because I found a bug in my setup...
probably going to be more code to say "hey, these current packages depend
on not current".
2015-06-22 09:33:03 +00:00
espie
0b5b5a74d6 cosmetic 2015-06-17 07:31:44 +00:00
espie
40499f8bbe do detain distfiles as well as paths (need to track them over rescan)
also, since distfiles are "always fetchable", need to check for detained
files before checking for "already done", since already done will want to
check the size...
2015-06-17 07:31:25 +00:00
espie
853ce1b8f7 tweak logic a bit: recheck sz and sha each time we encounter the same
distfile (error out if things are not consistent)

Fix bug: properly forget sz, give rescan a chance
2015-06-17 07:30:17 +00:00
espie
5e55c60de7 handle distfile failure better.
- we do rescan paths anyway, so make sure we queue only path.
- forgetting distfile details does not get around caching, so do creation
of distfiles in two times. cache is there to ensure unique distfiles, and
we can still forget details.
To do: remove distfiles from queue during forget, because there's no longer
any detail there.
2015-06-11 08:42:38 +00:00
espie
f9b580293d unify options. 2015-06-08 15:37:20 +00:00
espie
2db73700a1 close enough that I can unify them together.
Introduce an interface to specifically display results, so that it
can be copied to an output file, and just not appear on the terminal
2015-06-08 15:11:53 +00:00
espie
70fc0473bd unified dependency tagging, so that both tools can do dependency closure.
Provide -o output option, which also saves the actual useful output somewhere
2015-06-08 12:56:26 +00:00
espie
828e1671f8 fix long-standing race condition where removing a lock could break things.
That's just more stuff that has to wait while scanning is going on.
2015-06-08 11:06:08 +00:00
espie
cd48bdea30 tweak fullname to put the ! (for current packages at the start)
sort things in a more systematic way.
make sure results are displayed after the progress meter is properly
terminated
2015-06-08 10:32:55 +00:00
espie
c7446b9897 fsck tricks. Very often, the "invalid plists" are actually empty files left
behind after a panic. So just say so, saves you the hastle of going edit
the file, and hey, that's just empty space!
2015-06-07 12:21:21 +00:00
espie
01dbfca345 provide a forwarder to progressmeter, simplifies code
tweak for using in check-common-dirs: specify the reader,
allow a pass after scan.
2015-06-07 12:05:22 +00:00
espie
72fc751185 fine-tune display, better progress report when scanning the ports tree 2015-06-06 15:01:43 +00:00
espie
f1a5a54b22 bleh, fix fix. Wrong problem 2015-06-01 20:39:06 +00:00
espie
b4d6d84223 fix, noticed by naddy 2015-06-01 16:13:55 +00:00
espie
889658ea65 similar change to check-conflicts 2015-05-29 10:40:06 +00:00
espie
d7bd650dfb clean up some of the oldest code converted to separate users 2015-05-25 17:37:26 +00:00
espie
b364bd531d tweak find_dependencies to just return a result (deps or path)
reuse in can_be_junked. As exemplified by editors/tiled, a failing
port with nojunk set should also prevent junk tentatives, as these
will fail, but still untaint hosts...

seen by aja@ and naddy@, most probably.
2015-05-24 06:48:51 +00:00
espie
a961ac53e0 fix "nochroot" mode. Problem noticed by Mark Patruck 2015-05-20 11:54:35 +00:00
espie
e24afb41c1 zap local code. Now that chroot changes class, it's much better to use it
directly.
2015-05-20 08:34:45 +00:00
espie
391645a2bd use File object (name + user) to ensure watched files are watched with the
correct user. Should fix sthen@'s problems.

(File interface to be used elsewhere, as it's less cumbersome)
2015-05-18 16:35:15 +00:00
espie
4125493a02 Already run as the correct user, so revert.
run it  in a chdir(distdir) instead, avoids situations
where the original dir is inaccessible by unpriv_user AND
simplifies the code too. What more could you ask for ?
2015-05-17 20:39:45 +00:00
espie
59b4a6a4d6 make sure we switch to a directory within the chroot on localhost,
as per chroot(8).
2015-05-17 08:29:31 +00:00
espie
550697f7a6 We never use groups separately, make it a grouplist.
Get group name as well.

Pass BUILD_USER/BUILD_GROUP/FETCH_USER/FETCH_GROUP as env variables to STARTUP
script.
2015-05-16 18:14:04 +00:00
espie
372cc73c8f make log files more helpful, when dependencies get coalesced together and
handled by an earlier port, link to the relevant port which has the pkg_add.
Makes it much easier to figure out when show-prepare-results fails because
of conflicts in dependent ports...
2015-05-16 17:01:53 +00:00
espie
70b1c1c81b chdir($distdir) at the start of expire_old
First, it makes for simpler code. It also allows things to work when your
cwd is not readable by your user, such as /root, since File::Find wants the
cwd.
2015-05-16 15:27:48 +00:00