Hello community,

here is the log from the commit of package insserv-compat for openSUSE:Factory 
checked in at 2013-01-10 07:16:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/insserv-compat (Old)
 and      /work/SRC/openSUSE:Factory/.insserv-compat.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "insserv-compat", Maintainer is ""

Changes:
--------
New Changes file:

--- /dev/null   2013-01-09 19:40:42.352580873 +0100
+++ /work/SRC/openSUSE:Factory/.insserv-compat.new/insserv-compat.changes       
2013-01-10 07:16:51.000000000 +0100
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------
+Tue Dec 18 16:49:43 UTC 2012 - lnus...@suse.de
+
+- new package
+

New:
----
  init-functions
  insserv-compat.changes
  insserv-compat.spec
  insserv.pl

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ insserv-compat.spec ++++++
#
# spec file for package insserv-compat
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# icecream 0


Name:           insserv-compat
Summary:        Simple insserv replacement for systemd only systems
License:        MIT
Group:          System/Base
Version:        0.1
Release:        0
Url:            
https://build.opensuse.org/package/show?package=%name&project=openSUSE%3AFactory
Source:         insserv.pl
Source1:        init-functions
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Obsoletes:      insserv <= 1.16.0
Provides:       insserv = 1.16.1-1

%description 
insserv is used enable System V init scripts. This package only
contains a stub implemenation for use on systemd only systems.

%prep
%setup -q -c -T
%build
pod2man -s 8 -c 'The openSUSE boot concept' -r "openSUSE 12.3" -u %SOURCE0 
insserv.8

%install
for i in /sbin %{_sbindir} /usr/lib/lsb /lib/lsb %{_mandir}/man8; do
        install -d -m 755 %{buildroot}$i
done
install -m755 %{SOURCE0} %{buildroot}%{_sbindir}/insserv
install -m755 %{SOURCE1} %{buildroot}/lib/lsb/init-functions
install -m644 insserv.8 %{buildroot}%{_mandir}/man8
ln -s ../usr/sbin/insserv  %{buildroot}/sbin/insserv
ln -s ../../sbin/insserv  %{buildroot}/usr/lib/lsb/install_initd
ln -s ../../sbin/insserv  %{buildroot}/usr/lib/lsb/remove_initd

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{_sbindir}/insserv
/sbin/insserv
/lib/lsb/init-functions
/usr/lib/lsb/install_initd
/usr/lib/lsb/remove_initd
%{_mandir}/man8/insserv.*

%changelog
++++++ init-functions ++++++
#
# Define init LSB shell functions
#

#
# Source SuSE's rc functions
#
. /etc/rc.status

#
# Be sure that  start_daemon, killproc, and
# pidofproc will be script functions.
#
function start_daemon ()
{
    /sbin/start_daemon ${1+"$@"}
}

function killproc ()
{
    /sbin/killproc ${1+"$@"}
}

function pidofproc ()
{
    /sbin/pidofproc ${1+"$@"}
}

#
# Logging of succes messages
#
function log_success_msg ()
{
    echo -en "$@"
    echo -e  "$rc_done"
}

#
# Logging of failure messages
#
function log_failure_msg ()
{
    echo -en "$@"
    echo -e  "$rc_failed"
}

#
# Logging of warn messages
#
function log_warning_msg ()
{
    echo -en "$@"
    echo -e  "${stat}${attn} warning${norm}"
}

++++++ insserv.pl ++++++
#!/usr/bin/perl -w
# Copyright (c) 2012,2013 SUSE Linux Products GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

=head1 insserv

insserv - Enable an installed system init script

=head1 SYNOPSIS

insserv [[-r] <script>]

=head1 OPTIONS

=over 4

=item B<--remove, -r>

Remove the listed scripts from all runlevels

=back

=head1 DESCRIPTION

This version of insserv is just a stub for compatibility.

=cut

use strict;
use Getopt::Long;
Getopt::Long::Configure("no_ignore_case");

my $init_d = "/etc/init.d";

my %options;

sub parse($)
{
        my $name = shift;
        my $fh;
        unless (open($fh, '<', "$init_d/$name")) {
                warn "can't open $name: $!";
                return undef;
        }
        my $r = {};
        my $header = 0;
        while(<$fh>) {
                if ($header == 0 && /^### BEGIN INIT INFO/) {
                        $header = 1;
                        next;
                }
                next unless $header;
                last if ($header == 1 && /^### END INIT INFO/);
                unless (s/^#\s//) {
                        warn "$name: parse error";
                        $r = undef;
                        last;
                }
                if (/^(Default-(?:Start|Stop)):\s*(.*)/i) {
                        $r->{lc $1} = $2;
                }
        }
        close $fh;
        return $r;
}

sub do_unlink($)
{
        my $file = shift;
        print "rm $file\n" if $options{'verbose'};
        unlink($file);
}

sub do_symlink($$)
{
        my ($old, $new) = @_;
        print "ln -s $old $new\n" if $options{'verbose'};
        return 1 if ($options{'dryrun'});
        symlink($old, $new);
}

sub getlinks(;$)
{
        my $name = shift;
        my $links;
        for my $d (qw/rc0 rc1 rc2 rc3 rc4 rc5 rc6 rcS boot/) {
                my $dir = "$init_d/$d.d";
                opendir(my $dh, $dir) || next;
                for my $n (readdir $dh) {
                        next unless $n =~ /^[KS]\d\d/;
                        my $fn = "$dir/$n";
                        next unless -l $fn;
                        if ($name) {
                                my $n = readlink $fn;
                                $n =~ s/.*\///;
                                next unless ($n eq $name);
                        }
                        push @$links, $fn;
                }
                closedir $dh;
        }
        return $links;
}

sub cleanup()
{
        for my $link (@{getlinks()||[]}) {
                next if -e $link;
                do_unlink($link);
        }
}

sub disable($)
{
        my $name = shift;
        for my $link (@{getlinks($name)||[]}) {
                do_unlink($link);
        }
}

sub createlinks($$$)
{
        my $type = shift;
        my $name = shift;
        my @lvl = split(' ', shift);
        my $num = '50';
        for my $l (@lvl) {
                my $d = "rc$l.d";
                $d = 'boot.d' if ($l eq 'B');
                do_symlink("../$name", "$init_d/$d/$type$num$name");
        }
}

sub enable($)
{
        my $name = shift;
        my $links = getlinks($name);
        return 0 if $links; # already enabled
        my $h = parse($name);
        createlinks('S', $name, $h->{'default-start'} || '2 3 5');
        # default stop is actually ignored in SUSE ... o_O
        createlinks('K', $name, $h->{'default-start'} || '2 3 5');
}

sub usage($) {
        my $r = shift;
        use Pod::Usage;
        pod2usage($r);
        if ($@) {
                die "Pod::Usage missing\n";
        }
}

if ($0 =~ /install_initd$/) {
} elsif ($0 =~ /remove_initd$/) {
        $options{'remove'} = 1;
} else {
        GetOptions(
                \%options,
                "verbose|v",
                "config|c=s", # ignored
                "override|o=s", # ignored
                "path|p=s",
                "dryrun|n",
                "remove|r",
                "default|d", # ignored
                "force|f", # meaningless
                "upstart-job|u=s", # ignored
                "help|h",
        ) or usage(1);
}

if (@ARGV) {
        if (-d $ARGV[0]) {
                $init_d = shift @ARGV;
                usage(1) if @ARGV;
                cleanup();
        }
}

usage(1) if ($options{'remove'} && !@ARGV);
usage(0) if ($options{'help'});

$init_d = $options{'path'} if $options{'path'};

if (@ARGV) {
        for my $name (@ARGV) {
                if ($name =~ s/^(\/.*)\/(.+)/$2/) {
                        $init_d = $1 if $1;
                }
                if ($options{'remove'}) {
                        disable($name);
                } else {
                        enable($name);
                }
        }
} else {
        cleanup();
}
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to