mirror of
				https://gitlab.archlinux.org/archlinux/devtools.git
				synced 2025-10-27 14:02:22 +01:00 
			
		
		
		
	Compare commits
	
		
			12 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 8ffc2e44ee | ||
|   | a628c1a006 | ||
|   | 8ba91b0574 | ||
|   | 671643053d | ||
|   | bf96c9f949 | ||
|   | a030cdc532 | ||
|   | b7a3c74c50 | ||
|   | a33ee6e78d | ||
|   | 1f24380a31 | ||
|   | fbbcc30e3d | ||
|   | c1752bd716 | ||
|   | 42d821ef7b | 
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| V=20111101 | ||||
| V=20111111 | ||||
|  | ||||
| PREFIX = /usr/local | ||||
|  | ||||
| @@ -52,7 +52,7 @@ all: $(BINPROGS) $(SBINPROGS) bash_completion zsh_completion | ||||
|  | ||||
| edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g" | ||||
|  | ||||
| %: %.in | ||||
| %: %.in Makefile lib/common.sh | ||||
| 	@echo "GEN $@" | ||||
| 	@m4 -P $@.in | $(edit) >$@ | ||||
| 	@chmod a-w "$@" | ||||
|   | ||||
							
								
								
									
										23
									
								
								archbuild.in
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								archbuild.in
									
									
									
									
									
								
							| @@ -53,25 +53,34 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then | ||||
| 	done | ||||
| 	exec 9>&- | ||||
|  | ||||
| 	# FIXME: temporary workaround until pacman 4.0 moves to [core] | ||||
| 	if pacman -V | grep -q 'v4.' && ( [[ "$repo" == 'extra' || "$repo" == 'multilib' ]] ); then | ||||
| 		pacman_conf=$(mktemp) | ||||
| 		cp "@pkgdatadir@/pacman-${repo}.conf" "${pacman_conf}" | ||||
| 		sed -r 's/^#(SigLevel = Never)/\1/' -i "${pacman_conf}" | ||||
| 	else | ||||
| 		pacman_conf="@pkgdatadir@/pacman-${repo}.conf" | ||||
| 	fi | ||||
|  | ||||
| 	rm -rf "${chroots}/${repo}-${arch}" | ||||
| 	mkdir -p "${chroots}/${repo}-${arch}" | ||||
| 	setarch "${arch}" mkarchroot \ | ||||
| 		-C "@pkgdatadir@/pacman-${repo}.conf" \ | ||||
| 		-C "${pacman_conf}" \ | ||||
| 		-M "@pkgdatadir@/makepkg-${arch}.conf" \ | ||||
| 		"${chroots}/${repo}-${arch}/root" \ | ||||
| 		"${base_packages[@]}" | ||||
|  | ||||
| 	# FIXME: temporary workaround until pacman 4.0 moves to [core] | ||||
| 	case $repo in | ||||
| 		core|extra|community|multilib) | ||||
| 			sed -r '/^SigLevel.*/d' -i "${chroots}/${repo}-${arch}/root/etc/pacman.conf" | ||||
| 		;; | ||||
| 	esac | ||||
| 	if pacman -V | grep -q 'v4.' && ( [[ "$repo" == 'extra' || "$repo" == 'multilib' ]] ); then | ||||
| 		cp "@pkgdatadir@/pacman-${repo}.conf" "${chroots}/${repo}-${arch}/root/etc/pacman.conf" | ||||
| 	fi | ||||
| else | ||||
| 	setarch ${arch} mkarchroot \ | ||||
| 		-u \ | ||||
| 		-C "@pkgdatadir@/pacman-${repo}.conf" \ | ||||
| 		-M "@pkgdatadir@/makepkg-${arch}.conf" \ | ||||
| 		"${chroots}/${repo}-${arch}/root" | ||||
| fi | ||||
|  | ||||
| msg "Building in chroot for [${repo}] (${arch})..." | ||||
| setarch "${arch}" makechrootpkg -c -r "${chroots}/${repo}-${arch}" | ||||
| setarch "${arch}" makechrootpkg -c -n -r "${chroots}/${repo}-${arch}" | ||||
|   | ||||
| @@ -15,7 +15,7 @@ case $scriptname in | ||||
| 	communityco) | ||||
| 		SVNURL="svn+ssh://aur.archlinux.org/srv/svn-packages";; | ||||
| 	*) | ||||
| 		die "error: couldn't find svn url for $scriptname" | ||||
| 		die "Couldn't find svn url for $scriptname" | ||||
| 		;; | ||||
| esac | ||||
|  | ||||
|   | ||||
| @@ -36,7 +36,7 @@ for file in "${known_files[@]}"; do | ||||
| done | ||||
|  | ||||
| for tag in "$@"; do | ||||
| 	stat_busy "copying ${trunk} to ${tag}" | ||||
| 	stat_busy "Copying ${trunk} to ${tag}" | ||||
|  | ||||
| 	if [[ -d repos/$tag ]]; then | ||||
| 		declare -a trash | ||||
| @@ -56,7 +56,7 @@ for tag in "$@"; do | ||||
| 	stat_done | ||||
| done | ||||
|  | ||||
| stat_busy "releasing package" | ||||
| stat_busy "Releasing package" | ||||
| printf -v tag_list ", %s" "$@"; tag_list="${tag_list#, }" | ||||
| svn commit -q -m "archrelease: copy ${trunk} to $tag_list" || abort | ||||
| stat_done | ||||
|   | ||||
							
								
								
									
										30
									
								
								commitpkg.in
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								commitpkg.in
									
									
									
									
									
								
							| @@ -4,9 +4,9 @@ m4_include(lib/common.sh) | ||||
|  | ||||
| getpkgfile() { | ||||
| 	if [[ ${#} -ne 1 ]]; then | ||||
| 		die 'ERROR: No canonical package found!' | ||||
| 		die 'No canonical package found!' | ||||
| 	elif [ ! -f "${1}" ]; then | ||||
| 		die "ERROR: Package ${1} not found!" | ||||
| 		die "Package ${1} not found!" | ||||
| 	fi | ||||
|  | ||||
| 	echo ${1} | ||||
| @@ -83,19 +83,19 @@ while getopts ':l:a:' flag; do | ||||
| 	case $flag in | ||||
| 		l) rsyncopts+=("--bwlimit=$2") ;; | ||||
| 		a) commit_arch=$2 ;; | ||||
| 		:) die "option requires an argument -- '$OPTARG'" ;; | ||||
| 		\?) die "invalid option -- '$OPTARG'" ;; | ||||
| 		:) die "Option requires an argument -- '$OPTARG'" ;; | ||||
| 		\?) die "Invalid option -- '$OPTARG'" ;; | ||||
| 	esac | ||||
| done | ||||
| shift $(( OPTIND - 1 )) | ||||
|  | ||||
| if [ -n "$(svn status -q)" ]; then | ||||
| 	msgtemplate="upgpkg: $pkgbase $(get_full_version)"$'\n\n' | ||||
| 	if [ -n "$1" ]; then | ||||
| 		stat_busy 'committing changes to trunk' | ||||
| 		stat_busy 'Committing changes to trunk' | ||||
| 		svn commit -q -m "${msgtemplate}${1}" || die | ||||
| 		stat_done | ||||
| 	else | ||||
| 		msgtemplate="upgpkg: $pkgbase $(get_full_version)"$'\n\n' | ||||
| 		msgfile="$(mktemp)" | ||||
| 		echo "$msgtemplate" > "$msgfile" | ||||
| 		if [ -n "$SVN_EDITOR" ]; then | ||||
| @@ -108,7 +108,7 @@ if [ -n "$(svn status -q)" ]; then | ||||
| 			vi "$msgfile" | ||||
| 		fi | ||||
| 		[ -s "$msgfile" ] || die | ||||
| 		stat_busy 'committing changes to trunk' | ||||
| 		stat_busy 'Committing changes to trunk' | ||||
| 		svn commit -q -F "$msgfile" || die | ||||
| 		unlink "$msgfile" | ||||
| 		stat_done | ||||
| @@ -164,26 +164,26 @@ else | ||||
| fi | ||||
|  | ||||
| if [[ ${#uploads[*]} -gt 0 ]]; then | ||||
| 	msg 'uploading all package and signature files' | ||||
| 	msg 'Uploading all package and signature files' | ||||
| 	rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die | ||||
| fi | ||||
|  | ||||
| if [ "${arch[*]}" == 'any' ]; then | ||||
| 	if [ -d ../repos/$repo-i686 -a -d ../repos/$repo-x86_64 ]; then | ||||
| 		pushd ../repos/ >/dev/null | ||||
| 		stat_busy "removing $repo-i686 and $repo-x86_64" | ||||
| 		svn rm $repo-i686 | ||||
| 		svn rm $repo-x86_64 | ||||
| 		svn commit -q -m "removed $repo-i686 and $repo-x86_64 for $pkgname" | ||||
| 		stat_busy "Removing $repo-i686 and $repo-x86_64" | ||||
| 		svn rm -q $repo-i686 | ||||
| 		svn rm -q $repo-x86_64 | ||||
| 		svn commit -q -m "Removed $repo-i686 and $repo-x86_64 for $pkgname" | ||||
| 		stat_done | ||||
| 		popd >/dev/null | ||||
| 	fi | ||||
| else | ||||
| 	if [ -d ../repos/$repo-any ]; then | ||||
| 		pushd ../repos/ >/dev/null | ||||
| 		stat_busy "removing $repo-any" | ||||
| 		svn rm $repo-any | ||||
| 		svn commit -q -m "removed $repo-any for $pkgname" | ||||
| 		stat_busy "Removing $repo-any" | ||||
| 		svn rm -q $repo-any | ||||
| 		svn commit -q -m "Removed $repo-any for $pkgname" | ||||
| 		stat_done | ||||
| 		popd >/dev/null | ||||
| 	fi | ||||
|   | ||||
| @@ -15,7 +15,7 @@ script_mode=${0##*/find-lib} | ||||
|  | ||||
| case $script_mode in | ||||
| 	deps|provides) true;; | ||||
| 	*) die "unknown mode $script_mode" ;; | ||||
| 	*) die "Unknown mode $script_mode" ;; | ||||
| esac | ||||
|  | ||||
| if [[ -z $1 ]]; then | ||||
|   | ||||
| @@ -58,14 +58,14 @@ stat_done() { | ||||
| } | ||||
|  | ||||
| setup_workdir() { | ||||
| 	[ -z "$WORKDIR" ] && WORKDIR=$(mktemp -d /tmp/$(basename $0).XXXXXXXXXX) | ||||
| 	[[ -z $WORKDIR ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX") | ||||
| } | ||||
|  | ||||
| cleanup() { | ||||
| 	trap - EXIT INT QUIT TERM | ||||
|  | ||||
| 	[ -n "$WORKDIR" ] && rm -rf "$WORKDIR" | ||||
| 	[ "$1" ] && exit $1 | ||||
| 	[[ -n $WORKDIR ]] && rm -rf "$WORKDIR" | ||||
| 	[[ $1 ]] && exit $1 | ||||
| } | ||||
|  | ||||
| abort() { | ||||
|   | ||||
| @@ -87,7 +87,7 @@ makepkg_args="$makepkg_args ${*:$OPTIND}" | ||||
| # See if -R was passed to makepkg | ||||
| for arg in ${*:$OPTIND}; do | ||||
| 	if [[ $arg = -R ]]; then | ||||
| 		repack=1 | ||||
| 		repack=true | ||||
| 		break | ||||
| 	fi | ||||
| done | ||||
| @@ -114,7 +114,7 @@ umask 0022 | ||||
| # Note this is the same FD number as in mkarchroot | ||||
| exec 9>"$copydir.lock" | ||||
| if ! flock -n 9; then | ||||
| 	stat_busy "locking chroot copy '$copy'" | ||||
| 	stat_busy "Locking chroot copy '$copy'" | ||||
| 	flock 9 | ||||
| 	stat_done | ||||
| fi | ||||
| @@ -125,12 +125,12 @@ if [[ ! -d $copydir ]] || $clean_first; then | ||||
| 	exec 8>"$chrootdir/root.lock" | ||||
|  | ||||
| 	if ! flock -sn 8; then | ||||
| 		stat_busy "locking clean chroot" | ||||
| 		stat_busy "Locking clean chroot" | ||||
| 		flock -s 8 | ||||
| 		stat_done | ||||
| 	fi | ||||
|  | ||||
| 	stat_busy 'creating clean working copy' | ||||
| 	stat_busy 'Creating clean working copy' | ||||
| 	use_rsync=false | ||||
| 	if type -P btrfs >/dev/null; then | ||||
| 		[[ -d $copydir ]] && btrfs subvolume delete "$copydir" &>/dev/null | ||||
| @@ -274,7 +274,10 @@ sudo -u nobody makepkg $makepkg_args || touch BUILD_FAILED | ||||
|  | ||||
| if $run_namcap; then | ||||
| 	pacman -S --needed --noconfirm namcap | ||||
| 	namcap /build/PKGBUILD /pkgdest/*.pkg.tar.?z > /build/namcap.log | ||||
| 	for pkgfile in /build/PKGBUILD /pkgdest/*.pkg.tar.?z; do | ||||
| 		echo "Checking \${pkgfile##*/}" | ||||
| 		namcap "\$pkgfile" 2>&1 | tee "/build/\${pkgfile##*/}-namcap.log" | ||||
| 	done | ||||
| fi | ||||
|  | ||||
| exit 0 | ||||
| @@ -282,7 +285,7 @@ EOF | ||||
| chmod +x "$copydir/chrootbuild" | ||||
|  | ||||
| if mkarchroot -r "/chrootbuild" "$copydir"; then | ||||
| 	for pkgfile in "$copydir"/pkgdest/*.pkg.tar.*; do | ||||
| 	for pkgfile in "$copydir"/pkgdest/*.pkg.tar.?z; do | ||||
| 		if $add_to_db; then | ||||
| 			mkdir -p "$copydir/repo" | ||||
| 			pushd "$copydir/repo" >/dev/null | ||||
| @@ -294,7 +297,7 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then | ||||
| 		mv "$pkgfile" "$PKGDEST" | ||||
| 	done | ||||
|  | ||||
| 	for l in "$copydir"/build/{namcap,*-{build,check,package,package_*}}.log; do | ||||
| 	for l in "$copydir"/build/*-{build,check,namcap,package,package_*}.log; do | ||||
| 		[[ -f $l ]] && mv "$l" . | ||||
| 	done | ||||
| else | ||||
|   | ||||
| @@ -48,21 +48,21 @@ while getopts 'r:ufnhC:M:c:' arg; do | ||||
| done | ||||
|  | ||||
| if [ "$EUID" != '0' ]; then | ||||
| 	die 'this script must be run as root.' | ||||
| 	die 'This script must be run as root.' | ||||
| fi | ||||
|  | ||||
| shift $(($OPTIND - 1)) | ||||
|  | ||||
| if [ "$RUN" = '' -a $# -lt 2 ]; then | ||||
| 	die 'you must specify a directory and one or more packages' | ||||
| 	die 'You must specify a directory and one or more packages.' | ||||
| elif [ $# -lt 1 ]; then | ||||
| 	die 'you must specify a directory' | ||||
| 	die 'You must specify a directory.' | ||||
| fi | ||||
|  | ||||
| working_dir="$(readlink -f ${1})" | ||||
| shift 1 | ||||
|  | ||||
| [ "${working_dir}" = '' ] && die 'please specify a working directory' | ||||
| [ "${working_dir}" = '' ] && die 'Please specify a working directory.' | ||||
|  | ||||
| if [ -z "$cache_dir" ]; then | ||||
| 	cache_conf=${working_dir}/etc/pacman.conf | ||||
| @@ -129,6 +129,14 @@ copy_hostconf () { | ||||
| 	chroot "${working_dir}" /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS > "${working_dir}/etc/mtab" | ||||
| 	cp /etc/resolv.conf "${working_dir}/etc/resolv.conf" | ||||
| 	echo "Server = ${host_mirror}" > ${working_dir}/etc/pacman.d/mirrorlist | ||||
|  | ||||
| 	if [ "$pac_conf" != "" -a "$NOCOPY" = "n" ]; then | ||||
| 		cp ${pac_conf} ${working_dir}/etc/pacman.conf | ||||
| 	fi | ||||
|  | ||||
| 	if [ "$makepkg_conf" != "" -a "$NOCOPY" = "n" ]; then | ||||
| 		cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| chroot_umount () { | ||||
| @@ -149,7 +157,7 @@ chroot_lock () { | ||||
|  | ||||
| 	# Lock the chroot. Take note of the FD number. | ||||
| 	if ! flock -n 9; then | ||||
| 		stat_busy "locking chroot" | ||||
| 		stat_busy "Locking chroot" | ||||
| 		flock 9 | ||||
| 		stat_done | ||||
| 	fi | ||||
| @@ -161,7 +169,7 @@ if [ "$RUN" != "" ]; then | ||||
| 	# run chroot {{{ | ||||
| 	#Sanity check | ||||
| 	if [ ! -f "${working_dir}/.arch-chroot" ]; then | ||||
| 		die "'${working_dir}' does not appear to be a Arch chroot" | ||||
| 		die "'${working_dir}' does not appear to be a Arch chroot." | ||||
| 	fi | ||||
|  | ||||
| 	chroot_lock | ||||
| @@ -174,7 +182,7 @@ if [ "$RUN" != "" ]; then | ||||
| else | ||||
| 	# {{{ build chroot | ||||
| 	if [ -e "${working_dir}" -a "${FORCE}" = "n" ]; then | ||||
| 		die "working dir '${working_dir}' already exists - try using -f" | ||||
| 		die "Working directory '${working_dir}' already exists - try using -f" | ||||
| 	fi | ||||
|  | ||||
| 	if { type -P btrfs && btrfs subvolume create "${working_dir}"; } &>/dev/null; then | ||||
| @@ -198,7 +206,7 @@ else | ||||
| 			op="${op}f" | ||||
| 		fi | ||||
| 		if ! pacman ${op} ${pacargs} $@; then | ||||
| 			die 'failed to install all packages' | ||||
| 			die 'Failed to install all packages' | ||||
| 		fi | ||||
| 	fi | ||||
|  | ||||
| @@ -206,19 +214,13 @@ else | ||||
| 		ldconfig -r "${working_dir}" | ||||
| 	fi | ||||
|  | ||||
| 	if [ "$pac_conf" != "" -a "$NOCOPY" = "n" ]; then | ||||
| 		cp ${pac_conf} ${working_dir}/etc/pacman.conf | ||||
| 	fi | ||||
|  | ||||
| 	if [ "$makepkg_conf" != "" -a "$NOCOPY" = "n" ]; then | ||||
| 		cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf | ||||
| 	fi | ||||
|  | ||||
| 	if [ -e "${working_dir}/etc/locale.gen" ]; then | ||||
| 		sed -i 's@^#\(en_US\|de_DE\)\(\.UTF-8\)@\1\2@' "${working_dir}/etc/locale.gen" | ||||
| 		chroot "${working_dir}" /usr/sbin/locale-gen | ||||
| 	fi | ||||
|  | ||||
| 	copy_hostconf | ||||
|  | ||||
| 	if [ ! -e "${working_dir}/.arch-chroot" ]; then | ||||
| 		date +%s > "${working_dir}/.arch-chroot" | ||||
| 	fi | ||||
|   | ||||
| @@ -48,7 +48,7 @@ Architecture = auto | ||||
| # trusted. | ||||
| #SigLevel = Optional TrustAll | ||||
| # Disable signature checks for now | ||||
| SigLevel = Never | ||||
| #SigLevel = Never | ||||
|  | ||||
| # | ||||
| # REPOSITORIES | ||||
|   | ||||
| @@ -48,7 +48,7 @@ Architecture = auto | ||||
| # trusted. | ||||
| #SigLevel = Optional TrustAll | ||||
| # Disable signature checks for now | ||||
| SigLevel = Never | ||||
| #SigLevel = Never | ||||
|  | ||||
| # | ||||
| # REPOSITORIES | ||||
|   | ||||
		Reference in New Issue
	
	Block a user