summaryrefslogtreecommitdiff
path: root/pinyadmin/sbin/pinyconfig
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-04-24 13:00:05 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-04-24 13:00:05 -0700
commitffab3ec34b9fd949a9877d0a19182b58911424da (patch)
tree102fb78c332d7c43d5c3671e4de59bcba25134ca /pinyadmin/sbin/pinyconfig
parent4ac0fd01b73a0b718db3a756866fee121a1615f1 (diff)
parent2a27be477f89b42abb23793c5118b40120b793aa (diff)
downloadpiny-code-ffab3ec34b9fd949a9877d0a19182b58911424da.tar.gz
piny-code-ffab3ec34b9fd949a9877d0a19182b58911424da.zip
Merge branch 'master' of piny.be:/srv/git/piny-code
Conflicts: libpiny/lib/Piny/Repo.pm
Diffstat (limited to 'pinyadmin/sbin/pinyconfig')
-rwxr-xr-xpinyadmin/sbin/pinyconfig16
1 files changed, 11 insertions, 5 deletions
diff --git a/pinyadmin/sbin/pinyconfig b/pinyadmin/sbin/pinyconfig
index f6752db..e78cf3c 100755
--- a/pinyadmin/sbin/pinyconfig
+++ b/pinyadmin/sbin/pinyconfig
@@ -8,30 +8,36 @@ use Piny;
my ( $reponame, $attr, $value ) = @ARGV;
if ( not defined $reponame or not defined $attr ) {
- die "Usage: $0 reponame tweakable [value]\n";
+ die "Usage: $0 reponame|--user tweakable [value]\n";
};
$attr = lc $attr;
$attr =~ s/\./_/g;
-my $repo = Piny::Repo->new( $reponame );
+my $config;
+
+if ( $reponame eq "--user" ) {
+ $config = Piny::Environment->instance->user->config;
+} else {
+ $config = Piny::Repo->new( $reponame )->config;
+};
if ( defined $value ) {
undef $@;
eval {
- $repo->config->$attr( $value );
+ $config->$attr( $value );
};
if ( $@ ) {
print STDERR "$attr is not a legal tweakable, or $value is not a legal value for that tweakable.\n$@\n";
};
- if ( $value ne $repo->config->$attr ) {
+ if ( $value ne $config->$attr ) {
print STDERR "Failed to set $attr (perhaps an override is in place)\n";
};
};
undef $@;
eval {
- print "$attr = " . $repo->config->$attr . "\n";
+ print "$attr = " . $config->$attr . "\n";
};
if ( $@ ) {
print STDERR "$attr is not a legal tweakable, or its current value is illegal.\n$@\n";