/[smecontribs]/rpms/smeserver-subversion/contribs7/smeserver-subversion-1.4-ImproveRepositoryDeleteSanityCheck.patch
ViewVC logotype

Contents of /rpms/smeserver-subversion/contribs7/smeserver-subversion-1.4-ImproveRepositoryDeleteSanityCheck.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Tue Nov 25 16:20:30 2008 UTC (15 years, 11 months ago) by slords
Branch: MAIN
CVS Tags: smeserver-subversion-1_4-38_el4_sme, smeserver-subversion-1_4-51_el4_sme, smeserver-subversion-1_4-40_el4_sme, smeserver-subversion-1_4-49_el4_sme, smeserver-subversion-1_4-37_el4_sme, smeserver-subversion-1_4-36_el4_sme, smeserver-subversion-1_4-45_el4_sme, smeserver-subversion-1_4-50_el4_sme, smeserver-subversion-1_4-39_el4_sme, smeserver-subversion-1_4-48_el4_sme, smeserver-subversion-1_4-46_el4_sme, HEAD
Changes since 1.2: +0 -0 lines
Restore

1 --- smeserver-subversion-1.4/root/etc/e-smith/events/actions/repository-delete.ImproveRepositoryDeleteSanityCheck 2006-08-26 23:59:54.000000000 +0200
2 +++ smeserver-subversion-1.4/root/etc/e-smith/events/actions/repository-delete 2008-02-25 21:15:47.000000000 +0100
3 @@ -24,18 +24,30 @@
4 #----------------------------------------------------------------------
5
6 #------------------------------------------------------------
7 -# Delete the Unix account and files for the repository.
8 +# Delete the files for the repository.
9 #------------------------------------------------------------
10
11 -event=$1
12 -repository=$2
13 -if [ -z "$repository" ]
14 -then
15 - echo repositoryName argument missing
16 - exit 1
17 -fi
18 -
19 -/bin/rm -rf /home/e-smith/files/repositories/$repository
20 -#/usr/sbin/userdel "$repository"
21 -#/usr/sbin/groupdel "$repository"
22 -/sbin/e-smith/db accounts delete $repository
23 +use strict;
24 +use Errno;
25 +use File::Path;
26 +
27 +use esmith::AccountsDB;
28 +my $adb = esmith::AccountsDB->open_ro();
29 +
30 +my $event = $ARGV [0];
31 +my $repository = $ARGV [1];
32 +
33 +$a = $adb->get($repository) || undef;
34 +unless ( defined $a && $a->prop('type') eq "repository-deleted" )
35 +{
36 + warn "$repository is not a repository\n";
37 + exit (0);
38 +}
39 +
40 +my $dir = "/home/e-smith/files/repositories/$repository";
41 +
42 +exit 0 unless ( -d $dir );
43 +
44 +rmtree( $dir ) || die "Couldn't remove tree $dir\n";
45 +
46 +exit (0);

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed