--- sisyphus-0.9.1/bin/sisyphus_unpaired.unpaired 2005-07-01 22:20:05 +0400 +++ sisyphus-0.9.1/bin/sisyphus_unpaired 2005-09-06 17:39:27 +0400 @@ -27,16 +27,17 @@ show_help() { cat < Valid options are: -a, --architectures=LIST architectures to handle; -p, --prefix=DIR path to repository location; + -s, --safe-index generate index file; -q, --quiet try to be more quiet; -v, --verbose try to be more verbose; -h, --help show this text and exit. EOF exit } show_usage() @@ -52,27 +53,30 @@ exit_handler() local rc=$? trap - EXIT [ -z "$WORKDIR" ] || rm -rf -- "$WORKDIR" exit $rc } DATADIR= verbose= -TEMP=`getopt -n $PROG -o a:,p:,h,q,v -l architectures:,prefix:,help,quiet,verbose -- "$@"` || show_usage +safe_index= +TEMP=`getopt -n $PROG -o a:,p:,s,h,q,v -l architectures:,prefix:,safe-index,help,quiet,verbose -- "$@"` || show_usage eval set -- "$TEMP" while :; do case $1 in -a|--architectures) shift ARCHITECTURES="$1" ;; -p| --prefix) shift PREFIX="$(readlink -ev "$1")" ;; + -s|--safe-index) safe_index=1 + ;; -q|--quiet) verbose= ;; -v|--verbose) verbose=-v ;; -h|--help) show_help ;; --) shift; break ;; @@ -111,11 +115,13 @@ pushd "$NEW_SRC_REPOSITORIES" >/dev/null find ! -name 'altlinux-release-*src\.rpm' -name \*.src.rpm | cut -d/ -f2- | sort -u >"$WORKDIR/src.present" popd >/dev/null cut -f1 $WORKDIR/src-bin |sort -u >"$WORKDIR/src.used" cd "$DATADIR" -cat "$WORKDIR/src.used" |join -v2 - "$WORKDIR/src.present" >src-unused -cat "$WORKDIR/src.used" |join -v1 - "$WORKDIR/src.present" >src-unmet -cat "$WORKDIR/src-bin" |join -v1 -o 1.2 - "$WORKDIR/src.present" >bin-unmet +cat "$WORKDIR/src.used" | join -v2 - "$WORKDIR/src.present" >src-without-bin +cat "$WORKDIR/src.used" | join -v1 - "$WORKDIR/src.present" >src-not-existent +cat "$WORKDIR/src-bin" | join -v1 -o 1.2 - "$WORKDIR/src.present" >bin-without-src + +[ -z "$safe_index" ] || sort -o src-bin.index "$WORKDIR/src-bin"