ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : LiteSpeed
System : Linux v2202501248978307069 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64
User : voirf6718 ( 1002)
PHP Version : 7.3.33-1+focal
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Directory :  /bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //bin/dh_installtmpfiles
#!/usr/bin/perl -w

=head1 NAME

dh_installtmpfiles - install tmpfiles.d configuration files

=cut

use strict;
use warnings;
use Debian::Debhelper::Dh_Lib;
use File::Find;

our $VERSION = DH_BUILTIN_VERSION;

=head1 SYNOPSIS

B<dh_installtmpfiles> [S<I<debhelper options>>][B<--name=>I<name>]

=head1 DESCRIPTION

B<dh_installtmpfiles> is a debhelper program that is responsible for
installing package maintainer supplied tmpfiles.d configuration files
(e.g. for systemd-tmpfiles).

It also finds the tmpfiles.d configuration files installed by a package
and generates F<postinst> code blocks for activting the tmpfiles.d
configuration when the package is installed. These snippets are added
to the maintainer scripts by L<dh_installdeb(1)>.


=head1 OPTIONS

=over 4

This option controls both a prefix used for lookng up maintainer provided
tmpfiles.d configuration files (those mentioned in the L</FILES> section)
and also the base name used for the installed version of the file.

=back

=head1 FILES

=over 4

=item debian/I<package>.tmpfiles

If this exists, it is installed into F<usr/lib/tmpfiles.d/> in the
package build directory. Note that the C<tmpfiles.d> mechanism is
currently only used by systemd.

=item debian/I<package>.tmpfile

Deprecated name for debian/I<package>.tmpfiles.

=back

=head1 NOTES

This command is not idempotent. L<dh_prep(1)> should be called between
invocations of this command (with the same arguments). Otherwise, it
may cause multiple instances of the same text to be added to
maintainer scripts.

=cut

init();

sub uniq {
	my %seen;
	return grep { !$seen{$_}++ } @_;
}

# PROMISE: DH NOOP WITHOUT tmp(usr/lib/tmpfiles.d) tmp(etc/tmpfiles.d) pkgfile(tmpfiles) pkgfile(tmpfile) cli-options()

# Install package maintainer supplied tmpfiles files
foreach my $package (@{$dh{DOPACKAGES}}) {
	my $tmpdir = tmpdir($package);
	my $tmpfile = pkgfile($package, 'tmpfiles');
	my $name = $dh{NAME} // $package;
	my $old_tmpfile = pkgfile($package, 'tmpfile');
	my $dir;
	if (not $tmpfile) {
		my $new_name;
		next if not $old_tmpfile;
		$tmpfile = $old_tmpfile;
		$new_name = $old_tmpfile;
		$new_name =~ s{^(.+[./])tmpfile(\..+|)$}{$1tmpfiles$2};
		warning("The name $tmpfile is deprecated; please use $new_name instead");
		warning(qq{Possible fix: mv -f "${tmpfile}" "${new_name}"});
	} elsif ($old_tmpfile) {
		warning("There is both a $tmpfile and a $old_tmpfile that is relevant for this package!?");
		warning(qq{Possible fix: rm -f "${old_tmpfile}"});
		error("Aborting; Please resolve the ambiguity between ${tmpfile} and ${old_tmpfile}.");
	}

	$dir = "$tmpdir/usr/lib/tmpfiles.d";
	install_dir($dir);
	install_file($tmpfile, "${dir}/${name}.conf");
}

# Add postinst code blocks to handle tmpfiles
foreach my $package (@{$dh{DOPACKAGES}}) {
	my $tmpdir = tmpdir($package);
	my @tmpfiles;

	my @dirs = grep { -d } map { "${tmpdir}/$_" } qw(usr/lib/tmpfiles.d etc/tmpfiles.d);

	find({
		wanted => sub {
			my $name = $File::Find::name;
			return unless -f $name;
			push(@tmpfiles, basename($name)); },
		no_chdir => 1,
	}, @dirs) if @dirs;

	if (@tmpfiles) {
		autoscript($package, 'postinst', 'postinst-init-tmpfiles', { 'TMPFILES' => join(' ', uniq(sort(@tmpfiles))) });
	}
}

=head1 SEE ALSO

L<debhelper(7)>

=cut

ZeroDay Forums Mini