Browse Source

Dimitar Zhekov:


			
			
				rocklinux
			
			
		
Dimitar Zhekov 21 years ago
parent
commit
3d028ddc77
3 changed files with 58 additions and 46 deletions
  1. +1
    -1
      package/base/bize/bize.desc
  2. +29
    -16
      package/base/bize/bize.man
  3. +28
    -29
      package/base/bize/bize.sh

+ 1
- 1
package/base/bize/bize.desc

@ -33,6 +33,6 @@
[L] GPL [L] GPL
[S] Stable [S] Stable
[V] 0.3
[V] 0.7
[P] X -1---5---9 229.100 [P] X -1---5---9 229.100

+ 29
- 16
package/base/bize/bize.man

@ -6,7 +6,7 @@ bize \- ROCK-Linux .tar.bz2 package manager
.BI "bize -i [-t] [-v] [-f] [-R " root "] " package1.tar.bz2 .BI "bize -i [-t] [-v] [-f] [-R " root "] " package1.tar.bz2
.BI ... .BI ...
.LP .LP
.BI "bize -r [-t] [-v] [-f] [-R " root "] " package1 ...
.BI "bize -r [-t] [-v] [-f] [-R " root "] " package1 " ..."
.SH DESCRIPTION .SH DESCRIPTION
.B bize .B bize
is a shell script capable of installing, updating and removing is a shell script capable of installing, updating and removing
@ -14,16 +14,17 @@ ROCK-Linux .tar.bz2 package files. It implements a subset of
.B mine .B mine
options. options.
.SS Requirements .SS Requirements
.BR md5sum ", " sort ", " rm ", " rmdir ", " mkdir ", " tar " and
.BR bzip2 .
.BR which " (or " type "), " sort ", " rm ", " rmdir ", "
.BR mkdir ", " tar " and " bzip2 ", and also " md5sum ", "
unless
.B "\-f"
is specified.
All these are standard programs present in any Linux system, but All these are standard programs present in any Linux system, but
.B bize .B bize
checks for them on startup anyway. 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.
.PP
The operating system must be able to remove files being in use.
All Linux systems have this ability.
.SS Compatibility .SS Compatibility
The .tar.bz2 and .gem formats are not compatible. Packages The .tar.bz2 and .gem formats are not compatible. Packages
installed with installed with
@ -38,11 +39,15 @@ ROCK-Linux 1.7.0+ targets produce .tar.bz2 packages only.
.B bize .B bize
installs packages slightly faster than installs packages slightly faster than
.BR "mine " .BR "mine "
and removes them several times slower. Much more time is required
to install a package than to remove it, so
and removes them about 25% faster (but see
.BR BUGS).
More time is usually required to remove a package than to install
it, so
.B bize .B bize
is, overall, about 20% slower than
is, overall, about 15% faster than
.BR mine . .BR mine .
Needless to say, your mileage may vary.
.PP
The .tar.bz2 packages are a bit smaller than the .gem packages and The .tar.bz2 packages are a bit smaller than the .gem packages and
are created a bit faster. are created a bit faster.
.SH OPTIONS .SH OPTIONS
@ -65,15 +70,23 @@ Force removal/replacement of the modified files.
.BI "\-r " root .BI "\-r " root
Use Use
.I root .I root
as root directory instead of /.
as root directory instead of
.BR / .
.TP .TP
.B "\-\-" .B "\-\-"
Terminate the option list. Terminate the option list.
.SH BUGS .SH BUGS
Regular files with no md5sum entry are ignored in test mode and
treated as modified in real mode unless
.B bize
will try to compute md5sum for any file with an md5sum entry,
even for devices and pipes. A normally built and installed ROCK-
Linux package includes md5sum entries for the regular files only.
.PP
.B bize
doesn't make backups, because I don't like them (of course, any
modified files are preserved unless
.B "\-f" .B "\-f"
is specified. A normally built and installed ROCK-Linux package
must include such an entry for each regular file.
is specified).
.B mine
makes backups, so this is listed as a bug.
.SH SEE ALSO .SH SEE ALSO
GEM-MINE GEM-MINE

+ 28
- 29
package/base/bize/bize.sh

@ -8,7 +8,7 @@ bize_usage()
bize_remove() bize_remove()
{ {
local tag base sum md5s="$adm/md5sums/$pkg"
local line base tag md5s="$adm/md5sums/$pkg"
if [ "$keep" ] ; then if [ "$keep" ] ; then
if [ ! -f "$md5s" ] ; then if [ ! -f "$md5s" ] ; then
@ -16,44 +16,43 @@ bize_remove()
return return
fi fi
while read tag base ; do
(cd "$root/" && md5sum -c "var/adm/md5sums/$pkg" 2> /dev/null) |
while read line ; do
base="${line%: *}"
stat="${line##*: }"
file="$root/$base" file="$root/$base"
if [ -z "$base" ] ; then
echo "$0: invalid line '$tag' in $md5s" 1>&2
if [ -z "$base" -o -z "$stat" ] ; then
echo "$0: invalid md5sum output '$line'" 1>&2
elif [ -f "$file" -a ! -L "$file" ] ; then elif [ -f "$file" -a ! -L "$file" ] ; then
sum="`md5sum < $file`"
sum="${sum% -}"
if [ "$tag" = "$sum" ] ; then
if [ "$stat" = OK ] ; then
$unlink "$file" $unlink "$file"
elif [ "$stat" != FAILED ] ; then
echo "$0: $file: $stat"
elif [ "$test" ] ; then elif [ "$test" ] ; then
echo "$0: $file: modified, skipping" echo "$0: $file: modified, skipping"
fi fi
fi fi
done < $md5s
done
fi fi
sort -r -- "$list" | while read tag base ; do
sort -r "$list" | while read tag base ; do
file="$root/$base" file="$root/$base"
if [ "$tag" != "$pkg:" ] ; then if [ "$tag" != "$pkg:" ] ; then
echo "$0: invalid tag '$tag' in $list" 1>&2 echo "$0: invalid tag '$tag' in $list" 1>&2
elif [ -z "$base" ] ; then elif [ -z "$base" ] ; then
echo "$0: missing file name in $list" 1>&2 echo "$0: missing file name in $list" 1>&2
elif [ "$base" != "${base#var/adm/}" ] ; then
continue
elif [ -L "$file" ] ; then elif [ -L "$file" ] ; then
$unlink "$file" $unlink "$file"
elif [ -d "$file" ] ; then elif [ -d "$file" ] ; then
$test rmdir $voption -- "$file"
$test rmdir $voption "$file"
elif [ "${base#var/adm/}" != "$base" -a -f "$file" ] ; then
$unlink "$file"
elif [ "$keep" -a -f "$file" ] ; then elif [ "$keep" -a -f "$file" ] ; then
[ "$test" ] || echo "$0: $file: modified, skipping" [ "$test" ] || echo "$0: $file: modified, skipping"
else else
$unlink "$file" $unlink "$file"
fi fi
done done
for base in cksums dependencies descs flists logs md5sums packages ; do
$unlink "$adm/$base/$pkg"
done
} }
bize_install() bize_install()
@ -68,13 +67,14 @@ bize_install()
echo "$0: $arch: not a .tar.bz2 file" 1>&2 echo "$0: $arch: not a .tar.bz2 file" 1>&2
return return
fi fi
pkg="${pkg##*/}"
pkg="${pkg%-[0-9]*}" pkg="${pkg%-[0-9]*}"
pkg="${pkg##*/}"
if [ -z "$pkg" ] ; then if [ -z "$pkg" ] ; then
echo "$0: $arch: missing package name" 1>&2 echo "$0: $arch: missing package name" 1>&2
return return
fi fi
[ "${arch#-}" = "$arch" ] || arch="./$arch"
list="$adm/flists/$pkg" list="$adm/flists/$pkg"
if [ -f "$list" ] ; then if [ -f "$list" ] ; then
@ -84,11 +84,11 @@ bize_install()
[ "$verbose" ] && echo "installing $pkg ..." [ "$verbose" ] && echo "installing $pkg ..."
fi fi
$test mkdir -p$verbose -- "$root/"
$test mkdir -p$verbose "$root/"
if [ "$test" ] ; then if [ "$test" ] ; then
echo "bzip2 -c -d -- $arch | tar $taropt -C $root/"
echo "bzip2 -c -d $arch | tar $taropt -C $root/"
else else
bzip2 -c -d -- "$arch" | tar $taropt -C "$root/"
bzip2 -c -d "$arch" | tar $taropt -C "$root/"
fi fi
} }
@ -106,7 +106,7 @@ bize_uninstall()
bize_main() bize_main()
{ {
local which=which file arch list="sort rm rmdir mkdir tar bzip2" local which=which file arch list="sort rm rmdir mkdir tar bzip2"
local install remove test verbose voption keep=1 root=/ taropt
local install remove test verbose voption keep=k root=/ taropt
while [ "$1" ] ; do while [ "$1" ] ; do
case "$1" in case "$1" in
@ -124,14 +124,14 @@ bize_main()
shift shift
done done
if type which > /dev/null 2>&1 ; then
if type sh > /dev/null 2>&1 ; then
which=type which=type
elif ! which which > /dev/null 2>&1 ; then
elif ! which sh > /dev/null ; then
echo "$0: unable to find 'type' or 'which'" 1>&2 echo "$0: unable to find 'type' or 'which'" 1>&2
return 1 return 1
fi fi
[ "$keep" ] && list="md5sum $list"
[ "$keep" ] && list="$list md5sum"
for file in $list ; do for file in $list ; do
if ! $which $file > /dev/null ; then if ! $which $file > /dev/null ; then
echo "$0: unable to find '$file'" 1>&2 echo "$0: unable to find '$file'" 1>&2
@ -144,13 +144,13 @@ bize_main()
return 1 return 1
fi fi
root=${root%/}
root="${root%/}"
[ "${root#-}" = "$root" ] || root="./$root"
local adm="$root/var/adm" unlink="$test rm -f$verbose --" pkg
local adm="$root/var/adm" unlink="$test rm -f$verbose" pkg
if [ "$install" ] ; then if [ "$install" ] ; then
taropt="x${verbose}"
[ "$keep" ] && taropt="${taropt}k"
taropt="xp${verbose}${keep}"
for arch do for arch do
bize_install bize_install
done done
@ -164,4 +164,3 @@ bize_main()
} }
bize_main "$@" bize_main "$@"
unset bize_usage bize_remove bize_install bize_uninstall bize_main

Loading…
Cancel
Save