Bug #913

etc/Makefile cleanup

Added by matthias almost 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:
Priority:LowDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Heho,

I cleaned up etc/Makefile a bit. I removed almost all lines containing
"rm -rf $file" statements and moved the filenames to a new file called
src/FilesToRemove.Inc. This file is included by etc/Makefile and used
to remove obsolete files. New obsolete files can be added to that file
without polluting etc/Makefile.

I also added a short message and a 5 seconds delay to make really sure
that the user performed a "make installworld" first. The message and
the delay could be removed if somebody argues.

http://leaf.dragonflybsd.org/~matthias/etc_makefile_update.diff

In-collab-with: swildner@

If nobody objects, I'm going to commit the patch in a few days.

Matthias

History

#1 Updated by corecode almost 7 years ago

That's good.

That's bad. We should find a better way that a) relying on the user to prevent the user from hurting itself and b) annoying the user.

cheers
simon

#2 Updated by matthias almost 7 years ago

Sascha suggested to install the FilesToRemove.inc with installworld to a
temporary location and have "make upgrade" use this file instead of the
one in the source tree.

Matthias

#3 Updated by corecode almost 7 years ago

That's good. Maybe make it even more sophisticated and install the list of files to be removed. Then after make upgrade, install this list as "files that were removed". Next time, we'll only have to remove the files that were added (the delta), instead of blindly removing all files, even though they don't exist anymore.

cheers
simon

#4 Updated by steve almost 7 years ago

On Fri, 11 Jan 2008 13:16:13 +0100
"Simon 'corecode' Schubert" <> wrote:

This applies in general to make upgrade not just to the file
removal. Perhaps make buildworld could create a build timestamp file that
make installworld installs and make upgrade checks.

#5 Updated by matthias almost 7 years ago

Updated version with seatbelts for the user:

http://leaf.dragonflybsd.org/~matthias/etc_makefile_update.diff

#6 Updated by corecode almost 7 years ago

I guess you would want to remove the file /var/tmp/FilesToRemove.inc as
well?

Additionally, I think you can't use [ -e ] on constructs like {man,cat}

cheers
simon

#7 Updated by swildner almost 7 years ago

Removing it as well would mean you can do 'make upgrade' only once.

Sascha

#8 Updated by dillon almost 7 years ago

Hmm. Well, most of those conditionals are there to make sure that
a make upgrade does not turn the system into an unbootable brick
if run on too-old a copy of the world.

A lot of them are really old and can be removed, but I think a cleanup
needs some additional checks to really make it a good cleanup:

* Adjust installworld to install a file in /etc with the release id,
as the last step in the installworld operation. Maybe call it
/etc/.release or something.

* Add logic to make upgrade to check for the existance of and the
contents of {DESTDIR}/etc/.release. This allows make upgrade to know
definitively what version of the DragonFly world was last installed.
If it's too old, make upgrade can bail out with an error message.

Also, the .inc file should be named Makefile_<something>.inc, not
FilesToRemove.inc.

Apart from that it looks good.

-Matt
Matthew Dillon
<>

#9 Updated by swildner almost 7 years ago

Hmm, what exactly would be "too old"? I guess one should always be able
to upgrade to a new DragonFly release from the previous one. But should
this hold true too for the last two releases, or three? My experience
with upgrading old systems to the latest release or HEAD is rather limited..

Another question is if 'make upgrade' should only remove leftover files
from the previous RELEASE or if it should also remove files which are
added & removed between releases (if the time between addition & removal
is reasonably long, say, a few months), thus creating additional benefit
for people who track DEVELOPMENT and upgrade regularly. I think most of
the files fall into the former category, while few fall into the latter.

My feeling is that we shouldn't require every file that crops up and is
removed again to be added, but if someone cares, we should also not
forbid it. It's only a few files anyways.

Sascha

#10 Updated by dillon almost 7 years ago

:Another question is if 'make upgrade' should only remove leftover files
:from the previous RELEASE or if it should also remove files which are
:added & removed between releases (if the time between addition & removal
:is reasonably long, say, a few months), thus creating additional benefit
:for people who track DEVELOPMENT and upgrade regularly. I think most of
:the files fall into the former category, while few fall into the latter.
:
:My feeling is that we shouldn't require every file that crops up and is
:removed again to be added, but if someone cares, we should also not
:forbid it. It's only a few files anyways.
:
:Sascha

It needs to remove any file that was ever installed that isn't supposed
to be there, whether from a release or a development branch.

If we end up with a thousand files listed in there, that's the way it is.
I want 'make upgrade' to do everything that needs to be done after a
'make install' and not have any special cases.

-Matt

#11 Updated by corecode almost 7 years ago

Well, that should be sufficient, right? Or write an emtpy file, if you want to preserve the ability to upgrade more often.

cheers
simon

#12 Updated by swildner almost 7 years ago

Well it works now so why should we lose that? To save a few KB in /var/tmp?

Sascha

#13 Updated by swildner almost 7 years ago

OTOH, feel free to make that: I don't really care. :)

Sascha

#14 Updated by corecode almost 7 years ago

No, to avoid running all the remove process again on the next make upgrade :)

cheers
simon

#15 Updated by matthias almost 7 years ago

Slightly updated version:
http://leaf.dragonflybsd.org/~matthias/etc_makefile_update.diff

Note: this version doesn't contain any diff-logic or /etc/.release stuff.
I think we should get this into the tree first to stop polluting
etc/Makefile. Further improvements can be done following the commit.

Regards

Matthias

#16 Updated by swildner almost 7 years ago

Hmm, are you sure TO_REMOVE is complete? I don't see etc/rc.d/kldxref in
it, for example.

Sascha

Also available in: Atom PDF