@ -0,0 +1,32 @@ |
|||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/base/bize/bize.conf |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
|
||||
|
bize_main() { |
||||
|
install -m 0755 -o 0 -g 0 $confdir/bize.sh $root/bin/bize |
||||
|
install -m 0644 -o 0 -g 0 $confdir/bize.man $mandir/man8/bize.8 |
||||
|
} |
||||
|
|
||||
|
autoextract=0 |
||||
|
srctar=none |
||||
|
custmain=bize_main |
||||
|
|
@ -0,0 +1,38 @@ |
|||||
|
|
||||
|
[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
[COPY] |
||||
|
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
[COPY] Please add additional copyright information _after_ the line containing |
||||
|
[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
[COPY] |
||||
|
[COPY] ROCK Linux: rock-src/package/base/bize/bize.desc |
||||
|
[COPY] ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf |
||||
|
[COPY] |
||||
|
[COPY] This program is free software; you can redistribute it and/or modify |
||||
|
[COPY] it under the terms of the GNU General Public License as published by |
||||
|
[COPY] the Free Software Foundation; either version 2 of the License, or |
||||
|
[COPY] (at your option) any later version. A copy of the GNU General Public |
||||
|
[COPY] License can be found at Documentation/COPYING. |
||||
|
[COPY] |
||||
|
[COPY] Many people helped and are helping developing ROCK Linux. Please |
||||
|
[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
[COPY] file for details. |
||||
|
[COPY] |
||||
|
[COPY] --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
[I] ROCK-Linux .tar.bz2 package manager |
||||
|
|
||||
|
[T] The tool 'bize' is used to install, update and remove ROCK-Linux |
||||
|
[T] .tar.bz2 packages. |
||||
|
|
||||
|
[A] Dimitar Zhekov <jimmy@is-vn.bg> |
||||
|
[M] Dimitar Zhekov <jimmy@is-vn.bg> |
||||
|
|
||||
|
[C] base/setup |
||||
|
|
||||
|
[L] GPL |
||||
|
[S] Stable |
||||
|
[V] 0.3 |
||||
|
[P] X -1---5---9 229.100 |
||||
|
|
@ -0,0 +1,79 @@ |
|||||
|
.\" Copyright (c) 2004 Dimitar Toshkov Zhekov |
||||
|
.TH BIZE 8 "15 Mar 2004" |
||||
|
.SH NAME |
||||
|
bize \- ROCK-Linux .tar.bz2 package manager |
||||
|
.SH SYNOPSIS |
||||
|
.BI "bize -i [-t] [-v] [-f] [-R " root "] " package1.tar.bz2 |
||||
|
.BI ... |
||||
|
.LP |
||||
|
.BI "bize -r [-t] [-v] [-f] [-R " root "] " package1 ... |
||||
|
.SH DESCRIPTION |
||||
|
.B bize |
||||
|
is a shell script capable of installing, updating and removing |
||||
|
ROCK-Linux .tar.bz2 package files. It implements a subset of |
||||
|
.B mine |
||||
|
options. |
||||
|
.SS Requirements |
||||
|
.BR md5sum ", " sort ", " rm ", " rmdir ", " mkdir ", " tar " and |
||||
|
.BR bzip2 . |
||||
|
All these are standard programs present in any Linux system, but |
||||
|
.B bize |
||||
|
checks for them on startup anyway. |
||||
|
The presence of |
||||
|
.B md5sum |
||||
|
and of md5sum entries files is checked only if |
||||
|
.B "\-f" |
||||
|
is not specified. |
||||
|
.SS Compatibility |
||||
|
The .tar.bz2 and .gem formats are not compatible. Packages |
||||
|
installed with |
||||
|
.B bize |
||||
|
can be removed with |
||||
|
.B mine |
||||
|
and vice-versa. |
||||
|
.B bize |
||||
|
has not been tested with ROCK-Linux 1.6 or earlier. Some of the |
||||
|
ROCK-Linux 1.7.0+ targets produce .tar.bz2 packages only. |
||||
|
.SS Effectiveness |
||||
|
.B bize |
||||
|
installs packages slightly faster than |
||||
|
.BR "mine " |
||||
|
and removes them several times slower. Much more time is required |
||||
|
to install a package than to remove it, so |
||||
|
.B bize |
||||
|
is, overall, about 20% slower than |
||||
|
.BR mine . |
||||
|
The .tar.bz2 packages are a bit smaller than the .gem packages and |
||||
|
are created a bit faster. |
||||
|
.SH OPTIONS |
||||
|
.TP |
||||
|
.B "\-i" |
||||
|
Install or update packages. |
||||
|
.TP |
||||
|
.B "\-r" |
||||
|
Remove packages. |
||||
|
.TP |
||||
|
.B "\-t" |
||||
|
Test mode. Show what will happen without doing it. |
||||
|
.TP |
||||
|
.B "\-v" |
||||
|
Be verbose. |
||||
|
.TP |
||||
|
.B "\-f" |
||||
|
Force removal/replacement of the modified files. |
||||
|
.TP |
||||
|
.BI "\-r " root |
||||
|
Use |
||||
|
.I root |
||||
|
as root directory instead of /. |
||||
|
.TP |
||||
|
.B "\-\-" |
||||
|
Terminate the option list. |
||||
|
.SH BUGS |
||||
|
Regular files with no md5sum entry are ignored in test mode and |
||||
|
treated as modified in real mode unless |
||||
|
.B "\-f" |
||||
|
is specified. A normally built and installed ROCK-Linux package |
||||
|
must include such an entry for each regular file. |
||||
|
.SH SEE ALSO |
||||
|
GEM-MINE |
@ -0,0 +1,167 @@ |
|||||
|
#!/bin/sh |
||||
|
|
||||
|
bize_usage() |
||||
|
{ |
||||
|
echo "usage: bize -i [-t] [-v] [-f] [-R root] package1.tar.bz2 ..." 1>&2 |
||||
|
echo " bize -r [-t] [-v] [-f] [-R root] package1 ..." 1>&2 |
||||
|
} |
||||
|
|
||||
|
bize_remove() |
||||
|
{ |
||||
|
local tag base sum md5s="$adm/md5sums/$pkg" |
||||
|
|
||||
|
if [ "$keep" ] ; then |
||||
|
if [ ! -f "$md5s" ] ; then |
||||
|
echo "$0: $md5s: no such file, skipping remove" 1>&2 |
||||
|
return |
||||
|
fi |
||||
|
|
||||
|
while read tag base ; do |
||||
|
file="$root/$base" |
||||
|
if [ -z "$base" ] ; then |
||||
|
echo "$0: invalid line '$tag' in $md5s" 1>&2 |
||||
|
elif [ -f "$file" -a ! -L "$file" ] ; then |
||||
|
sum="`md5sum < $file`" |
||||
|
sum="${sum% -}" |
||||
|
if [ "$tag" = "$sum" ] ; then |
||||
|
$unlink "$file" |
||||
|
elif [ "$test" ] ; then |
||||
|
echo "$0: $file: modified, skipping" |
||||
|
fi |
||||
|
fi |
||||
|
done < $md5s |
||||
|
fi |
||||
|
|
||||
|
sort -r -- "$list" | while read tag base ; do |
||||
|
file="$root/$base" |
||||
|
if [ "$tag" != "$pkg:" ] ; then |
||||
|
echo "$0: invalid tag '$tag' in $list" 1>&2 |
||||
|
elif [ -z "$base" ] ; then |
||||
|
echo "$0: missing file name in $list" 1>&2 |
||||
|
elif [ "$base" != "${base#var/adm/}" ] ; then |
||||
|
continue |
||||
|
elif [ -L "$file" ] ; then |
||||
|
$unlink "$file" |
||||
|
elif [ -d "$file" ] ; then |
||||
|
$test rmdir $voption -- "$file" |
||||
|
elif [ "$keep" -a -f "$file" ] ; then |
||||
|
[ "$test" ] || echo "$0: $file: modified, skipping" |
||||
|
else |
||||
|
$unlink "$file" |
||||
|
fi |
||||
|
done |
||||
|
|
||||
|
for base in cksums dependencies descs flists logs md5sums packages ; do |
||||
|
$unlink "$adm/$base/$pkg" |
||||
|
done |
||||
|
} |
||||
|
|
||||
|
bize_install() |
||||
|
{ |
||||
|
if [ ! -f "$arch" ] ; then |
||||
|
echo "$0: $arch: no such file, skipping install" 1>&2 |
||||
|
return |
||||
|
fi |
||||
|
|
||||
|
pkg="${arch%.tar.bz2}" |
||||
|
if [ "$arch" = "$pkg" ] ; then |
||||
|
echo "$0: $arch: not a .tar.bz2 file" 1>&2 |
||||
|
return |
||||
|
fi |
||||
|
pkg="${pkg##*/}" |
||||
|
pkg="${pkg%-[0-9]*}" |
||||
|
|
||||
|
if [ -z "$pkg" ] ; then |
||||
|
echo "$0: $arch: missing package name" 1>&2 |
||||
|
return |
||||
|
fi |
||||
|
|
||||
|
list="$adm/flists/$pkg" |
||||
|
if [ -f "$list" ] ; then |
||||
|
[ "$verbose" ] && echo "updating $pkg ..." |
||||
|
bize_remove |
||||
|
else |
||||
|
[ "$verbose" ] && echo "installing $pkg ..." |
||||
|
fi |
||||
|
|
||||
|
$test mkdir -p$verbose -- "$root/" |
||||
|
if [ "$test" ] ; then |
||||
|
echo "bzip2 -c -d -- $arch | tar $taropt -C $root/" |
||||
|
else |
||||
|
bzip2 -c -d -- "$arch" | tar $taropt -C "$root/" |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
bize_uninstall() |
||||
|
{ |
||||
|
[ "$verbose" ] && echo "removing $pkg" |
||||
|
list="$adm/flists/$pkg" |
||||
|
if [ -f "$list" ] ; then |
||||
|
bize_remove |
||||
|
else |
||||
|
echo "$0: $list: no such file, skipping remove" 1>&2 |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
bize_main() |
||||
|
{ |
||||
|
local which=which file arch list="sort rm rmdir mkdir tar bzip2" |
||||
|
local install remove test verbose voption keep=1 root=/ taropt |
||||
|
|
||||
|
while [ "$1" ] ; do |
||||
|
case "$1" in |
||||
|
-i) install=1 ;; |
||||
|
-r) remove=1 ;; |
||||
|
-t) test=echo ;; |
||||
|
-f) keep="" ;; |
||||
|
-v) verbose=v ; voption=-v ;; |
||||
|
-R) shift ; root="$1" ;; |
||||
|
-R*) root="${1#-R}" ;; |
||||
|
--) break ;; |
||||
|
-*) bize_usage ; return 1 ;; |
||||
|
*) break;; |
||||
|
esac |
||||
|
shift |
||||
|
done |
||||
|
|
||||
|
if type which > /dev/null 2>&1 ; then |
||||
|
which=type |
||||
|
elif ! which which > /dev/null 2>&1 ; then |
||||
|
echo "$0: unable to find 'type' or 'which'" 1>&2 |
||||
|
return 1 |
||||
|
fi |
||||
|
|
||||
|
[ "$keep" ] && list="md5sum $list" |
||||
|
for file in $list ; do |
||||
|
if ! $which $file > /dev/null ; then |
||||
|
echo "$0: unable to find '$file'" 1>&2 |
||||
|
return 1 |
||||
|
fi |
||||
|
done |
||||
|
|
||||
|
if [ "$install" = "$remove" -o -z "$root" -o -z "$*" ] ; then |
||||
|
bize_usage |
||||
|
return 1 |
||||
|
fi |
||||
|
|
||||
|
root=${root%/} |
||||
|
|
||||
|
local adm="$root/var/adm" unlink="$test rm -f$verbose --" pkg |
||||
|
|
||||
|
if [ "$install" ] ; then |
||||
|
taropt="x${verbose}" |
||||
|
[ "$keep" ] && taropt="${taropt}k" |
||||
|
for arch do |
||||
|
bize_install |
||||
|
done |
||||
|
else |
||||
|
for pkg do |
||||
|
bize_uninstall |
||||
|
done |
||||
|
fi |
||||
|
|
||||
|
return 0 |
||||
|
} |
||||
|
|
||||
|
bize_main "$@" |
||||
|
unset bize_usage bize_remove bize_install bize_uninstall bize_main |