Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/repo/arch32.sh
blob: d1039ed6b2b37d98d43660ec32b9f275efff1dfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# does local adaptions needed to build for Archlinux32
pkgctl_repo_patch_arch32() {
  local pkgname="$1"
  
  # add the remote branch with our patches
  git -C "${pkgname}" remote add -m master archlinux32 git://git.archlinux32.org/packages
  git -C "${pkgname}" fetch --depth 1 archlinux32

  # extend architecture with our architecture
  awk -i inplace '!/^arch=[^#]*any/ {gsub(/^arch=\(/,"arch=(i486 i686 pentium4 ")}; {print}' \
    "${pkgname}/PKGBUILD"
  
  # iterate the arch32 diffs in the archlinux32/master branch (we don't know
  # the destination repo, so we just scan both 'core' and 'extra')
  listfile=$(mktemp --tmpdir="${WORKDIR}" pkgctl-arch32.XXXXXXXXXX)
  git -C "${pkgname}" ls-tree -r --name-only archlinux32/master "core/${pkgname}" >"${listfile}"
  git -C "${pkgname}" ls-tree -r --name-only archlinux32/master "extra/${pkgname}" >>"${listfile}"
  for file in $(cat "${listfile}"); do
	if [[ "${file##*/}" = "PKGBUILD" ]]; then
		printf "\n\n# -- Arch32 specific --\n\n" >> "${pkgname}/PKGBUILD"
		git -C "${pkgname}" show archlinux32/master:"${file}" >> "${pkgname}/PKGBUILD"
	else
		git -C "${pkgname}" show archlinux32/master:"${file}" > "${pkgname}/${file##*/}"
	fi
  done
}