From ebb614bd08d0f0bfa23c663db7ccd0783f8093f6 Mon Sep 17 00:00:00 2001 From: Sérgio M. Basto Date: Oct 06 2023 15:39:32 +0000 Subject: Archive LSB db won't be used for now --- diff --git a/redhat-lsb/README b/redhat-lsb/README deleted file mode 100644 index ae9b6f5..0000000 --- a/redhat-lsb/README +++ /dev/null @@ -1,14 +0,0 @@ -Environment Variables -=============================== -LSBDBHOST = -LSBDB = -LSBUSER = -LSBDBPASSWD = - -export LSBDBHOST=localhost -export LSBDB=lsb -export LSBUSER=lsbadmin -export LSBDBPASSWD=PASSWORD - - -WARNING: Most Scripts/Tools WILL NOT work if these variables are NOT set diff --git a/redhat-lsb/mkbaselist2 b/redhat-lsb/mkbaselist2 deleted file mode 100644 index da275c3..0000000 --- a/redhat-lsb/mkbaselist2 +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl - -# Source originally from lsb-cmdchk -# Creating a list of base libraries required by LSB -# -# changes from 3.1 version: LSB database is now version-aware -# DBI is used instead of deprecated Mysql.pm - -use DBI; -use Getopt::Long; -use Env qw(LSBUSER LSBDBPASSWD LSBDB LSBDBHOST); - -sub usage() -{ -print STDERR "mkbaselist -v \n"; -print STDERR " selects specific or All\n"; -die; -} - -GetOptions("v=s" => \$lsbversion); -if( !$lsbversion ) { usage(); } - -# Uncomment to trace SQL statments -#$trace=1; - -# -# 2) Establish connection to the database -# - -my $dbh = DBI->connect('DBI:mysql:database='.$LSBDB.';host='.$LSBDBHOST, $LSBUSER, $LSBDBPASSWD) - or die "Couldn't connect to database: ".$DBI->db_errstr; - -# -# 3) Get the list of libraries for LSB_Core and LSB_Cpp -# For LSB 3.2 LSB_Printing and LSB_Languages is added -# - -$select = "SELECT DISTINCT ALrunname,Lname from Library "; -$select.= "LEFT JOIN SModLib ON SMLlid=Lid "; -$select.= "LEFT JOIN SubModule ON SMid=SMLsmid "; -$select.= "LEFT JOIN ModSMod ON MSMsmid=SMid "; -$select.= "LEFT JOIN Module on Mid=MSMmid "; -$select.= "LEFT JOIN ArchLib ON ALlid=Lid "; -$select.= "LEFT JOIN Architecture ON ALaid=Aid "; -$select.= "WHERE ( (ALappearedin <= '$lsbversion' and ALappearedin<>'') "; -$select.= "AND (ALwithdrawnin IS NULL OR ALwithdrawnin > '$lsbversion') ) "; -$select.= "AND Aname='".$ARGV[0]."' "; -$select.= "AND ALrunname!='' "; -#temporary: graphics script isn't called, so do all here -#$select.= "AND Mname IN ('LSB-Core','LSB-CXX','LSB-Printing','LSB-Languages') "; -$select.= "ORDER BY ALrunname "; - -#print $select; - -my $sth = $dbh->prepare($select) - or die "Couldn't prepare $select query: ".DBI->errstr; -$sth->execute or die "Couldn't execute $select query: ".DBI->errstr; - -for(1..$sth->rows) { - my $entry = $sth->fetchrow_hashref - or die "Fetchrow failed on $select query: ".DBI->errstr; - $basename=$entry->{'ALrunname'}; - print "$basename\n"; -} - -$sth->finish; -$dbh->disconnect; diff --git a/redhat-lsb/mkcmdlist2 b/redhat-lsb/mkcmdlist2 deleted file mode 100644 index c5d83c5..0000000 --- a/redhat-lsb/mkcmdlist2 +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/perl - -# Source originally from lsb-cmdchk -# Creating a list of commands required by LSB - -use DBI; -use Getopt::Long; -use Env qw(LSBUSER LSBDBPASSWD LSBDB LSBDBHOST); - -sub usage() -{ -print STDERR "mkcmdlist -v \n"; -die; -} - -GetOptions("v=s" => \$lsbversion); -if( !$lsbversion ) { usage(); } - -# Uncomment to trace SQL statments -#$trace=1; - -# -# 2) Establish connection to the database -# - -my $dbh = DBI->connect('DBI:mysql:database='.$LSBDB.';host='.$LSBDBHOST, $LSBUSER, $LSBDBPASSWD) - or die "Couldn't connect to database: ".$DBI->db_errstr; - -# -# 3) Get the list of cmds -# - -$select = "SELECT DISTINCT Cid,Cname,Cpath FROM Command "; -$select.= "LEFT JOIN SModCmd ON SMCcid=Cid "; -$select.= "LEFT JOIN SubModule on SMid=SMCsmid "; -$select.= "WHERE (SMCappearedin <= '$lsbversion' and SMCappearedin<>'') "; -$select.= "AND (SMCwithdrawnin IS NULL OR SMCwithdrawnin > '$lsbversion') "; -$select.= "AND (SMmandatorysince <= '$lsbversion' and SMmandatorysince<>'') "; -$select.= "AND Cbuiltin!='Yes' "; -$select.= "ORDER BY Cname "; - -#print $select; - -my $sth = $dbh->prepare($select) - or die "Couldn't prepare $select query: ".DBI->errstr; -$sth->execute or die "Couldn't execute $select query: ".DBI->errstr; - -for(1..$sth->rows) { - my $entry = $sth->fetchrow_hashref - or die "Fetchrow failed on $select query: ".DBI->errstr; - $cmdname=$entry->{'Cname'}; - #if ($entry->{'Cpath'} eq "") { - # $cmdpath='None'; - #} else { - # $cmdpath=$entry->{'Cpath'}; - #} - print "$cmdname\n"; -} - -$sth->finish; -$dbh->disconnect; diff --git a/redhat-lsb/mkgraphiclist2 b/redhat-lsb/mkgraphiclist2 deleted file mode 100644 index dea1e79..0000000 --- a/redhat-lsb/mkgraphiclist2 +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/perl - -# Source originally from lsb-cmdchk -# Creating a list of desktop (graphics) libraries required by LSB -# -# changes from 3.1 version: LSB database is now version-aware -# DBI is used instead of deprecated Mysql.pm - -use DBI; -use Getopt::Long; -use Env qw(LSBUSER LSBDBPASSWD LSBDB LSBDBHOST); - -sub usage() -{ -print STDERR "mkgraphiclist -v \n"; -print STDERR " selects specific or All\n"; -die; -} - -GetOptions("v=s" => \$lsbversion); -if( !$lsbversion ) { usage(); } - -# Uncomment to trace SQL statments -#$trace=1; - -# -# 2) Establish connection to the database -# - -my $dbh = DBI->connect('DBI:mysql:database='.$LSBDB.';host='.$LSBDBHOST, $LSBUSER, $LSBDBPASSWD) - or die "Couldn't connect to database: ".$DBI->db_errstr; - -# -# 3) Get the list of libraries for LSB_Graphics -# - -$select = "SELECT DISTINCT ALrunname,Lname from Library "; -$select.= "LEFT JOIN ModLib ON MLlid=Lid "; -$select.= "LEFT JOIN SubModule ON SMid=MLmid "; -$select.= "LEFT JOIN ModSMod ON MSMsmid=SMid "; -$select.= "LEFT JOIN Module on Mid=MSMmid "; -$select.= "LEFT JOIN ArchLib ON ALlid=Lid "; -$select.= "LEFT JOIN Architecture ON ALaid=Aid "; -$select.= "WHERE ( (ALappearedin <= '$lsbversion' and ALappearedin<>'') "; -$select.= "AND (ALwithdrawnin IS NULL OR ALwithdrawnin > '$lsbversion') ) "; -$select.= "AND Aname='".$ARGV[0]."' "; -$select.= "AND ALrunname!='' "; -$select.= "AND Mname IN ('LSB-Desktop') "; -$select.= "ORDER BY ALrunname "; - -#print $select; - -my $sth = $dbh->prepare($select) - or die "Couldn't prepare $select query: ".DBI->errstr; -$sth->execute or die "Couldn't execute $select query: ".DBI->errstr; - -for(1..$sth->rows) { - my $entry = $sth->fetchrow_hashref - or die "Fetchrow failed on $select query: ".DBI->errstr; - $graphicsname=$entry->{'ALrunname'}; - print "$graphicsname\n"; -} - -$sth->finish; -$dbh->disconnect; diff --git a/redhat-lsb/mkredhat-lsb b/redhat-lsb/mkredhat-lsb deleted file mode 100644 index 35b221e..0000000 --- a/redhat-lsb/mkredhat-lsb +++ /dev/null @@ -1,166 +0,0 @@ -#!/bin/sh -# -# mkredhat-lsb: generate redhat-lsb.spec from redhat-lsb.spec.in -# by grokking through the LSB spec -# -# Matt Wilson -# -# Modified Wed, 5 July Lawrence Lim -# Generate redhat-lsb.spec via going through lsbspecdb -# -# Copyright 2002, 2003 Red Hat, Inc. -# -# This software may be freely redistributed under the terms of the GNU -# library public license. -# -# You should have received a copy of the GNU Library Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -LSB_ROOT=$1 -LIBSPATH="/lib /usr/lib /usr/X11R6/lib" -export PATH="$PATH:/usr/lib/lsb/" - -#checkFile $LSB_ROOT/lsbversion -#LSB_VERSION=$(cat $LSB_ROOT/lsbversion) -LSB_VERSION=4.0 - -# -# archLSB IA32 Libraries -# -# XXX spec is broken, add pthread.sgml to baselib.m4 -#ARCHLSB_IA32_BASELIB=`extractArch IA32` - -## exclude ld-lsb{arch}.so as it has been hard-coded -EXCLUDED_LD_LSB="(ld-lsb)" - -ARCHLSB_IA32_BASELIB="# archLSB IA32 Base Libraries" -IA32_BASELIB=`./mkbaselist2 -v $LSB_VERSION IA32 | egrep -v $EXCLUDED_LD_LSB` -# Add the Requires: to each. -for BASELIB in $IA32_BASELIB; do - ARCHLSB_IA32_BASELIB=`echo -e "$ARCHLSB_IA32_BASELIB"'\\\\\\n'"Requires: $BASELIB"` -done - -ARCHLSB_IA64_BASELIB="# archLSB IA64 Base Libraries" -IA64_BASELIB=`./mkbaselist2 -v $LSB_VERSION IA64 | egrep -v $EXCLUDED_LD_LSB` -# Add the Requires: to each. -for BASELIB in $IA64_BASELIB; do - ARCHLSB_IA64_BASELIB=`echo -e "$ARCHLSB_IA64_BASELIB"'\\\\\\n'"Requires: $BASELIB()(64bit)"` -done - -ARCHLSB_PPC32_BASELIB="# archLSB PPC32 Base Libraries" -PPC32_BASELIB=`./mkbaselist2 -v $LSB_VERSION PPC32 | egrep -v $EXCLUDED_LD_LSB` -# Add the Requires: to each. -for BASELIB in $PPC32_BASELIB; do - ARCHLSB_PPC32_BASELIB=`echo -e "$ARCHLSB_PPC32_BASELIB"'\\\\\\n'"Requires: $BASELIB"` -done - -ARCHLSB_PPC64_BASELIB="# archLSB PPC64 Base Libraries" -PPC64_BASELIB=`./mkbaselist2 -v $LSB_VERSION PPC64 | egrep -v $EXCLUDED_LD_LSB` -# Add the Requires: to each. -for BASELIB in $PPC64_BASELIB; do - ARCHLSB_PPC64_BASELIB=`echo -e "$ARCHLSB_PPC64_BASELIB"'\\\\\\n'"Requires: $BASELIB()(64bit)"` -done - -ARCHLSB_S390_BASELIB="# archLSB S390 Base Libraries" -S390_BASELIB=`./mkbaselist2 -v $LSB_VERSION S390 | egrep -v $EXCLUDED_LD_LSB` -# Add the Requires: to each. -for BASELIB in $S390_BASELIB; do - ARCHLSB_S390_BASELIB=`echo -e "$ARCHLSB_S390_BASELIB"'\\\\\\n'"Requires: $BASELIB"` -done - -ARCHLSB_S390X_BASELIB="# archLSB S390X Base Libraries" -S390X_BASELIB=`./mkbaselist2 -v $LSB_VERSION S390X | egrep -v $EXCLUDED_LD_LSB` -# Add the Requires: to each. -for BASELIB in $S390X_BASELIB; do - ARCHLSB_S390X_BASELIB=`echo -e "$ARCHLSB_S390X_BASELIB"'\\\\\\n'"Requires: $BASELIB()(64bit)"` -done - -ARCHLSB_AMD64_BASELIB="# archLSB AMD64 Base Libraries" -AMD64_BASELIB=`./mkbaselist2 -v $LSB_VERSION x86-64 | egrep -v $EXCLUDED_LD_LSB` -# Add the Requires: to each. -for BASELIB in $AMD64_BASELIB; do - ARCHLSB_AMD64_BASELIB=`echo -e "$ARCHLSB_AMD64_BASELIB"'\\\\\\n'"Requires: $BASELIB()(64bit)"` -done - -# -# gLSB Base/Utility/Stdc++ Libraries for ALL arch -# -# TODO: as of LSB 3.1, the result that came back from sgml sniffing is ok -# however, need to change it to extract from DB directly later - -GLSB_BASELIB="# gLSB Base/Utility/Stdc++/Graphics Libraries" -ALL_BASELIB=`./mkbaselist2 -v $LSB_VERSION All | egrep -v $EXCLUDED_LD_LSB` -# Add the Requires: to each. -for BASELIB in $ALL_BASELIB; do - GLSB_BASELIB=`echo -e "$GLSB_BASELIB"'\\\\\\n'"Requires: $BASELIB%{qual}"` -done - -#GLSB_BASELIB=`extractLibraries $LSB_ROOT/LSB/generic/baselib/baselib.sgml \ -# "# gLSB Base Libraries" %{qual}` - -# -# gLSB Utility Libraries -# -# TODO: as of LSB 3.1, the result that came back from sgml sniffing is ok -# however, need to change it to extract from DB directly later -#GLSB_UTILLIB=`extractLibraries $LSB_ROOT/LSB/generic/utillib/utillib.sgml \ -# "# gLSB Utility Libraries" %{qual}` - -# -# gLSB Graphics Libraries -# -#GLSB_GRAPHLIB="# gLSB Graphics Libraries" -#GRAPHICS=`./mkgraphiclist2` - -# Add the Requires: to each. -#for GRAPHICLIB in $GRAPHICS; do - # aah, shell escaping -# GLSB_GRAPHLIB=`echo -e "$GLSB_GRAPHLIB"'\\\\\\n'"Requires: $GRAPHICLIB"%{qual}` -#done - -# -# gLSB Command and Utilities -# -#checkFile $LSB_ROOT/LSB/generic/command/command.sgml - -# our foo-lsb package provides this program. -EXCLUDED_COMMANDS_REGEX="(lsb_release)" - -GLSB_COMMAND_UTILITIES="# gLSB Command and Utilities" -#COMMANDS=`grep '' $LSB_ROOT/LSB/generic/command/command.sgml | cut -b8- | -COMMANDS=`./mkcmdlist2 -v $LSB_VERSION | - egrep -v $EXCLUDED_COMMANDS_REGEX` - -#Check to make sure each required command exists -for COMMAND in $COMMANDS; do - if ! which $COMMAND > /dev/null 2> /dev/null; then - echo "ERROR: Path to required command $COMMAND not found" 1>&2 - exit 1 - fi -done - -# note the path and sort them -CMDPATHS=`for COMMAND in $COMMANDS; do which $COMMAND; done | sort` - -# Add the Requires: to each. -for CMDPATH in $CMDPATHS; do - # aah, shell escaping - GLSB_COMMAND_UTILITIES=`echo -e "$GLSB_COMMAND_UTILITIES"'\\\\\\n'"Requires: $CMDPATH"` -done - -# -# Autogenerate spec file -# - -sed -e "s,@GLSB_COMMAND_UTILITIES@,$GLSB_COMMAND_UTILITIES," \ - -e "s,@ARCHLSB_IA32_BASELIB@,$ARCHLSB_IA32_BASELIB," \ - -e "s,@ARCHLSB_IA64_BASELIB@,$ARCHLSB_IA64_BASELIB," \ - -e "s,@ARCHLSB_PPC32_BASELIB@,$ARCHLSB_PPC32_BASELIB," \ - -e "s,@ARCHLSB_PPC64_BASELIB@,$ARCHLSB_PPC64_BASELIB," \ - -e "s,@ARCHLSB_S390_BASELIB@,$ARCHLSB_S390_BASELIB," \ - -e "s,@ARCHLSB_S390X_BASELIB@,$ARCHLSB_S390X_BASELIB," \ - -e "s,@ARCHLSB_AMD64_BASELIB@,$ARCHLSB_AMD64_BASELIB," \ - -e "s,@GLSB_BASELIB@,$GLSB_BASELIB," \ - -e "s,@LSB_VERSION@,$LSB_VERSION," \ - redhat-lsb.spec.in > redhat-lsb.spec diff --git a/redhat-lsb/old_lsb_db/README b/redhat-lsb/old_lsb_db/README new file mode 100644 index 0000000..210734a --- /dev/null +++ b/redhat-lsb/old_lsb_db/README @@ -0,0 +1,58 @@ +Environment Variables +=============================== +LSBDBHOST = +LSBDB = +LSBUSER = +LSBDBPASSWD = + +export LSBDBHOST=localhost +export LSBDB=lsb +export LSBUSER=lsbadmin +export LSBDBPASSWD=PASSWORD + + +WARNING: Most Scripts/Tools WILL NOT work if these variables are NOT set + +* Two Databases +** LSB db + o Mysql database + o How to create LSB db? pls reference: + https://wiki.linuxfoundation.org/en/SpecDatabaseUsage + o Table names and table schemata, pls reference: + https://wiki.linuxfoundation.org/en/SpecDatabaseSchema + https://wiki.linuxfoundation.org/en/LSB_Elements_Schema + o we can query LSB db to get commands and libraries of a submodule + +** db from yum repo + o SQLite database, command sqlite3 works well + o we need package.sqlite and filelists.sqlite. You can download + them from one of Fedora mirror servers. Pls reference: + http://mirrors.fedoraproject.org/publiclist/ + o from filelists.sqlite, we can get package id by a command name + or library .so name + o we can get package name, version, group, provides, etc. from + primary.sqlite by package id. + +** put the two database together + we get a command name or library .so name, then we ask + filelists.sqlite and primary.sqlite to get the package + name. + +* Two Tools + o Tools in 'specdb' directory work with LSB database. + These tools source config file 'specdb/control' + o Tools in 'repodb' directory work with repo database + o Pls reference '-h' or '--help' option of commands + o repodb tools output results on stdout in one line if + find a match package, others output the command or library + name to stderr. So, it's easy to process the command + output. + o repodb tools always output more packages, you need manually + remove the unwanted one. + +* Why Not Generate Dependencies automatically? + o LSB has more and more submodules + o we need support more than one architectures + o generating dependencies automatically, make spec file full of 'ifarch', + and we will get a long and complicated spec file. + o generating dependencies manually is not difficult diff --git a/redhat-lsb/old_lsb_db/mkbaselist2 b/redhat-lsb/old_lsb_db/mkbaselist2 new file mode 100755 index 0000000..da275c3 --- /dev/null +++ b/redhat-lsb/old_lsb_db/mkbaselist2 @@ -0,0 +1,67 @@ +#!/usr/bin/perl + +# Source originally from lsb-cmdchk +# Creating a list of base libraries required by LSB +# +# changes from 3.1 version: LSB database is now version-aware +# DBI is used instead of deprecated Mysql.pm + +use DBI; +use Getopt::Long; +use Env qw(LSBUSER LSBDBPASSWD LSBDB LSBDBHOST); + +sub usage() +{ +print STDERR "mkbaselist -v \n"; +print STDERR " selects specific or All\n"; +die; +} + +GetOptions("v=s" => \$lsbversion); +if( !$lsbversion ) { usage(); } + +# Uncomment to trace SQL statments +#$trace=1; + +# +# 2) Establish connection to the database +# + +my $dbh = DBI->connect('DBI:mysql:database='.$LSBDB.';host='.$LSBDBHOST, $LSBUSER, $LSBDBPASSWD) + or die "Couldn't connect to database: ".$DBI->db_errstr; + +# +# 3) Get the list of libraries for LSB_Core and LSB_Cpp +# For LSB 3.2 LSB_Printing and LSB_Languages is added +# + +$select = "SELECT DISTINCT ALrunname,Lname from Library "; +$select.= "LEFT JOIN SModLib ON SMLlid=Lid "; +$select.= "LEFT JOIN SubModule ON SMid=SMLsmid "; +$select.= "LEFT JOIN ModSMod ON MSMsmid=SMid "; +$select.= "LEFT JOIN Module on Mid=MSMmid "; +$select.= "LEFT JOIN ArchLib ON ALlid=Lid "; +$select.= "LEFT JOIN Architecture ON ALaid=Aid "; +$select.= "WHERE ( (ALappearedin <= '$lsbversion' and ALappearedin<>'') "; +$select.= "AND (ALwithdrawnin IS NULL OR ALwithdrawnin > '$lsbversion') ) "; +$select.= "AND Aname='".$ARGV[0]."' "; +$select.= "AND ALrunname!='' "; +#temporary: graphics script isn't called, so do all here +#$select.= "AND Mname IN ('LSB-Core','LSB-CXX','LSB-Printing','LSB-Languages') "; +$select.= "ORDER BY ALrunname "; + +#print $select; + +my $sth = $dbh->prepare($select) + or die "Couldn't prepare $select query: ".DBI->errstr; +$sth->execute or die "Couldn't execute $select query: ".DBI->errstr; + +for(1..$sth->rows) { + my $entry = $sth->fetchrow_hashref + or die "Fetchrow failed on $select query: ".DBI->errstr; + $basename=$entry->{'ALrunname'}; + print "$basename\n"; +} + +$sth->finish; +$dbh->disconnect; diff --git a/redhat-lsb/old_lsb_db/mkcmdlist2 b/redhat-lsb/old_lsb_db/mkcmdlist2 new file mode 100755 index 0000000..c5d83c5 --- /dev/null +++ b/redhat-lsb/old_lsb_db/mkcmdlist2 @@ -0,0 +1,61 @@ +#!/usr/bin/perl + +# Source originally from lsb-cmdchk +# Creating a list of commands required by LSB + +use DBI; +use Getopt::Long; +use Env qw(LSBUSER LSBDBPASSWD LSBDB LSBDBHOST); + +sub usage() +{ +print STDERR "mkcmdlist -v \n"; +die; +} + +GetOptions("v=s" => \$lsbversion); +if( !$lsbversion ) { usage(); } + +# Uncomment to trace SQL statments +#$trace=1; + +# +# 2) Establish connection to the database +# + +my $dbh = DBI->connect('DBI:mysql:database='.$LSBDB.';host='.$LSBDBHOST, $LSBUSER, $LSBDBPASSWD) + or die "Couldn't connect to database: ".$DBI->db_errstr; + +# +# 3) Get the list of cmds +# + +$select = "SELECT DISTINCT Cid,Cname,Cpath FROM Command "; +$select.= "LEFT JOIN SModCmd ON SMCcid=Cid "; +$select.= "LEFT JOIN SubModule on SMid=SMCsmid "; +$select.= "WHERE (SMCappearedin <= '$lsbversion' and SMCappearedin<>'') "; +$select.= "AND (SMCwithdrawnin IS NULL OR SMCwithdrawnin > '$lsbversion') "; +$select.= "AND (SMmandatorysince <= '$lsbversion' and SMmandatorysince<>'') "; +$select.= "AND Cbuiltin!='Yes' "; +$select.= "ORDER BY Cname "; + +#print $select; + +my $sth = $dbh->prepare($select) + or die "Couldn't prepare $select query: ".DBI->errstr; +$sth->execute or die "Couldn't execute $select query: ".DBI->errstr; + +for(1..$sth->rows) { + my $entry = $sth->fetchrow_hashref + or die "Fetchrow failed on $select query: ".DBI->errstr; + $cmdname=$entry->{'Cname'}; + #if ($entry->{'Cpath'} eq "") { + # $cmdpath='None'; + #} else { + # $cmdpath=$entry->{'Cpath'}; + #} + print "$cmdname\n"; +} + +$sth->finish; +$dbh->disconnect; diff --git a/redhat-lsb/old_lsb_db/mkgraphiclist2 b/redhat-lsb/old_lsb_db/mkgraphiclist2 new file mode 100755 index 0000000..dea1e79 --- /dev/null +++ b/redhat-lsb/old_lsb_db/mkgraphiclist2 @@ -0,0 +1,65 @@ +#!/usr/bin/perl + +# Source originally from lsb-cmdchk +# Creating a list of desktop (graphics) libraries required by LSB +# +# changes from 3.1 version: LSB database is now version-aware +# DBI is used instead of deprecated Mysql.pm + +use DBI; +use Getopt::Long; +use Env qw(LSBUSER LSBDBPASSWD LSBDB LSBDBHOST); + +sub usage() +{ +print STDERR "mkgraphiclist -v \n"; +print STDERR " selects specific or All\n"; +die; +} + +GetOptions("v=s" => \$lsbversion); +if( !$lsbversion ) { usage(); } + +# Uncomment to trace SQL statments +#$trace=1; + +# +# 2) Establish connection to the database +# + +my $dbh = DBI->connect('DBI:mysql:database='.$LSBDB.';host='.$LSBDBHOST, $LSBUSER, $LSBDBPASSWD) + or die "Couldn't connect to database: ".$DBI->db_errstr; + +# +# 3) Get the list of libraries for LSB_Graphics +# + +$select = "SELECT DISTINCT ALrunname,Lname from Library "; +$select.= "LEFT JOIN ModLib ON MLlid=Lid "; +$select.= "LEFT JOIN SubModule ON SMid=MLmid "; +$select.= "LEFT JOIN ModSMod ON MSMsmid=SMid "; +$select.= "LEFT JOIN Module on Mid=MSMmid "; +$select.= "LEFT JOIN ArchLib ON ALlid=Lid "; +$select.= "LEFT JOIN Architecture ON ALaid=Aid "; +$select.= "WHERE ( (ALappearedin <= '$lsbversion' and ALappearedin<>'') "; +$select.= "AND (ALwithdrawnin IS NULL OR ALwithdrawnin > '$lsbversion') ) "; +$select.= "AND Aname='".$ARGV[0]."' "; +$select.= "AND ALrunname!='' "; +$select.= "AND Mname IN ('LSB-Desktop') "; +$select.= "ORDER BY ALrunname "; + +#print $select; + +my $sth = $dbh->prepare($select) + or die "Couldn't prepare $select query: ".DBI->errstr; +$sth->execute or die "Couldn't execute $select query: ".DBI->errstr; + +for(1..$sth->rows) { + my $entry = $sth->fetchrow_hashref + or die "Fetchrow failed on $select query: ".DBI->errstr; + $graphicsname=$entry->{'ALrunname'}; + print "$graphicsname\n"; +} + +$sth->finish; +$dbh->disconnect; diff --git a/redhat-lsb/old_lsb_db/mkredhat-lsb b/redhat-lsb/old_lsb_db/mkredhat-lsb new file mode 100755 index 0000000..35b221e --- /dev/null +++ b/redhat-lsb/old_lsb_db/mkredhat-lsb @@ -0,0 +1,166 @@ +#!/bin/sh +# +# mkredhat-lsb: generate redhat-lsb.spec from redhat-lsb.spec.in +# by grokking through the LSB spec +# +# Matt Wilson +# +# Modified Wed, 5 July Lawrence Lim +# Generate redhat-lsb.spec via going through lsbspecdb +# +# Copyright 2002, 2003 Red Hat, Inc. +# +# This software may be freely redistributed under the terms of the GNU +# library public license. +# +# You should have received a copy of the GNU Library Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +LSB_ROOT=$1 +LIBSPATH="/lib /usr/lib /usr/X11R6/lib" +export PATH="$PATH:/usr/lib/lsb/" + +#checkFile $LSB_ROOT/lsbversion +#LSB_VERSION=$(cat $LSB_ROOT/lsbversion) +LSB_VERSION=4.0 + +# +# archLSB IA32 Libraries +# +# XXX spec is broken, add pthread.sgml to baselib.m4 +#ARCHLSB_IA32_BASELIB=`extractArch IA32` + +## exclude ld-lsb{arch}.so as it has been hard-coded +EXCLUDED_LD_LSB="(ld-lsb)" + +ARCHLSB_IA32_BASELIB="# archLSB IA32 Base Libraries" +IA32_BASELIB=`./mkbaselist2 -v $LSB_VERSION IA32 | egrep -v $EXCLUDED_LD_LSB` +# Add the Requires: to each. +for BASELIB in $IA32_BASELIB; do + ARCHLSB_IA32_BASELIB=`echo -e "$ARCHLSB_IA32_BASELIB"'\\\\\\n'"Requires: $BASELIB"` +done + +ARCHLSB_IA64_BASELIB="# archLSB IA64 Base Libraries" +IA64_BASELIB=`./mkbaselist2 -v $LSB_VERSION IA64 | egrep -v $EXCLUDED_LD_LSB` +# Add the Requires: to each. +for BASELIB in $IA64_BASELIB; do + ARCHLSB_IA64_BASELIB=`echo -e "$ARCHLSB_IA64_BASELIB"'\\\\\\n'"Requires: $BASELIB()(64bit)"` +done + +ARCHLSB_PPC32_BASELIB="# archLSB PPC32 Base Libraries" +PPC32_BASELIB=`./mkbaselist2 -v $LSB_VERSION PPC32 | egrep -v $EXCLUDED_LD_LSB` +# Add the Requires: to each. +for BASELIB in $PPC32_BASELIB; do + ARCHLSB_PPC32_BASELIB=`echo -e "$ARCHLSB_PPC32_BASELIB"'\\\\\\n'"Requires: $BASELIB"` +done + +ARCHLSB_PPC64_BASELIB="# archLSB PPC64 Base Libraries" +PPC64_BASELIB=`./mkbaselist2 -v $LSB_VERSION PPC64 | egrep -v $EXCLUDED_LD_LSB` +# Add the Requires: to each. +for BASELIB in $PPC64_BASELIB; do + ARCHLSB_PPC64_BASELIB=`echo -e "$ARCHLSB_PPC64_BASELIB"'\\\\\\n'"Requires: $BASELIB()(64bit)"` +done + +ARCHLSB_S390_BASELIB="# archLSB S390 Base Libraries" +S390_BASELIB=`./mkbaselist2 -v $LSB_VERSION S390 | egrep -v $EXCLUDED_LD_LSB` +# Add the Requires: to each. +for BASELIB in $S390_BASELIB; do + ARCHLSB_S390_BASELIB=`echo -e "$ARCHLSB_S390_BASELIB"'\\\\\\n'"Requires: $BASELIB"` +done + +ARCHLSB_S390X_BASELIB="# archLSB S390X Base Libraries" +S390X_BASELIB=`./mkbaselist2 -v $LSB_VERSION S390X | egrep -v $EXCLUDED_LD_LSB` +# Add the Requires: to each. +for BASELIB in $S390X_BASELIB; do + ARCHLSB_S390X_BASELIB=`echo -e "$ARCHLSB_S390X_BASELIB"'\\\\\\n'"Requires: $BASELIB()(64bit)"` +done + +ARCHLSB_AMD64_BASELIB="# archLSB AMD64 Base Libraries" +AMD64_BASELIB=`./mkbaselist2 -v $LSB_VERSION x86-64 | egrep -v $EXCLUDED_LD_LSB` +# Add the Requires: to each. +for BASELIB in $AMD64_BASELIB; do + ARCHLSB_AMD64_BASELIB=`echo -e "$ARCHLSB_AMD64_BASELIB"'\\\\\\n'"Requires: $BASELIB()(64bit)"` +done + +# +# gLSB Base/Utility/Stdc++ Libraries for ALL arch +# +# TODO: as of LSB 3.1, the result that came back from sgml sniffing is ok +# however, need to change it to extract from DB directly later + +GLSB_BASELIB="# gLSB Base/Utility/Stdc++/Graphics Libraries" +ALL_BASELIB=`./mkbaselist2 -v $LSB_VERSION All | egrep -v $EXCLUDED_LD_LSB` +# Add the Requires: to each. +for BASELIB in $ALL_BASELIB; do + GLSB_BASELIB=`echo -e "$GLSB_BASELIB"'\\\\\\n'"Requires: $BASELIB%{qual}"` +done + +#GLSB_BASELIB=`extractLibraries $LSB_ROOT/LSB/generic/baselib/baselib.sgml \ +# "# gLSB Base Libraries" %{qual}` + +# +# gLSB Utility Libraries +# +# TODO: as of LSB 3.1, the result that came back from sgml sniffing is ok +# however, need to change it to extract from DB directly later +#GLSB_UTILLIB=`extractLibraries $LSB_ROOT/LSB/generic/utillib/utillib.sgml \ +# "# gLSB Utility Libraries" %{qual}` + +# +# gLSB Graphics Libraries +# +#GLSB_GRAPHLIB="# gLSB Graphics Libraries" +#GRAPHICS=`./mkgraphiclist2` + +# Add the Requires: to each. +#for GRAPHICLIB in $GRAPHICS; do + # aah, shell escaping +# GLSB_GRAPHLIB=`echo -e "$GLSB_GRAPHLIB"'\\\\\\n'"Requires: $GRAPHICLIB"%{qual}` +#done + +# +# gLSB Command and Utilities +# +#checkFile $LSB_ROOT/LSB/generic/command/command.sgml + +# our foo-lsb package provides this program. +EXCLUDED_COMMANDS_REGEX="(lsb_release)" + +GLSB_COMMAND_UTILITIES="# gLSB Command and Utilities" +#COMMANDS=`grep '' $LSB_ROOT/LSB/generic/command/command.sgml | cut -b8- | +COMMANDS=`./mkcmdlist2 -v $LSB_VERSION | + egrep -v $EXCLUDED_COMMANDS_REGEX` + +#Check to make sure each required command exists +for COMMAND in $COMMANDS; do + if ! which $COMMAND > /dev/null 2> /dev/null; then + echo "ERROR: Path to required command $COMMAND not found" 1>&2 + exit 1 + fi +done + +# note the path and sort them +CMDPATHS=`for COMMAND in $COMMANDS; do which $COMMAND; done | sort` + +# Add the Requires: to each. +for CMDPATH in $CMDPATHS; do + # aah, shell escaping + GLSB_COMMAND_UTILITIES=`echo -e "$GLSB_COMMAND_UTILITIES"'\\\\\\n'"Requires: $CMDPATH"` +done + +# +# Autogenerate spec file +# + +sed -e "s,@GLSB_COMMAND_UTILITIES@,$GLSB_COMMAND_UTILITIES," \ + -e "s,@ARCHLSB_IA32_BASELIB@,$ARCHLSB_IA32_BASELIB," \ + -e "s,@ARCHLSB_IA64_BASELIB@,$ARCHLSB_IA64_BASELIB," \ + -e "s,@ARCHLSB_PPC32_BASELIB@,$ARCHLSB_PPC32_BASELIB," \ + -e "s,@ARCHLSB_PPC64_BASELIB@,$ARCHLSB_PPC64_BASELIB," \ + -e "s,@ARCHLSB_S390_BASELIB@,$ARCHLSB_S390_BASELIB," \ + -e "s,@ARCHLSB_S390X_BASELIB@,$ARCHLSB_S390X_BASELIB," \ + -e "s,@ARCHLSB_AMD64_BASELIB@,$ARCHLSB_AMD64_BASELIB," \ + -e "s,@GLSB_BASELIB@,$GLSB_BASELIB," \ + -e "s,@LSB_VERSION@,$LSB_VERSION," \ + redhat-lsb.spec.in > redhat-lsb.spec diff --git a/redhat-lsb/old_lsb_db/redhat-lsb.spec.in b/redhat-lsb/old_lsb_db/redhat-lsb.spec.in new file mode 100644 index 0000000..1c2fce5 --- /dev/null +++ b/redhat-lsb/old_lsb_db/redhat-lsb.spec.in @@ -0,0 +1,483 @@ +# Define this to link to which library version eg. /lib64/ld-lsb-x86-64.so.3 +%global lsbsover 3 + +%ifarch %{ix86} +%global ldso ld-linux.so.2 +%global lsbldso ld-lsb.so +%endif + +%ifarch alpha +%define ldso ld-linux-alpha.so.2 +%define lsbldso ld-lsb-alpha.so +%endif + +%ifarch ia64 +%global ldso ld-linux-ia64.so.2 +%global lsbldso ld-lsb-ia64.so +%endif + +%ifarch ppc +%global ldso ld.so.1 +%global lsbldso ld-lsb-ppc32.so +%endif + +%ifarch ppc64 +%global ldso ld64.so.1 +%global lsbldso ld-lsb-ppc64.so +%endif + +%ifarch ppc64le +%global ldso ld64.so.2 +%global lsbldso ld-lsb-ppc64le.so +%endif + +%ifarch s390 +%global ldso ld.so.1 +%global lsbldso ld-lsb-s390.so +%endif + +%ifarch s390x +%global ldso ld64.so.1 +%global lsbldso ld-lsb-s390x.so +%endif + +%ifarch x86_64 +%global ldso ld-linux-x86-64.so.2 +%global lsbldso ld-lsb-x86-64.so +%endif + +%ifarch %{arm} +%global ldso ld-linux.so.2 +%global lsbldso ld-lsb-arm.so +%endif + +%ifarch aarch64 +%global ldso ld-linux-aarch64.so.1 +%global lsbldso ld-lsb-aarch64.so +%endif + +%global upstreamlsbrelver 2.0 +%global lsbrelver 4.1 + +Summary: Implementation of Linux Standard Base specification +Name: redhat-lsb +Version: 4.1 +Release: 1%{?dist} +URL: http://www.linuxfoundation.org/collaborate/workgroups/lsb +Source0: %{name}-%{version}-%{srcrelease}.tar.bz2 +Source1: http://prdownloads.sourceforge.net/lsb/lsb-release-%{upstreamlsbrelver}.tar.gz +Patch0: lsb-release-3.1-update-init-functions.patch +Patch1: redhat-lsb-lsb_start_daemon-fix.patch +Patch2: redhat-lsb-trigger.patch +License: GPL +Group: System Environment/Base +BuildRoot: %{_tmppath}/%{name}-root +BuildRequires: glibc-static +# dependency for primary LSB application for v1.3 +Provides: lsb = %{version} +# dependency for primary LSB application for v2.0 and v3.0 +%ifarch %{ix86} +%global archname ia32 +%endif +%ifarch ia64 +%global archname ia64 +%endif +%ifarch ppc +%global archname ppc32 +%endif +%ifarch ppc64 +%global archname ppc64 +%endif +%ifarch ppc64le +%global archname ppc64le +%endif +%ifarch s390 +%global archname s390 +%endif +%ifarch s390x +%global archname s390x +%endif +%ifarch x86_64 +%global archname amd64 +%endif +%ifarch %{arm} +%global archname arm +%endif +%ifarch aarch64 +%global archname aarch64 +%endif +%ifarch alpha +%define archname alpha +%endif +Provides: lsb-core-%{archname} = %{version} +Provides: lsb-graphics-%{archname} = %{version} +Provides: lsb-core-noarch = %{version} +Provides: lsb-graphics-noarch = %{version} + +ExclusiveArch: %{ix86} ia64 x86_64 ppc ppc64 s390 s390x + +%ifarch %{ix86} +@ARCHLSB_IA32_BASELIB@ +%endif + +%ifarch ia64 +@ARCHLSB_IA64_BASELIB@ +%endif + +%ifarch ppc +@ARCHLSB_PPC32_BASELIB@ +%endif + +%ifarch ppc64 +@ARCHLSB_PPC64_BASELIB@ +%endif + +%ifarch s390 +@ARCHLSB_S390_BASELIB@ +%endif + +%ifarch s390x +@ARCHLSB_S390X_BASELIB@ +%endif + +%ifarch x86_64 +@ARCHLSB_AMD64_BASELIB@ +%endif + +@GLSB_BASELIB@ + +@GLSB_COMMAND_UTILITIES@ + +%description +The Linux Standard Base (LSB) is an attempt to develop a set of +standards that will increase compatibility among Linux distributions. +The redhat-lsb package provides utilities needed for LSB Compliant +Applications. It also contains requirements that will ensure that all +components required by the LSB that are provided by Red Hat Linux are +installed on the system. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p0 -b .triggerfix + +%build +cd lsb-release-%{upstreamlsbrelver} +make + +%pre +# remove the extra symlink /bin/mailx -> /bin/mail +if [ -e /bin/mailx ]; then + if [ -L /bin/mailx ]; then + rm -f /bin/mailx + fi +fi + + +%install +rm -rf $RPM_BUILD_ROOT +# LSB uses /usr/lib rather than /usr/lib64 even for 64bit OS +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT%{_mandir} \ + $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT/usr/lib/lsb \ + $RPM_BUILD_ROOT%{_sysconfdir}/lsb-release.d/ $RPM_BUILD_ROOT%{_sbindir} +make DESTDIR=$RPM_BUILD_ROOT install +cd lsb-release-%{upstreamlsbrelver} +make mandir=$RPM_BUILD_ROOT/%{_mandir} prefix=$RPM_BUILD_ROOT/%{_prefix} install +cd .. +touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-4.0-%{archname} +touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-4.0-noarch +touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-4.0-%{archname} +touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-4.0-noarch +#touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-3.2-%{archname} +#touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-3.2-noarch +#touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-3.2-%{archname} +#touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-3.2-noarch +# and claim LSB 3.1 is supported as well +#touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-3.1-%{archname} +#touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-3.1-noarch +#touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-3.1-%{archname} +#touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-3.1-noarch + +for LSBVER in %{lsbsover}; do + ln -s %{ldso} $RPM_BUILD_ROOT/%{_lib}/%{lsbldso}.$LSBVER +done + +mkdir -p $RPM_BUILD_ROOT/bin + +# LSB uses /usr/lib rather than /usr/lib64 even for 64bit OS +# According to the lsb-core documentation provided by +# http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic.pdf +# it's OK to put non binary in /usr/lib. +ln -snf ../../../sbin/chkconfig $RPM_BUILD_ROOT/usr/lib/lsb/install_initd +ln -snf ../../../sbin/chkconfig $RPM_BUILD_ROOT/usr/lib/lsb/remove_initd +#ln -snf mail $RPM_BUILD_ROOT/bin/mailx + +#mkdir -p $RPM_BUILD_ROOT/usr/X11R6/lib/X11/xserver +#ln -snf /usr/%{_lib}/xserver/SecurityPolicy $RPM_BUILD_ROOT/usr/X11R6/lib/X11/xserver/SecurityPolicy +#ln -snf /usr/share/X11/fonts $RPM_BUILD_ROOT/usr/X11R6/lib/X11/fonts +#ln -snf /usr/share/X11/rgb.txt $RPM_BUILD_ROOT/usr/X11R6/lib/X11/rgb.txt + +# According to https://bugzilla.redhat.com/show_bug.cgi?id=232918 , the '-static' option +# is imported against segfault error while running redhat_lsb_trigger +gcc $RPM_OPT_FLAGS -Os -static -fno-stack-protector -o redhat_lsb_trigger{.%{_target_cpu},.c} -DLSBSOVER='"%{lsbsover}"' \ + -DLDSO='"%{ldso}"' -DLSBLDSO='"/%{_lib}/%{lsbldso}"' -D_GNU_SOURCE +install -m 700 redhat_lsb_trigger.%{_target_cpu} \ + $RPM_BUILD_ROOT%{_sbindir}/redhat_lsb_trigger.%{_target_cpu} + +cp -p redhat_lsb_init $RPM_BUILD_ROOT/bin/redhat_lsb_init + +%clean +rm -rf $RPM_BUILD_ROOT + +%triggerpostun -- glibc +if [ -x /usr/sbin/redhat_lsb_trigger.%{_target_cpu} ]; then + /usr/sbin/redhat_lsb_trigger.%{_target_cpu} +fi + +%ifnarch %{ix86} + /sbin/sln %{ldso} /%{_lib}/%{lsbldso} || : +%else + if [ -f /emul/ia32-linux/lib/%{ldso} ]; then + for LSBVER in %{lsbsover}; do + /sbin/sln /emul/ia32-linux/lib/%{ldso} /%{_lib}/%{lsbldso}.$LSBVER || : + done + else + for LSBVER in %{lsbsover}; do + /sbin/sln %{ldso} /%{_lib}/%{lsbldso}.$LSBVER || : + done + fi +%endif + +%ifarch %{ix86} +%post +# make this softlink again for /emul + if [ -f /emul/ia32-linux/lib/%{ldso} ]; then + for LSBVER in %{lsbsover}; do + /sbin/sln /emul/ia32-linux/lib/%{ldso} /%{_lib}/%{lsbldso}.$LSBVER || : + done + fi +%endif + +%files +#/usr/X11R6/lib/X11/fonts +#/usr/X11R6/lib/X11/rgb.txt +%defattr(-,root,root) +%{_sysconfdir}/redhat-lsb +#%config /etc/lsb-release +#/etc/redhat-lsb +%dir %{_sysconfdir}/lsb-release.d +# These files are needed because they shows which LSB we're supporting now, +# for example, if core-3.1-noarch exists, it means we are supporting LSB3.1 now +%{_sysconfdir}/lsb-release.d/* +#%dir /usr/X11R6/lib/X11/xserver +#/usr/X11R6/lib/X11/xserver/* +%{_mandir}/*/* +%{_bindir}/* +#/bin/mailx +/bin/redhat_lsb_init +/usr/lib/lsb +/%{_lib}/*so* +/lib/lsb* +%{_sbindir}/redhat_lsb_trigger.%{_target_cpu} +#/usr/X11R6/lib/X11/xserver/SecurityPolicy +#/usr/X11R6/lib/X11/fonts +#/usr/X11R6/lib/X11/rgb.txt + +%changelog +* Fri Jan 8 2010 Lawrence Lim - 4.0-1 +- update to LSB4.0 + +* Tue Oct 27 2009 Tom "spot" Callaway - 3.2-7 +- apply fix from bz514760 (thanks to Jakub Jelinek) + +* Wed Oct 21 2009 Tom "spot" Callaway - 3.2-6 +- apply fix from bz485367 (thanks to Jon Thomas) + +* Sun Jul 26 2009 Fedora Release Engineering - 3.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Apr 24 2009 Jens Petersen +- improve url to LSB WG + +* Thu Apr 23 2009 Jens Petersen - 3.2-4 +- use dist tag (Debarshi, #496553) +- update to ix86 (caillon) + +* Wed Feb 25 2009 Fedora Release Engineering - 3.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Aug 28 2008 Hao Liu 3.2-2 +- Modify "Requires: /usr/bin/mailx" to "Requires: mailx" (Bug #460249) + +* Wed Aug 18 2008 Hao Liu 3.2-1 +- Port forward to LSB 3.2 +- Remove symlink for mailx if user is upgrading from the redhat-lsb of older version +- Since F10 put mailx under /usr/bin, change the corresponding requires + +* Thu Aug 5 2008 Hao Liu - 3.1-22 +- Remove 2 requires which provided by redhat-lsb +- Add comments explaining why hard-coded path is kept +- Resolve some hard-coded path problems +- Add comments explaining why importing '-static' option while compiling redhat_lsb_trigger +- Replace %{_libdir}/lsb with /usr/lib/lsb +- Replace /%{_lib}/* with /%{_lib}/*so* +- Replace /lib/lsb with /lib/lsb* + +* Thu Jul 31 2008 Lawrence Lim - 3.1-21 +- remove symlink for mailx (Bug #457241) + +* Wed Apr 16 2008 Mats Wichmann 3.2-1 +- port forward to LSB 3.2 + +* Tue Feb 19 2008 Fedora Release Engineering - 3.1-20 +- Autorebuild for GCC 4.3 + +* Wed Oct 3 2007 Lawrence Lim - 3.1-19 +- fix build issue on ppc - (.opd+0x10): multiple definition of `__libc_start_main' + +* Fri Sep 21 2007 Lawrence Lim - 3.1-18 +- fix build issue in minimal build root (Bug #265241) + +* Wed Aug 29 2007 Fedora Release Engineering - 3.1-17 +- Rebuild for selinux ppc32 issue. + +* Fri Aug 20 2007 Lawrence Lim - 3.1-16 +- update spec file in accordance to feedback provided through merge review - merge-review.patch - #226363 + +* Wed Jul 18 2007 Lawrence Lim - 3.1-15.f8 +- Resolved: #239842 - /lib/lsb/init-functions shall use aliases but not functions +- forward port the patch from 3.1-12.3.EL which fix #217566, #233530, #240916 + +* Wed Jul 2 2007 Lawrence Lim - 3.1-14.fc7 +- fixed Bug 232918 for new glibc version + +* Wed Jul 18 2007 Lawrence - 3.1-13.f8 +- Resolved: #239842 - /lib/lsb/init-functions shall use aliases but not functions +- forward port the patch from 3.1-12.3.EL + +* Tue Jun 26 2007 Lawrence Lim - 3.1-12.3.EL +- Resolves: #217566 - rewrite /lib/lsb/init-functions file needs to define the commands as true shell functions rather than aliases. +- Resolves: #233530 - LSB pidofproc misspelled as pidofprof. +- Resolves: #240916 - "log_warning_message" replaced with "log_warning_msg" per the LSB 3.1 spec + +* Wed Dec 6 2006 Lawrence Lim - 3.1-12.2.EL +- Resolves: bug 217566 +- revise patch + +* Wed Nov 29 2006 Lawrence Lim - 3.1-12 +- replaced aliases with functions in /lib/lsb/init-functions; Bug 217566 + +* Sun Oct 01 2006 Jesse Keating - 3.1-11 +- rebuilt for unwind info generation, broken in gcc-4.1.1-21 + +* Thu Sep 21 2006 Lawrence Lim - 3.1-10.3 +- Fix upgrade issue; Bug 202548 + +* Wed Jul 12 2006 Jesse Keating - 3.1-10.2.1 +- rebuild + +* Thu Jul 6 2006 Lawrence Lim - 3.1-10.2 +- for some strange reason, ld-lsb-x86-64.so need to be ld-lsb-x86-64.so.3 (LSB3.0) rather than ld-lsb-x86-64.so.3.1 (LSB3.1) + +* Thu Jul 6 2006 Lawrence Lim - 3.1-10.1 +- generate spec file on RHEL5-Alpha system +- fix vsw4 test suite setup by creating symlink for X11 SecurityPolicy and XFontPath + +* Thu Jun 22 2006 Lawrence Lim - 3.0-10 +- Rewrite most part of the mkredhat-lsb to obtain information directly via specdb + rather than sniffing through sgml +- remove redundent script and bump up tarball version + +* Fri Feb 10 2006 Jesse Keating - 3.0-9.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 3.0-9.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Jan 13 2006 Leon Ho 3.0-9 +- Migrated back to rawhide + +* Wed Aug 3 2005 Leon Ho 3.0-8.EL +- Added libstdc++.so.6/libGL.so.1 requirement (RH#154605) + +* Wed Aug 3 2005 Leon Ho 3.0-7.EL +- Fixed multilib problem on lsb_release not to read /etc/lsb-release and solely + depends on /etc/lsb-release.d/ (Advised by LSB committee) +- Removed /etc/lsb-release (Advised by LSB committee) + +* Mon Aug 1 2005 Leon Ho 3.0-6.EL +- Made the /etc/lsb-release useful (RH#154605) +- Added redhat_lsb_trigger to fix RH#160585 (Jakub Jelinek) +- Fixed AMD64 base libraries requirement parsing (RH#154605) + +* Tue Jul 26 2005 Leon Ho 3.0-5.EL +- Fixed redhat-lsb's mkredhat-lsb on fetching lib and + cmd requirements + +* Mon Jul 18 2005 Leon Ho 3.0-4.EL +- Rebuilt + +* Tue Jul 05 2005 Leon Ho 3.0-3.EL +- Disabled support for LSB 1.3 and 2.0 + +* Mon Jun 20 2005 Leon Ho 3.0-2.EL +- Upgraded to lsb-release 2.0 + +* Thu Jun 09 2005 Leon Ho 3.0-1.EL +- Moved to LSB 3.0 + +* Wed Apr 13 2005 Leon Ho 1.3-10 +- Fixed ix86 package with ia32 emul support + +* Tue Feb 01 2005 Leon Ho 1.3-9 +- Sync what we have changed on the branches + Wed Nov 24 2004 Harald Hoyer + - added post section to recreate the softlink in emul mode (bug 140739) + Mon Nov 15 2004 Phil Knirsch + Tiny correction of bug in new triggers + +* Mon Jan 24 2005 Leon Ho 1.3-8 +- Add support provide on lsb-core-* for each arch + +* Fri Jan 21 2005 Leon Ho 1.3-7 +- Add to support multiple LSB test suite version +- Add %endif in trigger postun + +* Thu Nov 11 2004 Phil Knirsch 1.3-6 +- Fixed invalid sln call for trigger in postun on ia64 (#137647) + +* Mon Aug 09 2004 Phil Knirsch 1.3-4 +- Bump release and rebuilt for RHEL4. + +* Thu Jul 24 2003 Matt Wilson 1.3-3 +- fix lsb ld.so name for ia64 (#100613) + +* Fri May 23 2003 Matt Wilson 1.3-2 +- use /usr/lib/lsb for install_initd, remove_initd + +* Fri May 23 2003 Matt Wilson 1.3-2 +- add ia64 x86_64 ppc ppc64 s390 s390x + +* Tue Feb 18 2003 Matt Wilson 1.3-1 +- 1.3 + +* Wed Sep 4 2002 Matt Wilson +- 1.2.0 + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Wed Mar 27 2002 Matt Wilson +- addeed trigger on glibc to re-establish the ld-lsb.so.1 symlink in the + forced downgrade case. + +* Tue Mar 12 2002 Bill Nottingham +- add initscripts support + +* Thu Jan 24 2002 Matt Wilson +- Initial build. + diff --git a/redhat-lsb/old_lsb_db/redhat_lsb_trigger.c b/redhat-lsb/old_lsb_db/redhat_lsb_trigger.c new file mode 100644 index 0000000..8b47be7 --- /dev/null +++ b/redhat-lsb/old_lsb_db/redhat_lsb_trigger.c @@ -0,0 +1,504 @@ +#ifdef __sparc__ +register void *__thread_self __asm ("g7"); +#endif +#include +#include +#include +#include + +#if defined __i386__ +# define INTERNAL_SYSCALL_DECL(err) do { } while (0) +# define INTERNAL_SYSCALL(name, err, nr, args...) \ + ({ \ + register unsigned int resultvar; \ + asm volatile ( \ + "movl %1, %%eax\n\t" \ + "int $0x80\n\t" \ + : "=a" (resultvar) \ + : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \ + (int) resultvar; }) +# define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((unsigned int) (val) >= 0xfffff001u) +# define ASMFMT_0() +# define ASMFMT_1(arg1) \ + , "b" (arg1) +# define ASMFMT_2(arg1, arg2) \ + , "b" (arg1), "c" (arg2) +# define ASMFMT_3(arg1, arg2, arg3) \ + , "b" (arg1), "c" (arg2), "d" (arg3) +#elif defined __x86_64__ +# define INTERNAL_SYSCALL_DECL(err) do { } while (0) +# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ + ({ \ + unsigned long resultvar; \ + LOAD_ARGS_##nr (args) \ + LOAD_REGS_##nr \ + asm volatile ( \ + "syscall\n\t" \ + : "=a" (resultvar) \ + : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx"); \ + (long) resultvar; }) +# define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) +# define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((unsigned long) (val) >= -4095L) +# define LOAD_ARGS_0() +# define LOAD_REGS_0 +# define ASM_ARGS_0 +# define LOAD_ARGS_1(a1) \ + long int __arg1 = (long) (a1); \ + LOAD_ARGS_0 () +# define LOAD_REGS_1 \ + register long int _a1 asm ("rdi") = __arg1; \ + LOAD_REGS_0 +# define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1) +# define LOAD_ARGS_2(a1, a2) \ + long int __arg2 = (long) (a2); \ + LOAD_ARGS_1 (a1) +# define LOAD_REGS_2 \ + register long int _a2 asm ("rsi") = __arg2; \ + LOAD_REGS_1 +# define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2) +# define LOAD_ARGS_3(a1, a2, a3) \ + long int __arg3 = (long) (a3); \ + LOAD_ARGS_2 (a1, a2) +# define LOAD_REGS_3 \ + register long int _a3 asm ("rdx") = __arg3; \ + LOAD_REGS_2 +# define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3) +#elif defined __powerpc__ +# define INTERNAL_SYSCALL_DECL(err) long int err +# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ + ({ \ + register long int r0 __asm__ ("r0"); \ + register long int r3 __asm__ ("r3"); \ + register long int r4 __asm__ ("r4"); \ + register long int r5 __asm__ ("r5"); \ + register long int r6 __asm__ ("r6"); \ + register long int r7 __asm__ ("r7"); \ + register long int r8 __asm__ ("r8"); \ + LOADARGS_##nr(name, args); \ + __asm__ __volatile__ \ + ("sc\n\t" \ + "mfcr %0\n\t" \ + : "=&r" (r0), \ + "=&r" (r3), "=&r" (r4), "=&r" (r5), \ + "=&r" (r6), "=&r" (r7), "=&r" (r8) \ + : ASM_INPUT_##nr \ + : "r9", "r10", "r11", "r12", \ + "cr0", "ctr", "memory"); \ + err = r0; \ + (int) r3; \ + }) +# define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) +# define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((void) (val), __builtin_expect ((err) & (1 << 28), 0)) +# define LOADARGS_0(name, dummy) \ + r0 = name +# define LOADARGS_1(name, __arg1) \ + long int arg1 = (long int) (__arg1); \ + LOADARGS_0(name, 0); \ + r3 = arg1 +# define LOADARGS_2(name, __arg1, __arg2) \ + long int arg2 = (long int) (__arg2); \ + LOADARGS_1(name, __arg1); \ + r4 = arg2 +# define LOADARGS_3(name, __arg1, __arg2, __arg3) \ + long int arg3 = (long int) (__arg3); \ + LOADARGS_2(name, __arg1, __arg2); \ + r5 = arg3 +# define ASM_INPUT_0 "0" (r0) +# define ASM_INPUT_1 ASM_INPUT_0, "1" (r3) +# define ASM_INPUT_2 ASM_INPUT_1, "2" (r4) +# define ASM_INPUT_3 ASM_INPUT_2, "3" (r5) +#elif defined __ia64__ +# define DO_INLINE_SYSCALL_NCS(name, nr, args...) \ + LOAD_ARGS_##nr (args) \ + register long _r8 asm ("r8"); \ + register long _r10 asm ("r10"); \ + register long _r15 asm ("r15") = name; \ + long _retval; \ + LOAD_REGS_##nr \ + __asm __volatile ("break 0x100000;;" \ + : "=r" (_r8), "=r" (_r10), "=r" (_r15) \ + ASM_OUTARGS_##nr \ + : "2" (_r15) ASM_ARGS_##nr \ + : "memory" ASM_CLOBBERS_##nr); \ + _retval = _r8; +# define INTERNAL_SYSCALL_DECL(err) long int err +# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ + ({ \ + DO_INLINE_SYSCALL_NCS (name, nr, args) \ + err = _r10; \ + _retval; }) +# define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) +# define INTERNAL_SYSCALL_ERROR_P(val, err) (err == -1) +# define LOAD_ARGS_0() +# define LOAD_REGS_0 +# define LOAD_ARGS_1(a1) \ + long _arg1 = (long) (a1); \ + LOAD_ARGS_0 () +# define LOAD_REGS_1 \ + register long _out0 asm ("out0") = _arg1; \ + LOAD_REGS_0 +# define LOAD_ARGS_2(a1, a2) \ + long _arg2 = (long) (a2); \ + LOAD_ARGS_1 (a1) +# define LOAD_REGS_2 \ + register long _out1 asm ("out1") = _arg2; \ + LOAD_REGS_1 +# define LOAD_ARGS_3(a1, a2, a3) \ + long _arg3 = (long) (a3); \ + LOAD_ARGS_2 (a1, a2) +# define LOAD_REGS_3 \ + register long _out2 asm ("out2") = _arg3; \ + LOAD_REGS_2 +# define ASM_OUTARGS_0 +# define ASM_OUTARGS_1 ASM_OUTARGS_0, "=r" (_out0) +# define ASM_OUTARGS_2 ASM_OUTARGS_1, "=r" (_out1) +# define ASM_OUTARGS_3 ASM_OUTARGS_2, "=r" (_out2) +# define ASM_ARGS_0 +# define ASM_ARGS_1 ASM_ARGS_0, "3" (_out0) +# define ASM_ARGS_2 ASM_ARGS_1, "4" (_out1) +# define ASM_ARGS_3 ASM_ARGS_2, "5" (_out2) +# define ASM_CLOBBERS_0 ASM_CLOBBERS_1, "out0" +# define ASM_CLOBBERS_1 ASM_CLOBBERS_2, "out1" +# define ASM_CLOBBERS_2 ASM_CLOBBERS_3, "out2" +# define ASM_CLOBBERS_3 ASM_CLOBBERS_4, "out3" +# define ASM_CLOBBERS_4 ASM_CLOBBERS_5, "out4" +# define ASM_CLOBBERS_5 ASM_CLOBBERS_6, "out5" +# define ASM_CLOBBERS_6_COMMON , "out6", "out7", \ + /* Non-stacked integer registers, minus r8, r10, r15. */ \ + "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18", \ + "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", \ + "r28", "r29", "r30", "r31", \ + /* Predicate registers. */ \ + "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", \ + /* Non-rotating fp registers. */ \ + "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + /* Branch registers. */ \ + "b6" +# define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON , "b7" +#elif defined __s390__ +# define INTERNAL_SYSCALL_DECL(err) do { } while (0) +# define INTERNAL_SYSCALL_DIRECT(name, err, nr, args...) \ + ({ \ + DECLARGS_##nr(args) \ + register long _ret asm("2"); \ + asm volatile ( \ + "svc %b1\n\t" \ + : "=d" (_ret) \ + : "i" (__NR_##name) ASMFMT_##nr \ + : "memory" ); \ + _ret; }) +# define INTERNAL_SYSCALL_SVC0(name, err, nr, args...) \ + ({ \ + DECLARGS_##nr(args) \ + register unsigned long _nr asm("1") = (unsigned long)(__NR_##name); \ + register long _ret asm("2"); \ + asm volatile ( \ + "svc 0\n\t" \ + : "=d" (_ret) \ + : "d" (_nr) ASMFMT_##nr \ + : "memory" ); \ + _ret; }) +# define INTERNAL_SYSCALL(name, err, nr, args...) \ + (((__NR_##name) < 256) ? \ + INTERNAL_SYSCALL_DIRECT(name, err, nr, args) : \ + INTERNAL_SYSCALL_SVC0(name, err,nr, args)) +# define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((unsigned long) (val) >= -4095UL) +# define DECLARGS_0() +# define DECLARGS_1(arg1) \ + register unsigned long gpr2 asm ("2") = (unsigned long)(arg1); +# define DECLARGS_2(arg1, arg2) \ + DECLARGS_1(arg1) \ + register unsigned long gpr3 asm ("3") = (unsigned long)(arg2); +# define DECLARGS_3(arg1, arg2, arg3) \ + DECLARGS_2(arg1, arg2) \ + register unsigned long gpr4 asm ("4") = (unsigned long)(arg3); +# define ASMFMT_0 +# define ASMFMT_1 , "0" (gpr2) +# define ASMFMT_2 , "0" (gpr2), "d" (gpr3) +# define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4) +#elif defined __sparc__ +# ifndef __arch64__ +# define __INTERNAL_SYSCALL_STRING \ + "ta 0x10;" \ + "bcs,a 1f;" \ + " sub %%g0, %%o0, %%o0;" \ + "1:" +# define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6", \ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ + "cc", "memory" +# else +# define __INTERNAL_SYSCALL_STRING \ + "ta 0x6d;" \ + "bcs,a,pt %%xcc, 1f;" \ + " sub %%g0, %%o0, %%o0;" \ + "1:" +# define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6", \ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ + "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \ + "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ + "cc", "memory" +# endif +#define INTERNAL_SYSCALL_DECL(err) do { } while (0) +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + inline_syscall##nr(__INTERNAL_SYSCALL_STRING, __NR_##name, args) +#define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((unsigned long) (val) >= -515L) +# define inline_syscall0(string,name,dummy...) \ +({ \ + register long __o0 __asm__ ("o0"); \ + register long __g1 __asm__ ("g1") = name; \ + __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1) : \ + __SYSCALL_CLOBBERS); \ + __o0; \ +}) +# define inline_syscall1(string,name,arg1) \ +({ \ + register long __o0 __asm__ ("o0") = (long)(arg1); \ + register long __g1 __asm__ ("g1") = name; \ + __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0) : \ + __SYSCALL_CLOBBERS); \ + __o0; \ +}) +# define inline_syscall2(string,name,arg1,arg2) \ +({ \ + register long __o0 __asm__ ("o0") = (long)(arg1); \ + register long __o1 __asm__ ("o1") = (long)(arg2); \ + register long __g1 __asm__ ("g1") = name; \ + __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0), "r" (__o1) : \ + __SYSCALL_CLOBBERS); \ + __o0; \ +}) +# define inline_syscall3(string,name,arg1,arg2,arg3) \ +({ \ + register long __o0 __asm__ ("o0") = (long)(arg1); \ + register long __o1 __asm__ ("o1") = (long)(arg2); \ + register long __o2 __asm__ ("o2") = (long)(arg3); \ + register long __g1 __asm__ ("g1") = name; \ + __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \ + "0" (__g1), "1" (__o0), "r" (__o1), \ + "r" (__o2) : \ + __SYSCALL_CLOBBERS); \ + __o0; \ +}) +#elif defined __alpha__ +# define INTERNAL_SYSCALL(name, err_out, nr, args...) \ + INTERNAL_SYSCALL1(name, err_out, nr, args) +# define INTERNAL_SYSCALL1(name, err_out, nr, args...) \ + INTERNAL_SYSCALL_NCS(__NR_##name, err_out, nr, args) +# define INTERNAL_SYSCALL_NCS(name, err_out, nr, args...) \ +({ \ + long _sc_ret, _sc_err; \ + inline_syscall##nr(name, args); \ + err_out = _sc_err; \ + _sc_ret; \ +}) +# define INTERNAL_SYSCALL_DECL(err) long int err +# define INTERNAL_SYSCALL_ERROR_P(val, err) err +# define inline_syscall_clobbers \ + "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \ + "$22", "$23", "$24", "$25", "$27", "$28", "memory" +# define inline_syscall_r0_asm +# define inline_syscall_r0_out_constraint "=v" +# define inline_syscall0(name, args...) \ +{ \ + register long _sc_0 inline_syscall_r0_asm; \ + register long _sc_19 __asm__("$19"); \ + \ + _sc_0 = name; \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2" \ + : inline_syscall_r0_out_constraint (_sc_0), \ + "=r"(_sc_19) \ + : "0"(_sc_0) \ + : inline_syscall_clobbers, \ + "$16", "$17", "$18", "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} +# define inline_syscall1(name,arg1) \ +{ \ + register long _sc_0 inline_syscall_r0_asm; \ + register long _sc_16 __asm__("$16"); \ + register long _sc_19 __asm__("$19"); \ + \ + _sc_0 = name; \ + _sc_16 = (long) (arg1); \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3" \ + : inline_syscall_r0_out_constraint (_sc_0), \ + "=r"(_sc_19), "=r"(_sc_16) \ + : "0"(_sc_0), "2"(_sc_16) \ + : inline_syscall_clobbers, \ + "$17", "$18", "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} +# define inline_syscall2(name,arg1,arg2) \ +{ \ + register long _sc_0 inline_syscall_r0_asm; \ + register long _sc_16 __asm__("$16"); \ + register long _sc_17 __asm__("$17"); \ + register long _sc_19 __asm__("$19"); \ + \ + _sc_0 = name; \ + _sc_16 = (long) (arg1); \ + _sc_17 = (long) (arg2); \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3 %4" \ + : inline_syscall_r0_out_constraint (_sc_0), \ + "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17) \ + : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17) \ + : inline_syscall_clobbers, \ + "$18", "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} +# define inline_syscall3(name,arg1,arg2,arg3) \ +{ \ + register long _sc_0 inline_syscall_r0_asm; \ + register long _sc_16 __asm__("$16"); \ + register long _sc_17 __asm__("$17"); \ + register long _sc_18 __asm__("$18"); \ + register long _sc_19 __asm__("$19"); \ + \ + _sc_0 = name; \ + _sc_16 = (long) (arg1); \ + _sc_17 = (long) (arg2); \ + _sc_18 = (long) (arg3); \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3 %4 %5" \ + : inline_syscall_r0_out_constraint (_sc_0), \ + "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \ + "=r"(_sc_18) \ + : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), \ + "4"(_sc_18) \ + : inline_syscall_clobbers, "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} +#endif + +#ifdef __i386__ +static int +is_ia64 (void) +{ + unsigned int fl1, fl2; + + /* See if we can use cpuid. */ + __asm__ ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;" + "pushl %0; popfl; pushfl; popl %0; popfl" + : "=&r" (fl1), "=&r" (fl2) + : "i" (0x00200000)); + if (((fl1 ^ fl2) & 0x00200000) == 0) + return 0; + + /* Host supports cpuid. See if cpuid gives capabilities, try + CPUID(0). Preserve %ebx and %ecx; cpuid insn clobbers these, we + don't need their CPUID values here, and %ebx may be the PIC + register. */ + __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx" + : "=a" (fl1) : "0" (0) : "edx", "cc"); + if (fl1 == 0) + return 0; + + /* Invoke CPUID(1), return %edx; caller can examine bits to + determine what's supported. */ + __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx" + : "=d" (fl2), "=a" (fl1) : "1" (1) : "cc"); + return (fl2 & (1 << 30)) != 0; +} +#else +#define is_ia64() 0 +#endif + +int main (int argc, char **argv) +{ +/* redhat_lsb_trigger.c:428: warning: unused variable 'ret' */ +/* long ret; */ + INTERNAL_SYSCALL_DECL (err); + char lsbsover[] = LSBSOVER; + char *LSBVER, *p = lsbsover; + while ((LSBVER = strtok (p, " \t")) != NULL) + { + char buf[sizeof LSBLDSO + 1 + strlen (LSBVER)]; + p = buf; + p = mempcpy (p, LSBLDSO, sizeof LSBLDSO - 1); + *p++ = '.'; + strcpy (p, LSBVER); + if (is_ia64 ()) + INTERNAL_SYSCALL (symlink, err, 2, "/emul/ia32-linux/lib/" LDSO, buf); + else + INTERNAL_SYSCALL (symlink, err, 2, LDSO, buf); + p = NULL; + } + INTERNAL_SYSCALL (exit, err, 1, 0); + return 110; +} + +int __libc_multiple_threads __attribute__((nocommon)); +int __libc_enable_asynccancel (void) { return 0; } +void __libc_disable_asynccancel (int x) { } +void __libc_csu_init (void) { } +void __libc_csu_fini (void) { } +pid_t __fork (void) { return -1; } +char thr_buf[65536]; + +#ifndef __powerpc__ + +/* /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib64/libc.a(libc-start.o): In function `__libc_start_main': + * * (.opd+0x10): multiple definition of `__libc_start_main' */ +int ___libc_start_main (int (*main) (int argc, char **argv), + int argc, char **argv, + void (*init) (void), void (*fini) (void), + void (*rtld_fini) (void), void * stack_end) +#else +struct startup_info +{ + void *sda_base; + int (*main) (int, char **, char **, void *); + int (*init) (int, char **, char **, void *); + void (*fini) (void); +}; + +/* /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib64/libc.a(libc-start.o): In function `__libc_start_main': + * (.opd+0x10): multiple definition of `__libc_start_main' */ +int ___libc_start_main (int argc, char **argv, char **ev, + void *auxvec, void (*rtld_fini) (void), + struct startup_info *stinfo, + char **stack_on_entry) +#endif +{ +#if defined __ia64__ || defined __powerpc64__ + register void *r13 __asm ("r13") = thr_buf + 32768; + __asm ("" : : "r" (r13)); +#elif defined __sparc__ + register void *g6 __asm ("g6") = thr_buf + 32768; + __thread_self = thr_buf + 32768; + __asm ("" : : "r" (g6), "r" (__thread_self)); +#elif defined __s390__ && !defined __s390x__ + __asm ("sar %%a0,%0" : : "d" (thr_buf + 32768)); +#elif defined __s390x__ + __asm ("sar %%a1,%0; srlg 0,%0,32; sar %%a0,0" : : "d" (thr_buf + 32768) : "0"); +#elif defined __powerpc__ && !defined __powerpc64__ + register void *r2 __asm ("r2") = thr_buf + 32768; + __asm ("" : : "r" (r2)); +#endif +#ifdef __powerpc__ + argc = (long)*stack_on_entry; + argv = stack_on_entry + 1; +#endif + main (argc, argv); + return 110; +} diff --git a/redhat-lsb/old_lsb_db/utils/repodb/pl2pkg.pl b/redhat-lsb/old_lsb_db/utils/repodb/pl2pkg.pl new file mode 100755 index 0000000..d657064 --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/repodb/pl2pkg.pl @@ -0,0 +1,139 @@ +#!/usr/bin/perl +use strict; +use warnings; +use feature qw(say); +use Getopt::Long; +use DBI; + +use Cwd qw(abs_path getcwd); +use File::Basename; +use File::Temp qw(tempdir); +use Config::IniFiles; + +#set up autoflush +$| = 1; +$ENV{LANG} = 'C'; + +sub usage; +sub clean_when_exit; +sub when_get_SIGINT; + +my $default_SIGINT_func = $SIG{INT}; +$SIG{INT} = \&when_get_SIGINT; + +my ( $help, $like ) = qw( 0 0 ); +my ( $sucess, $failed, ) = qw( 0 1 ); +my ( $dbh, ) =qw(); +my ( $db_source, %attr ); +my ( $filelist, $pkg, ) = ( '', '', ); +my $st = ''; +my ( $rf_pkg, ) = ( '', '', ); +my $pkg_found = 0; + +GetOptions( + 'help' => \$help, + 'like' => \$like, + 'pkg=s' => \$pkg, + 'filelist=s' => \$filelist, + +); + +%attr = ( + RaiseError => 1, + AutoCommit => 1, + PrintError => 1, +); + +if ($help) { + usage; + goto EXIT; +} + +if ( -e $pkg && -r $pkg ) { + $db_source = 'dbi:SQLite:' . $pkg; + $dbh = DBI->connect( $db_source, '', '', \%attr ) + or die "Failed to connect $pkg: $!"; + if ( !defined( $dbh ) ) { + say STDERR 'Failed to connect ' . $pkg . ': $!'; + goto FAILED; + } +} +else { + say STDERR "$pkg: can not be open"; + goto FAILED; +} + +foreach my $pp (@ARGV) { + $pkg_found = 0; + my ( $pkg, $pkgKey, $provides ) = qw(); + $st = ''; + $st .= 'select provides.name, provides.pkgKey, '; + $st .= 'packages.name '; + $st .= 'from provides '; + $st .= 'left join packages '; + $st .= 'where provides.pkgKey = packages.pkgKey '; + $st .= 'and ( '; + if ($like) { + $st .= 'provides.name like ' . "'%$pp%' "; + } else { + $st .= 'provides.name = ' . "'$pp' "; + } + $st .= ' ) '; + $rf_pkg = $dbh->selectall_arrayref($st); + foreach my $row (@$rf_pkg) { + $pkg_found = 1; + $provides=$row->[0]; + $pkgKey=$row->[1]; + $pkg=$row->[2]; + if ($like) { + say $pkg . ' - ' . $pkgKey . ' - ' . $pp . ' - ' . $provides; + } else { + say $pkg . ' - ' . $pkgKey . ' - ' . $provides; + } + } + say STDERR $pp if (!$pkg_found); +} + +EXIT: +clean_when_exit; +exit $sucess; +FAILED: +clean_when_exit; +exit $failed; + +sub clean_when_exit { + $dbh->disconnect if ( defined( $dbh ) ); +} + +sub when_get_SIGINT { + clean_when_exit; + $SIG{INT} = \&$default_SIGINT_func; + &$default_SIGINT_func; + goto FAILED; +} + +sub usage { + say <<'EOF' +USAGE + pl2pkg.pl --pkg db provides + +DESCRIPTION + pl2pkg output format as follows: + when enable --like: + pkg - pkgKey - pp -- provides + when disable --like: + pkg - pkgKey - provides + +OPTIONS + --help => display this help page + --like => use 'like' replace of '=' in sql + --pkg pkg => give the repo package database + +EXAMPLE + ./pl2pkg.pl --pkg primary.sqlite ls bash + ./pl2pkg.pl --pkg primary.sqlite 'Perl(strict)' 'Perl(warnings)' + +REPORT BUG +Pls report bugs to xning@redhat.com. +EOF +} diff --git a/redhat-lsb/old_lsb_db/utils/repodb/pp2pkg.pl b/redhat-lsb/old_lsb_db/utils/repodb/pp2pkg.pl new file mode 100755 index 0000000..d6e9e62 --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/repodb/pp2pkg.pl @@ -0,0 +1,180 @@ +#!/usr/bin/perl +use strict; +use warnings; +use feature qw(say); +use Getopt::Long; +use DBI; + +use Cwd qw(abs_path getcwd); +use File::Basename; +use File::Temp qw(tempdir); +use Config::IniFiles; + +#set up autoflush +$| = 1; +$ENV{LANG} = 'C'; + +sub usage; +sub clean_when_exit; +sub when_get_SIGINT; + +my $default_SIGINT_func = $SIG{INT}; +$SIG{INT} = \&when_get_SIGINT; + +my ($help) = 0; +my ( $sucess, $failed, ) = qw( 0 1 ); +my ( @dbh, @db ); +my ( $db_source, %attr ); +my ( $filelist, $pkg, ) = ( '', '', ); +my ( $pkgKey, ) = ( '', ); + +GetOptions( + 'help' => \$help, + 'pkg=s' => \$pkg, + 'filelist=s' => \$filelist, +); + +$db[0] = $filelist; +$db[1] = $pkg; + +%attr = ( + RaiseError => 1, + AutoCommit => 1, + PrintError => 1, +); + +if ($help) { + usage; + goto EXIT; +} + +foreach ( 0 .. $#db ) { + if ( -e $db[$_] ) { + if ( -f $db[$_] and -r $db[$_] ) { + $db_source = 'dbi:SQLite:' . $db[$_]; + $dbh[$_] = DBI->connect( $db_source, '', '', \%attr ) + or die "Failed to connect $db[$_]: $!"; + goto FAILED if ( !defined( $dbh[$_] ) ); + } + else { + say STDERR "$db[$_]: can not be open"; + goto FAILED; + } + } + else { + say STDERR "filelist db do not exists" if ( $_ == 0 ); + say STDERR "pkg db do not exists" if ( $_ == 1 ); + goto FAILED; + } +} + +foreach my $n (@ARGV) { + my $statement = ''; + my ( $rf_file, $rf_pkg ) = qw(); + my ( $pkg, $pkg_grp, $pkgKey, $dir, @files, @types, ) = qw(); + my ( $n_dir, $n_file) = qw(); + my $pkg_found = 0; + $n_dir=dirname $n; + $n_file=basename $n; + $statement .= 'select filelist.pkgKey, filelist.dirname, '; + $statement .= 'filelist.filenames, filelist.filetypes '; + $statement .= 'from filelist '; + $statement .= 'where '; + $statement .= '( filenames = "' . $n_file . '" '; + $statement .= 'or filenames like "' . $n_file . '/%" '; + $statement .= 'or filenames like "%/' . $n_file . '/%" '; + $statement .= 'or filenames like "%/' . $n_file . '") '; + if ($n_dir =~ m!^/!mx) { + $statement .= 'and filelist.dirname = "' . $n_dir . '" '; + } +# say $statement; + $rf_file = $dbh[0]->selectall_arrayref($statement) + or die "failed to execute \"$statement\": $!"; +# say 'partial path name: ' . $n; + foreach my $row (@$rf_file) { + $pkgKey = $row->[0]; + $dir = $row->[1]; + @files = split m!/!, $row->[2]; + @types = split m!!, $row->[3]; + $files[ $#files + 1 ] = '' if ( $row->[2] =~ m!/$!mx ); + + if ( $#files == $#types ) { + foreach my $inx ( 0 .. $#files ) { + next if ($types[$inx] eq 'd'); + if ($files[$inx] eq $n_file) { + $pkg_found = 1 if ( !$pkg_found ); + $statement = ''; + $statement .= 'select packages.pkgKey, packages.name, '; + $statement .= 'packages.rpm_group, packages.rpm_packager '; + $statement .= 'from packages '; + $statement .= 'where packages.pkgKey = ' . $pkgKey . ' '; + $statement .= ''; + $rf_pkg = $dbh[1]->selectall_arrayref($statement) + or die "failed to execute \"$statement\": $!"; + if ( ( scalar @$rf_pkg ) != 1 ) { + say STDERR $pkgKey + . ': more than one packages have this id'; + goto FAILED; + } + $pkg = $rf_pkg->[0]->[1]; + $pkg_grp = $rf_pkg->[0]->[2]; + say '"' . $pkg_grp . '"' . ' - ' . $pkg . ' - ' + . $types[$inx] . ' - ' + . $dir . '/' + . $files[$inx] . ' - ' . ${n}; + } + } + } + else { + my $errstr = 'pkgKey ' . $pkgKey; + $errstr .= ': files and types not one-to-one: '; + $errstr .= $#files . ' - ' . $#types; + say STDERR $errstr; + goto FAILED; + } + } + say STDERR $n if (!$pkg_found); + next; +} + +EXIT: +clean_when_exit; +exit $sucess; +FAILED: +clean_when_exit; +exit $failed; + +sub clean_when_exit { + for ( 0 .. $#db ) { + $dbh[$_]->disconnect if ( defined( $dbh[$_] ) ); + } +} + +sub when_get_SIGINT { + clean_when_exit; + $SIG{INT} = \&$default_SIGINT_func; + &$default_SIGINT_func; + goto FAILED; +} + +sub usage { + say <<'EOF' +USAGE + pp2pkg.pl --pkg pkg --filelist filelist ppname + +DESCRIPTION + pp2pkg.pl output format as follows: + rpm group - package name - file type - match file - ppname + +OPTIONS + --help => display this help page + --pkg pkg => give the repo package database + --filelist filelist => give the repo filelist database + +EXAMPLE + ./pp2pkg --pkg primary.sqlite --filelist filelists.sqlite ls cmp + +REPORT BUG +Pls report bugs to xning@redhat.com. +EOF +} diff --git a/redhat-lsb/old_lsb_db/utils/specdb/control b/redhat-lsb/old_lsb_db/utils/specdb/control new file mode 100644 index 0000000..5edee9b --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/control @@ -0,0 +1,8 @@ +#mysql settings +lsbdbhost=localhost +lsbdbport=3306 +lsbdbuser=lsbadmin +lsbdbpassword=redhat-lsb +lsbdb=lsb +mysql_cmd="mysql --host ${lsbdbhost} --port ${lsbdbport} --user ${lsbdbuser} \ +-D ${lsbdb} --password=${lsbdbpassword} --batch -N -e" diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mkarch b/redhat-lsb/old_lsb_db/utils/specdb/mkarch new file mode 100755 index 0000000..6131444 --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mkarch @@ -0,0 +1,22 @@ +#!/bin/bash + +cd $(dirname $0) + +. control + +function usage { + cat <&2 +USAGE + $(basename $0) +EOF +} +if [ $# -eq 0 ];then + lsbdb=' +select Aname from Architecture order by Aname +' + ${mysql_cmd} "${lsbdb}" + exit 0 +else + usage + exit 1 +fi diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mkcmd b/redhat-lsb/old_lsb_db/utils/specdb/mkcmd new file mode 100755 index 0000000..50191ec --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mkcmd @@ -0,0 +1,87 @@ +#!/bin/bash + +cd $(dirname $0) +. control +function usage { + cat <&2 +USAGE + $(basename $0) -h + $(basename $0) --help + $(basename $0) submod lsbver +EOF +} + +if [ $# -eq 0 -o $# -eq 1 ];then + usage + exit 1 +elif [ $# -eq 2 ];then + submod=$1 + lsbver=$2 + select_st=' +select cmd from +( +( +select SMname, Cname as cmd, Ccandidatefor, +Cdeprecatedsince, SMCappearedin, SMCwithdrawnin +from Command +left join SModCmd on Cid = SMCcid +left join SubModule on SMCsmid = SMid +where SMname is not NULL +and Cpath is NULL +and ( Cbuiltin is NULL or strcmp (Cbuiltin, "No") = 0 ) +) +union +( +select "LSB_Others" as SMname, Cname as cmd, Ccandidatefor, +Cdeprecatedsince, SMCappearedin, SMCwithdrawnin +from Command +left join SModCmd on Cid = SMCcid +left join SubModule on SMCsmid = SMid +where SMname is NULL +and Cpath is NULL +and ( Cbuiltin is NULL or strcmp (Cbuiltin, "No") = 0 ) +) +union +( +select SMname, Cpath as cmd, Ccandidatefor, +Cdeprecatedsince, SMCappearedin, SMCwithdrawnin +from Command +left join SModCmd on Cid = SMCcid +left join SubModule on SMCsmid = SMid +where SMname is not NULL +and Cpath is not NULL +and ( Cbuiltin is NULL or strcmp (Cbuiltin, "No") = 0 ) +) +union +( +select "LSB_Others" as SMname, Cpath as cmd, Ccandidatefor, +Cdeprecatedsince, SMCappearedin, SMCwithdrawnin +from Command +left join SModCmd on Cid = SMCcid +left join SubModule on SMCsmid = SMid +where SMname is NULL +and Cpath is not NULL +and ( Cbuiltin is NULL or strcmp (Cbuiltin, "No") = 0 ) +) +) as ModCmd +where 1 = 1 +' + where_st=" +and ( strcmp (SMname, '${submod}' ) = 0 ) +and ( Ccandidatefor is NULL + or Ccandidatefor <= $lsbver + or strcmp ( Ccandidatefor, 'Unknown' ) != 0 ) +and ( SMCappearedin is not NULL + and strcmp ( SMCappearedin, '' ) != 0 + and SMCappearedin <= $lsbver ) +and ( SMCwithdrawnin is NULL + or SMCwithdrawnin > $lsbver ) +order by SMname,cmd +" + ${mysql_cmd} "${select_st} ${where_st}" + exit 0 +else + echo 'too many options' >&2 + usage + exit 1 +fi diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mkheader b/redhat-lsb/old_lsb_db/utils/specdb/mkheader new file mode 100755 index 0000000..6094799 --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mkheader @@ -0,0 +1,52 @@ +#!/bin/bash + +cd $(dirname $0) + +. control + +function usage { + cat <&2 +USAGE + $(basename $0) lsbver + $(basename $0) -h + $(basename $0) --help +EOF +} + +if [ $# -eq 0 ];then + usage + exit 1 +elif [ $# -eq 1 ];then + if [ "$1" = "-h" -o "$1" = "--help" ];then + usage + exit 1 + fi + lsbver=$1 + select_st=' +select Hname from +( +select Hname, Hcandidatefor, +Happearedin, Hwithdrawnin +from Header +) as header +where 1 = 1 +' +where_st=" +and ( Hcandidatefor is NULL + or Hcandidatefor <= $lsbver + or strcmp ( Hcandidatefor, 'Unknown' ) != 0 ) +and ( Happearedin is not NULL + and strcmp ( Happearedin, '' ) + and Happearedin <= $lsbver ) +and ( Hwithdrawnin is NULL + or Hwithdrawnin > $lsbver ) +order by Hname +" + +${mysql_cmd} "${select_st} ${where_st}" + exit 0 +else + echo 'error: too many options' >&2 + usage + exit 1 +fi diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mkil b/redhat-lsb/old_lsb_db/utils/specdb/mkil new file mode 100755 index 0000000..878d1e5 --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mkil @@ -0,0 +1,33 @@ +#!/bin/bash +#Interpreted Language + +cd $(dirname $0) + +. control + +function usage { + cat <&2 +USAGE + $(basename $0) -h + $(basename $0) --help + $(basename $0) lsbver +EOF +} + +if [ $# -eq 0 -o $# -gt 1 -o "$1" = '-h' -o "$1" = '--help' ];then + usage + exit 1 +fi + +lsbver=$1 +select_stm=' +select ILname from InterpretedLanguage +' +where_stm=" +where ( ILappearedin is not NULL + and strcmp ( ILappearedin, '' ) != 0 + and ILappearedin <= ${lsbver} ) +and ( ILwithdrawnin is NULL + or ILwithdrawnin > ${lsbver} ) +" +${mysql_cmd} "${select_stm} ${where_stm}" diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mkilm b/redhat-lsb/old_lsb_db/utils/specdb/mkilm new file mode 100755 index 0000000..0ca9ad4 --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mkilm @@ -0,0 +1,48 @@ +#!/bin/bash +#Interpreted Language Module + +cd $(dirname $0) + +. control + +function usage { + cat <&2 +USAGE + $(basename $0) -h + $(basename $0) --help + $(basename $0) interpretedlang lsbver +EOF +} + +if [ $# -ge 3 ];then + echo 'error: too many options' >&2 + usage + exit 1 +elif [ "$1" = '-h' -o "$1" = '--help' -o $# -eq 0 ];then + usage + exit 1 +fi +interpretedlang=$1 +lsbver=$2 + +select_stm='select ILMname, ILMversion +from InterpretedLanguageModule +left join InterpretedLanguage on ILMlanguage = ILid +' + +where_stm=" +where +strcmp ( ILname, '${interpretedlang}' ) = 0 +and ( ILMappearedin is not NULL + and strcmp ( ILMappearedin, '' ) != 0 + and ILMappearedin <= ${lsbver} ) +and ( ILMwithdrawnin is NULL + or ILMwithdrawnin > ${lsbver} ) +and ( ILappearedin is not NULL + and strcmp ( ILappearedin, '' ) + and ILappearedin <= ${lsbver} ) +and ( ILwithdrawnin is NULL + or ILwithdrawnin > ${lsbver} ) +" +#echo "${select_stm} ${where_stm}" +${mysql_cmd} "${select_stm} ${where_stm}" diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mklib b/redhat-lsb/old_lsb_db/utils/specdb/mklib new file mode 100755 index 0000000..469abf3 --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mklib @@ -0,0 +1,62 @@ +#!/bin/bash + +cd $(dirname $0) + +. control + +function usage { + cat <&2 +USAGE + $(basename $0) -h + $(basename $0) --help + $(basename $0) arch submod lsbver +EOF +} +if [ $# -eq 0 -o $# -eq 2 ];then + usage + exit 1 +elif [ $# -eq 1 ];then + if [ $1 = '-h' -o $1 = '--help' ];then + usage + exit 1 + else + echo "$1: wrong option" >&2 + exit 1 + fi +elif [ $# -eq 3 ];then + arch=$1 + submod=$2 + lsbver=$3 + select_st=' +select Lname, ALrunname +from Library +left join SModLib on Lid = SMLlid +left join ArchLib on Lid = ALlid +left join SubModule on SMLsmid = SMid +left join Architecture on ALaid = Aid +where 1 = 1 +' + where_st=" +and ( strcmp (Aname, '$arch') = 0 ) +and ( strcmp (SMname, '$submod') = 0 ) +and ( Lcandidatefor is NULL + or Lcandidatefor <= $lsbver + or strcmp ( Lcandidatefor, 'Unknown' ) != 0 ) +and ( ALappearedin is not NULL + and strcmp ( ALappearedin, '' ) != 0 + and ALappearedin <= $lsbver ) +and ( ALwithdrawnin is NULL + or ALwithdrawnin > $lsbver ) +and ( SMLappearedin is not NULL + and strcmp ( SMLappearedin, '' ) != 0 + and SMLappearedin <= $lsbver ) +and ( SMLwithdrawnin is NULL + or SMLwithdrawnin > $lsbver ) +" + ${mysql_cmd} "$select_st $where_st" + exit 0 +else + echo 'too many options' >&2 + usage + exit 1 +fi diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mkmod b/redhat-lsb/old_lsb_db/utils/specdb/mkmod new file mode 100755 index 0000000..8a2b84a --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mkmod @@ -0,0 +1,21 @@ +#!/bin/bash + +cd $(dirname $0) +. control + +function usage { + cat <&2 +USAGE + $(basename $0) +EOF +} +if [ $# -eq 0 ];then + select_st=' +select Mname from Module order by Mname +' + ${mysql_cmd} "$select_st" + exit 0 +else + usage + exit 1 +fi diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mksubmod b/redhat-lsb/old_lsb_db/utils/specdb/mksubmod new file mode 100755 index 0000000..a8d1325 --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mksubmod @@ -0,0 +1,56 @@ +#!/bin/bash + +cd $(dirname $0) +. control + +function usage { +cat <&2 +USAGE: + $(basename $0) -h + $(basename $0) --help + $(basename $0) + $(basename $0) mod lsbver +EOF + exit 1 +} + +if [ $# -eq 0 ];then + select_st='select SMname from SubModule' + { ${mysql_cmd} "${select_st}";echo "LSB_Others"; } | sort + exit 0 +elif [ $# -eq 1 ];then + if [ "$1" = '--help' -o "$1" = '-h' ];then + usage + else + echo "$1: wrong option" 1>&2 + exit 1 + fi +elif [ $# -eq 2 ];then + mod=$1 + lsbver=$2 + select_st=' +select SMname +from SubModule +left join ModSMod on SMid = MSMsmid +left join Module on MSMmid = Mid +where 1 = 1 +' + where_st=" +and ( strcmp (Mname, '$mod') = 0 ) +and ( SMmandatorysince is not NULL + and strcmp ( SMmandatorysince, '' ) != 0 + and SMmandatorysince <= $lsbver ) +and ( SMdeprecatedsince is NULL or SMdeprecatedsince > $lsbver ) +and ( MSMappearedin is not NULL +and strcmp ( MSMappearedin, '' ) != 0 +and MSMappearedin <= $lsbver ) +and ( MSMwithdrawnin is NULL or MSMwithdrawnin > $lsbver )" + +#echo "${select_st} ${where_st}" +${mysql_cmd} "${select_st} ${where_st}" + exit 0 +else + echo "wrong: too many options" >&2 + usage + exit 1 +fi diff --git a/redhat-lsb/old_lsb_db/utils/specdb/mkver b/redhat-lsb/old_lsb_db/utils/specdb/mkver new file mode 100755 index 0000000..c86bf5d --- /dev/null +++ b/redhat-lsb/old_lsb_db/utils/specdb/mkver @@ -0,0 +1,21 @@ +#!/bin/bash + +cd $(dirname $0) +. control + +function usage { + cat <&2 +USAGE + $(basename $0) +EOF +} +if [ $# -eq 0 ];then + select_st=' +select LVvalue from LSBVersion order by LVvalue +' +${mysql_cmd} "$select_st" + exit 0 +else + usage + exit 1 +fi diff --git a/redhat-lsb/redhat-lsb.spec.in b/redhat-lsb/redhat-lsb.spec.in deleted file mode 100644 index ae65896..0000000 --- a/redhat-lsb/redhat-lsb.spec.in +++ /dev/null @@ -1,458 +0,0 @@ -# Define this to link to which library version eg. /lib64/ld-lsb-x86-64.so.3 -%define lsbsover 3 - -%ifarch %{ix86} -%define ldso ld-linux.so.2 -%define lsbldso ld-lsb.so -%endif - -%ifarch ia64 -%define ldso ld-linux-ia64.so.2 -%define lsbldso ld-lsb-ia64.so -%endif - -%ifarch ppc -%define ldso ld.so.1 -%define lsbldso ld-lsb-ppc32.so -%endif - -%ifarch ppc64 -%define ldso ld64.so.1 -%define lsbldso ld-lsb-ppc64.so -%endif - -%ifarch s390 -%define ldso ld.so.1 -%define lsbldso ld-lsb-s390.so -%endif - -%ifarch s390x -%define ldso ld64.so.1 -%define lsbldso ld-lsb-s390x.so -%endif - -%ifarch x86_64 -%define ldso ld-linux-x86-64.so.2 -%define lsbldso ld-lsb-x86-64.so -%endif - -%ifarch ia64 ppc64 s390x x86_64 -%define qual ()(64bit) -%else -%define qual %{nil} -%endif - -%define upstreamlsbrelver 2.0 -%define lsbrelver 4.0 -%define srcrelease 1 - -Summary: LSB support for Red Hat Linux -Name: redhat-lsb -Version: 4.0 -Release: 1%{?dist} -URL: http://www.linuxfoundation.org/collaborate/workgroups/lsb -Source0: %{name}-%{version}-%{srcrelease}.tar.bz2 -Source1: http://prdownloads.sourceforge.net/lsb/lsb-release-%{upstreamlsbrelver}.tar.gz -Patch0: lsb-release-3.1-update-init-functions.patch -Patch1: redhat-lsb-lsb_start_daemon-fix.patch -Patch2: redhat-lsb-trigger.patch -License: GPL -Group: System Environment/Base -BuildRoot: %{_tmppath}/%{name}-root -BuildRequires: glibc-static -# dependency for primary LSB application for v1.3 -Provides: lsb = %{version} -# dependency for primary LSB application for v2.0 and v3.0 -%ifarch %{ix86} -%define archname ia32 -%endif -%ifarch ia64 -%define archname ia64 -%endif -%ifarch ppc -%define archname ppc32 -%endif -%ifarch ppc64 -%define archname ppc64 -%endif -%ifarch s390 -%define archname s390 -%endif -%ifarch s390x -%define archname s390x -%endif -%ifarch x86_64 -%define archname amd64 -%endif -Provides: lsb-core-%{archname} = %{version} -Provides: lsb-graphics-%{archname} = %{version} -Provides: lsb-core-noarch = %{version} -Provides: lsb-graphics-noarch = %{version} - -ExclusiveArch: %{ix86} ia64 x86_64 ppc ppc64 s390 s390x - -%ifarch %{ix86} -@ARCHLSB_IA32_BASELIB@ -%endif - -%ifarch ia64 -@ARCHLSB_IA64_BASELIB@ -%endif - -%ifarch ppc -@ARCHLSB_PPC32_BASELIB@ -%endif - -%ifarch ppc64 -@ARCHLSB_PPC64_BASELIB@ -%endif - -%ifarch s390 -@ARCHLSB_S390_BASELIB@ -%endif - -%ifarch s390x -@ARCHLSB_S390X_BASELIB@ -%endif - -%ifarch x86_64 -@ARCHLSB_AMD64_BASELIB@ -%endif - -@GLSB_BASELIB@ - -@GLSB_COMMAND_UTILITIES@ - -%description -The Linux Standard Base (LSB) is an attempt to develop a set of -standards that will increase compatibility among Linux distributions. -The redhat-lsb package provides utilities needed for LSB Compliant -Applications. It also contains requirements that will ensure that all -components required by the LSB that are provided by Red Hat Linux are -installed on the system. - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p0 -b .triggerfix - -%build -cd lsb-release-%{upstreamlsbrelver} -make - -%pre -# remove the extra symlink /bin/mailx -> /bin/mail -if [ -e /bin/mailx ]; then - if [ -L /bin/mailx ]; then - rm -f /bin/mailx - fi -fi - - -%install -rm -rf $RPM_BUILD_ROOT -# LSB uses /usr/lib rather than /usr/lib64 even for 64bit OS -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT%{_mandir} \ - $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT/usr/lib/lsb \ - $RPM_BUILD_ROOT%{_sysconfdir}/lsb-release.d/ $RPM_BUILD_ROOT%{_sbindir} -make DESTDIR=$RPM_BUILD_ROOT install -cd lsb-release-%{upstreamlsbrelver} -make mandir=$RPM_BUILD_ROOT/%{_mandir} prefix=$RPM_BUILD_ROOT/%{_prefix} install -cd .. -touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-4.0-%{archname} -touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-4.0-noarch -touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-4.0-%{archname} -touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-4.0-noarch -#touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-3.2-%{archname} -#touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-3.2-noarch -#touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-3.2-%{archname} -#touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-3.2-noarch -# and claim LSB 3.1 is supported as well -#touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-3.1-%{archname} -#touch $RPM_BUILD_ROOT/etc/lsb-release.d/core-3.1-noarch -#touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-3.1-%{archname} -#touch $RPM_BUILD_ROOT/etc/lsb-release.d/desktop-3.1-noarch - -for LSBVER in %{lsbsover}; do - ln -s %{ldso} $RPM_BUILD_ROOT/%{_lib}/%{lsbldso}.$LSBVER -done - -mkdir -p $RPM_BUILD_ROOT/bin - -# LSB uses /usr/lib rather than /usr/lib64 even for 64bit OS -# According to the lsb-core documentation provided by -# http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic.pdf -# it's OK to put non binary in /usr/lib. -ln -snf ../../../sbin/chkconfig $RPM_BUILD_ROOT/usr/lib/lsb/install_initd -ln -snf ../../../sbin/chkconfig $RPM_BUILD_ROOT/usr/lib/lsb/remove_initd -#ln -snf mail $RPM_BUILD_ROOT/bin/mailx - -#mkdir -p $RPM_BUILD_ROOT/usr/X11R6/lib/X11/xserver -#ln -snf /usr/%{_lib}/xserver/SecurityPolicy $RPM_BUILD_ROOT/usr/X11R6/lib/X11/xserver/SecurityPolicy -#ln -snf /usr/share/X11/fonts $RPM_BUILD_ROOT/usr/X11R6/lib/X11/fonts -#ln -snf /usr/share/X11/rgb.txt $RPM_BUILD_ROOT/usr/X11R6/lib/X11/rgb.txt - -# According to https://bugzilla.redhat.com/show_bug.cgi?id=232918 , the '-static' option -# is imported against segfault error while running redhat_lsb_trigger -gcc $RPM_OPT_FLAGS -Os -static -fno-stack-protector -o redhat_lsb_trigger{.%{_target_cpu},.c} -DLSBSOVER='"%{lsbsover}"' \ - -DLDSO='"%{ldso}"' -DLSBLDSO='"/%{_lib}/%{lsbldso}"' -D_GNU_SOURCE -install -m 700 redhat_lsb_trigger.%{_target_cpu} \ - $RPM_BUILD_ROOT%{_sbindir}/redhat_lsb_trigger.%{_target_cpu} - -cp -p redhat_lsb_init $RPM_BUILD_ROOT/bin/redhat_lsb_init - -%clean -rm -rf $RPM_BUILD_ROOT - -%triggerpostun -- glibc -if [ -x /usr/sbin/redhat_lsb_trigger.%{_target_cpu} ]; then - /usr/sbin/redhat_lsb_trigger.%{_target_cpu} -fi - -%ifnarch %{ix86} - /sbin/sln %{ldso} /%{_lib}/%{lsbldso} || : -%else - if [ -f /emul/ia32-linux/lib/%{ldso} ]; then - for LSBVER in %{lsbsover}; do - /sbin/sln /emul/ia32-linux/lib/%{ldso} /%{_lib}/%{lsbldso}.$LSBVER || : - done - else - for LSBVER in %{lsbsover}; do - /sbin/sln %{ldso} /%{_lib}/%{lsbldso}.$LSBVER || : - done - fi -%endif - -%ifarch %{ix86} -%post -# make this softlink again for /emul - if [ -f /emul/ia32-linux/lib/%{ldso} ]; then - for LSBVER in %{lsbsover}; do - /sbin/sln /emul/ia32-linux/lib/%{ldso} /%{_lib}/%{lsbldso}.$LSBVER || : - done - fi -%endif - -%files -#/usr/X11R6/lib/X11/fonts -#/usr/X11R6/lib/X11/rgb.txt -%defattr(-,root,root) -%{_sysconfdir}/redhat-lsb -#%config /etc/lsb-release -#/etc/redhat-lsb -%dir %{_sysconfdir}/lsb-release.d -# These files are needed because they shows which LSB we're supporting now, -# for example, if core-3.1-noarch exists, it means we are supporting LSB3.1 now -%{_sysconfdir}/lsb-release.d/* -#%dir /usr/X11R6/lib/X11/xserver -#/usr/X11R6/lib/X11/xserver/* -%{_mandir}/*/* -%{_bindir}/* -#/bin/mailx -/bin/redhat_lsb_init -/usr/lib/lsb -/%{_lib}/*so* -/lib/lsb* -%{_sbindir}/redhat_lsb_trigger.%{_target_cpu} -#/usr/X11R6/lib/X11/xserver/SecurityPolicy -#/usr/X11R6/lib/X11/fonts -#/usr/X11R6/lib/X11/rgb.txt - -%changelog -* Fri Jan 8 2010 Lawrence Lim - 4.0-1 -- update to LSB4.0 - -* Tue Oct 27 2009 Tom "spot" Callaway - 3.2-7 -- apply fix from bz514760 (thanks to Jakub Jelinek) - -* Wed Oct 21 2009 Tom "spot" Callaway - 3.2-6 -- apply fix from bz485367 (thanks to Jon Thomas) - -* Sun Jul 26 2009 Fedora Release Engineering - 3.2-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Fri Apr 24 2009 Jens Petersen -- improve url to LSB WG - -* Thu Apr 23 2009 Jens Petersen - 3.2-4 -- use dist tag (Debarshi, #496553) -- update to ix86 (caillon) - -* Wed Feb 25 2009 Fedora Release Engineering - 3.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Thu Aug 28 2008 Hao Liu 3.2-2 -- Modify "Requires: /usr/bin/mailx" to "Requires: mailx" (Bug #460249) - -* Wed Aug 18 2008 Hao Liu 3.2-1 -- Port forward to LSB 3.2 -- Remove symlink for mailx if user is upgrading from the redhat-lsb of older version -- Since F10 put mailx under /usr/bin, change the corresponding requires - -* Thu Aug 5 2008 Hao Liu - 3.1-22 -- Remove 2 requires which provided by redhat-lsb -- Add comments explaining why hard-coded path is kept -- Resolve some hard-coded path problems -- Add comments explaining why importing '-static' option while compiling redhat_lsb_trigger -- Replace %{_libdir}/lsb with /usr/lib/lsb -- Replace /%{_lib}/* with /%{_lib}/*so* -- Replace /lib/lsb with /lib/lsb* - -* Thu Jul 31 2008 Lawrence Lim - 3.1-21 -- remove symlink for mailx (Bug #457241) - -* Wed Apr 16 2008 Mats Wichmann 3.2-1 -- port forward to LSB 3.2 - -* Tue Feb 19 2008 Fedora Release Engineering - 3.1-20 -- Autorebuild for GCC 4.3 - -* Wed Oct 3 2007 Lawrence Lim - 3.1-19 -- fix build issue on ppc - (.opd+0x10): multiple definition of `__libc_start_main' - -* Fri Sep 21 2007 Lawrence Lim - 3.1-18 -- fix build issue in minimal build root (Bug #265241) - -* Wed Aug 29 2007 Fedora Release Engineering - 3.1-17 -- Rebuild for selinux ppc32 issue. - -* Fri Aug 20 2007 Lawrence Lim - 3.1-16 -- update spec file in accordance to feedback provided through merge review - merge-review.patch - #226363 - -* Wed Jul 18 2007 Lawrence Lim - 3.1-15.f8 -- Resolved: #239842 - /lib/lsb/init-functions shall use aliases but not functions -- forward port the patch from 3.1-12.3.EL which fix #217566, #233530, #240916 - -* Wed Jul 2 2007 Lawrence Lim - 3.1-14.fc7 -- fixed Bug 232918 for new glibc version - -* Wed Jul 18 2007 Lawrence - 3.1-13.f8 -- Resolved: #239842 - /lib/lsb/init-functions shall use aliases but not functions -- forward port the patch from 3.1-12.3.EL - -* Tue Jun 26 2007 Lawrence Lim - 3.1-12.3.EL -- Resolves: #217566 - rewrite /lib/lsb/init-functions file needs to define the commands as true shell functions rather than aliases. -- Resolves: #233530 - LSB pidofproc misspelled as pidofprof. -- Resolves: #240916 - "log_warning_message" replaced with "log_warning_msg" per the LSB 3.1 spec - -* Wed Dec 6 2006 Lawrence Lim - 3.1-12.2.EL -- Resolves: bug 217566 -- revise patch - -* Wed Nov 29 2006 Lawrence Lim - 3.1-12 -- replaced aliases with functions in /lib/lsb/init-functions; Bug 217566 - -* Sun Oct 01 2006 Jesse Keating - 3.1-11 -- rebuilt for unwind info generation, broken in gcc-4.1.1-21 - -* Thu Sep 21 2006 Lawrence Lim - 3.1-10.3 -- Fix upgrade issue; Bug 202548 - -* Wed Jul 12 2006 Jesse Keating - 3.1-10.2.1 -- rebuild - -* Thu Jul 6 2006 Lawrence Lim - 3.1-10.2 -- for some strange reason, ld-lsb-x86-64.so need to be ld-lsb-x86-64.so.3 (LSB3.0) rather than ld-lsb-x86-64.so.3.1 (LSB3.1) - -* Thu Jul 6 2006 Lawrence Lim - 3.1-10.1 -- generate spec file on RHEL5-Alpha system -- fix vsw4 test suite setup by creating symlink for X11 SecurityPolicy and XFontPath - -* Thu Jun 22 2006 Lawrence Lim - 3.0-10 -- Rewrite most part of the mkredhat-lsb to obtain information directly via specdb - rather than sniffing through sgml -- remove redundent script and bump up tarball version - -* Fri Feb 10 2006 Jesse Keating - 3.0-9.2 -- bump again for double-long bug on ppc(64) - -* Tue Feb 07 2006 Jesse Keating - 3.0-9.1 -- rebuilt for new gcc4.1 snapshot and glibc changes - -* Fri Jan 13 2006 Leon Ho 3.0-9 -- Migrated back to rawhide - -* Wed Aug 3 2005 Leon Ho 3.0-8.EL -- Added libstdc++.so.6/libGL.so.1 requirement (RH#154605) - -* Wed Aug 3 2005 Leon Ho 3.0-7.EL -- Fixed multilib problem on lsb_release not to read /etc/lsb-release and solely - depends on /etc/lsb-release.d/ (Advised by LSB committee) -- Removed /etc/lsb-release (Advised by LSB committee) - -* Mon Aug 1 2005 Leon Ho 3.0-6.EL -- Made the /etc/lsb-release useful (RH#154605) -- Added redhat_lsb_trigger to fix RH#160585 (Jakub Jelinek) -- Fixed AMD64 base libraries requirement parsing (RH#154605) - -* Tue Jul 26 2005 Leon Ho 3.0-5.EL -- Fixed redhat-lsb's mkredhat-lsb on fetching lib and - cmd requirements - -* Mon Jul 18 2005 Leon Ho 3.0-4.EL -- Rebuilt - -* Tue Jul 05 2005 Leon Ho 3.0-3.EL -- Disabled support for LSB 1.3 and 2.0 - -* Mon Jun 20 2005 Leon Ho 3.0-2.EL -- Upgraded to lsb-release 2.0 - -* Thu Jun 09 2005 Leon Ho 3.0-1.EL -- Moved to LSB 3.0 - -* Wed Apr 13 2005 Leon Ho 1.3-10 -- Fixed ix86 package with ia32 emul support - -* Tue Feb 01 2005 Leon Ho 1.3-9 -- Sync what we have changed on the branches - Wed Nov 24 2004 Harald Hoyer - - added post section to recreate the softlink in emul mode (bug 140739) - Mon Nov 15 2004 Phil Knirsch - Tiny correction of bug in new triggers - -* Mon Jan 24 2005 Leon Ho 1.3-8 -- Add support provide on lsb-core-* for each arch - -* Fri Jan 21 2005 Leon Ho 1.3-7 -- Add to support multiple LSB test suite version -- Add %endif in trigger postun - -* Thu Nov 11 2004 Phil Knirsch 1.3-6 -- Fixed invalid sln call for trigger in postun on ia64 (#137647) - -* Mon Aug 09 2004 Phil Knirsch 1.3-4 -- Bump release and rebuilt for RHEL4. - -* Thu Jul 24 2003 Matt Wilson 1.3-3 -- fix lsb ld.so name for ia64 (#100613) - -* Fri May 23 2003 Matt Wilson 1.3-2 -- use /usr/lib/lsb for install_initd, remove_initd - -* Fri May 23 2003 Matt Wilson 1.3-2 -- add ia64 x86_64 ppc ppc64 s390 s390x - -* Tue Feb 18 2003 Matt Wilson 1.3-1 -- 1.3 - -* Wed Sep 4 2002 Matt Wilson -- 1.2.0 - -* Fri Jun 21 2002 Tim Powers -- automated rebuild - -* Thu May 23 2002 Tim Powers -- automated rebuild - -* Wed Mar 27 2002 Matt Wilson -- addeed trigger on glibc to re-establish the ld-lsb.so.1 symlink in the - forced downgrade case. - -* Tue Mar 12 2002 Bill Nottingham -- add initscripts support - -* Thu Jan 24 2002 Matt Wilson -- Initial build. - diff --git a/redhat-lsb/redhat_lsb_trigger.c b/redhat-lsb/redhat_lsb_trigger.c deleted file mode 100644 index 8b47be7..0000000 --- a/redhat-lsb/redhat_lsb_trigger.c +++ /dev/null @@ -1,504 +0,0 @@ -#ifdef __sparc__ -register void *__thread_self __asm ("g7"); -#endif -#include -#include -#include -#include - -#if defined __i386__ -# define INTERNAL_SYSCALL_DECL(err) do { } while (0) -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - ({ \ - register unsigned int resultvar; \ - asm volatile ( \ - "movl %1, %%eax\n\t" \ - "int $0x80\n\t" \ - : "=a" (resultvar) \ - : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \ - (int) resultvar; }) -# define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned int) (val) >= 0xfffff001u) -# define ASMFMT_0() -# define ASMFMT_1(arg1) \ - , "b" (arg1) -# define ASMFMT_2(arg1, arg2) \ - , "b" (arg1), "c" (arg2) -# define ASMFMT_3(arg1, arg2, arg3) \ - , "b" (arg1), "c" (arg2), "d" (arg3) -#elif defined __x86_64__ -# define INTERNAL_SYSCALL_DECL(err) do { } while (0) -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ - ({ \ - unsigned long resultvar; \ - LOAD_ARGS_##nr (args) \ - LOAD_REGS_##nr \ - asm volatile ( \ - "syscall\n\t" \ - : "=a" (resultvar) \ - : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx"); \ - (long) resultvar; }) -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) -# define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned long) (val) >= -4095L) -# define LOAD_ARGS_0() -# define LOAD_REGS_0 -# define ASM_ARGS_0 -# define LOAD_ARGS_1(a1) \ - long int __arg1 = (long) (a1); \ - LOAD_ARGS_0 () -# define LOAD_REGS_1 \ - register long int _a1 asm ("rdi") = __arg1; \ - LOAD_REGS_0 -# define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1) -# define LOAD_ARGS_2(a1, a2) \ - long int __arg2 = (long) (a2); \ - LOAD_ARGS_1 (a1) -# define LOAD_REGS_2 \ - register long int _a2 asm ("rsi") = __arg2; \ - LOAD_REGS_1 -# define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2) -# define LOAD_ARGS_3(a1, a2, a3) \ - long int __arg3 = (long) (a3); \ - LOAD_ARGS_2 (a1, a2) -# define LOAD_REGS_3 \ - register long int _a3 asm ("rdx") = __arg3; \ - LOAD_REGS_2 -# define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3) -#elif defined __powerpc__ -# define INTERNAL_SYSCALL_DECL(err) long int err -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ - ({ \ - register long int r0 __asm__ ("r0"); \ - register long int r3 __asm__ ("r3"); \ - register long int r4 __asm__ ("r4"); \ - register long int r5 __asm__ ("r5"); \ - register long int r6 __asm__ ("r6"); \ - register long int r7 __asm__ ("r7"); \ - register long int r8 __asm__ ("r8"); \ - LOADARGS_##nr(name, args); \ - __asm__ __volatile__ \ - ("sc\n\t" \ - "mfcr %0\n\t" \ - : "=&r" (r0), \ - "=&r" (r3), "=&r" (r4), "=&r" (r5), \ - "=&r" (r6), "=&r" (r7), "=&r" (r8) \ - : ASM_INPUT_##nr \ - : "r9", "r10", "r11", "r12", \ - "cr0", "ctr", "memory"); \ - err = r0; \ - (int) r3; \ - }) -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) -# define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((void) (val), __builtin_expect ((err) & (1 << 28), 0)) -# define LOADARGS_0(name, dummy) \ - r0 = name -# define LOADARGS_1(name, __arg1) \ - long int arg1 = (long int) (__arg1); \ - LOADARGS_0(name, 0); \ - r3 = arg1 -# define LOADARGS_2(name, __arg1, __arg2) \ - long int arg2 = (long int) (__arg2); \ - LOADARGS_1(name, __arg1); \ - r4 = arg2 -# define LOADARGS_3(name, __arg1, __arg2, __arg3) \ - long int arg3 = (long int) (__arg3); \ - LOADARGS_2(name, __arg1, __arg2); \ - r5 = arg3 -# define ASM_INPUT_0 "0" (r0) -# define ASM_INPUT_1 ASM_INPUT_0, "1" (r3) -# define ASM_INPUT_2 ASM_INPUT_1, "2" (r4) -# define ASM_INPUT_3 ASM_INPUT_2, "3" (r5) -#elif defined __ia64__ -# define DO_INLINE_SYSCALL_NCS(name, nr, args...) \ - LOAD_ARGS_##nr (args) \ - register long _r8 asm ("r8"); \ - register long _r10 asm ("r10"); \ - register long _r15 asm ("r15") = name; \ - long _retval; \ - LOAD_REGS_##nr \ - __asm __volatile ("break 0x100000;;" \ - : "=r" (_r8), "=r" (_r10), "=r" (_r15) \ - ASM_OUTARGS_##nr \ - : "2" (_r15) ASM_ARGS_##nr \ - : "memory" ASM_CLOBBERS_##nr); \ - _retval = _r8; -# define INTERNAL_SYSCALL_DECL(err) long int err -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ - ({ \ - DO_INLINE_SYSCALL_NCS (name, nr, args) \ - err = _r10; \ - _retval; }) -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) -# define INTERNAL_SYSCALL_ERROR_P(val, err) (err == -1) -# define LOAD_ARGS_0() -# define LOAD_REGS_0 -# define LOAD_ARGS_1(a1) \ - long _arg1 = (long) (a1); \ - LOAD_ARGS_0 () -# define LOAD_REGS_1 \ - register long _out0 asm ("out0") = _arg1; \ - LOAD_REGS_0 -# define LOAD_ARGS_2(a1, a2) \ - long _arg2 = (long) (a2); \ - LOAD_ARGS_1 (a1) -# define LOAD_REGS_2 \ - register long _out1 asm ("out1") = _arg2; \ - LOAD_REGS_1 -# define LOAD_ARGS_3(a1, a2, a3) \ - long _arg3 = (long) (a3); \ - LOAD_ARGS_2 (a1, a2) -# define LOAD_REGS_3 \ - register long _out2 asm ("out2") = _arg3; \ - LOAD_REGS_2 -# define ASM_OUTARGS_0 -# define ASM_OUTARGS_1 ASM_OUTARGS_0, "=r" (_out0) -# define ASM_OUTARGS_2 ASM_OUTARGS_1, "=r" (_out1) -# define ASM_OUTARGS_3 ASM_OUTARGS_2, "=r" (_out2) -# define ASM_ARGS_0 -# define ASM_ARGS_1 ASM_ARGS_0, "3" (_out0) -# define ASM_ARGS_2 ASM_ARGS_1, "4" (_out1) -# define ASM_ARGS_3 ASM_ARGS_2, "5" (_out2) -# define ASM_CLOBBERS_0 ASM_CLOBBERS_1, "out0" -# define ASM_CLOBBERS_1 ASM_CLOBBERS_2, "out1" -# define ASM_CLOBBERS_2 ASM_CLOBBERS_3, "out2" -# define ASM_CLOBBERS_3 ASM_CLOBBERS_4, "out3" -# define ASM_CLOBBERS_4 ASM_CLOBBERS_5, "out4" -# define ASM_CLOBBERS_5 ASM_CLOBBERS_6, "out5" -# define ASM_CLOBBERS_6_COMMON , "out6", "out7", \ - /* Non-stacked integer registers, minus r8, r10, r15. */ \ - "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18", \ - "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", \ - "r28", "r29", "r30", "r31", \ - /* Predicate registers. */ \ - "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", \ - /* Non-rotating fp registers. */ \ - "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ - /* Branch registers. */ \ - "b6" -# define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON , "b7" -#elif defined __s390__ -# define INTERNAL_SYSCALL_DECL(err) do { } while (0) -# define INTERNAL_SYSCALL_DIRECT(name, err, nr, args...) \ - ({ \ - DECLARGS_##nr(args) \ - register long _ret asm("2"); \ - asm volatile ( \ - "svc %b1\n\t" \ - : "=d" (_ret) \ - : "i" (__NR_##name) ASMFMT_##nr \ - : "memory" ); \ - _ret; }) -# define INTERNAL_SYSCALL_SVC0(name, err, nr, args...) \ - ({ \ - DECLARGS_##nr(args) \ - register unsigned long _nr asm("1") = (unsigned long)(__NR_##name); \ - register long _ret asm("2"); \ - asm volatile ( \ - "svc 0\n\t" \ - : "=d" (_ret) \ - : "d" (_nr) ASMFMT_##nr \ - : "memory" ); \ - _ret; }) -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - (((__NR_##name) < 256) ? \ - INTERNAL_SYSCALL_DIRECT(name, err, nr, args) : \ - INTERNAL_SYSCALL_SVC0(name, err,nr, args)) -# define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned long) (val) >= -4095UL) -# define DECLARGS_0() -# define DECLARGS_1(arg1) \ - register unsigned long gpr2 asm ("2") = (unsigned long)(arg1); -# define DECLARGS_2(arg1, arg2) \ - DECLARGS_1(arg1) \ - register unsigned long gpr3 asm ("3") = (unsigned long)(arg2); -# define DECLARGS_3(arg1, arg2, arg3) \ - DECLARGS_2(arg1, arg2) \ - register unsigned long gpr4 asm ("4") = (unsigned long)(arg3); -# define ASMFMT_0 -# define ASMFMT_1 , "0" (gpr2) -# define ASMFMT_2 , "0" (gpr2), "d" (gpr3) -# define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4) -#elif defined __sparc__ -# ifndef __arch64__ -# define __INTERNAL_SYSCALL_STRING \ - "ta 0x10;" \ - "bcs,a 1f;" \ - " sub %%g0, %%o0, %%o0;" \ - "1:" -# define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6", \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ - "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ - "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ - "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ - "cc", "memory" -# else -# define __INTERNAL_SYSCALL_STRING \ - "ta 0x6d;" \ - "bcs,a,pt %%xcc, 1f;" \ - " sub %%g0, %%o0, %%o0;" \ - "1:" -# define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6", \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ - "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ - "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ - "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ - "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \ - "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ - "cc", "memory" -# endif -#define INTERNAL_SYSCALL_DECL(err) do { } while (0) -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - inline_syscall##nr(__INTERNAL_SYSCALL_STRING, __NR_##name, args) -#define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned long) (val) >= -515L) -# define inline_syscall0(string,name,dummy...) \ -({ \ - register long __o0 __asm__ ("o0"); \ - register long __g1 __asm__ ("g1") = name; \ - __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1) : \ - __SYSCALL_CLOBBERS); \ - __o0; \ -}) -# define inline_syscall1(string,name,arg1) \ -({ \ - register long __o0 __asm__ ("o0") = (long)(arg1); \ - register long __g1 __asm__ ("g1") = name; \ - __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0) : \ - __SYSCALL_CLOBBERS); \ - __o0; \ -}) -# define inline_syscall2(string,name,arg1,arg2) \ -({ \ - register long __o0 __asm__ ("o0") = (long)(arg1); \ - register long __o1 __asm__ ("o1") = (long)(arg2); \ - register long __g1 __asm__ ("g1") = name; \ - __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0), "r" (__o1) : \ - __SYSCALL_CLOBBERS); \ - __o0; \ -}) -# define inline_syscall3(string,name,arg1,arg2,arg3) \ -({ \ - register long __o0 __asm__ ("o0") = (long)(arg1); \ - register long __o1 __asm__ ("o1") = (long)(arg2); \ - register long __o2 __asm__ ("o2") = (long)(arg3); \ - register long __g1 __asm__ ("g1") = name; \ - __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \ - "0" (__g1), "1" (__o0), "r" (__o1), \ - "r" (__o2) : \ - __SYSCALL_CLOBBERS); \ - __o0; \ -}) -#elif defined __alpha__ -# define INTERNAL_SYSCALL(name, err_out, nr, args...) \ - INTERNAL_SYSCALL1(name, err_out, nr, args) -# define INTERNAL_SYSCALL1(name, err_out, nr, args...) \ - INTERNAL_SYSCALL_NCS(__NR_##name, err_out, nr, args) -# define INTERNAL_SYSCALL_NCS(name, err_out, nr, args...) \ -({ \ - long _sc_ret, _sc_err; \ - inline_syscall##nr(name, args); \ - err_out = _sc_err; \ - _sc_ret; \ -}) -# define INTERNAL_SYSCALL_DECL(err) long int err -# define INTERNAL_SYSCALL_ERROR_P(val, err) err -# define inline_syscall_clobbers \ - "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \ - "$22", "$23", "$24", "$25", "$27", "$28", "memory" -# define inline_syscall_r0_asm -# define inline_syscall_r0_out_constraint "=v" -# define inline_syscall0(name, args...) \ -{ \ - register long _sc_0 inline_syscall_r0_asm; \ - register long _sc_19 __asm__("$19"); \ - \ - _sc_0 = name; \ - __asm__ __volatile__ \ - ("callsys # %0 %1 <= %2" \ - : inline_syscall_r0_out_constraint (_sc_0), \ - "=r"(_sc_19) \ - : "0"(_sc_0) \ - : inline_syscall_clobbers, \ - "$16", "$17", "$18", "$20", "$21"); \ - _sc_ret = _sc_0, _sc_err = _sc_19; \ -} -# define inline_syscall1(name,arg1) \ -{ \ - register long _sc_0 inline_syscall_r0_asm; \ - register long _sc_16 __asm__("$16"); \ - register long _sc_19 __asm__("$19"); \ - \ - _sc_0 = name; \ - _sc_16 = (long) (arg1); \ - __asm__ __volatile__ \ - ("callsys # %0 %1 <= %2 %3" \ - : inline_syscall_r0_out_constraint (_sc_0), \ - "=r"(_sc_19), "=r"(_sc_16) \ - : "0"(_sc_0), "2"(_sc_16) \ - : inline_syscall_clobbers, \ - "$17", "$18", "$20", "$21"); \ - _sc_ret = _sc_0, _sc_err = _sc_19; \ -} -# define inline_syscall2(name,arg1,arg2) \ -{ \ - register long _sc_0 inline_syscall_r0_asm; \ - register long _sc_16 __asm__("$16"); \ - register long _sc_17 __asm__("$17"); \ - register long _sc_19 __asm__("$19"); \ - \ - _sc_0 = name; \ - _sc_16 = (long) (arg1); \ - _sc_17 = (long) (arg2); \ - __asm__ __volatile__ \ - ("callsys # %0 %1 <= %2 %3 %4" \ - : inline_syscall_r0_out_constraint (_sc_0), \ - "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17) \ - : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17) \ - : inline_syscall_clobbers, \ - "$18", "$20", "$21"); \ - _sc_ret = _sc_0, _sc_err = _sc_19; \ -} -# define inline_syscall3(name,arg1,arg2,arg3) \ -{ \ - register long _sc_0 inline_syscall_r0_asm; \ - register long _sc_16 __asm__("$16"); \ - register long _sc_17 __asm__("$17"); \ - register long _sc_18 __asm__("$18"); \ - register long _sc_19 __asm__("$19"); \ - \ - _sc_0 = name; \ - _sc_16 = (long) (arg1); \ - _sc_17 = (long) (arg2); \ - _sc_18 = (long) (arg3); \ - __asm__ __volatile__ \ - ("callsys # %0 %1 <= %2 %3 %4 %5" \ - : inline_syscall_r0_out_constraint (_sc_0), \ - "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \ - "=r"(_sc_18) \ - : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), \ - "4"(_sc_18) \ - : inline_syscall_clobbers, "$20", "$21"); \ - _sc_ret = _sc_0, _sc_err = _sc_19; \ -} -#endif - -#ifdef __i386__ -static int -is_ia64 (void) -{ - unsigned int fl1, fl2; - - /* See if we can use cpuid. */ - __asm__ ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;" - "pushl %0; popfl; pushfl; popl %0; popfl" - : "=&r" (fl1), "=&r" (fl2) - : "i" (0x00200000)); - if (((fl1 ^ fl2) & 0x00200000) == 0) - return 0; - - /* Host supports cpuid. See if cpuid gives capabilities, try - CPUID(0). Preserve %ebx and %ecx; cpuid insn clobbers these, we - don't need their CPUID values here, and %ebx may be the PIC - register. */ - __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx" - : "=a" (fl1) : "0" (0) : "edx", "cc"); - if (fl1 == 0) - return 0; - - /* Invoke CPUID(1), return %edx; caller can examine bits to - determine what's supported. */ - __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx" - : "=d" (fl2), "=a" (fl1) : "1" (1) : "cc"); - return (fl2 & (1 << 30)) != 0; -} -#else -#define is_ia64() 0 -#endif - -int main (int argc, char **argv) -{ -/* redhat_lsb_trigger.c:428: warning: unused variable 'ret' */ -/* long ret; */ - INTERNAL_SYSCALL_DECL (err); - char lsbsover[] = LSBSOVER; - char *LSBVER, *p = lsbsover; - while ((LSBVER = strtok (p, " \t")) != NULL) - { - char buf[sizeof LSBLDSO + 1 + strlen (LSBVER)]; - p = buf; - p = mempcpy (p, LSBLDSO, sizeof LSBLDSO - 1); - *p++ = '.'; - strcpy (p, LSBVER); - if (is_ia64 ()) - INTERNAL_SYSCALL (symlink, err, 2, "/emul/ia32-linux/lib/" LDSO, buf); - else - INTERNAL_SYSCALL (symlink, err, 2, LDSO, buf); - p = NULL; - } - INTERNAL_SYSCALL (exit, err, 1, 0); - return 110; -} - -int __libc_multiple_threads __attribute__((nocommon)); -int __libc_enable_asynccancel (void) { return 0; } -void __libc_disable_asynccancel (int x) { } -void __libc_csu_init (void) { } -void __libc_csu_fini (void) { } -pid_t __fork (void) { return -1; } -char thr_buf[65536]; - -#ifndef __powerpc__ - -/* /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib64/libc.a(libc-start.o): In function `__libc_start_main': - * * (.opd+0x10): multiple definition of `__libc_start_main' */ -int ___libc_start_main (int (*main) (int argc, char **argv), - int argc, char **argv, - void (*init) (void), void (*fini) (void), - void (*rtld_fini) (void), void * stack_end) -#else -struct startup_info -{ - void *sda_base; - int (*main) (int, char **, char **, void *); - int (*init) (int, char **, char **, void *); - void (*fini) (void); -}; - -/* /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib64/libc.a(libc-start.o): In function `__libc_start_main': - * (.opd+0x10): multiple definition of `__libc_start_main' */ -int ___libc_start_main (int argc, char **argv, char **ev, - void *auxvec, void (*rtld_fini) (void), - struct startup_info *stinfo, - char **stack_on_entry) -#endif -{ -#if defined __ia64__ || defined __powerpc64__ - register void *r13 __asm ("r13") = thr_buf + 32768; - __asm ("" : : "r" (r13)); -#elif defined __sparc__ - register void *g6 __asm ("g6") = thr_buf + 32768; - __thread_self = thr_buf + 32768; - __asm ("" : : "r" (g6), "r" (__thread_self)); -#elif defined __s390__ && !defined __s390x__ - __asm ("sar %%a0,%0" : : "d" (thr_buf + 32768)); -#elif defined __s390x__ - __asm ("sar %%a1,%0; srlg 0,%0,32; sar %%a0,0" : : "d" (thr_buf + 32768) : "0"); -#elif defined __powerpc__ && !defined __powerpc64__ - register void *r2 __asm ("r2") = thr_buf + 32768; - __asm ("" : : "r" (r2)); -#endif -#ifdef __powerpc__ - argc = (long)*stack_on_entry; - argv = stack_on_entry + 1; -#endif - main (argc, argv); - return 110; -} diff --git a/redhat-lsb/utils/README b/redhat-lsb/utils/README deleted file mode 100644 index 60051c4..0000000 --- a/redhat-lsb/utils/README +++ /dev/null @@ -1,43 +0,0 @@ -* Two Databases -** LSB db - o Mysql database - o How to create LSB db? pls reference: - https://wiki.linuxfoundation.org/en/SpecDatabaseUsage - o Table names and table schemata, pls reference: - https://wiki.linuxfoundation.org/en/SpecDatabaseSchema - https://wiki.linuxfoundation.org/en/LSB_Elements_Schema - o we can query LSB db to get commands and libraries of a submodule - -** db from yum repo - o SQLite database, command sqlite3 works well - o we need package.sqlite and filelists.sqlite. You can download - them from one of Fedora mirror servers. Pls reference: - http://mirrors.fedoraproject.org/publiclist/ - o from filelists.sqlite, we can get package id by a command name - or library .so name - o we can get package name, version, group, provides, etc. from - primary.sqlite by package id. - -** put the two database together - we get a command name or library .so name, then we ask - filelists.sqlite and primary.sqlite to get the package - name. - -* Two Tools - o Tools in 'specdb' directory work with LSB database. - These tools source config file 'specdb/control' - o Tools in 'repodb' directory work with repo database - o Pls reference '-h' or '--help' option of commands - o repodb tools output results on stdout in one line if - find a match package, others output the command or library - name to stderr. So, it's easy to process the command - output. - o repodb tools always output more packages, you need manually - remove the unwanted one. - -* Why Not Generate Dependencies automatically? - o LSB has more and more submodules - o we need support more than one architectures - o generating dependencies automatically, make spec file full of 'ifarch', - and we will get a long and complicated spec file. - o generating dependencies manually is not difficult diff --git a/redhat-lsb/utils/repodb/pl2pkg.pl b/redhat-lsb/utils/repodb/pl2pkg.pl deleted file mode 100755 index d657064..0000000 --- a/redhat-lsb/utils/repodb/pl2pkg.pl +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; -use feature qw(say); -use Getopt::Long; -use DBI; - -use Cwd qw(abs_path getcwd); -use File::Basename; -use File::Temp qw(tempdir); -use Config::IniFiles; - -#set up autoflush -$| = 1; -$ENV{LANG} = 'C'; - -sub usage; -sub clean_when_exit; -sub when_get_SIGINT; - -my $default_SIGINT_func = $SIG{INT}; -$SIG{INT} = \&when_get_SIGINT; - -my ( $help, $like ) = qw( 0 0 ); -my ( $sucess, $failed, ) = qw( 0 1 ); -my ( $dbh, ) =qw(); -my ( $db_source, %attr ); -my ( $filelist, $pkg, ) = ( '', '', ); -my $st = ''; -my ( $rf_pkg, ) = ( '', '', ); -my $pkg_found = 0; - -GetOptions( - 'help' => \$help, - 'like' => \$like, - 'pkg=s' => \$pkg, - 'filelist=s' => \$filelist, - -); - -%attr = ( - RaiseError => 1, - AutoCommit => 1, - PrintError => 1, -); - -if ($help) { - usage; - goto EXIT; -} - -if ( -e $pkg && -r $pkg ) { - $db_source = 'dbi:SQLite:' . $pkg; - $dbh = DBI->connect( $db_source, '', '', \%attr ) - or die "Failed to connect $pkg: $!"; - if ( !defined( $dbh ) ) { - say STDERR 'Failed to connect ' . $pkg . ': $!'; - goto FAILED; - } -} -else { - say STDERR "$pkg: can not be open"; - goto FAILED; -} - -foreach my $pp (@ARGV) { - $pkg_found = 0; - my ( $pkg, $pkgKey, $provides ) = qw(); - $st = ''; - $st .= 'select provides.name, provides.pkgKey, '; - $st .= 'packages.name '; - $st .= 'from provides '; - $st .= 'left join packages '; - $st .= 'where provides.pkgKey = packages.pkgKey '; - $st .= 'and ( '; - if ($like) { - $st .= 'provides.name like ' . "'%$pp%' "; - } else { - $st .= 'provides.name = ' . "'$pp' "; - } - $st .= ' ) '; - $rf_pkg = $dbh->selectall_arrayref($st); - foreach my $row (@$rf_pkg) { - $pkg_found = 1; - $provides=$row->[0]; - $pkgKey=$row->[1]; - $pkg=$row->[2]; - if ($like) { - say $pkg . ' - ' . $pkgKey . ' - ' . $pp . ' - ' . $provides; - } else { - say $pkg . ' - ' . $pkgKey . ' - ' . $provides; - } - } - say STDERR $pp if (!$pkg_found); -} - -EXIT: -clean_when_exit; -exit $sucess; -FAILED: -clean_when_exit; -exit $failed; - -sub clean_when_exit { - $dbh->disconnect if ( defined( $dbh ) ); -} - -sub when_get_SIGINT { - clean_when_exit; - $SIG{INT} = \&$default_SIGINT_func; - &$default_SIGINT_func; - goto FAILED; -} - -sub usage { - say <<'EOF' -USAGE - pl2pkg.pl --pkg db provides - -DESCRIPTION - pl2pkg output format as follows: - when enable --like: - pkg - pkgKey - pp -- provides - when disable --like: - pkg - pkgKey - provides - -OPTIONS - --help => display this help page - --like => use 'like' replace of '=' in sql - --pkg pkg => give the repo package database - -EXAMPLE - ./pl2pkg.pl --pkg primary.sqlite ls bash - ./pl2pkg.pl --pkg primary.sqlite 'Perl(strict)' 'Perl(warnings)' - -REPORT BUG -Pls report bugs to xning@redhat.com. -EOF -} diff --git a/redhat-lsb/utils/repodb/pp2pkg.pl b/redhat-lsb/utils/repodb/pp2pkg.pl deleted file mode 100755 index d6e9e62..0000000 --- a/redhat-lsb/utils/repodb/pp2pkg.pl +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; -use feature qw(say); -use Getopt::Long; -use DBI; - -use Cwd qw(abs_path getcwd); -use File::Basename; -use File::Temp qw(tempdir); -use Config::IniFiles; - -#set up autoflush -$| = 1; -$ENV{LANG} = 'C'; - -sub usage; -sub clean_when_exit; -sub when_get_SIGINT; - -my $default_SIGINT_func = $SIG{INT}; -$SIG{INT} = \&when_get_SIGINT; - -my ($help) = 0; -my ( $sucess, $failed, ) = qw( 0 1 ); -my ( @dbh, @db ); -my ( $db_source, %attr ); -my ( $filelist, $pkg, ) = ( '', '', ); -my ( $pkgKey, ) = ( '', ); - -GetOptions( - 'help' => \$help, - 'pkg=s' => \$pkg, - 'filelist=s' => \$filelist, -); - -$db[0] = $filelist; -$db[1] = $pkg; - -%attr = ( - RaiseError => 1, - AutoCommit => 1, - PrintError => 1, -); - -if ($help) { - usage; - goto EXIT; -} - -foreach ( 0 .. $#db ) { - if ( -e $db[$_] ) { - if ( -f $db[$_] and -r $db[$_] ) { - $db_source = 'dbi:SQLite:' . $db[$_]; - $dbh[$_] = DBI->connect( $db_source, '', '', \%attr ) - or die "Failed to connect $db[$_]: $!"; - goto FAILED if ( !defined( $dbh[$_] ) ); - } - else { - say STDERR "$db[$_]: can not be open"; - goto FAILED; - } - } - else { - say STDERR "filelist db do not exists" if ( $_ == 0 ); - say STDERR "pkg db do not exists" if ( $_ == 1 ); - goto FAILED; - } -} - -foreach my $n (@ARGV) { - my $statement = ''; - my ( $rf_file, $rf_pkg ) = qw(); - my ( $pkg, $pkg_grp, $pkgKey, $dir, @files, @types, ) = qw(); - my ( $n_dir, $n_file) = qw(); - my $pkg_found = 0; - $n_dir=dirname $n; - $n_file=basename $n; - $statement .= 'select filelist.pkgKey, filelist.dirname, '; - $statement .= 'filelist.filenames, filelist.filetypes '; - $statement .= 'from filelist '; - $statement .= 'where '; - $statement .= '( filenames = "' . $n_file . '" '; - $statement .= 'or filenames like "' . $n_file . '/%" '; - $statement .= 'or filenames like "%/' . $n_file . '/%" '; - $statement .= 'or filenames like "%/' . $n_file . '") '; - if ($n_dir =~ m!^/!mx) { - $statement .= 'and filelist.dirname = "' . $n_dir . '" '; - } -# say $statement; - $rf_file = $dbh[0]->selectall_arrayref($statement) - or die "failed to execute \"$statement\": $!"; -# say 'partial path name: ' . $n; - foreach my $row (@$rf_file) { - $pkgKey = $row->[0]; - $dir = $row->[1]; - @files = split m!/!, $row->[2]; - @types = split m!!, $row->[3]; - $files[ $#files + 1 ] = '' if ( $row->[2] =~ m!/$!mx ); - - if ( $#files == $#types ) { - foreach my $inx ( 0 .. $#files ) { - next if ($types[$inx] eq 'd'); - if ($files[$inx] eq $n_file) { - $pkg_found = 1 if ( !$pkg_found ); - $statement = ''; - $statement .= 'select packages.pkgKey, packages.name, '; - $statement .= 'packages.rpm_group, packages.rpm_packager '; - $statement .= 'from packages '; - $statement .= 'where packages.pkgKey = ' . $pkgKey . ' '; - $statement .= ''; - $rf_pkg = $dbh[1]->selectall_arrayref($statement) - or die "failed to execute \"$statement\": $!"; - if ( ( scalar @$rf_pkg ) != 1 ) { - say STDERR $pkgKey - . ': more than one packages have this id'; - goto FAILED; - } - $pkg = $rf_pkg->[0]->[1]; - $pkg_grp = $rf_pkg->[0]->[2]; - say '"' . $pkg_grp . '"' . ' - ' . $pkg . ' - ' - . $types[$inx] . ' - ' - . $dir . '/' - . $files[$inx] . ' - ' . ${n}; - } - } - } - else { - my $errstr = 'pkgKey ' . $pkgKey; - $errstr .= ': files and types not one-to-one: '; - $errstr .= $#files . ' - ' . $#types; - say STDERR $errstr; - goto FAILED; - } - } - say STDERR $n if (!$pkg_found); - next; -} - -EXIT: -clean_when_exit; -exit $sucess; -FAILED: -clean_when_exit; -exit $failed; - -sub clean_when_exit { - for ( 0 .. $#db ) { - $dbh[$_]->disconnect if ( defined( $dbh[$_] ) ); - } -} - -sub when_get_SIGINT { - clean_when_exit; - $SIG{INT} = \&$default_SIGINT_func; - &$default_SIGINT_func; - goto FAILED; -} - -sub usage { - say <<'EOF' -USAGE - pp2pkg.pl --pkg pkg --filelist filelist ppname - -DESCRIPTION - pp2pkg.pl output format as follows: - rpm group - package name - file type - match file - ppname - -OPTIONS - --help => display this help page - --pkg pkg => give the repo package database - --filelist filelist => give the repo filelist database - -EXAMPLE - ./pp2pkg --pkg primary.sqlite --filelist filelists.sqlite ls cmp - -REPORT BUG -Pls report bugs to xning@redhat.com. -EOF -} diff --git a/redhat-lsb/utils/specdb/control b/redhat-lsb/utils/specdb/control deleted file mode 100644 index 5edee9b..0000000 --- a/redhat-lsb/utils/specdb/control +++ /dev/null @@ -1,8 +0,0 @@ -#mysql settings -lsbdbhost=localhost -lsbdbport=3306 -lsbdbuser=lsbadmin -lsbdbpassword=redhat-lsb -lsbdb=lsb -mysql_cmd="mysql --host ${lsbdbhost} --port ${lsbdbport} --user ${lsbdbuser} \ --D ${lsbdb} --password=${lsbdbpassword} --batch -N -e" diff --git a/redhat-lsb/utils/specdb/mkarch b/redhat-lsb/utils/specdb/mkarch deleted file mode 100755 index 6131444..0000000 --- a/redhat-lsb/utils/specdb/mkarch +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) - -. control - -function usage { - cat <&2 -USAGE - $(basename $0) -EOF -} -if [ $# -eq 0 ];then - lsbdb=' -select Aname from Architecture order by Aname -' - ${mysql_cmd} "${lsbdb}" - exit 0 -else - usage - exit 1 -fi diff --git a/redhat-lsb/utils/specdb/mkcmd b/redhat-lsb/utils/specdb/mkcmd deleted file mode 100755 index 50191ec..0000000 --- a/redhat-lsb/utils/specdb/mkcmd +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) -. control -function usage { - cat <&2 -USAGE - $(basename $0) -h - $(basename $0) --help - $(basename $0) submod lsbver -EOF -} - -if [ $# -eq 0 -o $# -eq 1 ];then - usage - exit 1 -elif [ $# -eq 2 ];then - submod=$1 - lsbver=$2 - select_st=' -select cmd from -( -( -select SMname, Cname as cmd, Ccandidatefor, -Cdeprecatedsince, SMCappearedin, SMCwithdrawnin -from Command -left join SModCmd on Cid = SMCcid -left join SubModule on SMCsmid = SMid -where SMname is not NULL -and Cpath is NULL -and ( Cbuiltin is NULL or strcmp (Cbuiltin, "No") = 0 ) -) -union -( -select "LSB_Others" as SMname, Cname as cmd, Ccandidatefor, -Cdeprecatedsince, SMCappearedin, SMCwithdrawnin -from Command -left join SModCmd on Cid = SMCcid -left join SubModule on SMCsmid = SMid -where SMname is NULL -and Cpath is NULL -and ( Cbuiltin is NULL or strcmp (Cbuiltin, "No") = 0 ) -) -union -( -select SMname, Cpath as cmd, Ccandidatefor, -Cdeprecatedsince, SMCappearedin, SMCwithdrawnin -from Command -left join SModCmd on Cid = SMCcid -left join SubModule on SMCsmid = SMid -where SMname is not NULL -and Cpath is not NULL -and ( Cbuiltin is NULL or strcmp (Cbuiltin, "No") = 0 ) -) -union -( -select "LSB_Others" as SMname, Cpath as cmd, Ccandidatefor, -Cdeprecatedsince, SMCappearedin, SMCwithdrawnin -from Command -left join SModCmd on Cid = SMCcid -left join SubModule on SMCsmid = SMid -where SMname is NULL -and Cpath is not NULL -and ( Cbuiltin is NULL or strcmp (Cbuiltin, "No") = 0 ) -) -) as ModCmd -where 1 = 1 -' - where_st=" -and ( strcmp (SMname, '${submod}' ) = 0 ) -and ( Ccandidatefor is NULL - or Ccandidatefor <= $lsbver - or strcmp ( Ccandidatefor, 'Unknown' ) != 0 ) -and ( SMCappearedin is not NULL - and strcmp ( SMCappearedin, '' ) != 0 - and SMCappearedin <= $lsbver ) -and ( SMCwithdrawnin is NULL - or SMCwithdrawnin > $lsbver ) -order by SMname,cmd -" - ${mysql_cmd} "${select_st} ${where_st}" - exit 0 -else - echo 'too many options' >&2 - usage - exit 1 -fi diff --git a/redhat-lsb/utils/specdb/mkheader b/redhat-lsb/utils/specdb/mkheader deleted file mode 100755 index 6094799..0000000 --- a/redhat-lsb/utils/specdb/mkheader +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) - -. control - -function usage { - cat <&2 -USAGE - $(basename $0) lsbver - $(basename $0) -h - $(basename $0) --help -EOF -} - -if [ $# -eq 0 ];then - usage - exit 1 -elif [ $# -eq 1 ];then - if [ "$1" = "-h" -o "$1" = "--help" ];then - usage - exit 1 - fi - lsbver=$1 - select_st=' -select Hname from -( -select Hname, Hcandidatefor, -Happearedin, Hwithdrawnin -from Header -) as header -where 1 = 1 -' -where_st=" -and ( Hcandidatefor is NULL - or Hcandidatefor <= $lsbver - or strcmp ( Hcandidatefor, 'Unknown' ) != 0 ) -and ( Happearedin is not NULL - and strcmp ( Happearedin, '' ) - and Happearedin <= $lsbver ) -and ( Hwithdrawnin is NULL - or Hwithdrawnin > $lsbver ) -order by Hname -" - -${mysql_cmd} "${select_st} ${where_st}" - exit 0 -else - echo 'error: too many options' >&2 - usage - exit 1 -fi diff --git a/redhat-lsb/utils/specdb/mkil b/redhat-lsb/utils/specdb/mkil deleted file mode 100755 index 878d1e5..0000000 --- a/redhat-lsb/utils/specdb/mkil +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -#Interpreted Language - -cd $(dirname $0) - -. control - -function usage { - cat <&2 -USAGE - $(basename $0) -h - $(basename $0) --help - $(basename $0) lsbver -EOF -} - -if [ $# -eq 0 -o $# -gt 1 -o "$1" = '-h' -o "$1" = '--help' ];then - usage - exit 1 -fi - -lsbver=$1 -select_stm=' -select ILname from InterpretedLanguage -' -where_stm=" -where ( ILappearedin is not NULL - and strcmp ( ILappearedin, '' ) != 0 - and ILappearedin <= ${lsbver} ) -and ( ILwithdrawnin is NULL - or ILwithdrawnin > ${lsbver} ) -" -${mysql_cmd} "${select_stm} ${where_stm}" diff --git a/redhat-lsb/utils/specdb/mkilm b/redhat-lsb/utils/specdb/mkilm deleted file mode 100755 index 0ca9ad4..0000000 --- a/redhat-lsb/utils/specdb/mkilm +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -#Interpreted Language Module - -cd $(dirname $0) - -. control - -function usage { - cat <&2 -USAGE - $(basename $0) -h - $(basename $0) --help - $(basename $0) interpretedlang lsbver -EOF -} - -if [ $# -ge 3 ];then - echo 'error: too many options' >&2 - usage - exit 1 -elif [ "$1" = '-h' -o "$1" = '--help' -o $# -eq 0 ];then - usage - exit 1 -fi -interpretedlang=$1 -lsbver=$2 - -select_stm='select ILMname, ILMversion -from InterpretedLanguageModule -left join InterpretedLanguage on ILMlanguage = ILid -' - -where_stm=" -where -strcmp ( ILname, '${interpretedlang}' ) = 0 -and ( ILMappearedin is not NULL - and strcmp ( ILMappearedin, '' ) != 0 - and ILMappearedin <= ${lsbver} ) -and ( ILMwithdrawnin is NULL - or ILMwithdrawnin > ${lsbver} ) -and ( ILappearedin is not NULL - and strcmp ( ILappearedin, '' ) - and ILappearedin <= ${lsbver} ) -and ( ILwithdrawnin is NULL - or ILwithdrawnin > ${lsbver} ) -" -#echo "${select_stm} ${where_stm}" -${mysql_cmd} "${select_stm} ${where_stm}" diff --git a/redhat-lsb/utils/specdb/mklib b/redhat-lsb/utils/specdb/mklib deleted file mode 100755 index 469abf3..0000000 --- a/redhat-lsb/utils/specdb/mklib +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) - -. control - -function usage { - cat <&2 -USAGE - $(basename $0) -h - $(basename $0) --help - $(basename $0) arch submod lsbver -EOF -} -if [ $# -eq 0 -o $# -eq 2 ];then - usage - exit 1 -elif [ $# -eq 1 ];then - if [ $1 = '-h' -o $1 = '--help' ];then - usage - exit 1 - else - echo "$1: wrong option" >&2 - exit 1 - fi -elif [ $# -eq 3 ];then - arch=$1 - submod=$2 - lsbver=$3 - select_st=' -select Lname, ALrunname -from Library -left join SModLib on Lid = SMLlid -left join ArchLib on Lid = ALlid -left join SubModule on SMLsmid = SMid -left join Architecture on ALaid = Aid -where 1 = 1 -' - where_st=" -and ( strcmp (Aname, '$arch') = 0 ) -and ( strcmp (SMname, '$submod') = 0 ) -and ( Lcandidatefor is NULL - or Lcandidatefor <= $lsbver - or strcmp ( Lcandidatefor, 'Unknown' ) != 0 ) -and ( ALappearedin is not NULL - and strcmp ( ALappearedin, '' ) != 0 - and ALappearedin <= $lsbver ) -and ( ALwithdrawnin is NULL - or ALwithdrawnin > $lsbver ) -and ( SMLappearedin is not NULL - and strcmp ( SMLappearedin, '' ) != 0 - and SMLappearedin <= $lsbver ) -and ( SMLwithdrawnin is NULL - or SMLwithdrawnin > $lsbver ) -" - ${mysql_cmd} "$select_st $where_st" - exit 0 -else - echo 'too many options' >&2 - usage - exit 1 -fi diff --git a/redhat-lsb/utils/specdb/mkmod b/redhat-lsb/utils/specdb/mkmod deleted file mode 100755 index 8a2b84a..0000000 --- a/redhat-lsb/utils/specdb/mkmod +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) -. control - -function usage { - cat <&2 -USAGE - $(basename $0) -EOF -} -if [ $# -eq 0 ];then - select_st=' -select Mname from Module order by Mname -' - ${mysql_cmd} "$select_st" - exit 0 -else - usage - exit 1 -fi diff --git a/redhat-lsb/utils/specdb/mksubmod b/redhat-lsb/utils/specdb/mksubmod deleted file mode 100755 index a8d1325..0000000 --- a/redhat-lsb/utils/specdb/mksubmod +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) -. control - -function usage { -cat <&2 -USAGE: - $(basename $0) -h - $(basename $0) --help - $(basename $0) - $(basename $0) mod lsbver -EOF - exit 1 -} - -if [ $# -eq 0 ];then - select_st='select SMname from SubModule' - { ${mysql_cmd} "${select_st}";echo "LSB_Others"; } | sort - exit 0 -elif [ $# -eq 1 ];then - if [ "$1" = '--help' -o "$1" = '-h' ];then - usage - else - echo "$1: wrong option" 1>&2 - exit 1 - fi -elif [ $# -eq 2 ];then - mod=$1 - lsbver=$2 - select_st=' -select SMname -from SubModule -left join ModSMod on SMid = MSMsmid -left join Module on MSMmid = Mid -where 1 = 1 -' - where_st=" -and ( strcmp (Mname, '$mod') = 0 ) -and ( SMmandatorysince is not NULL - and strcmp ( SMmandatorysince, '' ) != 0 - and SMmandatorysince <= $lsbver ) -and ( SMdeprecatedsince is NULL or SMdeprecatedsince > $lsbver ) -and ( MSMappearedin is not NULL -and strcmp ( MSMappearedin, '' ) != 0 -and MSMappearedin <= $lsbver ) -and ( MSMwithdrawnin is NULL or MSMwithdrawnin > $lsbver )" - -#echo "${select_st} ${where_st}" -${mysql_cmd} "${select_st} ${where_st}" - exit 0 -else - echo "wrong: too many options" >&2 - usage - exit 1 -fi diff --git a/redhat-lsb/utils/specdb/mkver b/redhat-lsb/utils/specdb/mkver deleted file mode 100755 index c86bf5d..0000000 --- a/redhat-lsb/utils/specdb/mkver +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) -. control - -function usage { - cat <&2 -USAGE - $(basename $0) -EOF -} -if [ $# -eq 0 ];then - select_st=' -select LVvalue from LSBVersion order by LVvalue -' -${mysql_cmd} "$select_st" - exit 0 -else - usage - exit 1 -fi