Add the gconf.pl and omf.pl scripts to automatically add GConf and OMF plist
instructions respectively.
This commit is contained in:
parent
d134d8a57f
commit
ac97f36397
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=21287
3 changed files with 118 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
# $FreeBSD: www/en/gnome/Makefile,v 1.15 2004/06/06 20:31:29 marcus Exp $
|
||||
# $FreeBSD: www/en/gnome/Makefile,v 1.16 2004/06/17 00:28:54 adamw Exp $
|
||||
|
||||
.if exists(../Makefile.conf)
|
||||
.include "../Makefile.conf"
|
||||
|
@ -13,7 +13,7 @@ SUBDIR+= images
|
|||
DOCS= screenshots.sgml
|
||||
DOCS+= contact.sgml
|
||||
|
||||
DATA= index.html newsflash.html news.rdf gnome_upgrade.sh gnomelogalyzer.sh builditinator.sh
|
||||
DATA= index.html newsflash.html news.rdf gnome_upgrade.sh gnomelogalyzer.sh builditinator.sh omf.pl gconf.pl
|
||||
|
||||
CLEANFILES= index.html
|
||||
CLEANFILES+= newsflash.html
|
||||
|
|
58
en/gnome/gconf.pl
Executable file
58
en/gnome/gconf.pl
Executable file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
#
|
||||
# gconf.pl - a script to add proper gconf schema handling to port PLISTs
|
||||
# usage: gconf.pl [plist] [plist] [...]
|
||||
#
|
||||
# $Id: gconf.pl,v 1.1 2004-06-27 21:41:07 marcus Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
if (scalar(@ARGV) == 0) {
|
||||
|
||||
# If no arguments were given, assume we're using the pkg-plist in the
|
||||
# current directory.
|
||||
push @ARGV, "./pkg-plist";
|
||||
}
|
||||
|
||||
foreach (@ARGV) {
|
||||
unless (open(INFILE, $_)) {
|
||||
warn "Unable to open $_: $!\n";
|
||||
next;
|
||||
}
|
||||
|
||||
my @file = <INFILE>;
|
||||
|
||||
close(INFILE);
|
||||
|
||||
for (my $i = 0 ; $i < scalar(@file) ; $i++) {
|
||||
my ($install, $uninstall);
|
||||
next unless $file[$i] =~ /\.schemas?\n$/;
|
||||
my $schema = $file[$i];
|
||||
chomp $schema;
|
||||
$uninstall =
|
||||
"\@unexec env GCONF_CONFIG_SOURCE=xml::\%D/etc/gconf/gconf.xml.defaults gconftool-2 --makefile-uninstall-rule \%D/$schema > /dev/null || /usr/bin/true\n";
|
||||
|
||||
if ($file[$i - 1] ne $uninstall) {
|
||||
splice @file, $i, 0, $uninstall;
|
||||
$i++
|
||||
}
|
||||
|
||||
$install =
|
||||
"\@exec env GCONF_CONFIG_SOURCE=xml::\%D/etc/gconf/gconf.xml.defaults gconftool-2 --makefile-install-rule \%D/$schema > /dev/null || /usr/bin/true\n";
|
||||
if ($file[$i + 1] ne $install) {
|
||||
splice @file, $i + 1, 0, $install;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
unless (open(OUTFILE, ">" . $_)) {
|
||||
warn "Failed to open $_: $!\n";
|
||||
next;
|
||||
}
|
||||
|
||||
print OUTFILE @file;
|
||||
|
||||
close(OUTFILE);
|
||||
}
|
58
en/gnome/omf.pl
Executable file
58
en/gnome/omf.pl
Executable file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
#
|
||||
# omf.pl - a script to add proper OMF handling to port PLISTs
|
||||
# usage: omf.pl [plist] [plist] [...]
|
||||
#
|
||||
# $Id: omf.pl,v 1.1 2004-06-27 21:41:07 marcus Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
if (scalar(@ARGV) == 0) {
|
||||
|
||||
# If no arguments were given, assume we're using the pkg-plist in the
|
||||
# current directory.
|
||||
push @ARGV, "./pkg-plist";
|
||||
}
|
||||
|
||||
foreach (@ARGV) {
|
||||
unless (open(INFILE, $_)) {
|
||||
warn "Unable to open $_: $!\n";
|
||||
next;
|
||||
}
|
||||
|
||||
my @file = <INFILE>;
|
||||
|
||||
close(INFILE);
|
||||
|
||||
my @omfs;
|
||||
for (my $i = 0 ; $i < scalar(@file) ; $i++) {
|
||||
next unless $file[$i] =~ /\.omf\n$/;
|
||||
my $omf = $file[$i];
|
||||
chomp $omf;
|
||||
my $install =
|
||||
"\@exec scrollkeeper-install -q \%D/$omf 2>/dev/null || /usr/bin/true\n";
|
||||
if ($file[$i + 1] eq $install) {
|
||||
next;
|
||||
}
|
||||
splice @file, $i + 1, 0, $install;
|
||||
push (@omfs, $omf);
|
||||
$i++;
|
||||
}
|
||||
|
||||
foreach my $omf (@omfs) {
|
||||
my $uninstall =
|
||||
"\@unexec scrollkeeper-uninstall -q \%D/$omf 2>/dev/null || /usr/bin/true\n";
|
||||
push @file, $uninstall;
|
||||
}
|
||||
|
||||
unless (open(OUTFILE, ">" . $_)) {
|
||||
warn "Failed to open $_: $!\n";
|
||||
next;
|
||||
}
|
||||
|
||||
print OUTFILE @file;
|
||||
|
||||
close(OUTFILE);
|
||||
}
|
Loading…
Reference in a new issue