summaryrefslogtreecommitdiff
path: root/pinyadmin/sbin/rebuildrepo
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-05-11 21:56:42 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-05-11 21:56:42 -0700
commit3ca6564c2d95d12dff83cc645c280aa734ad19f8 (patch)
tree6ceacee15e63bf9a3a44235676a7e09135e63b9c /pinyadmin/sbin/rebuildrepo
parentd3d06161d535d965867902f84b6e2ac558ce10c6 (diff)
downloadpiny-code-3ca6564c2d95d12dff83cc645c280aa734ad19f8.tar.gz
piny-code-3ca6564c2d95d12dff83cc645c280aa734ad19f8.zip
Making rebuildrepo user-usable and user-safe.
Diffstat (limited to 'pinyadmin/sbin/rebuildrepo')
-rwxr-xr-xpinyadmin/sbin/rebuildrepo7
1 files changed, 7 insertions, 0 deletions
diff --git a/pinyadmin/sbin/rebuildrepo b/pinyadmin/sbin/rebuildrepo
index 9d4e359..2ddc33b 100755
--- a/pinyadmin/sbin/rebuildrepo
+++ b/pinyadmin/sbin/rebuildrepo
@@ -5,10 +5,17 @@ use warnings;
use Piny;
+my $env = Piny::Environment->instance( );
+
foreach my $reponame ( @ARGV ) {
my $repo = Piny::Repo->new( $reponame );
+ if ( $env->user->uid != 0 and $repo->owner->uid != $env->user->uid ) {
+ print STDERR "You are not the owner of $reponame!\n";
+ exit 1;
+ };
+
$repo->rebuild;
};