Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/SLE-12-GA' into jsmeix_patches_o…
Browse files Browse the repository at this point in the history
…s13_2
  • Loading branch information
jreidinger committed Jan 19, 2015
2 parents 2612c73 + 5a19032 commit 68e2186
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 15 deletions.
14 changes: 14 additions & 0 deletions package/yast2-scanner.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Tue May 27 14:27:36 CEST 2014 - jsmeix@suse.de

- setup_network_scanner_config.with_systemd_support is an
enhancement for /usr/lib/YaST2/bin/setup_network_scanner_config
that provides additional support for systemd (bnc#859353).

-------------------------------------------------------------------
Thu May 15 16:45:07 CEST 2014 - jsmeix@suse.de

- use_fast_append_instead_of_slow_add.diff replaces
slow Builtins.add() with fast '<<' append operator
where needed to avoid "hang up impression" (bnc#877516).

-------------------------------------------------------------------
Wed Nov 13 15:56:18 UTC 2013 - jreidinger@suse.com

Expand Down
10 changes: 2 additions & 8 deletions src/modules/Scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1794,20 +1794,14 @@ def ModelItems(filter_string)
end
# Take the filter_string into account:
if "" == filter_string
model_items = Builtins.add(
model_items,
Item(Id(database_index), model_string)
)
model_items << Item(Id(database_index), model_string)
else
# test whether the model_string matches to the filter_string:
if Builtins.regexpmatch(
Builtins.tolower(model_string),
Builtins.tolower(filter_string)
)
model_items = Builtins.add(
model_items,
Item(Id(database_index), model_string)
)
model_items << Item(Id(database_index), model_string)
end
end
end
Expand Down
40 changes: 33 additions & 7 deletions tools/setup_network_scanner_config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

# Johannes Meixner <jsmeix@suse.de>, 2004, 2005, 2006, 2007, 2008, 2010
# Johannes Meixner <jsmeix@suse.de>, 2004, 2005, 2006, 2007, 2008, 2010, 2014
#
# Copyright (c) 2010 Novell, Inc.
# All Rights Reserved.
Expand Down Expand Up @@ -39,6 +39,8 @@ ACTIVATE_BACKEND=${0%/*}/activate_scanner_backend
DEACTIVATE_BACKEND=${0%/*}/deactivate_scanner_backend
XINETD_CONFIG_FILE="/etc/xinetd.d/sane-port"
XINETD_INIT_SCRIPT="/etc/init.d/xinetd"
XINETD_SYSTEMD_UNIT="xinetd.service"
XINETD_SYSTEMD_UNIT_FILE="/usr/lib/systemd/system/$XINETD_SYSTEMD_UNIT"

# Function to remove old entries and append new entries to a SANE config file:
ReWrite()
Expand Down Expand Up @@ -69,15 +71,39 @@ fi
# and do the appropriate stuff regarding the xinetd:
if [ -n "$SANED_CONFIG" ]
then sed -i -e 's/^.*disable.*$/\tdisable = no/' $XINETD_CONFIG_FILE || { echo "Failed to enable saned in $XINETD_CONFIG_FILE" 1>&2 ; exit 6 ; }
if $XINETD_INIT_SCRIPT status &>/dev/null
then $XINETD_INIT_SCRIPT reload || { echo "Failed to reload xinetd" 1>&2 ; exit 7 ; }
else $XINETD_INIT_SCRIPT start || { echo "Failed to start xinetd" 1>&2 ; exit 8 ; }
insserv xinetd || { echo "Failed to insserv xinetd" 1>&2 ; exit 9 ; }
if test -e $XINETD_INIT_SCRIPT
then if $XINETD_INIT_SCRIPT status &>/dev/null
then $XINETD_INIT_SCRIPT reload || { echo "Failed to reload xinetd" 1>&2 ; exit 7 ; }
else $XINETD_INIT_SCRIPT start || { echo "Failed to start xinetd" 1>&2 ; exit 8 ; }
insserv xinetd || { echo "Failed to insserv xinetd" 1>&2 ; exit 9 ; }
fi
exit 0
fi
if test -e $XINETD_SYSTEMD_UNIT_FILE
then if systemctl --quiet is-active $XINETD_SYSTEMD_UNIT && systemctl --quiet is-enabled $XINETD_SYSTEMD_UNIT
then systemctl --quiet reload $XINETD_SYSTEMD_UNIT || { echo "Failed to reload xinetd" 1>&2 ; exit 7 ; }
else systemctl --quiet start $XINETD_SYSTEMD_UNIT || { echo "Failed to start xinetd" 1>&2 ; exit 8 ; }
systemctl --quiet enable $XINETD_SYSTEMD_UNIT || { echo "Failed to enable xinetd" 1>&2 ; exit 9 ; }
fi
exit 0
fi
echo "Cannot reload or start and enable xinetd (neither $XINETD_INIT_SCRIPT nor $XINETD_SYSTEMD_UNIT_FILE)" 1>&2
exit 11
else sed -i -e 's/^.*disable.*$/\tdisable = yes/' $XINETD_CONFIG_FILE || { echo "Failed to disable saned in $XINETD_CONFIG_FILE" 1>&2 ; exit 10 ; }
if $XINETD_INIT_SCRIPT status &>/dev/null
then $XINETD_INIT_SCRIPT reload || { echo "Failed to reload xinetd" 1>&2 ; exit 7 ; }
if test -e $XINETD_INIT_SCRIPT
then if $XINETD_INIT_SCRIPT status &>/dev/null
then $XINETD_INIT_SCRIPT reload || { echo "Failed to reload xinetd" 1>&2 ; exit 7 ; }
fi
exit 0
fi
if test -e $XINETD_SYSTEMD_UNIT_FILE
then if systemctl --quiet is-active $XINETD_SYSTEMD_UNIT
then systemctl --quiet reload $XINETD_SYSTEMD_UNIT || { echo "Failed to reload xinetd" 1>&2 ; exit 7 ; }
fi
exit 0
fi
echo "Cannot reload xinetd (neither $XINETD_INIT_SCRIPT nor $XINETD_SYSTEMD_UNIT_FILE)" 1>&2
exit 11
fi

exit 0
Expand Down

0 comments on commit 68e2186

Please sign in to comment.