[bamf] 04/05: debian/bamfdaemon.post*: Tabify indentation.
Mike Gabriel
sunweaver at debian.org
Fri Jun 19 12:15:58 UTC 2015
This is an automated email from the git hooks/post-receive script.
sunweaver pushed a commit to branch master
in repository bamf.
commit ea7bf767cf28ee55de0d1447e7dc4fce62d6a2f0
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Fri Jun 19 14:11:49 2015 +0200
debian/bamfdaemon.post*: Tabify indentation.
---
debian/bamfdaemon.postinst | 135 +++++++++++++++++++++++----------------------
debian/bamfdaemon.postrm | 2 +-
2 files changed, 69 insertions(+), 68 deletions(-)
diff --git a/debian/bamfdaemon.postinst b/debian/bamfdaemon.postinst
index c5285e3..69f7d87 100644
--- a/debian/bamfdaemon.postinst
+++ b/debian/bamfdaemon.postinst
@@ -4,83 +4,84 @@ set -e
BAMF_INDEX_NAME="bamf-2.index"
if [ "$1" = "configure" ] || [ "$1" = "triggered" ]; then
- if [ -d /usr/share/applications ]; then
- # rebuild index
- I=/usr/share/applications/$BAMF_INDEX_NAME
- echo "Rebuilding $I..."
- rm -f $I
- perl -e '
-use File::Find;
-my $dir_name;
+ if [ -d /usr/share/applications ]; then
+ # rebuild index
+ I=/usr/share/applications/$BAMF_INDEX_NAME
+ echo "Rebuilding $I..."
+ rm -f $I
+ perl -e '
+ use File::Find;
+ my $dir_name;
-sub strip_exec
-{
- my $f = $_;
- return unless $f =~ /\.desktop$/;
- return unless ("$File::Find::dir" eq "$dir_name");
- my @lines;
- open F, $f;
- @lines = <F>;
- close F;
- my $in_desktop_entry = 0;
- my $exec = "";
- my $class = "";
- my $no_display = "false";
- my $only_show_in = "";
+ sub strip_exec
+ {
+ my $f = $_;
+ return unless $f =~ /\.desktop$/;
+ return unless ("$File::Find::dir" eq "$dir_name");
+ my @lines;
+ open F, $f;
+ @lines = <F>;
+ close F;
+ my $in_desktop_entry = 0;
+ my $exec = "";
+ my $class = "";
+ my $no_display = "false";
+ my $only_show_in = "";
- foreach (@lines)
- {
- if (/^\[\s*(.+)\s*\]/)
- {
- $was_in_desktop = $in_desktop_entry;
- $in_desktop_entry = ($1 eq "Desktop Entry");
+ foreach (@lines)
+ {
+ if (/^\[\s*(.+)\s*\]/)
+ {
+ $was_in_desktop = $in_desktop_entry;
+ $in_desktop_entry = ($1 eq "Desktop Entry");
- if ($was_in_desktop and !$in_desktop_entry)
- {
- last;
- }
- }
+ if ($was_in_desktop and !$in_desktop_entry)
+ {
+ last;
+ }
+ }
- if ($in_desktop_entry)
- {
- if (/^Exec=(.+)$/)
- {
- $exec = $1;
- $exec =~ s/^\s+|\s+$//g;
- }
+ if ($in_desktop_entry)
+ {
+ if (/^Exec=(.+)$/)
+ {
+ $exec = $1;
+ $exec =~ s/^\s+|\s+$//g;
+ }
- if (/^NoDisplay=(.+)$/)
- {
- $no_display = $1;
- $no_display =~ s/^\s+|\s+$//g;
- }
+ if (/^NoDisplay=(.+)$/)
+ {
+ $no_display = $1;
+ $no_display =~ s/^\s+|\s+$//g;
+ }
- if (/^OnlyShowIn=(.+)$/)
- {
- $only_show_in = $1;
- $only_show_in =~ s/^\s+|\s+$//g;
- }
+ if (/^OnlyShowIn=(.+)$/)
+ {
+ $only_show_in = $1;
+ $only_show_in =~ s/^\s+|\s+$//g;
+ }
- if (/^StartupWMClass=(.+)$/)
- {
- $class = $1;
- $class =~ s/^\s+|\s+$//g;
- }
- }
- }
+ if (/^StartupWMClass=(.+)$/)
+ {
+ $class = $1;
+ $class =~ s/^\s+|\s+$//g;
+ }
+ }
+ }
- if ($exec ne "")
- {
- print "$f\t$exec\t$class\t$only_show_in\t$no_display\n";
- }
-};
+ if ($exec ne "")
+ {
+ print "$f\t$exec\t$class\t$only_show_in\t$no_display\n";
+ }
+ };
-$dir_name = $ARGV[-1];
-$dir_name = $1 if($dir_name=~/(.*)\/$/);
-find(\&strip_exec, $dir_name);' /usr/share/applications > $I.new || rm -f $I.new
+ $dir_name = $ARGV[-1];
+ $dir_name = $1 if($dir_name=~/(.*)\/$/);
+ find(\&strip_exec, $dir_name);' /usr/share/applications \
+ > $I.new || rm -f $I.new
- [ -e $I.new ] && mv $I.new $I || true
- fi
+ [ -e $I.new ] && mv $I.new $I || true
+ fi
fi
#DEBHELPER#
diff --git a/debian/bamfdaemon.postrm b/debian/bamfdaemon.postrm
index 8b38294..a283d16 100644
--- a/debian/bamfdaemon.postrm
+++ b/debian/bamfdaemon.postrm
@@ -2,7 +2,7 @@
set -e
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
- rm -f /usr/share/applications/bamf.index
+ rm -f /usr/share/applications/bamf.index
fi
#DEBHELPER#
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/bamf.git
More information about the pkg-mate-commits
mailing list