FreeDOS UNINSTALL wanted / DEL @listfile tool wanted
Eric Auer <[email protected]>
| Newsgroups | gmane.os.freedos.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I would like to have an UNINSTALLER for ZIP files. This would
ease the removal of FreeDOS packages and of stale files when
updating packages.
The idea:
>unzip -l \home\ramdisk\test.zip
Warning: TZ environment variable not found, cannot use UTC times!!
Archive: /home/ramdisk/test.zip
Length Date Time Name
-------- ---- ---- ----
0 10-18-02 21:10 foo/
0 10-18-02 21:10 foo/bar
0 10-18-02 21:10 baz
-------- -------
0 3 files
Or even:
>\dos\dos\freedos\bin\unzip -Z -1 \home\ramdisk\test.zip
Warning: TZ environment variable not found, cannot use UTC times!!
foo/
foo/bar
baz
(this test is done in xdosemu, this is why unzip is in
\dos\dos\freedos\bin for me :-))
You could store the output of unzip -Z -1 in a file, possibly
along with the directory prefix that you used when unpacking.
Then, when you want to uninstall the package (for example before
installing a new version), you would need a tool like "del all
files listed in instlogs\foobar.log" to delete all files of foobar.
Using a batch file, you can change to the right prefix directory
before starting with the delete, so you do not need a tool that
can add the prefix itself!?
Now my question:
Does anybody know such a "delete all files mentioned in listfile"
tool, with or without the prefix functionality?
Is anybody willing to write a few nice batchfiles called
install and uninstall that would show you the contents of a .zip,
then prompt you for a base/prefix directory, then install all stuff
there and log the process as described above in the install case
and for the uninstall case, show the list and eventually the prefix,
allow the user to accept/override the prefix (if no prefix is found
in the list, the default would be something like \ or \freedos\) and
then, automatically or interactively (with delete this? prompt per
file, that is del /p mode), delete all the files that belong to the
package?
Syntax could be:
install package [prefix] [/simulateonly]
uninstall [package|zipfile|listfile] [prefix] [/prompt]
or similar.
Feel free to use more powerful languages than batchfiles.
To get started, I would already be happy with a tool that does
"delete all files in list", because then I can at least uninstall
semi-automatically. By the way, with the Linux shell I can do this:
> rm -vf $(zipinfo -1 test.zip )
rm: foo: ist ein Verzeichnis
removing foo/bar
removing baz
(rm does not allow to delete directories, you need to use rmdir. Just
like in DOS. But stale directories are not too bad, stale files are worse)
You can also specify a directory prefix:
> zipinfo -1 test.zip | sed -e 's_^_bar/_g'
bar/foo/
bar/foo/bar
bar/baz
> rm -fv $(zipinfo -1 test.zip | sed -e 's_^_bar/_g')
rm: bar/foo: ist ein Verzeichnis
removing bar/foo/bar
removing bar/baz
I think you get my point. I would be happy to be able to do the same
with DOS. Less flexibility is of course okay, nobody needs to add $(...)
to FreeCOM. If there is a DOS version of sed (the stream editor,
s_^_bar/_g globally replaces beginning-of-line by bar/), feel free to
use it. But other ways of allowing a prefix would be okay, too. For
example changing to the "prefix directory" before running rm/del/sometool.
Thanks for your feedback. I hope you think that the ability to uninstall
zip files is a really useful feature. I do.
Eric