diff options
author | Karl Berry <karl@freefriends.org> | 2008-09-24 16:39:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-09-24 16:39:22 +0000 |
commit | 35c52f226665f12cf6aadb8fd8a10b539172d045 (patch) | |
tree | 26c21a9ed398cb395819300635d9a62dfca6eef5 /Master/tlpkg/bin/tlprm | |
parent | ea37fb2c115c61d53fa11d528703aea350be0be0 (diff) |
rm grnumalt, nonfree
git-svn-id: svn://tug.org/texlive/trunk@10714 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tlprm')
-rwxr-xr-x | Master/tlpkg/bin/tlprm | 130 |
1 files changed, 57 insertions, 73 deletions
diff --git a/Master/tlpkg/bin/tlprm b/Master/tlpkg/bin/tlprm index 58f82604dc1..c7adf0d2211 100755 --- a/Master/tlpkg/bin/tlprm +++ b/Master/tlpkg/bin/tlprm @@ -24,17 +24,14 @@ use TeXLive::TLPSRC; use TeXLive::TLUtils; use Pod::Usage; use Getopt::Long; -use Cwd 'abs_path'; +use Cwd qw(abs_path); -my $opt_svn = 1; -my $help = 0; +my $opt_help = 0; TeXLive::TLUtils::process_logging_options(); +GetOptions("help|?" => \$opt_help) or pod2usage(1); -GetOptions("svn!", - "help|?" => \$help) or pod2usage(1); - -pod2usage(-exitstatus => 0, -verbose => 2) if $help; +pod2usage(-exitstatus => 0, -verbose => 2) if $opt_help; exit (&main ()); @@ -44,7 +41,7 @@ sub main my $failure_count = 0; chomp (my $Master = `cd $mydir/../.. && pwd`); - my $tlpdb = TeXLive::TLPDB->new (root => $Master); + my $tlpdb = TeXLive::TLPDB->new ("root" => $Master); foreach my $f (@ARGV) { my $obj = $tlpdb->get_package ($f); @@ -55,51 +52,49 @@ sub main } my @files = $obj->all_files; - if ($opt_svn) { - my $tlpsrc = new TeXLive::TLPSRC; - $tlpsrc->from_file ($f); - push (@files, $tlpsrc->_srcfile); # also want to remove the tlpsrc file. - - # The paths in tlpdb are relative to Master, so we chdir there so - # that Cwd::abs_path can work. - chdir ($Master) || die "chdir($Master) failed: $!"; - - # Commonly, we want to remove entire directories, not just all the - # files in the directory. - my @removals = &collapse_dirs (@files); - my $removals = join ("", map { "$_\n" } @removals); - - my $TMPDIR = $ENV{"TMPDIR"} || "/tmp"; - my $rm_file = "$TMPDIR/tlprm.rm"; - unlink ($rm_file); - `printf "$removals" >$rm_file`; - - my @lines = `grep -l 'depend.* $f\$' $Master/tlpkg/tlpsrc/collection-*`; - my $commit_file = "$TMPDIR/tlprm.commit"; - unlink ($commit_file); - `printf "$removals" >$commit_file`; - `printf "@lines" >>$commit_file`; - - print "first edit collections:\n", @lines; - print "and if needed: $Master/tlpkg/bin/tlpkg-ctan-check\n"; - `echo $Master/tlpkg/bin/tlpkg-ctan-check >>$commit_file`; - - print "then:\nsvn remove `cat $rm_file`\n"; - print "svn commit -m'rm $f' `cat $commit_file`\n"; - - if (1) { # maybe only if debugging? - print "\nremovals ($rm_file):\n"; - print `cat $rm_file`; - print "\ncommits ($commit_file):\n"; - print `cat $commit_file`; - print "\nlist of files being removed:\n"; - print "$_\n" foreach @files; - } - - } else { - die "sorry, can only do svn removals now."; - # maybe later it will make sense to extend this for removals - # from an installation. + my $tlpsrc = new TeXLive::TLPSRC; + $tlpsrc->from_file ($f); + push (@files, $tlpsrc->_srcfile); # also want to remove the tlpsrc file. + + # The paths in tlpdb are relative to Master, so we chdir there so + # that Cwd::abs_path can work. + chdir ($Master) || die "chdir($Master) failed: $!"; + + # Commonly, we want to remove entire directories, not just all the + # files in the directory. + my @removals = &collapse_dirs (@files); + my $removals = join ("", map { "$_\n" } @removals); + + my $TMPDIR = $ENV{"TMPDIR"} || "/tmp"; + my $rm_file = "$TMPDIR/tlprm.rm"; + unlink ($rm_file); + `printf "$removals" >$rm_file`; + + my $commit_file = "$TMPDIR/tlprm.commit"; + unlink ($commit_file); + `printf "$removals" >$commit_file`; + + my @lines = `grep -l 'depend.* $f\$' $Master/tlpkg/tlpsrc/collection-*`; + `printf "@lines" >>$commit_file`; + print "first edit collections:\n", @lines; + + print "and if needed: $Master/tlpkg/bin/tlpkg-ctan-check\n"; + `echo $Master/tlpkg/bin/tlpkg-ctan-check >>$commit_file`; + + # e.g., insert a die. + print "and to avoid resurrection: $Master/tlpkg/bin/ctan2tds\n"; + `echo $Master/tlpkg/bin/ctan2tds >>$commit_file`; + + print "then:\nsvn remove `cat $rm_file`\n"; + print "svn commit -m'rm $f, REASON' `cat $commit_file`\n"; + + if (1) { # maybe only if debugging? + print "\nremovals ($rm_file):\n"; + print `cat $rm_file`; + print "\ncommits ($commit_file):\n"; + print `cat $commit_file`; + print "\nlist of files being removed:\n"; + print "$_\n" foreach @files; } } @@ -117,8 +112,8 @@ sub main # retained. # # We do not try to check anything recursively. It doesn't buy us -# anything, since what we will eventually be doing is running svn -# commands to remove these dirs/files, and it's harmless to list subdirs. +# anything, since we will eventually be running svn commands to remove +# these dirs/files, and it's harmless to list subdirs. # sub collapse_dirs { @@ -182,31 +177,20 @@ tlprm [OPTION]... [TLPKG]... =head1 OPTIONS -=over 4 - -=item B<-svn> -Print the Subversion commands that will do the actual removal. This is -the default mode of operation. - -=back - -The standard options C<-help> and C<-debug> are also accepted. -See the tlpfiles documentation for details. +The standard options B<-q>, B<-v>, and B<-logfile>=I<file> are +accepted; see the C<process_logging_options> function in +L<TeXLive::TLUtils> for details. =head1 DESCRIPTION -By default (or with the C<--svn> option), B<tlprm> merely prints -commands to remove TeX Live packages from the source repository, e.g., -when a package becomes obsolete or merged. It does not actually run any -commands, remove anything, or change the TeX Live package database or -anything else. +B<tlprm> merely prints Subversion commands to remove TeX Live packages +from the source repository, e.g., when a package becomes obsolete or +merged. It does not actually run any commands, remove anything, or +change the TeX Live package database or anything else. No dependency or other checking is done. It also does not remove the given package from any collection(s) where it is present. -Perhaps someday this will be extended to remove a package from an actual -installation. - =head1 AUTHORS AND COPYRIGHT This script and its documentation were written for the TeX Live |