diff options
Diffstat (limited to 'SBO-Lib/lib')
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 818d8b8..46ef2f6 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -241,6 +241,18 @@ sub idx { return undef; } +sub indent { + my ($indent, $text) = @_; + return $text unless $indent; + + my @lines = split /\n/, $text; + foreach my $line (@lines) { + next unless length($line); + $line = (" " x $indent) . $line; + } + return join "\n", @lines; +} + # Move everything in /usr/sbo except distfiles and repo dirs into repo dir sub migrate_repo { make_path($repo_path) unless -d $repo_path; |