Everywhere: Remove everything non-essential for "make clean all"

This commit removes everything not strictly necessary for running
"make clean all" inside jw-build.

packaging jw-devtest. This cuts the repo down from 24077 to 4725
lines of code.

The idea is to

1) Further remove bloat from the remaining bits

2) Re-add what's necessary to build and package other essential repos.

   The decision should be based on whether or not jw-build can also be
   useful in a non-janware context.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-11-14 15:02:56 +01:00
commit bc883deed4
32 changed files with 0 additions and 18851 deletions

View file

@ -1,8 +0,0 @@
#!/bin/bash
while true; do
make pkg-release-reinstall
[ $? = 0 ] && break
echo ================================================================================================================
sleep 60
done

View file

@ -1,111 +0,0 @@
#!/bin/bash
log()
{
echo "=== $@"
}
err()
{
log $@
}
fatal()
{
err $@
exit 1
}
lp()
{
scm.sh ls-files | grep "/$1$"
}
usage()
{
echo "$myname [-h] [-t target-dir ] [ package-name ]"
[ "$1" ] && exit $1
}
collect_changes()
{
local projs="$*"
local proj changed_path project_path p b lp
[ "$projs" ] || {
if [ -f .git ]; then
projs=`pwd | xargs basename`
projs="$proj-run $proj-devel"
else
projs="$(jw-pkg list | sed 's/-[0-9].*//')"
fi
}
for proj in $projs; do
(
changed_paths=`rpm -qV $proj | sed '
/^..5.*/ !d
s%^..5...... . /%/%
'`
[ "$changed_paths" ] || exit
project_path=$(echo $proj | sed 's/-run$\|-devel$//')
cd $project_path || {
err "Failed to change to $project_path"
exit
}
log "Handling project $proj"
for p in $changed_paths; do
[ -r $p ] || {
err "can't read $p"
continue
}
b=`basename $p`
lp=`lp "$b"`
[ "$lp" ] || {
err "$p is not in repository"
continue
}
nl=`lp "$b" | wc -l`
[ $nl -gt 1 ] && {
log $p is more than once in repository:
lp $b
continue
}
diff -q $lp $p >/dev/null 2>&1 && {
continue
}
log copying $p $lp
cp $p $lp
done
)
done
}
# -- here we go
set -- `getopt 'ht:' $*`
while [ "$1" != -- ]; do
case "$1" in
-h)
usage 0
;;
-t)
target="$2"
shift
;;
*)
usage 1
;;
esac
shift
done
shift
[ "$target" ] && {
cd $target || fatal "failed to change to target dir \"$target\""
}
collect_changes

View file

@ -1,117 +0,0 @@
#!/bin/bash
cat_header()
{
cat <<-EOT
====== Dummy-Titel ======
----
===== Links =====
----
* {{$namespace:$n, Stand `date +'%d.%m.%Y'`}}
===== Backlinks =====
----
{{backlinks>.}}
===== Annotierte Version =====
----
EOT
}
strip()
{
sed "s/^ *//; s/ *$//" | grep .
}
field()
{
grep "| *$2 *\(|\|$\)" $files | grep "pdfwiki\|binary" | cut -d\| -f$1 | strip
}
cmd_name_extern_2_intern()
{
field 3 "$1"
}
cmd_name_intern_2_extern()
{
field 2 "$1"
}
cmd_uploads()
{
cat $files | grep "pdfwiki\|binary" | cut -d\| -f3 | strip
}
cmd_milk_dirs()
{
local dirs="$@"
for d in $dirs; do
ls $d/* 2>/dev/null | while read f; do
l=`basename "$f"`
n=`cmd_name_extern_2_intern "$l"`
[ "$n" ] || {
echo "ignoring unknown file \"$l\""
continue
}
[ -e "$n" ] && {
echo "ignoring existing file \"$l\""
continue
}
type=$(field 1 "$l")
echo type=$type
case $type in
pdfwiki)
t=`echo $n | sed 's/\.[^.]*$//'`
txt="$t.txt"
[ -e "$txt" ] && {
echo "ignoring existing file \"$txt\""
continue
}
cp "$f" "tmp-$n"
pdftotext "tmp-$n"
pdfimages -png -j tmp-$n $n
rm -f $n-*.pnm
cat_header "$l" "$n" > $txt.tmp
cat tmp-$txt >> $txt.tmp
mv $txt.tmp $txt
mv tmp-$n $n
rm -f tmp-$txt
;;
binary)
cp "$f" "$n"
;;
*)
echo "ignoring file with unknown extension: \"$f\""
;;
esac
done
done
}
# ------------------------------------------------ here we go
files=files.txt
namespace=files:doc:extern
eval set -- `getopt -o hn: -l namespace: -- "$@"`
while [ "$1" != -- ]; do
case $1 in
-n|--namespace)
namespace="$2"
shift
;;
-h)
usage 0;;
*)
usage 1;;
esac
shift
done
shift
cmd="${1/-/_}"
shift
eval cmd_$cmd "$@"

View file

@ -1,33 +0,0 @@
#!/bin/sh
in=$1
if [ "$2" ]; then
out="$2"
else
out=`echo $1 | sed 's/\.\([^.]\+$\)/-greyed-out.\1/'`
fi
#convert -monochrome $in $out
#convert -monochrome -opaque \#e5e5e5 $in $out
#convert -modulate 100,40 $in $out
#convert +level 25% $in $out
#convert +level 30% $in $out
#convert -colorspace Gray $in $out
#convert +level 30% -colorspace Gray $in $out
convert -colorspace Gray +level 30% -brightness-contrast 35 $in $out
# TODO: overlay same image, 1px shifted down and right, with different gray level
# ------------------------------------------------
#convert small.miff -modulate 100,40 small-grey.miff
#montage -fill black -font $P/LucidaGrande.ttf -pointsize 10 -geometry +0+0 -label "${LABEL}" -background transparent small-grey.miff small-text.png
#composite -size 48x48 xc:$BGCOL -compose copy small-text.png mask.miff
#composite small-text.png -compose atop mask.miff apmask.miff
# ------------------------------------------------
#convert $in \( +clone -background black -shadow 75x0+0-5 \) \
# \( -clone 0 -alpha off -virtual-pixel black -motion-blur 0x3-90 -alpha on \) \
# -delete 0 -background none -layers merge +repage $out

View file

@ -1,159 +0,0 @@
#!/bin/bash
cfg_section()
{
ini_section "$inifile" $@
}
cfg_value()
{
ini_value "$inifile" $@
}
# -- here we go
echo "== running $0" "$@" >&2
export LANG=POSIX
dir=`dirname $0`
inifile="$1"
. $dir/ini-tools.sh
cat << EOT
format_depends()
{
echo "\$@" | sed 's/ */,/g; s/,\([><=]\+\),*/\1/g; s/, *,*/,/g; s/, *$//; s/^ *,//; s/\([><=]\+\)\([0-9.-]\+\)/ (\1\2) /g'
}
#changelog()
#{
# #dch -c /dev/stdout --create -v \$VERSION-\$RELEASE --package \$NAME
#cat << EOF
#\$NAME (\$VERSION-\$RELEASE) UNRELEASED; urgency=medium
#
# * Initial release. (Closes: #XXXXXX)
#
# -- Jan Lindemann <jan@janware.com> `date -R`
#
#EOF
#}
compat()
{
echo -n 9
}
control()
{
cat << EOF
Source: \$NAME
Maintainer: Jan Lindemann <jan@janware.com>
Section: `cfg_value global.group`
Priority: optional
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 9)
EOT
cfg_value global.subpackages | grep -q run && cat << EOT
Package: \$NAME-run
Architecture: any
Depends: \`format_depends "\${shlibs:Depends}, \${misc:Depends}, \$REQUIRES_RUN"\`
# untested:
Conflicts: \`format_depends "\$CONFLICTS_RUN"\`
Description: `cfg_value summary`
`cfg_value description | sed 's/^/ /'`
EOT
cfg_value global.subpackages | grep -q devel && cat << EOT
Package: \$NAME-devel
Architecture: any
Depends: \`format_depends "\$NAME-run = \$VERSION-\$RELEASE, \$REQUIRES_DEVEL"\`
# untested:
Conflicts: \`format_depends "\$CONFLICTS_DEVEL"\`
Description: \$NAME Development Package
Development tools for \$NAME-run
EOT
cat << EOT
EOF
}
copyright()
{
echo -n "Copyright (c) `date +'%Y'`, janware GmbH"
}
format()
{
echo "3.0 (quilt)"
}
rules()
{
cat << "EOF"
#!/usr/bin/make -f
# tip from https://pkg-perl.alioth.debian.org/debhelper.html
# PACKAGE = \$(firstword \$(shell dh_listpackages))
# TMP = \$(CURDIR)/debian/\$(PACKAGE)
NAME = \$(shell pwd | xargs basename | sed 's/-[0-9.-]\+//')
DEB_DIR = \$\$(pwd)/debian
ENV_PREFIX = \$\$(pwd)/debian/tmp/inst-root
EOF
echo INSTALL_LOG = \$INSTALL_LOG
cat << "EOF"
%:
EOF
echo -e "\tdh \$""@"
cat << EOF
override_dh_auto_test:
override_dh_installdirs:
@echo "running override_dh_installdirs ($@)"
#dh_installdirs
override_dh_auto_install:
@echo "running override_dh_auto_install ($@)"
mkdir -p \`dirname \$INSTALL_LOG\`
> \$INSTALL_LOG
\\\$(MAKE) ENV_PREFIX=\\\$(ENV_PREFIX) INSTALL_LOG=\\\$(INSTALL_LOG) install
PATH=$JWB_SCRIPT_DIR:\\\$(PATH) /bin/bash pkg.sh milk-install-log -p \\\$(ENV_PREFIX) -n \\\$(NAME) -t deb \$INSTALL_LOG \\\$(DEB_DIR)
dh_installdirs
override_dh_install:
dh_install --sourcedir=./debian/tmp/inst-root
override_dh_shlibdeps:
LD_LIBRARY_PATH=lib:\\\$(LD_LIBRARY_PATH) dh_shlibdeps
override_dh_auto_clean:
override_dh_compress:
EOF
}
mkdir -p debian
#dch --create --empty
cd debian
for file in compat control copyright format rules; do
test -e \$file && continue
\$file > \$file
done
chmod 755 rules
cd ..
dch --create --newversion \$VERSION-\$RELEASE --controlmaint --package \$NAME --force-distribution --distribution \$DISTRIBUTION "Release built by $0"
echo "Produced by $0, the output should be in the \"debian\" sub-directory."
EOT

View file

@ -1,168 +0,0 @@
#!/bin/bash
_cat()
{
sed 's/^ *|//'
}
cfg_section()
{
ini_section "$inifile" $@
}
cfg_value()
{
ini_value "$inifile" $@
}
cfg_escape()
{
sed 's/\\/\\\\/g; s/\$/\\$/g; s/`/\\`/g'
}
# unneeded but kept, because it might come in handy in the future
have_pkg()
{
echo "$subpackages" | grep -q "\(^[ ]*\|[ ]\+\)$1\([ ]\+\|$\)"
return $?
}
subpackage_description()
{
case $1 in
run)
echo "Runtime files"
;;
devel)
echo "Development files"
;;
esac
}
os_cascade()
{
# might want to run python3 path/to/projects.py --os=suse-tumbleweed os-cascade
# or turn this into a python script and use projects.py as a module.
if [ "$DISTRIBUTION" ]; then
echo os linux $DISTRIBUTION | sed 's/\([^-]\+\)-\([^-]\+\)/\1 \1-\2/g'
else
echo os linux
fi
}
# -- here we go
echo "== running $0" "$@" >&2
export LANG=POSIX
dir=`dirname $0`
inifile="$1"
. $dir/ini-tools.sh
subpackages=`cfg_value global.subpackages`
license=`cfg_value global.license`
[ "$license" ] || license="janware GmbH proprietary license"
vendor=`cfg_value global.vendor`
[ "$vendor" ] || vendor="janware GmbH"
url=`cfg_value global.url`
[ "$url" ] || url="https://janware.com"
_cat <<- EOT
|echo "%define debug_package %{nil}"
|# ---------------------------------------
|echo "Name: \$NAME"
|echo "Summary: `cfg_value summary`"
|echo "Version: \$VERSION"
|echo "Release: \$RELEASE"
|echo "License: $license"
|echo "Group: System/Libraries"
|[ -n "\$SOURCE" ] && echo "Source: \$SOURCE"
|echo "Vendor: $vendor"
|echo "URL: $url"
|echo "BuildRoot: /var/tmp/%{name}-buildroot"
|echo "Distribution: jw / openSUSE Tumbleweed"
|echo ""
|echo "%description"
|echo "`cfg_value description`"
|echo ""
|# ---------------------------------------
|echo "%prep"
|echo "%setup -q -n \$NAME-\$V"
|echo ""
|echo "%build"
|echo 'pwd'
|echo 'make config'
|echo 'make'
|echo ""
|echo "%install"
|echo 'rm -rf \$RPM_BUILD_ROOT'
|echo "export ENV_PREFIX=\\\$RPM_BUILD_ROOT"
|echo "export INSTALL_LOG=\$INSTALL_LOG"
|echo "mkdir -p \`dirname \$INSTALL_LOG\`"
|echo "> \$INSTALL_LOG"
|echo "make install"
|echo "export PATH=$JWB_SCRIPT_DIR:\\\$PATH"
|echo "/bin/bash pkg.sh milk-install-log -p \\\$ENV_PREFIX -n \$NAME -t rpm -s \\"$subpackages\\" \$INSTALL_LOG \`dirname \$INSTALL_LOG\`"
|echo "exit 0" # <- Cut short CentOS magic appended to install scriptlet, which would generate .pyo files and other cruft.
EOT
for p in $subpackages; do
P=${p^^}
_cat <<- EOT
|echo ""
|echo "# --------------------------------------- subpackage $p"
|echo ""
|echo "%package -n \$NAME-$p"
|echo "Summary: `cfg_value summary`"
|echo "Group: `cfg_value global.group`"
|[ "\$REQUIRES_$P" ] && echo "Requires: \$REQUIRES_$P"
|[ "\$CONFLICTS_$P" ] && echo "Conflicts: \$CONFLICTS_$P"
|[ "\$PROVIDES_$P" ] && echo "Provides: \$PROVIDES_$P"
|echo ""
EOT
descr=`subpackage_description $p`
if [ "$descr" ]; then
_cat <<- EOT
|echo ""
|echo "%description -n \$NAME-$p"
|echo "$descr"
EOT
fi
for stage in pre preun post postun; do
echo "== processing stage $stage: cfg_section pkg.$p.$stage" >&2
out=""
#for os in '' `os_cascade | sed 's/\(^\| \)/ ./g'`; do
for os in '' `os_cascade`; do
sec=pkg.$p.$stage
if [ "$os" ]; then
sec="$sec.$os"
head="\n# --- $os\n"
else
head=""
fi
cfg_section $sec | grep -q . || continue
out="$out$head`cfg_section $sec`"
done
if [ "$out" ]; then
echo -e "$out" >&2
_cat <<- EOT
|echo ""
|echo "%$stage -n \$NAME-$p"
EOT
echo "cat << EOT"
echo -e "$out" | cfg_escape
echo "EOT"
fi
done
_cat <<- EOT
|echo ""
|echo "%files -n \$NAME-$p -f \$INSTALL_LOG.\$NAME-$p"
|echo '%defattr (-, root, root)'
EOT
done

View file

@ -1,41 +0,0 @@
#!/bin/bash
log()
{
echo $@
}
err()
{
echo $@ >&2
}
fatal()
{
err $@
exit 1
}
cmd_list_projects()
{
local all_proj proj p
(
cd $projroot || fatal Failed to change to $projroot
all_proj=`find . -maxdepth 1 -mindepth 1 -type d`
for p in $all_proj; do
test -x $p || continue
test -r $p || continue
p=${p##./}
test -f $HOME/cvs-list.txt && grep -q "^$p$" $HOME/cvs-list.txt || continue
proj="$proj $p"
done
[ "$proj" ] && echo $proj
)
}
# ---------- here we go
cvsroot=/srv/cvs
projroot=$cvsroot/proj
cmd=${1/-/_}
shift
eval cmd_$cmd $@

View file

@ -1,189 +0,0 @@
#!/bin/bash
log_dpkg()
{
echo dpkg $@
/usr/bin/dpkg $@
}
run()
{
echo $@
eval $@
}
# to be used on debian prior to jessie
dpkg_verify()
{
local exitcode file pkg hashfile rfile phash hash
exitcode=0
for file in $*; do
pkg=`dpkg -S "$file" | cut -d: -f 1`
hashfile="/var/lib/dpkg/info/$pkg.md5sums"
if [ -s "$hashfile" ]; then
rfile=`echo "$file" | cut -d/ -f 2-`
phash=`grep -E "$rfile\$" "$hashfile" | cut -d\ -f 1`
hash=`md5sum "$file" | cut -d\ -f 1`
if [ "$hash" = "$phash" ]; then
echo "$file: ok"
else
echo "$file: CHANGED"
exitcode=1
fi
else
echo "$file: UNKNOWN"
exitcode=1
fi
done
return $exitcode
}
cmd_install()
{
local n=`basename $1`
n=`echo $n | sed "s/_[0-9.-]\+_amd64.deb//"`
/bin/bash $0 -q $n >/dev/null 2>&1 && {
fatal "$n is already installed (`/bin/bash $0 -q $n`)"
}
cmd_update $1
}
cmd_update()
{
$dpkg --dry-run -i $1 || fatal "Test-installation failed."
$dpkg -i $1 || fatal "Installation failed."
}
cmd_erase()
{
#$dpkg -r $1
$dpkg --purge $*
}
cmd_query()
{
[ "$query_cmds" ] && {
local cmd installed
local id=name
if echo $query_cmds | grep -q p; then
id=pkg
query_cmds=`echo $query_cmds | sed 's/p//'`
elif echo $query_cmds | grep -q f; then
id=file
query_cmds=`echo $query_cmds | sed 's/f//'`
fi
for cmd in $query_cmds; do
case $cmd in
V)
$dpkg --verify $1
;;
i)
case $id in
file)
$dpkg -I $1;;
name)
$dpkg -s $1;;
#run apt-cache show $1;;
pkg)
$dpkg -S $1;;
esac
;;
l)
case $id in
file)
echo blah
#$dpkg -p $1;;
;;
name)
$dpkg -L $1;;
pkg)
$dpkg -c $1;;
esac
;;
a)
$dpkg -l $1
;;
esac
done
return $?
}
local p=`echo $1 | sed 's/-[0-9.-]\+$//'`
local v=`echo $1 | sed "s/^$p-*//"`
local ip=`dpkg-query -W -f '${Package}' $p >/dev/null 2>&1`
[ $? != 0 -o -z "$ip" ] && exit 1
local iv=`dpkg-query -W -f '${Version}' $p >/dev/null 2>&1`
[ "$v" ] && {
[ "$v" != "$iv" ] && {
echo "tried $1, installed version is $iv" >&2
exit 1
}
}
echo $ip-$iv
return 0
}
usage()
{
echo "usage: $myname [-h] [... misc rpm options]"
[ "$1" ] && exit $1
}
fatal()
{
echo $@ >&2
exit 1
}
# -- here we go
myname=`basename $0`
dpkg=log_dpkg
cmd=""
set -- `getopt hqiUeVfapl "$@"`
while [ "$1" != -- ]; do
case $1 in
-h)
usage 0
;;
-q)
[ "$cmd" ] && usage 1
cmd=query
;;
-V|-f|-a|-p|-l)
[ "$cmd" ] && {
[ "$cmd" = query ] || usage 1
query_cmds="$query_cmds ${1:1:1}"
}
;;
-i)
[ "$cmd" ] && {
[ "$cmd" = query ] || usage 1
query_cmds="$query_cmds ${1:1:1}"
shift
continue
}
cmd=install
;;
-U)
[ "$cmd" ] && usage 1
cmd=update
;;
-e)
[ "$cmd" ] && usage 1
cmd=erase
;;
*)
usage 1
;;
esac
shift
done
shift
# [ $# != 1 ] && usage 1
[ "$cmd" ] || usage 1
eval cmd_\$cmd $*

View file

@ -1,201 +0,0 @@
#!/bin/sh
myname=`basename $0`
cwd=`pwd`
make_initrd_from_template()
{
uname_r=$1
target=$2
modules_dir=$3
template=$4
shift 4
mod_names="$*"
# set up work space
dir=`mktemp -d "/tmp/$myname""_XXXXXX"`
mkdir $dir/source
# unpack template and copy it
cat $template | (cd $dir/source; gunzip | cpio -i)
cp -rp $dir/source $dir/target
rm -rf $dir/target/lib/modules/*
# copy all modules both in template and kernel
(
cd $dir/source
find . -name '*.ko'
) | while read tmpl_relpath; do
mod_name=`basename $tmpl_relpath`
source_mod=`cd $modules_dir; find . -name $mod_name`
if [ ! "$source_mod" ]; then
echo "warning: module $mod_name not found in $modules_dir" >&2
# exit 1
else
mod_relpath=`dirname $source_mod`
target_path=$dir/target/lib/modules/$uname_r/$mod_relpath
echo "copying $mod_name from $mod_relpath to $target_path"
mkdir -p $target_path
cp -p $modules_dir/$source_mod $target_path
fi
done
# copy all explicitly specified modules
for mod_name in $mod_names; do
echo "processing explicitly requested module $mod_name"
mod_source_path=`find $modules_dir -name $mod_name.ko`
if [ -z "$mod_source_path" ]; then
echo "warning: explicitly specified module $mod_name not found in $uname_r" >&2
continue
fi
mod_relpath=`echo $mod_source_path | sed "s%$modules_dir%%g; s/$mod_name.ko$//"`
target_path=$dir/target/lib/modules/$uname_r/$mod_relpath
echo "copying $mod_name from $mod_relpath to $target_path"
mkdir -p $target_path
cp -p $mod_source_path $target_path
done
# linuxrc
if [ "$linux_rc" ]; then
echo "copying $linux_rc to linuxrc"
cp $linux_rc $dir/target/init
fi
# depmod
/sbin/depmod -a -b $dir/target -v $uname_r > /dev/null
# pack stuff up
(cd $dir/target; find . | cpio -co) | gzip -9 > $target
rm -rf $dir
}
unquote()
{
cat | sed 's/^[ ]*|//'
}
config_section()
{
output_file=
add_boot_dir=
add_modules_basedir=
root_dev=
initrd_template=
sed -n "/\[$2\]/,/\[/ p" $1 | sed '/]/ d; s/#.*//; /./ !d; s/ *= */=/; s/=\(.*\)/="\1"/'
}
boot_sections()
{
sed '/\[boot\..*\]/ !d; s/\[boot\.//; s/\].*//' $1
}
name_filter()
{
echo $1 | \
tr [A-Z] [a-z] | \
sed 's/\.tar\.gz/.tgz/; s/-/_/g; s/\([^.]*\)\.\([^.]*\)$$/\1@\2/; s/\./_/g; s/@/./'
}
#make_initrd $template $modules_dir
set -- `getopt 'i:f:o:d:' $*`
while [ "$1" != -- ]; do
case $1 in
-f)
opt_config_file="$2"
shift
;;
-o)
opt_output_file="$2"
shift
;;
-d)
opt_build_dir="$2"
boot_dir="$2"
shift
;;
-i)
linux_rc="$2"
shift
;;
*)
usage
;;
esac
shift
done
shift
if [ ! "$opt_build_dir" ]; then
boot_dir=`mktemp -d "/tmp/$myname""_XXXXXX"`
fi
eval `config_section $opt_config_file global`
echo DEFAULT menu.c32 > $boot_dir/isolinux.cfg
echo PROMPT 0 >> $boot_dir/isolinux.cfg
for sec in `boot_sections $opt_config_file`; do
echo "+ processing section boot.$sec"
config_section $opt_config_file boot.$sec
eval `config_section $opt_config_file boot.$sec`
if [ "$add_boot_dir" ]; then
echo "+ adding boot directory $add_boot_dir"
for f in $add_boot_dir/*; do
b=`basename $f`
n=`name_filter $b`
echo "+ copying $f -> $n"
cp -p $f $boot_dir/$n
done
kernels=`file $add_boot_dir/* | grep -ie 'linux.*kernel' | sed 's/:.*//'`
for kernel in $kernels; do
kernel_version=`basename $kernel | sed 's/vmlinuz-//'`
kernel_version_iso=`name_filter $kernel_version | cut -b1-21`
echo "+ processing kernel $kernel (version $kernel_version)"
# create initrd
if [ "$initrd_template" ]; then
echo "+ creating initial ram disk from template $initrd_template"
make_initrd_from_template \
$kernel_version \
$boot_dir/initrd_$kernel_version_iso \
$add_modules_basedir/$kernel_version \
$initrd_template \
$included_modules
fi
# create isolinux.cfg
cat << EOT | unquote >> $boot_dir/isolinux.cfg
|
|LABEL $kernel_version
|KERNEL vmlinuz_$kernel_version_iso
|APPEND initrd=initrd_$kernel_version_iso root=$root_dev
EOT
done
fi
done
cp $* $boot_dir
mkisofs -l --iso-level 2 -o $opt_output_file \
-b isolinux.bin -c boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
$boot_dir
if [ ! "$opt_build_dir" ]; then
rm -rf $boot_dir
fi

View file

@ -1,246 +0,0 @@
#!/bin/sh
myname=`basename $0`
usage()
{
cat << EOT | sed 's/^ |//'
|
| $myname [global options] cmd [cmd-arguments] ...
|
| global options are:
|
| -F flavour : flavour is one of: priv, jw, contrib
|
| commands are:
|
| create-repo name
| update-descriptions
| list-repos
| create-repo-dir
| list-maintainers
|
EOT
[ "$1" ] && exit $1
}
log()
{
echo $@
logger -t $myname "$@"
}
err()
{
echo $@ >&2
logger -t $myname "error: $@"
}
fatal()
{
err "fatal: $@"
exit 1
}
md()
{
local dir=$1
local mode=$2
local owner=$3
local group=$4
[ -d $dir ] || {
log "creating $dir as $owner.$group with mode $mode"
/usr/bin/install -m $mode -o $owner -g $group -d $dir || {
fatal "failed to create directory $dir"
}
}
}
check_user_is_self()
{
[ "$id" != "$user" ] && fatal "User $id is not allowed to do this to user $user's repositories."
}
# ----------------- commands
md_p()
{
[ -d "$1" ] && return
md_p `dirname "$1"` $2 $3 $4
md $@
}
cmd_cmd_create_repo_dir()
{
[ "$UID" != 0 ] && fatal "tried to create directory \"$dir\" as `whoami`, needs to be done as root"
local gid=`id -g $id`
md_p /srv/git 750 root git
md_p /srv/git/$id 750 root git
md_p `dirname $dir` 750 $id $gid
md_p $dir 02750 $id $gid
}
cmd_create_repo()
{
[ -e $dir ] && {
err "$dir already exists"
test $no_error_if_exists -eq 0
exit $?
}
/usr/bin/sudo `readlink -f $0` create-project-dir $dir || fatal "failed to create [$dir] as root"
cd $dir || fatal "failed to change to $dir"
git init --bare --shared=0640 || fatal "git init failed"
}
read_project_metadata()
{
local pd="$1"
local field="$2"
git -C $pd show HEAD:make/project.conf | sed -n "/^\[$field\]/,/^\[/ p" | grep -v '\[' | cat -s | sed '${/^$/d;}'
}
cmd_update_descriptions()
{
[ -d $pdir ] || return 0
cd $pdir || return 1
local projs="$*"
[ "$projs" = all ] && projs=`cmd_list_repos`
local proj
for proj in $projs; do
umask 0022
[ -d "$proj" ] || fatal "Failed to find project $pdir/$proj"
local tmp=`mktemp /tmp/$myname-XXXXXXX`
local descr=$proj/description
read_project_metadata $proj summary > $tmp
[ -s "$tmp" ] || read_project_metadata $proj description > $tmp
if [ -s "$tmp" ] && ! diff -q "$tmp" "$descr" >/dev/null 2>&1; then
chown --reference=$proj $tmp
chmod 640 $tmp
echo "====== Changing description of $proj"
echo '-- old --'
cat $descr
echo '-- new --'
cat $tmp
mv $tmp $descr
fi
rm -f $tmp
done
}
cmd_list_repos()
{
[ -d $pdir ] || return 0
cd $pdir || return 1
ls */HEAD | sed 's%/HEAD%%' 2>/dev/null
return $?
}
cmd_list_maintainers()
{
local dev_chief=jan
local master_dir=/srv/git/$dev_chief/proj
local d pdir p val
for d in $master_dir; do
for pdir in `find $d -maxdepth 1 -mindepth 1 -type d`; do
[ -x $pdir ] || continue
[ -r $pdir ] || continue
#echo "$d -> $pdir"
p=`basename $pdir`
val=`git -C $pdir show HEAD:make/project.conf 2>/dev/null |
sed -n '/^\[global\]/,/^\[/ p' |
sed '
/^[[:space:]]*jw-maintainer/ !d;
s/.*= *//
'`
[ "$val" ] || val="unknown"
[ "$val" ] || continue
printf "%-30s %s\n" $p $val
done
done
}
# ----------------- here we go
no_error_if_exists=0
id=`whoami`
#user=$id
flavour=priv
OPTIND=1
while getopts jhu:F: flag; do
case $flag in
h)
usage 0;;
u)
user=$OPTARG;;
j) # legacy support
flavour=jw;;
F)
flavour=$OPTARG;;
p)
no_error_if_exist=1;;
*)
usage 1;;
esac
done
shift $(($OPTIND - 1))
if [ "$user" ]; then
id=$user
else
if [ "$SUDO_UID" ]; then
id=`/usr/bin/getent passwd $SUDO_UID | cut -d: -f1`
[ "$id" ] || fatal "failed to find uid $SUDO_UID in user database"
fi
user=$id
fi
git_home=/srv/git/$id
pdir=$git_home/priv
case $flavour in
jw|proj)
pdir=$git_home/proj;;
priv)
pdir=$git_home/priv;;
test)
pdir=$git_home/test;;
contrib)
pdir=$git_home/contrib;;
*)
fatal "unknown repository flavour \"$flavour\""
esac
cmd=$1
shift
p=$1
dir=$pdir/$p
case $cmd in
create-personal-project|create-repo)
check_user_is_self
cmd_create_repo "$@"
;;
update-descriptions|update-descr)
cmd_update_descriptions "$@"
;;
list-personal-projects|list-repos)
cmd_list_repos "$@"
;;
create-project-dir|create-repo-dir)
dir=$1 # this is all a horrible variable and usage mess
check_user_is_self
cmd_cmd_create_repo_dir "$@"
;;
list-maintainers|maintainers)
cmd_list_maintainers
;;
*)
usage 1
;;
esac

View file

@ -1,9 +0,0 @@
#!/bin/sh
get_conf_sec()
{
sed -n "/\[$1\]/,/\[/ p" | sed '/]/ d; s/#.*//; /./ !d; s/ *= */=/; s/=\(.*\)/="\1"/'
}
cat $2 | get_conf_sec $1

View file

@ -1,56 +0,0 @@
ini_section()
{
local inifile="$1"
local sec="$2"
cat "$inifile" |
cut -d\# -f1 |
tr -s '\n' '\n' |
sed -n "/^ *\[$sec\]/,/^ *\[/ p" |
grep -v '^ *\[' |
sed '/^ *$/ d'
}
ini_value()
{
local inifile="$1"
local path="$2"
local sec=`echo "$path" | sed 's/\.[^.]\+$//'`
local key=`echo "$path" | sed 's/.*\.//'`
# echo "path=>$path<"
# echo "sec=>$sec<"
# echo "key=>$key<"
if [ "$key" = "$path" ]; then
ini_section "$inifile" "$path"
return 0
fi
ini_section "$inifile" "$sec" | sed "
/^ *$key *=/ !d
s/^ *$key *= *//
s/ *$//
/^ *$/ d
"
}
ini_has_section()
{
local inifile="$1"
local sec="$2"
grep -q "^ *\[$sec\]" $inifile || return 1
}
ini_has_value()
{
ini_value $@ | grep -q .
}
ini_escape()
{
cat | sed '
s/\$/\\$/g
s/`/\\\`/g
'
}

File diff suppressed because it is too large Load diff

View file

@ -1,226 +0,0 @@
#!/bin/sh
myname=`basename $0`
longname=$0
opts="v"
channel_present()
{
if smart channel --show $1 2>&1 | grep -q baseurl >/dev/null; then
return 0
fi
return 1
}
usage()
{
cat << EOT
$myname command [arguments]
command is one of
help: show this help screen
init: initialize
uninit: undo initialization
install: install packages in [arguments]
update: update all jannet software on the system
restore: restore a previous jannet software version state
info: query information about installed software
checklog: update the installation log file if necessary
rpmnew: remove superfluous rpmnew files and show conflicts
for others
build-date: show installed jannet packages along with build date
built-today: show installed jannet packages that were built today
EOT
if [ "$1" ]; then
exit $1
fi
}
get_opts()
{
set -- `getopt $opts $*`
while [ "$1" != -- ] ; do
case "$1" in
-v)
opt_verbose=true
;;
*)
eusage
;;
esac
shift
done
shift
}
create_ldconfig_state()
{
echo "=== automatically created by $myname update script"
echo "--- files"
ls /etc/ld.so.conf.d
echo "--- directories"
find /etc/ld.so.conf.d -type f | xargs cat | sort -u
}
check_ldconfig()
{
local state=/var/log/jw-build-ldconf.state
[ -f $state ] && create_ldconfig_state | diff $state - >/dev/null 2>&1 && return
echo -n "running ldconfig ... "
/sbin/ldconfig
create_ldconfig_state > $state
echo "done."
}
list_all_packages()
{
rpm -qa --queryformat '%{NAME}: %{URL}\n' | \
grep -i '^[^ ]\+:.*\(jannet\.de\|janware\.com\)' | \
sed 's/\(^[^ ]\+\) *:.*/\1/; s/[ ]*$//' |\
sort -u
}
cmd_rpmnew()
{
local file
list_all_packages |
xargs rpm -ql |
while read file; do
if [ -e "$file.rpmnew" ]; then
if diff -q $file $file.rpmnew; then
if [ -L "$file" ]; then
echo ========== skipping link $file
diff $file.rpmnew $file
continue
fi
echo mv $file.rpmnew $file
sudo mv $file.rpmnew $file
else
echo =========== $file
diff $file.rpmnew $file
fi
fi
done
}
cmd_diff()
{
local file
list_all_packages |
xargs rpm -qV |
sed '/^....L\|^..5/ !d; s%[^/]*/%/%' |
while read file; do
if diff -q $file $file.rpmnew; then
if [ -L "$file" ]; then
echo ========== skipping link $file
diff $file.rpmnew $file
continue
fi
echo mv $file.rpmnew $file
sudo mv $file.rpmnew $file
else
echo =========== $file
diff $file.rpmnew $file
fi
done
}
cmd_build_date()
{
list_all_packages |
xargs rpm -q --queryformat '%{BUILDTIME} %{NAME}\n' |
sort -n |
sed 's/-run\|-devel//' |
sort -u |
while read t p; do
echo `date --date=@$t --rfc-3339=seconds` $p
done
}
cmd_built_today()
{
local today=`date +'%Y-%m-%d'`
cmd_build_date | grep $today | cut -d' ' -f3
}
cmd="$1"
shift
get_opts $*
case $cmd in
init)
if ! channel_present jw-foss; then
echo -n "adding installation source ... "
sudo smart channel -y --add jw-foss \
type=yast2 \
baseurl=https://pkg:we0rntj3p@janware.com/files/packages/jw-foss/suse/tumbleweed?auth=basic&credentials=jannet.cat \
>/dev/null 2>&1
if channel_present; then echo done; else echo failed; fi
fi
;;
uninit)
if channel_present jw-foss; then
echo -n "removing installation source ... "
sudo smart channel -y --remove jw-foss >/dev/null 2>&1
echo done
fi
;;
update)
sudo smart update jw-foss
sudo smart upgrade -y
check_ldconfig
;;
install)
sudo smart update jw-foss
if [ -f $1 ]; then
sudo smart install -y `cat $1`
else
sudo smart install -y $*
fi
check_ldconfig
;;
restore)
echo "not yet implemented, sorry" >&2
;;
checklog)
line=`jannet info | tr -s " "`
echo $line
;;
info)
if [ "$opt_verbose" = true ]; then
list_all_packages | xargs rpm -qi
else
list_all_packages | xargs rpm -q
fi
;;
rpmnew)
cmd_rpmnew $@
;;
diff)
cmd_diff $@
;;
build-date)
cmd_build_date
;;
built-today)
cmd_built_today
;;
help)
usage 0
;;
*)
usage 1
;;
esac

File diff suppressed because it is too large Load diff

View file

@ -1,197 +0,0 @@
#!/bin/bash
log()
{
echo $@
}
err()
{
log $@
}
fatal()
{
err $@
exit 1
}
usage()
{
echo "$myname [-h] [-s summary] [-d description] [-g pkg-group] name"
[ "$1" ] && exit $1
}
cat_Makefile()
{
cat <<-EOT
TOPDIR = .
include \$(TOPDIR)/make/proj.mk
include \$(JWBDIR)/make/topdir.mk
EOT
}
cat_VERSION()
{
cat <<-EOT
1.0.0-0-dev
EOT
}
cat_make_Makefile()
{
cat <<-EOT
TOPDIR = ..
include \$(TOPDIR)/make/proj.mk
include \$(JWBDIR)/make/make.mk
EOT
}
cat_make_proj_mk()
{
cat <<-EOT
# to be included from inside the project directory
DEV_PROJECTS_DIR ?= \$(TOPDIR)/..
ifeq (\$(TARGET),mingw)
FLAVOUR_PATH_PREFIX = win32/
endif
JWBDIR ?= \$(firstword \$(wildcard \$(DEV_PROJECTS_DIR)/jw-build \$(BUILD_TOOLS_PREFIX)/opt/\$(FLAVOUR_PATH_PREFIX)jw-build))
USE_PROJECT_LIB = false
HDRDIR_SCOPE_SUFFIX = \$(PROJECT)
EOT
}
cat_make_project_conf()
{
local login=$JANWARE_USER
[ "$login" ] || login=`whoami`
local fullname=`getent passwd $login | cut -d: -f5`
[ "$fullname" ] || fullname=$JANWARE_USER
[ "$fullname" ] || fullname=`whoami | xargs getent passwd | cut -d: -f5`
[ "$fullname" ] || fullname=`whoami`
cat <<-EOT
[summary]
$summary
[description]
$description
[global]
group = "$pkg_group"
subpackages = $subpackages
license = Copyright (c) $fullname, all rights reserved
jw-maintainer = $JANWARE_USER
[build]
libname = none
[pkg.requires.jw]
devel = $name-run = VERSION-REVISION, jw-build-devel = VERSION
build = jw-build-devel
EOT
}
cat_gitignore()
{
cat <<-EOT
*.done
*.dist
*.dep.mk
.cache.mk
*.o
*.so.*
*.so
*.a
*.rep
ld-*.conf
*.ldscript
*.pc
$name
*_generated_*
*.secret
local.mk
.gdb_history
dist
mkspec.sh
*.out
*.orig
*.old
.feedfs_history
.exrc
*.swp
*tmp*
__init__.py
__pycache__
EOT
}
# ---------------------- here we go
myname=`basename $0`
projdir=.
summary=
description=
subpackages="run"
eval set -- `getopt -- hd:s:p:g: "$@"`
while [ "$1" != -- ]; do
case $1 in
-d)
eval description=\"$2\"
shift;;
-s)
eval summary=\"$2\"
shift;;
-p)
eval subpackages=\"$2\"
shift;;
-g)
eval pkg_group=\"$2\"
shift;;
-h)
usage 0;;
*)
usage 1;;
esac
shift
done
shift
[ -z "$description" ] && description="$summary"
[ -z "$summary" ] && summary="$description"
[ -z "$pkg_group" ] && pkg_group="Amusements/Teaching/Other"
[ -f $projdir/Makefile ] || {
fatal "$projdir doesn't contain a Makefile"
}
name="$1"
[ -d $projdir/$name ] && {
fatal "$projdir/$name already exists"
}
set -e
mkdir -p $projdir
mkdir $name
cd $projdir/$name
mkdir make
cat_Makefile > Makefile
cat_make_Makefile > make/Makefile
cat_VERSION > VERSION
cat_make_proj_mk > make/proj.mk
cat_make_project_conf > make/project.conf
cat_gitignore > .gitignore
log Successfully created project template \"$name\".

View file

@ -1,4 +0,0 @@
#!/bin/bash
/usr/bin/ssh $JW_BUILD_SSH_EXTRA_OPTS "$@"

View file

@ -1,503 +0,0 @@
#!/bin/bash
log()
{
if [ "$1" = -n ]; then
shift
echo -n "$myname: $*"
return
fi
if [ "$1" = -c ]; then
shift
echo "$*"
return
fi
if [ "$1" = -C ]; then
shift
echo -n "$*"
return
fi
echo "$myname: $*"
}
channel_present()
{
if smart channel --show $1 2>&1 | grep -q baseurl >/dev/null; then
return 0
fi
return 1
}
usage()
{
cat << EOT
$myname [global options] command [options] [package ...]
command is one of
help: show this help screen
init: initialize
uninit: undo initialization
install: install packages in [arguments]
update: update all jannet software on the system
restore: restore a previous jannet software version state
list: query information about installed software packages
list-projects: query information about installed software projects
checklog: update the installation log file if necessary
rpmnew: remove superfluous rpmnew files and show conflicts
for others
build-date: show installed janware packages along with build date
built-today: show installed janware packages built today
list-changed-files: list files changed since installation
list-templates: list templates
list-template-tables: list templates tables
list-template-output: list template output files
rm-template-output: remove template output files
compile-templates: compile templates
global options are
-v be verbose
package
optional whitespace-separated list of package names, generally limiting the
scope of the command to the specified packages, defaults to all installed
janware packages
EOT
[ "$1" ] && exit $1
}
create_ldconfig_state()
{
echo "=== automatically created by $myname update script"
echo "--- files"
ls /etc/ld.so.conf.d
echo "--- directories"
find /etc/ld.so.conf.d -type f | xargs cat | sort -u
}
check_ldconfig()
{
local state=/var/log/jw-build-ldconf.state
[ -f $state ] && create_ldconfig_state | diff $state - >/dev/null 2>&1 && return
echo -n "running ldconfig ... "
/sbin/ldconfig
create_ldconfig_state > $state
echo "done."
}
list_packages()
{
local query_tags=""
eval set -- `getopt -- VPNUD "$@"`
while [ "$1" != -- ]; do
case $1 in
-V)
query_tags="$query_tags %{Vendor}"
;;
-P)
query_tags="$query_tags %{Packager}"
;;
-U)
query_tags="$query_tags %{URL}"
;;
-D)
query_tags="$query_tags %{Distribution}"
;;
*)
echo -e "Unexpected argument >$1<\n" >&2
usage 1
;;
esac
shift
done
shift
[ "$query_tags" ] || query_tags="%{URL}"
local names="$1"
local rpm_args
if [ -n "$names" ]; then
rpm_args="$rpm_args $names"
else
rpm_args="$rpm_args -a"
fi
rpm -q --queryformat "%{Name}: $query_tags\n" $rpm_args | \
grep -i '^[^ ]\+:.*\(jannet\|janware\)' | \
sed 's/\(^[^ ]\+\) *:.*/\1/; s/[ ]*$//' |\
sort -u
}
list_projects()
{
list_packages "$@" | xargs -r rpm -q --queryformat '%{SOURCERPM}\n' | \
sed 's/[ ]*//; s/-[0-9]\+.*//' |\
sort -u
}
list_files()
{
# Need to sort -u, because apparently, during installation, rpm -ql
# returns every file in the package _twice_. Funny.
list_packages "$@" | sort -u | xargs -r rpm -ql
}
cmd_rpmnew()
{
local file
list_files "$@" |
while read file; do
if [ -e "$file.rpmnew" ]; then
if diff -q $file $file.rpmnew; then
if [ -L "$file" ]; then
echo ========== skipping link $file
diff $file.rpmnew $file
continue
fi
echo mv $file.rpmnew $file
sudo mv $file.rpmnew $file
else
echo =========== $file
diff $file.rpmnew $file
fi
fi
done
}
cmd_diff()
{
local file
list_packages "$@" |
xargs -r rpm -qV |
sed '/^....L\|^..5/ !d; s%[^/]*/%/%' |
while read file; do
if diff -q $file $file.rpmnew; then
if [ -L "$file" ]; then
echo ========== skipping link $file
diff $file.rpmnew $file
continue
fi
echo mv $file.rpmnew $file
sudo mv $file.rpmnew $file
else
echo =========== $file
diff $file.rpmnew $file
fi
done
}
cmd_build_date()
{
list_packages "$@" |
xargs -r rpm -q --queryformat '%{BUILDTIME} %{NAME}\n' |
sort -n |
sed 's/-run\|-devel//' |
sort -u |
while read t p; do
echo `date --date=@$t --rfc-3339=seconds` $p
done
}
cmd_list_templates()
{
local ext_from="$template_exts" # TODO: support more than one
local ext_from_re=`echo $ext_from | sed 's/\./\\./g'`
local f
list_files "$@" | while read f; do
[ -f "$f" -o -L "$f" ] || continue
echo $f | grep -q "$ext_from_re$" || continue
echo $f
done
}
cmd_list_template_tables()
{
local ext_from="$table_exts"
local e f t
list_files "$@" | while read f; do
[ -f "$f" -o -L "$f" ] || continue
for e in $ext_from; do
t="${f%.*}$e"
[ -f "$t" ] || continue
echo $t
done
done
}
cmd_list_template_output()
{
local re=`echo $template_exts | sed 's/\./\\\\./g; s/^ *//; s/ *$//; s/ */$\\\\|/g; s/\(.*\)/\\\\(\1$\\\\)/'`
local f
list_files "$@" | sed "/$re/ !d; s/$re//" | while read f; do
[ -f "$f" -o -L "$f" ] || continue
echo $f
done
}
cmd_rm_template_output()
{
local restore=0
while [ "${1:0:1}" = '-' ]; do
case "$1" in
-r)
restore=1
;;
*)
usage 1
;;
esac
shift
done
local f
cmd_list_template_output $@ | while read f; do
log "removing $f"
rm $f
bak=$f$template_bak_ext
if [ "$restore" = 1 -a -f "$bak" ]; then
log "restoring $f from $bak"
mv $bak $f
fi
done
}
cmd_compile_templates()
{
__md() {
stat --format '%U:%G %a' "$1" 2>/dev/null
}
local ext_from="$template_exts" # TODO: support more than one
local ext_from_re=`echo $template_exts | sed 's/\./\\./g'`
local ext_to=""
local ext_tables="$table_exts"
local default_group=root
local default_owner=root
local default_mode=600
local conf_patt="^[ ]*# *conf:"
local missing_table=0
local backup=0
umask 0077
while [ "${1:0:1}" = '-' ]; do
case "$1" in
-o)
default_owner="$2"
shift
;;
-m)
default_mode="$2"
shift
;;
-g)
default_group="$2"
shift
;;
-b)
backup=1
;;
-c)
conf_patt="$2"
shift
;;
*)
usage 1
;;
esac
shift
done
local f
while read f; do
local base=`echo $f | sed "s/$ext_from_re$//"`
[ "$base" ] || continue
local to=$base$ext_to
local table=""
local ext
for ext in $ext_tables; do
table=$base$ext
[ -f "$table" ] && break
done
[ -f $table ] || {
log "WARNING: No key-value table found for template $f, not compiling." >&2
((missing_table++))
continue
}
# TODO: use mktemp -d and keep temporary files in read-only dir
local tmp=$to.tmp
log -n "Applying macros in $table to $f"
local mode=$default_mode
local owner=$default_owner
local group=$default_group
local diff=""
eval `sed "/$conf_patt/ !d; s/$conf_patt//" $f`
eval `sed "/$conf_patt/ !d; s/$conf_patt//" $table`
sed 's|^[ ]*#.*||; s|/|\\/|g; s|\([^ =]\+\)[ =]\+\(.*\)|s/\1/\2/g|' $table | sed -f - $f > $tmp
chmod $mode $tmp
chown $owner $tmp
chgrp $group $tmp
diff -q $tmp $to >/dev/null 2>&1 || diff="@content"
local md_to=$(__md "$to")
local md_tmp=$(__md "$tmp")
[ "$md_to" = "$md_tmp" ] || diff="$diff@metadata ($md_to -> $md_tmp)"
if [ -z "$diff" ]; then
log -c ", no changes."
rm $tmp
continue
fi
local bak=$to$template_bak_ext
if [ "$backup" = 1 -a -f $to ] && ! diff -q $to $bak >/dev/null 2>&1; then
log -C ", saving backup to $to to $bak"
cp -p $to $bak
fi
mv $tmp $to
diff=${diff##@}
log -c ", updating ${diff//@/ + }, done."
done <<< $(cmd_list_templates "$@")
if [ "$missing_table" != 0 ]; then
log "WARNING: $missing_table missing tables found. You might want to add them and run sudo $cmdline again."
fi
}
cmd_get_value_from_tables()
{
local key show_file
eval set -- `getopt -- k: "$@"`
while [ "$1" != -- ]; do
case $1 in
-k)
key=$2
shift
;;
-f)
show_file=1
shift
;;
*)
echo -e "Unexpected argument >$1<\n" >&2
usage 1
;;
esac
shift
done
shift
local f
while read f; do
grep -q "^\s*$key\s\+" $f || continue
[ "$show_file" = 1 ] && echo -n "$f: "
sed "s|^[ ]*#.*||; /^\s*$key\(\s\|=\)\+/ !d; s/^\s*$key\(\s\|=\)\+//" $f
done <<< $(cmd_list_template_tables "$@")
}
cmd_built_today()
{
local today=`date +'%Y-%m-%d'`
cmd_build_date | grep $today | cut -d' ' -f3
}
cmd_list_changed_files()
{
list_projects "$@" | xargs rpm -qV | grep '^..5' | sed 's|[^/]*/|/|'
}
# ----- here we go
cmdline="$0 $@"
myname=`basename $0`
longname=$0
opts="v"
table_exts=".jw-secret .jw-vars"
template_exts=".jw-tmpl"
template_bak_ext=".jw-pkg.bak"
while [ "${1:0:1}" = '-' ]; do
case "$1" in
-v)
opt_verbose=true
shift
;;
*)
usage 1
;;
esac
shift
done
cmd="${1//-/_}"
shift
case $cmd in
# -- TODO: re-implement this using pkg-manager.sh, or integrate with pkg-manager.sh
#init)
# if ! channel_present ftp.jannet.de; then
# echo -n "adding installation source ... "
# sudo smart channel -y --add ftp.jannet.de \
# type=yast2 \
# baseurl=ftp://dspadm:dspasswd@ftp.jannet.de/pub/packages/linux/suse/10.1 \
# >/dev/null 2>&1
# if channel_present; then echo done; else echo failed; fi
# fi
# ;;
#
#uninit)
# if channel_present ftp.jannet.de; then
# echo -n "removing installation source ... "
# sudo smart channel -y --remove ftp.jannet.de >/dev/null 2>&1
# echo done
# fi
# ;;
#
#update)
# sudo smart update ftp.jannet.de
# sudo smart upgrade -y
# check_ldconfig
# ;;
#
#install)
# sudo smart update ftp.jannet.de
# if [ -f $1 ]; then
# sudo smart install -y `cat $1`
# else
# sudo smart install -y $*
# fi
# check_ldconfig
# ;;
#restore)
# echo "not yet implemented, sorry" >&2
# ;;
list)
if [ "$opt_verbose" = true ]; then
list_packages "$@" | xargs -r rpm -qi
else
list_packages "$@" | xargs -r rpm -q
fi
;;
list_projects)
list_projects "$@"
;;
compile_templates|list_templates|list_template_tables|list_template_output|rm_template_output|diff|build_date|built_today|rpmnew|get_value_from_tables|list_changed_files)
cmd_$cmd "$@"
;;
help)
usage 0
;;
*)
usage 1
;;
esac

View file

@ -1,30 +0,0 @@
#!/bin/bash
ldflags="$@"
for f in $ldflags; do
echo checking $f
if [ "${f:0:2}" = -l ]; then
libs="$libs ${f:2}"
fi
done
echo libs=$libs
path=$LD_LIBRARY_PATH
path=${path//:/ }
for l in $libs; do
lp=
for p in $path; do
lpc=$p/lib$l.so
if [ -r $lpc ]; then
lp=$lpc
break
fi
done
[ -n "$lp" ] || {
echo library $l not found in path, skipping
continue
}
echo ==================================== $lp
lddtree $lp
done

View file

@ -1,41 +0,0 @@
#!/bin/sh
########################################################################
# #
# generic utiltiy modules #
# (c) 2001 jannet it services #
# contact@jannet.de #
# #
# $Id$
# #
# This program is free software; permission to use, copy, modify, #
# distribute, and sell this software and its documentation under the #
# terms of the GNU Public license as published by the Free Software #
# Foundation, either version 2 or any later version of the license, is #
# hereby granted without fee, provided that (i) the above copyright #
# notices and this permission notice appear in all copies of the #
# software and related documentation, and (ii) the name of JanNet may #
# not be used in any advertising or publicity relating to the software #
# without the specific, prior written permission of JanNet. #
# #
# This program is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- #
# TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General #
# Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software Founda- #
# tion, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
# #
########################################################################
version_tag=$1
cat << EOT
VERSION {
$version_tag {
global:
*;
};
}
EOT

Some files were not shown because too many files have changed in this diff Show more