diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-03-15 11:08:10 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-03-15 11:08:10 +0000 |
commit | fd9fbc68bb6617be37e7c779d9fd15f7428cf48c (patch) | |
tree | e27b75674d2ed196ea9b373beebafeb5c9a90f62 /scripts | |
parent | 2888f54b6df1ea2d90f477e99dd2caa6ff3821b0 (diff) | |
download | upstream-fd9fbc68bb6617be37e7c779d9fd15f7428cf48c.tar.gz upstream-fd9fbc68bb6617be37e7c779d9fd15f7428cf48c.tar.bz2 upstream-fd9fbc68bb6617be37e7c779d9fd15f7428cf48c.zip |
scripts/feeds: add support for uninstalling targets
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44782 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/feeds | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/feeds b/scripts/feeds index 62edb66820..785be385a9 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -581,6 +581,17 @@ sub install { return $ret; } +sub uninstall_target($) { + my $dir = shift; + my $name = $dir; + $name =~ s/.*\///g; + + my $dest = readlink $dir; + return unless $dest =~ /..\/..\/feeds/; + warn "Uninstalling target '$name'\n"; + unlink "$dir"; +} + sub uninstall { my %opts; my $name; @@ -595,6 +606,10 @@ sub uninstall { if ($opts{a}) { system("rm -rvf ./package/feeds"); + foreach my $dir (glob "target/linux/*") { + next unless -l $dir; + uninstall_target($dir); + } $uninstall = 1; } else { if($#ARGV == -1) { @@ -603,6 +618,13 @@ sub uninstall { } get_installed(); while ($name = shift @ARGV) { + my $target = "target/linux/$name"; + -l "$target" and do { + uninstall_target($target); + $uninstall = 1; + next; + }; + my $pkg = $installed{$name}; $pkg or do { warn "WARNING: $name not installed\n"; |