I compile from source quite a number of programs, and they tend to occupy a fair amount of disk space. After installation, a "make clean" gets free of most of it. I would like to remove anything that came with the original source tar.gz file, but keep my added or modified files in the directory. So, the question: is there an easy way to compare a directory with the archive.tgz it came from, and remove anything that is the same as contained in the said tar? Maybe someone has done this before. (It might be on the "info tar" but it is complicated reading ;-) ) -- Cheers, Carlos Robinson
Check out Midnight Comander (mc on the command line) - It might do have a way to do that. On Wed, 2003-05-21 at 12:00, Carlos E. R. wrote:
I compile from source quite a number of programs, and they tend to occupy a fair amount of disk space. After installation, a "make clean" gets free of most of it. I would like to remove anything that came with the original source tar.gz file, but keep my added or modified files in the directory.
So, the question: is there an easy way to compare a directory with the archive.tgz it came from, and remove anything that is the same as contained in the said tar? Maybe someone has done this before.
(It might be on the "info tar" but it is complicated reading ;-) )
-- Cheers, Carlos Robinson
The 03.05.21 at 12:13, Ty C. Mixon wrote:
Check out Midnight Comander (mc on the command line) - It might do have a way to do that.
Yes, it does it, except that "Command/Compare directories" (C-x d) doesn't recurse. Thus, I have to find every file on the dir (M-?), "Panelize" - so that I get a flattened tree - Compare (C-x d), and then I get, marked in yellow, new and modified files. Finally, "reverse selecTion" (M-*) It is possible, yes... but too many keystrokes. Maybe this can be automated using the mc user menu configuration. It is a way. -- Cheers, Carlos Robinson
Carlos E. R. wrote:
I compile from source quite a number of programs, and they tend to occupy a fair amount of disk space. After installation, a "make clean" gets free of most of it. I would like to remove anything that came with the original source tar.gz file, but keep my added or modified files in the directory.
So, the question: is there an easy way to compare a directory with the archive.tgz it came from, and remove anything that is the same as contained in the said tar? Maybe someone has done this before.
(It might be on the "info tar" but it is complicated reading ;-) )
You could try creating a patch file. This is fairly standard. The obvious way would be to create two copies of the files: original and modified and use diff -r to create the patch. Then use gunzip to compress the patch. You may be able to create a patch file directly from .tgz files: I haven't checked. See man pages for diff and patch -- JDL Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
The 03.05.21 at 18:36, John Lamb wrote:
You could try creating a patch file. This is fairly standard. The obvious way would be to create two copies of the files: original and modified and use diff -r to create the patch. Then use gunzip to compress the patch.
Mmm... could be... :-? But what I intended was simply to preserve the modified files complete, not the differences in each file or the tar so I could rebuild the modifications. Ie: 1) Compare a list of files, one from the directory, and another from the tgz; 2) From that, get the list of intact files, and/or modified files, and 3) Finally, delete intact files on directory. The reason is that it makes easier browsing for me. But I'll think about the diff thing, it could be... :-? -- Cheers, Carlos Robinson
participants (3)
-
Carlos E. R.
-
John Lamb
-
Ty C. Mixon