View | Details | Raw Unified | Return to bug 6739
Collapse All | Expand All

(-)hasher-1.0.13/functions.in (-2 / +6 lines)
Lines 77-82 Link Here
77
def_target=@deftarget@
77
def_target=@deftarget@
78
target=
78
target=
79
79
80
# repo directory.
81
def_repo=repo
82
repo=
83
80
# RPM --excludedocs
84
# RPM --excludedocs
81
exclude_docs=
85
exclude_docs=
82
86
Lines 313-326 Link Here
313
# assumed: cwd == workdir
317
# assumed: cwd == workdir
314
make_repo()
318
make_repo()
315
{
319
{
316
	mkdir -p $verbose -- repo/{{SRPMS,${target:-$def_target}/RPMS}.hasher,${target:-$def_target}/base}
320
	mkdir -p $verbose -- ${repo:-$def_repo}/{{SRPMS,${target:-$def_target}/RPMS}.hasher,${target:-$def_target}/base}
317
}
321
}
318
322
319
# assumed: cwd == workdir, defined prog_genbasedir
323
# assumed: cwd == workdir, defined prog_genbasedir
320
update_repo()
324
update_repo()
321
{
325
{
322
	[ -z "$no_stuff" ] || return 0
326
	[ -z "$no_stuff" ] || return 0
323
	"$prog_genbasedir" --topdir=repo --no-oldhashfile --bz2only --mapi ${target:-$def_target} hasher &&
327
	"$prog_genbasedir" --topdir=${repo:-$def_repo} --no-oldhashfile --bz2only --mapi ${target:-$def_target} hasher &&
324
		Verbose "updated hasher repository indices." ||
328
		Verbose "updated hasher repository indices." ||
325
		Fatal "failed to update hasher repository indices."
329
		Fatal "failed to update hasher repository indices."
326
}
330
}
(-)hasher-1.0.13/hsh (-1 / +6 lines)
Lines 56-61 Link Here
56
  --query-req-prog=FILE             program to run to query for requirements
56
  --query-req-prog=FILE             program to run to query for requirements
57
                                    instead of autogenerated script;
57
                                    instead of autogenerated script;
58
  --target=ARCH                     target architecture;
58
  --target=ARCH                     target architecture;
59
  --repo=DIR                        repository directory;
59
  --number=NUMBER                   subconfig identifier;
60
  --number=NUMBER                   subconfig identifier;
60
  --nprocs=NUMBER                   number of CPUs to use;
61
  --nprocs=NUMBER                   number of CPUs to use;
61
  --mountpoints=LIST                comma-separated list of known mount points;
62
  --mountpoints=LIST                comma-separated list of known mount points;
Lines 77-83 Link Here
77
	[ -n "$1" ] && exit "$1" || exit
78
	[ -n "$1" ] && exit "$1" || exit
78
}
79
}
79
80
80
TEMP=`getopt -n $PROG -o q,v,V,h -l with-stuff,without-stuff,no-stuff,no-cache,no-contents-indices,excludedocs,repackage-source,initroot-only,no-sisyphus-check::,no-sisyphus-check-in::,no-sisyphus-check-out::,rebuild-prog:,query-req-prog:,target:,number:,nprocs:,mountpoints:,hasher-priv-dir:,install-langs:,build-args:,contents-index-all:,contents-index-bin:,pkg-init-list:,pkg-build-list:,apt-config:,apt-prefix:,quiet,verbose,help,version -- "$@"` || Usage
81
TEMP=`getopt -n $PROG -o q,v,V,h -l with-stuff,without-stuff,no-stuff,no-cache,no-contents-indices,excludedocs,repackage-source,initroot-only,no-sisyphus-check::,no-sisyphus-check-in::,no-sisyphus-check-out::,rebuild-prog:,query-req-prog:,target:,repo:,number:,nprocs:,mountpoints:,hasher-priv-dir:,install-langs:,build-args:,contents-index-all:,contents-index-bin:,pkg-init-list:,pkg-build-list:,apt-config:,apt-prefix:,quiet,verbose,help,version -- "$@"` || Usage
81
eval set -- "$TEMP"
82
eval set -- "$TEMP"
82
83
83
no_cache=
84
no_cache=
Lines 128-133 Link Here
128
			[ -z "${target##[A-Za-z]*}" ] ||
129
			[ -z "${target##[A-Za-z]*}" ] ||
129
				Fatal "--target: $target: invalid architecture."
130
				Fatal "--target: $target: invalid architecture."
130
			;;
131
			;;
132
		--repo) shift; repo="$1"
133
			;;
131
		--build-args) shift; rpmargs="$1"
134
		--build-args) shift; rpmargs="$1"
132
			;;
135
			;;
133
		--number) shift; number="${1##-}"
136
		--number) shift; number="${1##-}"
Lines 229-234 Link Here
229
	rm -rf aptbox
232
	rm -rf aptbox
230
	$hasher_dir/mkaptbox "$workdir" \
233
	$hasher_dir/mkaptbox "$workdir" \
231
		${target:+--target="$target"} \
234
		${target:+--target="$target"} \
235
		${repo:+--repo="$repo"} \
232
		${apt_config:+--apt-config="$apt_config"} \
236
		${apt_config:+--apt-config="$apt_config"} \
233
		${quiet:+$quiet} \
237
		${quiet:+$quiet} \
234
		${verbose:+$verbose} \
238
		${verbose:+$verbose} \
Lines 263-268 Link Here
263
	[ -n "$f" ] || return 0
267
	[ -n "$f" ] || return 0
264
	$hasher_dir/rebuild "$workdir" \
268
	$hasher_dir/rebuild "$workdir" \
265
		${target:+--target="$target"} \
269
		${target:+--target="$target"} \
270
		${repo:+--repo="$repo"} \
266
		${hasher_priv_dir:+--hasher-priv-dir="$hasher_priv_dir"} \
271
		${hasher_priv_dir:+--hasher-priv-dir="$hasher_priv_dir"} \
267
		${known_mountpoints:+--mountpoints="$known_mountpoints"} \
272
		${known_mountpoints:+--mountpoints="$known_mountpoints"} \
268
		${quiet:+$quiet} \
273
		${quiet:+$quiet} \
(-)hasher-1.0.13/mkaptbox (-2 / +5 lines)
Lines 41-46 Link Here
41
  --with-stuff              configure sources.list for the work repository;
41
  --with-stuff              configure sources.list for the work repository;
42
  --without-stuff           do not configure sources.list for the work repository;
42
  --without-stuff           do not configure sources.list for the work repository;
43
  --target=ARCH             target architecture of the work repository;
43
  --target=ARCH             target architecture of the work repository;
44
  --repo=DIR                path to work repository directory;
44
  --apt-config=FILE         path to custom apt.conf file;
45
  --apt-config=FILE         path to custom apt.conf file;
45
  --apt-prefix=DIR          path to apt directory prefix (e.g. /usr);
46
  --apt-prefix=DIR          path to apt directory prefix (e.g. /usr);
46
  --no-update               do not run "apt-get update" after creation;
47
  --no-update               do not run "apt-get update" after creation;
Lines 57-63 Link Here
57
	[ -n "$1" ] && exit "$1" || exit
58
	[ -n "$1" ] && exit "$1" || exit
58
}
59
}
59
60
60
TEMP=`getopt -n $PROG -o f,u,q,v,V,h -l with-stuff,without-stuff,no-stuff,target:,apt-config:,apt-prefix:,no-update,update,force,quiet,verbose,help,version -- "$@"` || Usage
61
TEMP=`getopt -n $PROG -o f,u,q,v,V,h -l with-stuff,without-stuff,no-stuff,target:,repo:,apt-config:,apt-prefix:,no-update,update,force,quiet,verbose,help,version -- "$@"` || Usage
61
eval set -- "$TEMP"
62
eval set -- "$TEMP"
62
63
63
force=
64
force=
Lines 73-78 Link Here
73
			[ -z "${target##[A-Za-z]*}" ] ||
74
			[ -z "${target##[A-Za-z]*}" ] ||
74
				Fatal "--target: $target: invalid architecture."
75
				Fatal "--target: $target: invalid architecture."
75
			;;
76
			;;
77
		--repo) shift; repo="$1"
78
			;;
76
		--apt-config)
79
		--apt-config)
77
			apt_config="$(opt_check_read "$1" "$2")"
80
			apt_config="$(opt_check_read "$1" "$2")"
78
			shift
81
			shift
Lines 159-165 Link Here
159
162
160
target_config="./etc/apt/sources.list"
163
target_config="./etc/apt/sources.list"
161
cat >"$target_config" <<__EOF__
164
cat >"$target_config" <<__EOF__
162
${no_stuff:+#}rpm file:$workdir/repo ${target:-$def_target} hasher
165
${no_stuff:+#}rpm file:$workdir/${repo:-$def_repo} ${target:-$def_target} hasher
163
$(grep '^[^#]' "$sl_value")
166
$(grep '^[^#]' "$sl_value")
164
__EOF__
167
__EOF__
165
Verbose "created APT source list file \`$target_config'"
168
Verbose "created APT source list file \`$target_config'"
(-)hasher-1.0.13/rebuild (-4 / +7 lines)
Lines 47-52 Link Here
47
  --rebuild-prog=FILE               program to run for rebuild instead of autogenerated script;
47
  --rebuild-prog=FILE               program to run for rebuild instead of autogenerated script;
48
  --query-req-prog=FILE             program to run to query for requirements instead of autogenerated script;
48
  --query-req-prog=FILE             program to run to query for requirements instead of autogenerated script;
49
  --target=ARCH                     target architecture;
49
  --target=ARCH                     target architecture;
50
  --repo=DIR                        repository directory;
50
  --args=ARGS                       extra arguments for rpmbuild;
51
  --args=ARGS                       extra arguments for rpmbuild;
51
  --mountpoints=LIST                comma-separated list of known mount points;
52
  --mountpoints=LIST                comma-separated list of known mount points;
52
  --nodeps                          ignore package dependencies (dangerous);
53
  --nodeps                          ignore package dependencies (dangerous);
Lines 60-66 Link Here
60
	[ -n "$1" ] && exit "$1" || exit
61
	[ -n "$1" ] && exit "$1" || exit
61
}
62
}
62
63
63
TEMP=`getopt -n $PROG -o q,v,V,h -l with-stuff,without-stuff,no-stuff,excludedocs,no-sisyphus-check::,no-sisyphus-check-in::,no-sisyphus-check-out::,rebuild-prog:,query-req-prog:,target:,args:,mountpoints:,nodeps,number:,hasher-priv-dir:,quiet,verbose,help,version -- "$@"` || Usage
64
TEMP=`getopt -n $PROG -o q,v,V,h -l with-stuff,without-stuff,no-stuff,excludedocs,no-sisyphus-check::,no-sisyphus-check-in::,no-sisyphus-check-out::,rebuild-prog:,query-req-prog:,target:,repo:,args:,mountpoints:,nodeps,number:,hasher-priv-dir:,quiet,verbose,help,version -- "$@"` || Usage
64
eval set -- "$TEMP"
65
eval set -- "$TEMP"
65
66
66
nodeps=
67
nodeps=
Lines 96-101 Link Here
96
			[ -z "${target##[A-Za-z]*}" ] ||
97
			[ -z "${target##[A-Za-z]*}" ] ||
97
				Fatal "--target: $target: invalid architecture."
98
				Fatal "--target: $target: invalid architecture."
98
			;;
99
			;;
100
		--repo) shift; repo="$1"
101
			;;
99
		--args) shift; rpmargs="$1"
102
		--args) shift; rpmargs="$1"
100
			;;
103
			;;
101
		--mountpoints) shift; known_mountpoints="$1"
104
		--mountpoints) shift; known_mountpoints="$1"
Lines 311-328 Link Here
311
case `find chroot/.out/ -mindepth 1 -maxdepth 1 -type f -name \*.src.rpm |grep -c '\.src\.rpm$'` in
314
case `find chroot/.out/ -mindepth 1 -maxdepth 1 -type f -name \*.src.rpm |grep -c '\.src\.rpm$'` in
312
	0)
315
	0)
313
		find chroot/.in/ -mindepth 1 -maxdepth 1 -type f -name \*.src.rpm -print0 |
316
		find chroot/.in/ -mindepth 1 -maxdepth 1 -type f -name \*.src.rpm -print0 |
314
			xargs -r0 mv --reply=yes $verbose --target-directory=repo/SRPMS.hasher/ --
317
			xargs -r0 mv --reply=yes $verbose --target-directory=${repo:-$def_repo}/SRPMS.hasher/ --
315
		;;
318
		;;
316
	1)
319
	1)
317
		find chroot/.out/ -mindepth 1 -maxdepth 1 -type f -name \*.src.rpm -print0 |
320
		find chroot/.out/ -mindepth 1 -maxdepth 1 -type f -name \*.src.rpm -print0 |
318
			xargs -r0 mv --reply=yes $verbose --target-directory=repo/SRPMS.hasher/ --
321
			xargs -r0 mv --reply=yes $verbose --target-directory=${repo:-$def_repo}/SRPMS.hasher/ --
319
		;;
322
		;;
320
	*)
323
	*)
321
		Fatal "too many src.rpm files written."
324
		Fatal "too many src.rpm files written."
322
		;;
325
		;;
323
esac
326
esac
324
find chroot/.out/ -mindepth 1 -maxdepth 1 -type f -name \*.rpm -print0 |
327
find chroot/.out/ -mindepth 1 -maxdepth 1 -type f -name \*.rpm -print0 |
325
	xargs -r0 mv --reply=yes $verbose --target-directory=repo/"${target:-$def_target}"/RPMS.hasher/ --
328
	xargs -r0 mv --reply=yes $verbose --target-directory=${repo:-$def_repo}/"${target:-$def_target}"/RPMS.hasher/ --
326
329
327
purge_chroot_in
330
purge_chroot_in
328
purge_chroot_out
331
purge_chroot_out

Return to bug 6739