View | Details | Raw Unified
Collapse All | Expand All

(-)sisyphus-0.9.1/bin/sisyphus_unpaired.unpaired (-4 / +10 lines)
 Lines 27-42    Link Here 
27
show_help()
27
show_help()
28
{
28
{
29
	cat <<EOF
29
	cat <<EOF
30
Usage: $PROG [options] <output-directory>
30
Usage: $PROG [options] <output-directory>
31
31
32
Valid options are:
32
Valid options are:
33
  -a, --architectures=LIST  architectures to handle;
33
  -a, --architectures=LIST  architectures to handle;
34
  -p, --prefix=DIR          path to repository location;
34
  -p, --prefix=DIR          path to repository location;
35
  -s, --safe-index          generate index file;
35
  -q, --quiet               try to be more quiet;
36
  -q, --quiet               try to be more quiet;
36
  -v, --verbose             try to be more verbose;
37
  -v, --verbose             try to be more verbose;
37
  -h, --help                show this text and exit.
38
  -h, --help                show this text and exit.
38
EOF
39
EOF
39
	exit
40
	exit
40
}
41
}
41
42
42
show_usage()
43
show_usage()
 Lines 52-78   exit_handler() Link Here 
52
	local rc=$?
53
	local rc=$?
53
	trap - EXIT
54
	trap - EXIT
54
	[ -z "$WORKDIR" ] || rm -rf -- "$WORKDIR"
55
	[ -z "$WORKDIR" ] || rm -rf -- "$WORKDIR"
55
	exit $rc
56
	exit $rc
56
}
57
}
57
58
58
DATADIR=
59
DATADIR=
59
verbose=
60
verbose=
60
TEMP=`getopt -n $PROG -o a:,p:,h,q,v -l architectures:,prefix:,help,quiet,verbose -- "$@"` || show_usage
61
safe_index=
62
TEMP=`getopt -n $PROG -o a:,p:,s,h,q,v -l architectures:,prefix:,safe-index,help,quiet,verbose -- "$@"` || show_usage
61
eval set -- "$TEMP"
63
eval set -- "$TEMP"
62
64
63
while :; do
65
while :; do
64
	case $1 in
66
	case $1 in
65
		-a|--architectures) shift
67
		-a|--architectures) shift
66
			ARCHITECTURES="$1"
68
			ARCHITECTURES="$1"
67
			;;
69
			;;
68
		-p| --prefix) shift
70
		-p| --prefix) shift
69
			PREFIX="$(readlink -ev "$1")"
71
			PREFIX="$(readlink -ev "$1")"
70
			;;
72
			;;
73
		-s|--safe-index) safe_index=1
74
			;;
71
		-q|--quiet) verbose=
75
		-q|--quiet) verbose=
72
			;;
76
			;;
73
		-v|--verbose) verbose=-v
77
		-v|--verbose) verbose=-v
74
			;;
78
			;;
75
		-h|--help) show_help
79
		-h|--help) show_help
76
			;;
80
			;;
77
		--) shift; break
81
		--) shift; break
78
			;;
82
			;;
 Lines 111-121   pushd "$NEW_SRC_REPOSITORIES" >/dev/null Link Here 
111
find ! -name 'altlinux-release-*src\.rpm' -name \*.src.rpm |
115
find ! -name 'altlinux-release-*src\.rpm' -name \*.src.rpm |
112
	cut -d/ -f2- |
116
	cut -d/ -f2- |
113
	sort -u >"$WORKDIR/src.present"
117
	sort -u >"$WORKDIR/src.present"
114
popd >/dev/null
118
popd >/dev/null
115
119
116
cut -f1 $WORKDIR/src-bin |sort -u >"$WORKDIR/src.used"
120
cut -f1 $WORKDIR/src-bin |sort -u >"$WORKDIR/src.used"
117
121
118
cd "$DATADIR"
122
cd "$DATADIR"
119
cat "$WORKDIR/src.used" |join -v2 - "$WORKDIR/src.present"        >src-unused
123
cat "$WORKDIR/src.used" | join -v2 - "$WORKDIR/src.present"	   >src-without-bin
120
cat "$WORKDIR/src.used" |join -v1 - "$WORKDIR/src.present"        >src-unmet
124
cat "$WORKDIR/src.used" | join -v1 - "$WORKDIR/src.present"	   >src-not-existent
121
cat "$WORKDIR/src-bin"  |join -v1 -o 1.2 - "$WORKDIR/src.present" >bin-unmet
125
cat "$WORKDIR/src-bin"  | join -v1 -o 1.2 - "$WORKDIR/src.present" >bin-without-src
126
127
[ -z "$safe_index" ] || sort -o src-bin.index "$WORKDIR/src-bin"