Browse Source

Stefan Fiedler:


			
			
				rocklinux
			
			
		
Stefan Fiedler 17 years ago
parent
commit
7f72e510ca
4 changed files with 49 additions and 18 deletions
  1. +4
    -3
      misc/tools-source/config_helper.c
  2. +4
    -0
      scripts/Config
  3. +20
    -3
      scripts/config.func
  4. +21
    -12
      scripts/functions

+ 4
- 3
misc/tools-source/config_helper.c

@ -357,19 +357,20 @@ int pkgfork(char *pkgname, char *xpkg, char** opt)
}
}
}
return 0;
}
int cfghlp_builtin(WORD_LIST *list)
{
char *args[10];
char *args[50];
int i;
for (i=0; i<9 && list; i++) {
for (i=0; i<50 && list; i++) {
args[i] = list->word->word;
list = list->next;
}
for (; i<10; i++) {
for (; i<50; i++) {
args[i] = "";
}

+ 4
- 0
scripts/Config

@ -139,6 +139,10 @@ if [ ! -e config/$config ] ; then
$0 -oldconfig $profile $nobashmod -cfg $config
fi
# From scripts/parse-config
base=$(pwd -P)
. scripts/functions
. scripts/config.func
mkdir -p config/$config

+ 20
- 3
scripts/config.func

@ -114,8 +114,17 @@ then
# unflag CORE
#
pkgfork() {
local script="\$5==\"$1\" {print;\$5=\"$1=$2\";"
shift; shift;
local pkg=$1 xpkg=$2 script ; shift 2
parse_desc package/*/$pkg/$pkg.desc P V
extraver=$( echo $desc_V 0 | cut -f2 -d" " )
script="\$5==\"$pkg\" {print; \$1=\"${desc_P%% *}\"; \
\$2=\"$( echo $desc_P | cut -f2 -d" ")\"; \
\$3=\"${desc_P##* }\"; \$5=\"$pkg=$xpkg\"; \
\$6=\"${desc_V%% *}\"; \$7=\"$extraver\";"
while [ -n "$1" ]; do
case "$1" in
status)
@ -177,8 +186,16 @@ else
return $ret
}
pkgfork() {
local pkg=$1 xpkg=$2 extraver ; shift 2
bprof pkgfork start
cfghlp pkgfork "$@"
parse_desc package/*/$pkg/$pkg.desc P V
extraver=$( echo $desc_V 0 | cut -f2 -d" " )
cfghlp pkgfork $pkg $xpkg status ${desc_P%% *} priority ${desc_P##* } \
stages $( echo $desc_P | cut -f2 -d" ") \
version ${desc_V%% *} extraversion $extraver $@
bprof pkgfork stop
}
fi

+ 21
- 12
scripts/functions

@ -1,3 +1,4 @@
#!/bin/bash
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
@ -346,27 +347,35 @@ postflist_libs() {
fi
}
# Parse the *.desc file. Use the description from PKG-DESC-FORMAT and
# save the tag data in $desc_*.
# parse_desc <desc file> [ <tag1> [ <tag2> [ ... ] ] ]
# Parse the *.desc file and save the tag data in $desc_*. If no tags are
# given, use all tags from PKG-DESC-FORMAT.
#
parse_desc() {
parser="$( which descparser )"
local descfilename=$1 ; shift
local parser="$( which descparser )" tag tagdata
[ -z "${parser}" ] && parser="$base/src/descparser"
if [ ! -x "${parser}" ] ; then
mkdir -p $base/src
cc -o $base/src/descparser $base/misc/tools-source/descparser.c
fi
[ ! -x "${parser}" ] && abort "Couldn't find \`descparser'! Please run ./scripts/Build-Tools!"
tag="`grep '^\[' $base/Documentation/Developers/PKG-DESC-FORMAT | \
sed 's, (\*),,; s,\] \[,|,g; s,\[,,; s,\],,;'`"
descfile="$( pkg="$pkg" xpkg="$xpkg" $parser < $1 )"
tag="$(
prog="" ; for x ; do
prog="$prog /\(^\||\)$x\(|\|$\)/ { p ; d } ;"
done
[ "$prog" != "" ] && prog="$prog d"
sed "/^\[/! d; s, (\*),,; s,\] \[,|,g; s,\[,,; s,\],,; $prog" \
$base/Documentation/Developers/PKG-DESC-FORMAT
)"
descfile="$( pkg="$pkg" xpkg="$xpkg" $parser < $descfilename )"
for tag in $tag ; do
tagdata="`echo "$descfile" | egrep "^\[($tag)\]" | \
cut -f2- -d']' | sed 's,^ ,,'`"
tag="`echo $tag | cut -f1 -d'|' | tr - _`"
if eval "[ -z \"\$desc_$tag\" ]"; then
eval "desc_$tag=\"\$tagdata\""
fi
tagdata="`sed -e"s,^\[\(${tag//|/\\|/}\)\] ,,p ; d" <<< "$descfile"`"
tag="`sed -e"s,|.*,, ; s,-,_,g" <<< "$tag"`"
eval "desc_$tag=\"\$tagdata\""
done
}

Loading…
Cancel
Save