Commit Graph

963 Commits

Author SHA1 Message Date
0da910fb46 lib/transaction.c (rpmRunTransactions): Ignore unavailable mount points instead of bailing out 2007-03-29 16:03:42 +00:00
Alexey Tourbin
2635799cae spec: updated dependencies on rpm-build-perl and rpm-build-python 2007-03-28 16:53:56 +04:00
Alexey Tourbin
d55243bd02 platform.in: removed perl macros 2007-03-28 16:52:33 +04:00
a78e49bdb2 Merge branch 'master' into mod 2007-03-27 23:15:44 +00:00
9eb6e27e8a 4.0.4-alt75
- Changed /mnt/* mountpoints handling to behave the same way
  as other mountpoints.
- Fixed support of filesystems with f_bsize==0.
- files.req.list: Added /etc/hooks directory.
2007-03-27 22:43:15 +00:00
94bc3f23e1 scripts/files.req.list: Add /etc/hooks 2007-03-27 22:36:28 +00:00
2aea31a78f lib/transaction.c (rpmRunTransactions): Drop "/mnt" support 2007-03-27 15:41:57 +00:00
8708708cac lib/fs.c (getFilesystemList): Drop "/mnt" support 2007-03-27 15:41:38 +00:00
Alexey Tourbin
85b13554f1 platform.in: moved the reset of python macros to rpm-build-python/python,
except for %__python_version, which is used in rpm-build-python.spec
2007-03-19 14:15:39 +03:00
Alexey Tourbin
0551d4e07e platform.in: removed python from %___build_pre, will be re-added in rpm-build-python/python.env 2007-03-19 13:36:52 +03:00
Alexey Tourbin
da04721ca4 platform.in: made %___build_pre modular, by sourcing /etc/rpm/macros.d/*.env
A few notes.

RPM uses only ^/etc/rpm/macros.d/[[:alnum:]_-]*[[:alnum:]]$
files to load macros.  The dot is not possible here, so there
will be no conflict between *.env and non-env files.

/etc/rpm/macros.d is now possibly misused, since the name implies
there must be macros.  However, *.env files can have macros, too.
The difference is that the macros from *.env files are expanded
and placed into %___build_pre, i.e. some rpm-tmp.* shell scripts.
Totally different semantics, but that's still about macros.

At least one *.env file is required to make 'cat *.env' happy.
I think I will updated the dependency on rpm-build-python,
which whill provide python.env file.
2007-03-19 13:01:04 +03:00
Alexey Tourbin
4d8a11acb6 rpmio/macro.c (rpmInitMacrofileGlob): require last character to be alnum
Rationale: I use 'set patchmode=-' in my ~/.vimrc.
2007-03-19 12:41:26 +03:00
Alexey Tourbin
434d4daed5 Merge branch 'master' of git.alt:/people/ldv/packages/rpm into mod
Conflicts:

	autodeps/linux.prov.in
	autodeps/linux.req.in
2007-03-18 12:16:52 +03:00
af0adf575e 4.0.4-alt74
- find-provides, find-requires:
  + Added support for files of type "Mono/.Net assembly" to repair
    Mono support when new file(1) is installed (#11088, ildar@).
2007-03-17 20:09:40 +00:00
c226f12904 autodeps/linux.{prov,req}.in: Handle files of type "Mono/.Net assembly" (#11088, ildar@) 2007-03-17 19:59:55 +00:00
Alexey Tourbin
3ba849e8f4 rpm-build.buildreq: added *.req.files and *.prov.files patterns 2007-03-17 15:23:06 +03:00
Alexey Tourbin
5909f93e30 find-package (FindByName): optimized awk script
It looks like that, unlike in perl, pattern matching in awk is very slow.
Perhaps they just don't have regexp engine hackers like Larry Wall or
Ilya Zakharevich (or, most recently, Yves Orton aka demerphq).

That's okay, since I can rewrite the script without pattern matching at all.
That is, I don't have to split each index line into dir+basename, because
I can prepare all valid absolute pathnames in advance.

Old speed:

$ time /usr/lib/rpm/shell.req -v /dev/stdin <<<`rpm -ql rpm-utils |sed -n 's|/usr/bin/||p'`
shell.req: add_changelog -> /usr/bin/add_changelog -> rpm-utils (via content index)
shell.req: buildreq -> /usr/bin/buildreq -> rpm-utils (via content index)
shell.req: cleanup_spec -> /usr/bin/cleanup_spec -> rpm-utils (via content index)
shell.req: compare_packages -> /usr/bin/compare_packages -> rpm-utils (via content index)
shell.req: filereq -> /usr/bin/filereq -> rpm-utils (via content index)
shell.req: packageof -> /usr/bin/packageof -> rpm-utils (via content index)
shell.req: packagereq -> /usr/bin/packagereq -> rpm-utils (via content index)
shell.req: rebuild_package -> /usr/bin/rebuild_package -> rpm-utils (via content index)
shell.req: rebuild_packages -> /usr/bin/rebuild_packages -> rpm-utils (via content index)
shell.req: rpmdups -> /usr/bin/rpmdups -> rpm-utils (via content index)
shell.req: rpmevrcmp -> /usr/bin/rpmevrcmp -> rpm-utils (via content index)
shell.req: rpmrdups -> /usr/bin/rpmrdups -> rpm-utils (via content index)
shell.req: rpmvercmp -> /usr/bin/rpmvercmp -> rpm-utils (via content index)
shell.req: stamp_spec -> /usr/bin/stamp_spec -> rpm-utils (via content index)
rpm-utils
/usr/lib/rpm/shell.req -v /dev/stdin <<<   5.37s user 0.11s system 96% cpu 5.683 total
$

New speed:

$ time /usr/lib/rpm/shell.req -v /dev/stdin <<<`rpm -ql rpm-utils |sed -n 's|/usr/bin/||p'`
shell.req: add_changelog -> /usr/bin/add_changelog -> rpm-utils (via content index)
shell.req: buildreq -> /usr/bin/buildreq -> rpm-utils (via content index)
shell.req: cleanup_spec -> /usr/bin/cleanup_spec -> rpm-utils (via content index)
shell.req: compare_packages -> /usr/bin/compare_packages -> rpm-utils (via content index)
shell.req: filereq -> /usr/bin/filereq -> rpm-utils (via content index)
shell.req: packageof -> /usr/bin/packageof -> rpm-utils (via content index)
shell.req: packagereq -> /usr/bin/packagereq -> rpm-utils (via content index)
shell.req: rebuild_package -> /usr/bin/rebuild_package -> rpm-utils (via content index)
shell.req: rebuild_packages -> /usr/bin/rebuild_packages -> rpm-utils (via content index)
shell.req: rpmdups -> /usr/bin/rpmdups -> rpm-utils (via content index)
shell.req: rpmevrcmp -> /usr/bin/rpmevrcmp -> rpm-utils (via content index)
shell.req: rpmrdups -> /usr/bin/rpmrdups -> rpm-utils (via content index)
shell.req: rpmvercmp -> /usr/bin/rpmvercmp -> rpm-utils (via content index)
shell.req: stamp_spec -> /usr/bin/stamp_spec -> rpm-utils (via content index)
rpm-utils
/usr/lib/rpm/shell.req -v /dev/stdin <<<   0.34s user 0.10s system 88% cpu 0.499 total
$

More than ten times faster, wow!
I didn't know regexp engine could be that slow, really.
2007-03-12 15:06:11 +03:00
Alexey Tourbin
b1b2fab77c find-package (FindPackage): require either absolute path or no slashes 2007-03-12 15:06:10 +03:00
Alexey Tourbin
9693c85f52 implemented symlinks.req
Consider R-devel package, which has its own private bin/ directory,
where it keeps certain scripts.

$ rpm -ql R-devel |grep libtool
/usr/lib/R/bin/libtool
$ rpm -ql R-devel |grep texi2dvi
/usr/lib/R/bin/texi2dvi
$

I replace some scripts, such as libtool, with wrappers:

$ tail -1 /usr/lib/R/bin/libtool
exec /usr/bin/libtool "$@"
$

R-devel now has a libtool dependency, generated by shell.req:

$ rpm -qR R-devel |grep libtool
libtool-common
$ rpm -qf /usr/bin/libtool
libtool-common-0.2-alt1
$

However, I want the very same dependency SIMPLY BY PLACING SYMBOLIC LINK
to /usr/bin/libtool.  My new script symlinks.req implements this idea.

It works as follows:

1) We check all absolute symbolic links, e.g. -> /usr/bin/libtool.
If symbolic link is absolute, we fetch its value and feed to FindPackage.
Note that FindPackage will first check whether e.g. /usr/bin/libtool is
available under RPM_BUILD_ROOT.

2) We also check all broken symbolic links, e.g. -> ../../../bin/libtool.
The fact that symbolic link is broken means that it cannot be resolved into
buildroot and otherwise must be resolved in the host system after the package
is installed, which is the dependency on where it would point to after install.

This means we must canonicalize the link value, strip RPM_BUILD_ROOT,
and then call FindPackage.  Here is what happens:

$ cd `mktemp -d`
$ RPM_BUILD_ROOT=$PWD
$ mkdir -p ./usr/lib/R/bin/
$ ln -s `relative /usr/bin/libtool /usr/lib/R/bin/libtool` $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
$ l $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
lrwxrwxrwx 1 at at 20 Mar  9 22:14 /tmp/.private/at/tmp.AHnBX26473/usr/lib/R/bin/libtool -> ../../../bin/libtool
$ [ -e $RPM_BUILD_ROOT/usr/lib/R/bin/libtool ] || echo broken
broken
$ readlink -vm $RPM_BUILD_ROOT/usr/lib/R/bin/libtool
/tmp/.private/at/tmp.AHnBX26473/usr/bin/libtool
$ to=`!!`; echo ${to#$RPM_BUILD_ROOT}
/usr/bin/libtool
$

And then FindPackage is called with "/usr/bin/libtool".

Now note that if FindPackage is not able to associate e.g. /usr/bin/libtool
with any particular rpm package, it will just place raw dependency on
/usr/bin/libtool.  So, this new type of dependencies is a bit dangerous:
basically for each really broken symbolic link there will be an unmet
dependency.  On the other hand, this can be viewed as a means of protection
from packages with really broken symbolic links.

If you are frightened with this brand new and dangerous type of dependencies,
please also note that this new type of dependencies is not much more dangerous
than absolute paths to executables in plain shell scripts.

$ /usr/lib/rpm/shell.req -v /dev/stdin <<</i/am/unmet
error: file /i/am/unmet: No such file or directory
shell.req: /dev/stdin: /i/am/unmet -> /i/am/unmet (raw, not found)
/i/am/unmet
$
2007-03-12 15:06:09 +03:00
Alexey Tourbin
ae6059ee04 lib.req.files: added "executable not executable" warning 2007-03-12 15:06:08 +03:00
Alexey Tourbin
371f6d1527 adapted pam.req and pam.prov 2007-03-12 15:06:07 +03:00
Alexey Tourbin
53b2853dff find-provides: deal with absolute and broken symbolic links 2007-03-12 15:06:06 +03:00
Alexey Tourbin
47fe2b2b3f find-package (FindByName): if the index search detects real conflict, try /usr/bin/which first
E.g. if the content index search detected something like

	/usr/bin/arpsend -> arpsend
	/usr/sbin/arpsend -> vzctl

then we should consult the host system first.  There's a good chance
that the right package, either arpsend or vzctl, IS installed, and
other candidate packages are NOT installed.  However, if /usr/bin/which
cannot find any candidate, we should reconsult the index again.
2007-03-12 15:06:05 +03:00
Alexey Tourbin
83e2b0cfe7 find-package: introduced RPM_FINDPACKAGE_PATH, which makes PATH search fully configurable
$ RPM_FINDPACKAGE_PATH=/usr/bin /usr/lib/rpm/shell.req -v /dev/stdin <<<arpsend
shell.req: /dev/stdin: arpsend indexed by: /usr/bin/arpsend -> arpsend, /usr/sbin/arpsend -> vzctl
shell.req: /dev/stdin: arpsend -> /usr/bin/arpsend -> arpsend (via content index)
arpsend
$ RPM_FINDPACKAGE_PATH=/usr/sbin /usr/lib/rpm/shell.req -v /dev/stdin <<<arpsend
shell.req: /dev/stdin: arpsend indexed by: /usr/sbin/arpsend -> vzctl, /usr/bin/arpsend -> arpsend
shell.req: /dev/stdin: arpsend -> /usr/sbin/arpsend -> vzctl (via content index)
vzctl
$

Also added %add_findpackage_path() and %set_findpackage_path() to platform.in.
2007-03-12 15:06:04 +03:00
Alexey Tourbin
f060b30e6c find-package (FindByName): enhanced content index part
Old behaviour:

$ /usr/lib/rpm/shell.req -v /dev/stdin <<<arpsend
shell.req: arpsend -> /usr/sbin/arpsend -> vzctl (via content index)
vzctl
$

New behaviour:

$ /usr/lib/rpm/shell.req -v /dev/stdin <<<arpsend
shell.req: /dev/stdin: arpsend indexed by: /usr/bin/arpsend -> arpsend, /usr/sbin/arpsend -> vzctl
shell.req: /dev/stdin: arpsend -> /usr/bin/arpsend -> arpsend (via content index)
arpsend
$ /usr/lib/rpm/shell.req -v /dev/stdin <<<ifup
shell.req: /dev/stdin: ifup indexed by: /sbin/ifup -> etcnet, /sbin/ifup -> net-scripts
shell.req: /dev/stdin: ifup -> /sbin/ifup -> /sbin/ifup (raw, ambiguous, via content index)
/sbin/ifup
$
2007-03-12 15:06:03 +03:00
Alexey Tourbin
b208a5725d find-package (FindByPath): enhanced content index part
There's a problem with content index:

$ /usr/lib/rpm/shell.req -v /dev/stdin <<</sbin/ifup
shell.req: /dev/stdin: /sbin/ifup -> etcnet (via content index)
etcnet
$ grep /sbin/ifup ~tmp/build/cache/contents/contents_index_bin
/sbin/ifup      etcnet
/sbin/ifup      net-scripts
$

After this change:

$ /usr/lib/rpm/shell.req -v /dev/stdin <<</sbin/ifup
shell.req: /dev/stdin: /sbin/ifup indexed by: etcnet net-scripts
shell.req: /dev/stdin: /sbin/ifup -> /sbin/ifup (raw, ambiguous, via content index)
/sbin/ifup
$

Also improved diagnostics and updated copyright statement.
2007-03-12 15:06:02 +03:00
Alexey Tourbin
5852768964 find-package (FindByName): enhanced /usr/bin/which part
There's been a few problems.

1) ~/bin should not be checked.

$ /usr/lib/rpm/shell.req -v /dev/stdin <<<vim
warning: no package provides /home/at/bin/vim
shell.req: /dev/stdin: vim not found (skip)
$

Fortunately /usr/bin/which has --skip-tilde option.

2) Check for /etc/alternatives was missing.

$ PATH=/bin:/usr/bin /usr/lib/rpm/shell.req -v /dev/stdin <<<vim
shell.req: /dev/stdin: vim -> /usr/bin/vim -> vim-X11
vim-console
vim-enhanced (via rpmdb)
vim-X11
vim-console
vim-enhanced
$

This is why FindByName should ultimately call FindByPath.
After this change, it works just fine:

$ scripts/shell.req.in -v /dev/stdin <<<vim
shell.req.in: /dev/stdin: vim -> /usr/bin/vim -> ... (via which)
shell.req.in: /dev/stdin: /usr/bin/vim -> /usr/bin/vim (alternative)
/usr/bin/vim
$

Also enabled /usr/bin/which --all option and added diagnostics
for really ambiguous cases.
2007-03-12 15:06:00 +03:00
Alexey Tourbin
8d2821443d find-package: factored FindByPath() and FindByName()
Actually if you think about it a few hours or so... you may come to
know that FindByName() should ultimately call FindByPath().  But this
will be the next commit.
2007-03-12 15:05:59 +03:00
Alexey Tourbin
f9a7e6dea2 find-package: if some path is provided by two or more rpmdb packages, output raw dependence
Here is the problem:

$ /usr/lib/rpm/shell.req -v /dev/stdin <<</usr/bin/openssl-config
shell.req: /dev/stdin: /usr/bin/openssl-config -> libssl-devel<STDERR-NEWLINE>
openssl (via rpmdb)
libssl-devel
openssl
$

Here is the solution:

$ /usr/lib/rpm/shell.req -v /dev/stdin <<</usr/bin/openssl-config
shell.req: /dev/stdin: /usr/bin/openssl-config provided by: libssl-devel openssl
shell.req: /dev/stdin: /usr/bin/openssl-config -> /usr/bin/openssl-config (raw)
/usr/bin/openssl-config
$

Note that this new behaviour now matches content index search:

$ grep openssl-config ~tmp/build/cache/contents/contents_index_bin
/usr/bin/openssl-config /usr/bin/openssl-config
$
2007-03-12 15:05:58 +03:00
Alexey Tourbin
b8c1488e12 shell.req: better error diagnostics 2007-03-12 15:05:57 +03:00
Alexey Tourbin
c33a51b79c factored files.req 2007-03-12 15:05:18 +03:00
Alexey Tourbin
80c40744e1 factored static.req 2007-03-11 15:00:35 +03:00
Alexey Tourbin
d87d2c8431 spec: removed http.req, sql.req, and sql.prov from rpm-build %files list 2007-03-11 15:00:34 +03:00
Alexey Tourbin
f0ec810739 factored lib.req and lib.prov
Moved old code from find-requires and find-provides to lib.req and lib.prov.
For some reason, also a few python-related lines was removed.

Adapted lib.req and lib.prov to work without RPM_BUILD_ROOT.

In lib.prov, simplified RPM_FINDPROV_LIB_PATH handling (replaced
`lookup_path "$dir" "$PATH"' with `[ -z "${PATH##* $dir *}" ]').

Added lib.req.files and lib.prov.files.
2007-03-11 15:00:33 +03:00
Alexey Tourbin
4a05dd411d scripts/ldd.in: adapted for empty RPM_BUILD_ROOT 2007-03-11 15:00:32 +03:00
Alexey Tourbin
6097bf7ee7 autodeps/linux.req.in: removed libperl stuff
Perl extensions are now automatically linked with libperl (starting with
rpm-build-perl >= 0.6.0-alt1, and natively starting with perl-devel >= 1:5.8.8-alt5).
2007-03-11 15:00:30 +03:00
Alexey Tourbin
767681ad03 adapted pkgconfig.req and pkgconfig.prov
Also enhanced the scripts by using pkg-config --print-errors, because
pkg-config is silent by default.  Also added checks for pkg-config exit
status and valid output.

Also changed the order: libdir/pkgconfig:datadir/pkgconfig instead of
datadir/pkgconfig:libdir/pkgconfig, according to pkg-config(1).
2007-03-11 15:00:29 +03:00
Alexey Tourbin
e69e87503e scripts/shell.req.in: fixed sed filter
See my previous commit.  It goes like this:

$ /usr/lib/rpm/shell.req -v /usr/bin/buildreq
shell.req: /usr/bin/buildreq: cat -> /bin/cat -> coreutils (via rpmdb)
shell.req: /usr/bin/buildreq: cmp -> /usr/bin/cmp -> diffutils (via rpmdb)
shell.req: /usr/bin/buildreq: function(Info) not found (skip)
shell.req: /usr/bin/buildreq: function(show_help) not found (skip)
shell.req: /usr/bin/buildreq: function(show_usage) not found (skip)
shell.req: /usr/bin/buildreq: rm -> /bin/rm -> coreutils (via rpmdb)
shell.req: /usr/bin/buildreq: sed -> /bin/sed -> sed (via rpmdb)
coreutils
diffutils
sed
$

I argue that this behaviour, i.e. function(Info) processing, is erroneous.
There are two reasons: 1) it is impossible to resolve function(Info) neither
via FindPackage nor via .provides.sh (the latter has just plain function names);
2) the fact that Info has been detected as function means that Info() function
is defined in the very same file, i.e. /usr/bin/buildreq.  This means that
function(Info) is self-provided dependency and thus should not be processed
at all.
2007-03-11 15:00:27 +03:00
Alexey Tourbin
ed12439edd scripts/find-package.in: added verbosity
Now it works like this:

$ /usr/lib/rpm/shell.req -v /usr/bin/buildreq
shell.req: /usr/bin/buildreq: cat -> /bin/cat -> coreutils (via rpmdb)
shell.req: /usr/bin/buildreq: cmp -> /usr/bin/cmp -> diffutils (via rpmdb)
shell.req: /usr/bin/buildreq: function(Info) not found (skip)
shell.req: /usr/bin/buildreq: function(show_help) not found (skip)
shell.req: /usr/bin/buildreq: function(show_usage) not found (skip)
shell.req: /usr/bin/buildreq: rm -> /bin/rm -> coreutils (via rpmdb)
shell.req: /usr/bin/buildreq: sed -> /bin/sed -> sed (via rpmdb)
coreutils
diffutils
sed
$

It looks like there's a problem with function(Info) here.
Verbosity is a good thing.
2007-03-11 15:00:25 +03:00
Alexey Tourbin
2fc12ef2fa factored shebang.req
This is the dependency generator for #! lines.
shebang.req.files makes sure that only executable scripts are processed.

Here is why I chose the "shebang" name.

From Jargon File (4.3.1, 29 Jun 2001) [jargon]:

  shebang /sh*-bang/ n. The character sequence "#!" that frequently
     begins executable shell scripts under Unix. Probably derived from "shell
     bang" under the influence of American slang "the whole shebang"
     (everything, the works).

$ cd /usr/lib/perl5/pod
$ grep -i sharpbang *
perltoc.pod:C<shar>, C<sharpbang>, C<shmattype>, C<shortsize>, C<shrpenv>, C<shsharp>,
$ grep -i shebang *
perl58delta.pod:The command-line options -s and -F are now recognized on the shebang
perlbs2000.pod:BS2000 POSIX doesn't support the shebang notation
perlfaq3.pod:batch file and codify it in C<ALTERNATE_SHEBANG> (see the
perlfaq7.pod:line in your perl script (the "shebang" line) does not contain the
perlfaq7.pod:where you expect it so you need to adjust your shebang line.
perlfaq8.pod:but my shebang line is not the path to perl, so the shell runs the
perlglossary.pod:=item shebang
perljp.pod: "shebang"ѹǡJperlѤscriptΤۤȤɤѹʤѲǽȻפޤ
perlplan9.pod:such as "#!/usr/local/bin/perl". This is known as a shebang
perlplan9.pod:shebang path from config information located in Plan 9
perlport.pod:sub-systems do not support the C<#!> shebang trick for script invocation.
perlport.pod:OS/390 will support the C<#!> shebang trick in release 2.8 and beyond.
perlrun.pod:C<ALTERNATE_SHEBANG> (see the F<dosish.h> file in the source
perltoc.pod:serialization, server, service, setgid, setuid, shared memory, shebang,
perlwin32.pod:Perl scripts on UNIX use the "#!" (a.k.a "shebang") line to
$
2007-03-11 15:00:24 +03:00
Alexey Tourbin
6dd0803866 adapted shell.req and shell.prov
1) added scripts/shell.req.files and scripts/shell.prov.files.
scripts/shell.req.files has new patterns for '/usr/bin/env bash'
and '/bin/ash'.

2) adapted scripts/shell.req.in and scripts/shell.prov.in
by using ArgvFileAction.  Also made them work with empty RPM_BUILD_ROOT.

Note: now shell.req produces dependencies from .provides.sh even
if the latter is inside RPM_BUILD_ROOT.  The reason is that .provides.sh
and the script can reside in two different subpackages (and otherwise,
rpm will optimize out the dependency).

3) removed corresponding old code from autodeps/linux.req.in
and autodeps/linux.prov.in.
2007-03-11 15:00:23 +03:00
Alexey Tourbin
2bce0efdba scripts/find-package.in: adapted for empty RPM_BUILD_ROOT and `sh -u'
Note: this is non-essential change, so I won't update copyright notice.
2007-03-11 15:00:22 +03:00
Alexey Tourbin
ac29fd993a scripts/functions: implemented ArgvFileAction()
This function provides "standard calling conventions" for req/prov methods.
The idea is that the shell script which implements a req/prov method need
not know how exactly it was called and how it should process its arguments.
Instead, it should impelment a function which takes exactly one argument,
which is filename, say MyReq, and finally just call

	ArgvFileAction MyReq "$@"

Standard input to argv conversion is then done automatically and transparently.

This will also enable scripts to process real argv arguments, if any,
instead of standard input (but fall back to standard input otherwise).
I also added --help and -v|--verbose options.  Surprisingly enough,
the latter increases RPM_SCRIPTS_DEBUG level.

Also added non-intrusive canonicalization of pathnames, hence the name
ArgvFileAction.  This is not going to affect rpm-build, but hopefully
this can help when the script is invoked manually.
2007-03-11 15:00:21 +03:00
Alexey Tourbin
9717c12847 autodeps/linux.{req,prov}.in: implemented method dispatcher
find-requires is now a dispatcher for /usr/lib/rpm/*.req scripts (methods).
find-provides is now a dispatcher for /usr/lib/rpm/*.prov scripts (methods).

The algorithm is basically as follows:

1) Filter input file list through TOPDIR and SKIPLIST patterns.

2) Run the resulting file list through file(1), which output is (per line)

<input-file-name><tab><optional-single-space><file-magic-type>

3) For each req/prov methods, there must be corresponding *.files
filter (e.g. /usr/lib/rpm/perl.req.files for /usr/lib/rpm/perl.req).
We feed file(1) output to this filter; the filter must print the list
of <input-files-name>s (per line) which will be processed with the
corresponding req/prov method.

4) Each req/prov method is invoked with corresponding file list on its
standard input.  The method must output valid rpm dependencies (per line)
or exit with non-zero code.

Notes:

Unlike find-requires, find-provides runs file(1) with -L option.

RPM_FINDREQ_DEFAULT_METHOD and RPM_FINDPROV_DEFAULT go away.
All available methods are run by default.

The old code has been kept.  I am going to remove it gradually
as I factor particular req/prov scripts.
2007-03-11 15:00:20 +03:00
Alexey Tourbin
844f420037 scripts/functions: implemented SetupMethods() and RunMethods()
I want some rpm scripts to be modular, so that e.g. adding new automatic
dependencies does not require ad hoc modifications.

The plan is as follows: I am going to manage methods.  Methods
are scripts which e.g. implement particular dependency detection.
The set of methods is defined by its suffix, so that /usr/lib/rpm/*.req
are all "req" methods (the "req" method set).

Hereby I provide two functions which abstract the usage of method sets.

1)
methods=$(SetupMethods SETID WANTED_METHODS)

Returns (prints) the list of active methods identified by SETID.
The SETID argument, according to the above, should be filename suffix.

Performs a check if all WANTED_METHODS are available.  WANTED_METHODS is
a space and/or comma separated list of method basenames, e.g. "perl" for
/usr/lib/rpm/perl.req.  The list of WANTED_METHODS is also interpreted
according to AutoReqProv tag rules, i.e. "yes" to enable all methods,
"no" to disable all methods, "noperl" to exclude "perl" etc.

When no methods are active, the output string is guaranteed to be empty.

2)
RunMethods SETID "$methods" [CMD...]

Executes method set scripts identified by SETID; the list of methods
"$methods" must be obtained from SetupMethods.  CMD can warp method script
execution.
2007-03-11 14:59:44 +03:00
Alexey Tourbin
c7a5905b8e scripts/functions: always validate non-empty RPM_BUILD_ROOT
I am going to make certain req/prov scripts work even with empty
RPM_BUILD_ROOT (so that I can analyze the dependencies within the
host system).  This probably means that I will remove ValidateBuildRoot
clause from the script.  However, since non-empty RPM_BUILD_ROOT still
must be valid, I place the check here.
2007-03-06 17:31:31 +03:00
Alexey Tourbin
1490bfdfd8 enhanced RPM_SCRIPTS_DEBUG support, implemented debug levels
Just setting -x is very noisy.  Here is a better plan.  I implement 3
debug levels: verbose (1), debug (2, implies verbose) and -x (3, implies
debug).  I move RPM_SCRIPTS_DEBUG test from scripts to scripts/functions,
as well as provide Verbose() and Debug() shell functions for use in scripts.

Furthermore, _scripts_debug macro is now automatically set when rpmbuild
is invoked with --verbose option.  Use -vv for debug and -vvv for -x.
2007-03-06 17:23:41 +03:00
c2248551ff 4.0.4-alt73
- Updated gendiff utility (Alexey Tourbin).
- Added hooks for Java autoreq facility (Damir Shayhutdinov).
- build/expression.c (doPrimary): Read closing parenthesis (Michael Schroeder).
- files.req.list: Added /etc/udev/rules.d firectory.
- Changed default nice change value from 10 to 8.
- Made nice change value configurable via %%nice_change macro.
2007-02-23 03:12:42 +03:00
5d54cdc0ec rpmqv.c (main): Make "nice change" value configurable via %nice_change macro; change default "nice change" value from 10 to 8 2007-02-23 00:12:39 +00:00
86ad8ff400 build/expression.c (doPrimary): Read closing parenthesis, patch from Michael Schroeder 2007-02-23 00:05:37 +00:00