[arch-commits] Commit in eclipse/repos (18 files)
Jan Steffens
heftig at archlinux.org
Fri Jun 30 16:03:41 UTC 2017
Date: Friday, June 30, 2017 @ 16:03:39
Author: heftig
Revision: 299436
archrelease: copy trunk to extra-i686, extra-x86_64
Added:
eclipse/repos/extra-i686/PKGBUILD
(from rev 299435, eclipse/trunk/PKGBUILD)
eclipse/repos/extra-i686/commonify
(from rev 299435, eclipse/trunk/commonify)
eclipse/repos/extra-i686/eclipse.desktop
(from rev 299435, eclipse/trunk/eclipse.desktop)
eclipse/repos/extra-i686/eclipse.sh
(from rev 299435, eclipse/trunk/eclipse.sh)
eclipse/repos/extra-x86_64/PKGBUILD
(from rev 299435, eclipse/trunk/PKGBUILD)
eclipse/repos/extra-x86_64/commonify
(from rev 299435, eclipse/trunk/commonify)
eclipse/repos/extra-x86_64/eclipse.desktop
(from rev 299435, eclipse/trunk/eclipse.desktop)
eclipse/repos/extra-x86_64/eclipse.sh
(from rev 299435, eclipse/trunk/eclipse.sh)
Deleted:
eclipse/repos/extra-i686/PKGBUILD
eclipse/repos/extra-i686/commonify
eclipse/repos/extra-i686/eclipse.desktop
eclipse/repos/extra-i686/eclipse.install
eclipse/repos/extra-i686/eclipse.sh
eclipse/repos/extra-x86_64/PKGBUILD
eclipse/repos/extra-x86_64/commonify
eclipse/repos/extra-x86_64/eclipse.desktop
eclipse/repos/extra-x86_64/eclipse.install
eclipse/repos/extra-x86_64/eclipse.sh
------------------------------+
/PKGBUILD | 200 ++++++++++++++++++++++++++++++++
/commonify | 252 +++++++++++++++++++++++++++++++++++++++++
/eclipse.desktop | 18 ++
/eclipse.sh | 6
extra-i686/PKGBUILD | 99 ----------------
extra-i686/commonify | 41 ------
extra-i686/eclipse.desktop | 9 -
extra-i686/eclipse.install | 11 -
extra-i686/eclipse.sh | 3
extra-x86_64/PKGBUILD | 99 ----------------
extra-x86_64/commonify | 41 ------
extra-x86_64/eclipse.desktop | 9 -
extra-x86_64/eclipse.install | 11 -
extra-x86_64/eclipse.sh | 3
14 files changed, 476 insertions(+), 326 deletions(-)
Deleted: extra-i686/PKGBUILD
===================================================================
--- extra-i686/PKGBUILD 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-i686/PKGBUILD 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,99 +0,0 @@
-# $Id$
-# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
-# Contributor: Ionut Biru <ibiru at archlinux.org>
-# Contributor: Paul Mattal <paul at archlinux.org>
-# Contributor: Andrew Wright <andreww at photism.org>
-# Contributor: Andreas W. Hauser <andy-aur at splashground.de>
-# Contributor: Marco Crosio <marco.crosio at gmail.com>
-
-pkgbase=eclipse
-pkgname=(eclipse-{common,java,jee,cpp,php})
-pkgver=4.6.3
-pkgrel=1
-_release=neon-3
-pkgdesc="Highly extensible IDE"
-license=(EPL)
-arch=(i686 x86_64)
-url="https://eclipse.org"
-makedepends=(ruby)
-options=(!emptydirs)
-source=(commonify eclipse.sh eclipse.desktop)
-source_i686=()
-source_x86_64=()
-noextract=()
-
-for _pkg in ${pkgname[@]}; do
- [[ $_pkg == 'eclipse-common' ]] && continue
- source_i686+=(http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$_pkg-$_release-linux-gtk.tar.gz)
- source_x86_64+=(http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$_pkg-$_release-linux-gtk-x86_64.tar.gz)
- noextract+=($_pkg-$_release-linux-gtk{,-x86_64}.tar.gz)
- eval "package_$_pkg() { _package $_pkg; }"
-done
-
-sha256sums=('9f8980078c97fb3020ba2e9c6c07eac077b932406aba3e2d6a4763a5d299290d'
- '04e789fb695d5f95d09ddb994ae30397b39aee35f11997465dd91d129c41b2ed'
- '57559c2548ae463089acb3c2825ebc002ed83067ddc953b23d36a7b5a02deaf3')
-sha256sums_i686=('07452c284696ed79f056296c9c47f5097c30dfe2e1784623e129c509619c1b9d'
- '40a12a9a8932ec27004bcace6b7d2d9755401b3875783d16bec6038fa85abe84'
- 'aeee272443a7327325a940479902c0cde7b050aa981cf44a016b770d55a35a2d'
- 'e414695a5e08507309a6bd61e69839523b37a74672b0f8d774fe8fae5896f30b')
-sha256sums_x86_64=('6e187bb230525f1b85a950a3c72afdca201d7957797ec81d620bdaae9e810250'
- '1c178265ae2a452698e358a4c0ebb4ae86f79edf49d0303d40bef6f539281c19'
- 'e203ff06381b0ba728b07181ebfa3b41bf18d5cae5857e5ffd462aece32df1fe'
- 'ba0cd36c4d69519e01feef5a391f9d59c8865713fe1a8462ad0bd77f04de09ec')
-
-prepare() {
- mkdir eclipse-common
-
- for _pkg in ${pkgname[@]}; do
- [[ $_pkg == 'eclipse-common' ]] && continue
-
- if [[ $CARCH == x86_64 ]]; then
- bsdtar -xf "$_pkg-$_release-linux-gtk-x86_64.tar.gz"
- else
- bsdtar -xf "$_pkg-$_release-linux-gtk.tar.gz"
- fi
-
- mv eclipse $_pkg
- done
-}
-
-build() {
- ./commonify ${pkgname[@]}
-
- mkdir -p eclipse-common/dropins
- touch eclipse-common/dropins/.keep
-}
-
-package_eclipse-common() {
- pkgdesc+=" (common files)"
- depends=("java-environment>=8" webkit2gtk unzip)
- install=eclipse.install
-
- install -d "$pkgdir/usr/lib"
- cp -a eclipse-common "$pkgdir/usr/lib/eclipse"
-
- install -D eclipse.sh "$pkgdir/usr/bin/eclipse"
- install -Dm644 eclipse.desktop "$pkgdir/usr/share/applications/eclipse.desktop"
-
- for _i in 16 32 48 256; do
- install -Dm644 eclipse-common/plugins/org.eclipse.platform_*/eclipse${_i}.png \
- "$pkgdir/usr/share/icons/hicolor/${_i}x${_i}/apps/eclipse.png"
- done
-}
-
-_package() {
- _variant=${1#eclipse-}
- pkgdesc+=" (${_variant^^} variant)"
- depends=(eclipse-common)
- provides=("eclipse=$pkgver-$pkgrel")
- conflicts=(eclipse)
-
- case $_variant in
- java) replaces=(eclipse) ;;
- cpp) replaces=(eclipse-cdt) ;;
- esac
-
- install -d "$pkgdir/usr/lib"
- cp -a $1 "$pkgdir/usr/lib/eclipse"
-}
Copied: eclipse/repos/extra-i686/PKGBUILD (from rev 299435, eclipse/trunk/PKGBUILD)
===================================================================
--- extra-i686/PKGBUILD (rev 0)
+++ extra-i686/PKGBUILD 2017-06-30 16:03:39 UTC (rev 299436)
@@ -0,0 +1,100 @@
+# $Id$
+# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
+# Contributor: Ionut Biru <ibiru at archlinux.org>
+# Contributor: Paul Mattal <paul at archlinux.org>
+# Contributor: Andrew Wright <andreww at photism.org>
+# Contributor: Andreas W. Hauser <andy-aur at splashground.de>
+# Contributor: Marco Crosio <marco.crosio at gmail.com>
+
+pkgbase=eclipse
+pkgname=(eclipse-{common,java,jee,cpp,php,javascript})
+pkgver=4.7.0
+pkgrel=1
+_release=oxygen-R
+pkgdesc="Highly extensible IDE"
+license=(EPL)
+arch=(i686 x86_64)
+url="https://eclipse.org"
+makedepends=(python3)
+options=(!emptydirs)
+source=(commonify eclipse.sh eclipse.desktop)
+source_i686=()
+source_x86_64=()
+noextract=()
+
+for _pkg in ${pkgname[@]}; do
+ [[ $_pkg == 'eclipse-common' ]] && continue
+ source_i686+=(http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$_pkg-$_release-linux-gtk.tar.gz)
+ source_x86_64+=(http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$_pkg-$_release-linux-gtk-x86_64.tar.gz)
+ noextract+=($_pkg-$_release-linux-gtk{,-x86_64}.tar.gz)
+ eval "package_$_pkg() { _package $_pkg; }"
+done
+
+sha256sums=('a5a5cb8a8b86bd8bb98692c4553abd84592aac2438621d8273c43715a115e2ac'
+ '04e789fb695d5f95d09ddb994ae30397b39aee35f11997465dd91d129c41b2ed'
+ '57559c2548ae463089acb3c2825ebc002ed83067ddc953b23d36a7b5a02deaf3')
+sha256sums_i686=('89366eaf3f86dee46494848c86818625cd79a7a8aea53c0e292e13f715120023'
+ 'ed8da4b793ede3718eef9cc731a229e191aa0474e5bbcf3c9b4b89cf231a8b8f'
+ 'c4d2c349b07fac80b7d4deb1fe2e9a5580c7190ee4dd7869a131a129e7293640'
+ 'fcc18e1afc28690f44439ab30212101e37e6e07ae9369be3e4fb5be5c3fb4293'
+ 'a3d67801df5ccc279bb2026e4ba0bdfcff55f91a799279421658a6c4ffe02e92')
+sha256sums_x86_64=('f9bfa89f66886f34132623c5fc9f9202fe2bbf6c47d0e8c01cffe1302f3f4ca0'
+ '721fc94a6eab655a9372db95b2609e6ba8523526872ed4a612dcac8fbb0eb4f0'
+ 'c721d8b653f56b7de14f39928f682cdbf375d2a5fda9bf96bb3352035e50fd99'
+ '7851e183f77e20bd177956dc621ce1c90e64671d80d5173faf3dd883bfd032d1'
+ '6ffc11cece7324826199c444d070256143a17228d0ac652af58fe3dce41219cb')
+
+prepare() {
+ mkdir eclipse-common
+
+ for _pkg in ${pkgname[@]}; do
+ [[ $_pkg == 'eclipse-common' ]] && continue
+
+ if [[ $CARCH == x86_64 ]]; then
+ bsdtar -xf "$_pkg-$_release-linux-gtk-x86_64.tar.gz"
+ else
+ bsdtar -xf "$_pkg-$_release-linux-gtk.tar.gz"
+ fi
+
+ mv eclipse $_pkg
+ done
+}
+
+build() {
+ ./commonify --identical ${pkgname[@]}
+
+ mkdir -p eclipse-common/dropins
+ touch eclipse-common/dropins/.keep
+}
+
+package_eclipse-common() {
+ pkgdesc+=" (common files)"
+ depends=("java-environment>=8" webkit2gtk unzip)
+
+ install -d "$pkgdir/usr/lib"
+ cp -a eclipse-common "$pkgdir/usr/lib/eclipse"
+
+ install -D eclipse.sh "$pkgdir/usr/bin/eclipse"
+ install -Dm644 eclipse.desktop "$pkgdir/usr/share/applications/eclipse.desktop"
+
+ for _i in 16 32 48 256; do
+ install -Dm644 eclipse-common/plugins/org.eclipse.platform_*/eclipse${_i}.png \
+ "$pkgdir/usr/share/icons/hicolor/${_i}x${_i}/apps/eclipse.png"
+ done
+}
+
+_package() {
+ _variant=${1#eclipse-}
+ pkgdesc+=" (${_variant^^} variant)"
+ depends=(eclipse-common)
+ provides=("eclipse=$pkgver-$pkgrel")
+ conflicts=(eclipse)
+
+ case $_variant in
+ java) replaces=(eclipse) ;;
+ cpp) replaces=(eclipse-cdt) ;;
+ esac
+
+ install -d "$pkgdir/usr/lib"
+ cp -a $1 "$pkgdir/usr/lib/eclipse"
+}
Deleted: extra-i686/commonify
===================================================================
--- extra-i686/commonify 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-i686/commonify 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,41 +0,0 @@
-#!/usr/bin/env ruby
-require 'set'
-require 'fileutils'
-
-common = ARGV.shift
-targets = ARGV.dup
-first, *rest = targets
-
-files = targets.map do |dir|
- Dir.chdir dir
- g = Dir.glob("**/*").select { |file| test(?f, file) }
- Dir.chdir ".."
- puts "#{dir}: Found #{g.size} files"
- Set.new(g)
-end
-
-commonfiles = files.inject(:&)
-puts "#{commonfiles.size} common files"
-
-samefiles = 0
-commonfiles.each do |file|
- firstfile = File.join first, file
- targetfiles = rest.map { |target| File.join target, file }
-
- is_same = targetfiles.all? do |targetfile|
- system "diff", "-q", firstfile, targetfile,
- in: "/dev/null", out: "/dev/null", err: [:child, :out]
- end
-
- if is_same
- commonfile = File.join common, file
- FileUtils.mkdir_p File.dirname(commonfile)
- FileUtils.mv firstfile, commonfile
- FileUtils.rm(targetfiles)
- samefiles += 1
- else
- puts "Divergent common file: #{file}"
- end
-end
-
-puts "#{common}: #{samefiles} identical common files"
Copied: eclipse/repos/extra-i686/commonify (from rev 299435, eclipse/trunk/commonify)
===================================================================
--- extra-i686/commonify (rev 0)
+++ extra-i686/commonify 2017-06-30 16:03:39 UTC (rev 299436)
@@ -0,0 +1,126 @@
+#!/usr/bin/env python3
+from argparse import ArgumentParser
+from asyncio.subprocess import DEVNULL
+from asyncio import get_event_loop, gather, BoundedSemaphore, create_subprocess_exec
+from enum import Enum, auto
+from logging import getLogger, basicConfig, INFO
+from os import cpu_count
+from pathlib import Path
+from sys import exit
+
+
+logger = getLogger(__name__)
+
+
+class Mode(Enum):
+ identical = auto()
+ nonconflicting = auto()
+
+
+def parse_args(args=None):
+ parser = ArgumentParser(description="Extract common files.")
+
+ modes = parser.add_mutually_exclusive_group(required=True)
+ for m in Mode:
+ modes.add_argument(f"--{m.name}", dest="mode", action="store_const", const=m,
+ help=f"extract {m.name} common files")
+
+ parser.add_argument("common_dir", metavar="COMMON_DIR",
+ help="common files directory to move to")
+ parser.add_argument("targets", nargs="+", metavar="INPUT_DIR", help="directory to move from")
+
+ return parser.parse_args(args)
+
+
+diff_semaphore = BoundedSemaphore(value=cpu_count())
+
+
+class DiffError(RuntimeError):
+ def __init__(self, file1, file2):
+ self.file1 = file1
+ self.file2 = file2
+
+
+async def diff(file1, file2):
+ async with diff_semaphore:
+ p = await create_subprocess_exec("diff", "-q", str(file1), str(file2),
+ stdin=DEVNULL, stdout=DEVNULL, stderr=DEVNULL)
+ try:
+ ret = await p.wait()
+ except:
+ try:
+ p.kill()
+ except:
+ pass
+
+ if ret != 0:
+ raise DiffError(file1, file2)
+
+
+async def identical(files):
+ if len(files) < 2:
+ return True
+ first, *rest = files
+ fut = gather(*[diff(first, f) for f in rest])
+ try:
+ await fut
+ except DiffError as e:
+ logger.info("Divergent files: %s <> %s", e.file1, e.file2)
+ return False
+ else:
+ return True
+ finally:
+ fut.cancel()
+
+def commonify_file(common_file, files):
+ common_file.parent.mkdir(parents=True, exist_ok=True)
+ first, *rest = files
+ first.rename(common_file)
+ for f in rest:
+ f.unlink()
+
+
+async def commonify_identical(common_file, files):
+ if await identical(files):
+ commonify_file(common_file, files)
+ return 1
+ return 0
+
+
+def arg_dir(s):
+ p = Path(s)
+ if not p.is_dir():
+ raise ValueError(f"{s!r} is not a directory")
+ return p
+
+
+async def main(settings):
+ ignore_len = settings.mode == Mode.nonconflicting
+ common_dir = arg_dir(settings.common_dir)
+ targets = [arg_dir(t) for t in settings.targets]
+
+ d = {}
+ for t in targets:
+ n = 0
+ for f in t.glob("**/*"):
+ if f.is_file():
+ d.setdefault(f.relative_to(t), []).append(f)
+ n += 1
+ logger.info("%s: Found %d files", t, n)
+
+ results = await gather(*[
+ commonify_identical(common_dir / f, tf)
+ for f, tf in d.items()
+ if ignore_len or len(tf) == len(targets)
+ ])
+
+ logger.info("%s: %d %s files",
+ common_dir, sum(results), settings.mode.name)
+ return 0
+
+
+if __name__ == "__main__":
+ basicConfig(level=INFO)
+ settings = parse_args()
+ loop = get_event_loop()
+ exit(loop.run_until_complete(main(settings)))
Deleted: extra-i686/eclipse.desktop
===================================================================
--- extra-i686/eclipse.desktop 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-i686/eclipse.desktop 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,9 +0,0 @@
-[Desktop Entry]
-Name=Eclipse
-Comment=A Java Development Environment
-Icon=eclipse
-Exec=eclipse
-Terminal=false
-Type=Application
-Categories=Development;IDE;Java;
-StartupNotify=true
Copied: eclipse/repos/extra-i686/eclipse.desktop (from rev 299435, eclipse/trunk/eclipse.desktop)
===================================================================
--- extra-i686/eclipse.desktop (rev 0)
+++ extra-i686/eclipse.desktop 2017-06-30 16:03:39 UTC (rev 299436)
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Eclipse
+Comment=A Java Development Environment
+Icon=eclipse
+Exec=eclipse
+Terminal=false
+Type=Application
+Categories=Development;IDE;Java;
+StartupNotify=true
Deleted: extra-i686/eclipse.install
===================================================================
--- extra-i686/eclipse.install 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-i686/eclipse.install 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,11 +0,0 @@
-post_install() {
- gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
-}
-
-post_upgrade() {
- post_install
-}
-
-post_remove() {
- post_install
-}
Deleted: extra-i686/eclipse.sh
===================================================================
--- extra-i686/eclipse.sh 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-i686/eclipse.sh 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,3 +0,0 @@
-#!/bin/bash
-export ECLIPSE_HOME=/usr/lib/eclipse
-exec ${ECLIPSE_HOME}/eclipse "$@"
Copied: eclipse/repos/extra-i686/eclipse.sh (from rev 299435, eclipse/trunk/eclipse.sh)
===================================================================
--- extra-i686/eclipse.sh (rev 0)
+++ extra-i686/eclipse.sh 2017-06-30 16:03:39 UTC (rev 299436)
@@ -0,0 +1,3 @@
+#!/bin/bash
+export ECLIPSE_HOME=/usr/lib/eclipse
+exec ${ECLIPSE_HOME}/eclipse "$@"
Deleted: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-x86_64/PKGBUILD 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,99 +0,0 @@
-# $Id$
-# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
-# Contributor: Ionut Biru <ibiru at archlinux.org>
-# Contributor: Paul Mattal <paul at archlinux.org>
-# Contributor: Andrew Wright <andreww at photism.org>
-# Contributor: Andreas W. Hauser <andy-aur at splashground.de>
-# Contributor: Marco Crosio <marco.crosio at gmail.com>
-
-pkgbase=eclipse
-pkgname=(eclipse-{common,java,jee,cpp,php})
-pkgver=4.6.3
-pkgrel=1
-_release=neon-3
-pkgdesc="Highly extensible IDE"
-license=(EPL)
-arch=(i686 x86_64)
-url="https://eclipse.org"
-makedepends=(ruby)
-options=(!emptydirs)
-source=(commonify eclipse.sh eclipse.desktop)
-source_i686=()
-source_x86_64=()
-noextract=()
-
-for _pkg in ${pkgname[@]}; do
- [[ $_pkg == 'eclipse-common' ]] && continue
- source_i686+=(http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$_pkg-$_release-linux-gtk.tar.gz)
- source_x86_64+=(http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$_pkg-$_release-linux-gtk-x86_64.tar.gz)
- noextract+=($_pkg-$_release-linux-gtk{,-x86_64}.tar.gz)
- eval "package_$_pkg() { _package $_pkg; }"
-done
-
-sha256sums=('9f8980078c97fb3020ba2e9c6c07eac077b932406aba3e2d6a4763a5d299290d'
- '04e789fb695d5f95d09ddb994ae30397b39aee35f11997465dd91d129c41b2ed'
- '57559c2548ae463089acb3c2825ebc002ed83067ddc953b23d36a7b5a02deaf3')
-sha256sums_i686=('07452c284696ed79f056296c9c47f5097c30dfe2e1784623e129c509619c1b9d'
- '40a12a9a8932ec27004bcace6b7d2d9755401b3875783d16bec6038fa85abe84'
- 'aeee272443a7327325a940479902c0cde7b050aa981cf44a016b770d55a35a2d'
- 'e414695a5e08507309a6bd61e69839523b37a74672b0f8d774fe8fae5896f30b')
-sha256sums_x86_64=('6e187bb230525f1b85a950a3c72afdca201d7957797ec81d620bdaae9e810250'
- '1c178265ae2a452698e358a4c0ebb4ae86f79edf49d0303d40bef6f539281c19'
- 'e203ff06381b0ba728b07181ebfa3b41bf18d5cae5857e5ffd462aece32df1fe'
- 'ba0cd36c4d69519e01feef5a391f9d59c8865713fe1a8462ad0bd77f04de09ec')
-
-prepare() {
- mkdir eclipse-common
-
- for _pkg in ${pkgname[@]}; do
- [[ $_pkg == 'eclipse-common' ]] && continue
-
- if [[ $CARCH == x86_64 ]]; then
- bsdtar -xf "$_pkg-$_release-linux-gtk-x86_64.tar.gz"
- else
- bsdtar -xf "$_pkg-$_release-linux-gtk.tar.gz"
- fi
-
- mv eclipse $_pkg
- done
-}
-
-build() {
- ./commonify ${pkgname[@]}
-
- mkdir -p eclipse-common/dropins
- touch eclipse-common/dropins/.keep
-}
-
-package_eclipse-common() {
- pkgdesc+=" (common files)"
- depends=("java-environment>=8" webkit2gtk unzip)
- install=eclipse.install
-
- install -d "$pkgdir/usr/lib"
- cp -a eclipse-common "$pkgdir/usr/lib/eclipse"
-
- install -D eclipse.sh "$pkgdir/usr/bin/eclipse"
- install -Dm644 eclipse.desktop "$pkgdir/usr/share/applications/eclipse.desktop"
-
- for _i in 16 32 48 256; do
- install -Dm644 eclipse-common/plugins/org.eclipse.platform_*/eclipse${_i}.png \
- "$pkgdir/usr/share/icons/hicolor/${_i}x${_i}/apps/eclipse.png"
- done
-}
-
-_package() {
- _variant=${1#eclipse-}
- pkgdesc+=" (${_variant^^} variant)"
- depends=(eclipse-common)
- provides=("eclipse=$pkgver-$pkgrel")
- conflicts=(eclipse)
-
- case $_variant in
- java) replaces=(eclipse) ;;
- cpp) replaces=(eclipse-cdt) ;;
- esac
-
- install -d "$pkgdir/usr/lib"
- cp -a $1 "$pkgdir/usr/lib/eclipse"
-}
Copied: eclipse/repos/extra-x86_64/PKGBUILD (from rev 299435, eclipse/trunk/PKGBUILD)
===================================================================
--- extra-x86_64/PKGBUILD (rev 0)
+++ extra-x86_64/PKGBUILD 2017-06-30 16:03:39 UTC (rev 299436)
@@ -0,0 +1,100 @@
+# $Id$
+# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
+# Contributor: Ionut Biru <ibiru at archlinux.org>
+# Contributor: Paul Mattal <paul at archlinux.org>
+# Contributor: Andrew Wright <andreww at photism.org>
+# Contributor: Andreas W. Hauser <andy-aur at splashground.de>
+# Contributor: Marco Crosio <marco.crosio at gmail.com>
+
+pkgbase=eclipse
+pkgname=(eclipse-{common,java,jee,cpp,php,javascript})
+pkgver=4.7.0
+pkgrel=1
+_release=oxygen-R
+pkgdesc="Highly extensible IDE"
+license=(EPL)
+arch=(i686 x86_64)
+url="https://eclipse.org"
+makedepends=(python3)
+options=(!emptydirs)
+source=(commonify eclipse.sh eclipse.desktop)
+source_i686=()
+source_x86_64=()
+noextract=()
+
+for _pkg in ${pkgname[@]}; do
+ [[ $_pkg == 'eclipse-common' ]] && continue
+ source_i686+=(http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$_pkg-$_release-linux-gtk.tar.gz)
+ source_x86_64+=(http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$_pkg-$_release-linux-gtk-x86_64.tar.gz)
+ noextract+=($_pkg-$_release-linux-gtk{,-x86_64}.tar.gz)
+ eval "package_$_pkg() { _package $_pkg; }"
+done
+
+sha256sums=('a5a5cb8a8b86bd8bb98692c4553abd84592aac2438621d8273c43715a115e2ac'
+ '04e789fb695d5f95d09ddb994ae30397b39aee35f11997465dd91d129c41b2ed'
+ '57559c2548ae463089acb3c2825ebc002ed83067ddc953b23d36a7b5a02deaf3')
+sha256sums_i686=('89366eaf3f86dee46494848c86818625cd79a7a8aea53c0e292e13f715120023'
+ 'ed8da4b793ede3718eef9cc731a229e191aa0474e5bbcf3c9b4b89cf231a8b8f'
+ 'c4d2c349b07fac80b7d4deb1fe2e9a5580c7190ee4dd7869a131a129e7293640'
+ 'fcc18e1afc28690f44439ab30212101e37e6e07ae9369be3e4fb5be5c3fb4293'
+ 'a3d67801df5ccc279bb2026e4ba0bdfcff55f91a799279421658a6c4ffe02e92')
+sha256sums_x86_64=('f9bfa89f66886f34132623c5fc9f9202fe2bbf6c47d0e8c01cffe1302f3f4ca0'
+ '721fc94a6eab655a9372db95b2609e6ba8523526872ed4a612dcac8fbb0eb4f0'
+ 'c721d8b653f56b7de14f39928f682cdbf375d2a5fda9bf96bb3352035e50fd99'
+ '7851e183f77e20bd177956dc621ce1c90e64671d80d5173faf3dd883bfd032d1'
+ '6ffc11cece7324826199c444d070256143a17228d0ac652af58fe3dce41219cb')
+
+prepare() {
+ mkdir eclipse-common
+
+ for _pkg in ${pkgname[@]}; do
+ [[ $_pkg == 'eclipse-common' ]] && continue
+
+ if [[ $CARCH == x86_64 ]]; then
+ bsdtar -xf "$_pkg-$_release-linux-gtk-x86_64.tar.gz"
+ else
+ bsdtar -xf "$_pkg-$_release-linux-gtk.tar.gz"
+ fi
+
+ mv eclipse $_pkg
+ done
+}
+
+build() {
+ ./commonify --identical ${pkgname[@]}
+
+ mkdir -p eclipse-common/dropins
+ touch eclipse-common/dropins/.keep
+}
+
+package_eclipse-common() {
+ pkgdesc+=" (common files)"
+ depends=("java-environment>=8" webkit2gtk unzip)
+
+ install -d "$pkgdir/usr/lib"
+ cp -a eclipse-common "$pkgdir/usr/lib/eclipse"
+
+ install -D eclipse.sh "$pkgdir/usr/bin/eclipse"
+ install -Dm644 eclipse.desktop "$pkgdir/usr/share/applications/eclipse.desktop"
+
+ for _i in 16 32 48 256; do
+ install -Dm644 eclipse-common/plugins/org.eclipse.platform_*/eclipse${_i}.png \
+ "$pkgdir/usr/share/icons/hicolor/${_i}x${_i}/apps/eclipse.png"
+ done
+}
+
+_package() {
+ _variant=${1#eclipse-}
+ pkgdesc+=" (${_variant^^} variant)"
+ depends=(eclipse-common)
+ provides=("eclipse=$pkgver-$pkgrel")
+ conflicts=(eclipse)
+
+ case $_variant in
+ java) replaces=(eclipse) ;;
+ cpp) replaces=(eclipse-cdt) ;;
+ esac
+
+ install -d "$pkgdir/usr/lib"
+ cp -a $1 "$pkgdir/usr/lib/eclipse"
+}
Deleted: extra-x86_64/commonify
===================================================================
--- extra-x86_64/commonify 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-x86_64/commonify 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,41 +0,0 @@
-#!/usr/bin/env ruby
-require 'set'
-require 'fileutils'
-
-common = ARGV.shift
-targets = ARGV.dup
-first, *rest = targets
-
-files = targets.map do |dir|
- Dir.chdir dir
- g = Dir.glob("**/*").select { |file| test(?f, file) }
- Dir.chdir ".."
- puts "#{dir}: Found #{g.size} files"
- Set.new(g)
-end
-
-commonfiles = files.inject(:&)
-puts "#{commonfiles.size} common files"
-
-samefiles = 0
-commonfiles.each do |file|
- firstfile = File.join first, file
- targetfiles = rest.map { |target| File.join target, file }
-
- is_same = targetfiles.all? do |targetfile|
- system "diff", "-q", firstfile, targetfile,
- in: "/dev/null", out: "/dev/null", err: [:child, :out]
- end
-
- if is_same
- commonfile = File.join common, file
- FileUtils.mkdir_p File.dirname(commonfile)
- FileUtils.mv firstfile, commonfile
- FileUtils.rm(targetfiles)
- samefiles += 1
- else
- puts "Divergent common file: #{file}"
- end
-end
-
-puts "#{common}: #{samefiles} identical common files"
Copied: eclipse/repos/extra-x86_64/commonify (from rev 299435, eclipse/trunk/commonify)
===================================================================
--- extra-x86_64/commonify (rev 0)
+++ extra-x86_64/commonify 2017-06-30 16:03:39 UTC (rev 299436)
@@ -0,0 +1,126 @@
+#!/usr/bin/env python3
+from argparse import ArgumentParser
+from asyncio.subprocess import DEVNULL
+from asyncio import get_event_loop, gather, BoundedSemaphore, create_subprocess_exec
+from enum import Enum, auto
+from logging import getLogger, basicConfig, INFO
+from os import cpu_count
+from pathlib import Path
+from sys import exit
+
+
+logger = getLogger(__name__)
+
+
+class Mode(Enum):
+ identical = auto()
+ nonconflicting = auto()
+
+
+def parse_args(args=None):
+ parser = ArgumentParser(description="Extract common files.")
+
+ modes = parser.add_mutually_exclusive_group(required=True)
+ for m in Mode:
+ modes.add_argument(f"--{m.name}", dest="mode", action="store_const", const=m,
+ help=f"extract {m.name} common files")
+
+ parser.add_argument("common_dir", metavar="COMMON_DIR",
+ help="common files directory to move to")
+ parser.add_argument("targets", nargs="+", metavar="INPUT_DIR", help="directory to move from")
+
+ return parser.parse_args(args)
+
+
+diff_semaphore = BoundedSemaphore(value=cpu_count())
+
+
+class DiffError(RuntimeError):
+ def __init__(self, file1, file2):
+ self.file1 = file1
+ self.file2 = file2
+
+
+async def diff(file1, file2):
+ async with diff_semaphore:
+ p = await create_subprocess_exec("diff", "-q", str(file1), str(file2),
+ stdin=DEVNULL, stdout=DEVNULL, stderr=DEVNULL)
+ try:
+ ret = await p.wait()
+ except:
+ try:
+ p.kill()
+ except:
+ pass
+
+ if ret != 0:
+ raise DiffError(file1, file2)
+
+
+async def identical(files):
+ if len(files) < 2:
+ return True
+ first, *rest = files
+ fut = gather(*[diff(first, f) for f in rest])
+ try:
+ await fut
+ except DiffError as e:
+ logger.info("Divergent files: %s <> %s", e.file1, e.file2)
+ return False
+ else:
+ return True
+ finally:
+ fut.cancel()
+
+def commonify_file(common_file, files):
+ common_file.parent.mkdir(parents=True, exist_ok=True)
+ first, *rest = files
+ first.rename(common_file)
+ for f in rest:
+ f.unlink()
+
+
+async def commonify_identical(common_file, files):
+ if await identical(files):
+ commonify_file(common_file, files)
+ return 1
+ return 0
+
+
+def arg_dir(s):
+ p = Path(s)
+ if not p.is_dir():
+ raise ValueError(f"{s!r} is not a directory")
+ return p
+
+
+async def main(settings):
+ ignore_len = settings.mode == Mode.nonconflicting
+ common_dir = arg_dir(settings.common_dir)
+ targets = [arg_dir(t) for t in settings.targets]
+
+ d = {}
+ for t in targets:
+ n = 0
+ for f in t.glob("**/*"):
+ if f.is_file():
+ d.setdefault(f.relative_to(t), []).append(f)
+ n += 1
+ logger.info("%s: Found %d files", t, n)
+
+ results = await gather(*[
+ commonify_identical(common_dir / f, tf)
+ for f, tf in d.items()
+ if ignore_len or len(tf) == len(targets)
+ ])
+
+ logger.info("%s: %d %s files",
+ common_dir, sum(results), settings.mode.name)
+ return 0
+
+
+if __name__ == "__main__":
+ basicConfig(level=INFO)
+ settings = parse_args()
+ loop = get_event_loop()
+ exit(loop.run_until_complete(main(settings)))
Deleted: extra-x86_64/eclipse.desktop
===================================================================
--- extra-x86_64/eclipse.desktop 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-x86_64/eclipse.desktop 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,9 +0,0 @@
-[Desktop Entry]
-Name=Eclipse
-Comment=A Java Development Environment
-Icon=eclipse
-Exec=eclipse
-Terminal=false
-Type=Application
-Categories=Development;IDE;Java;
-StartupNotify=true
Copied: eclipse/repos/extra-x86_64/eclipse.desktop (from rev 299435, eclipse/trunk/eclipse.desktop)
===================================================================
--- extra-x86_64/eclipse.desktop (rev 0)
+++ extra-x86_64/eclipse.desktop 2017-06-30 16:03:39 UTC (rev 299436)
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Eclipse
+Comment=A Java Development Environment
+Icon=eclipse
+Exec=eclipse
+Terminal=false
+Type=Application
+Categories=Development;IDE;Java;
+StartupNotify=true
Deleted: extra-x86_64/eclipse.install
===================================================================
--- extra-x86_64/eclipse.install 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-x86_64/eclipse.install 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,11 +0,0 @@
-post_install() {
- gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
-}
-
-post_upgrade() {
- post_install
-}
-
-post_remove() {
- post_install
-}
Deleted: extra-x86_64/eclipse.sh
===================================================================
--- extra-x86_64/eclipse.sh 2017-06-30 14:21:12 UTC (rev 299435)
+++ extra-x86_64/eclipse.sh 2017-06-30 16:03:39 UTC (rev 299436)
@@ -1,3 +0,0 @@
-#!/bin/bash
-export ECLIPSE_HOME=/usr/lib/eclipse
-exec ${ECLIPSE_HOME}/eclipse "$@"
Copied: eclipse/repos/extra-x86_64/eclipse.sh (from rev 299435, eclipse/trunk/eclipse.sh)
===================================================================
--- extra-x86_64/eclipse.sh (rev 0)
+++ extra-x86_64/eclipse.sh 2017-06-30 16:03:39 UTC (rev 299436)
@@ -0,0 +1,3 @@
+#!/bin/bash
+export ECLIPSE_HOME=/usr/lib/eclipse
+exec ${ECLIPSE_HOME}/eclipse "$@"
More information about the arch-commits
mailing list