Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using packages-names-translator via a cli option #41

Open
Ashark opened this issue May 3, 2019 · 7 comments
Open

using packages-names-translator via a cli option #41

Ashark opened this issue May 3, 2019 · 7 comments

Comments

@Ashark
Copy link

Ashark commented May 3, 2019

The significant content of the debtap script is about mapping debian dependencies to arch linux dependencies. It is not easy to extract only needed places of code for this task (because it will be a really long script). But it will be good if we can check mapping via command line without actually having a .deb file.
Can you please add it? For example, with "-d --d --dependency-map" option.
I need it because I am repacking an amdgpu-pro ubuntu packages for archlinux with a script https://github.com/Ashark/archlinux-amdgpu/blob/master/gen-PKGBUILD.py#L286

@Ashark
Copy link
Author

Ashark commented May 3, 2019

As a workaround I have written translate_deb_to_arch_dependency.sh:

#!/bin/bash

rm -rf tmp-mapdeps-pkg
mkdir -p tmp-mapdeps-pkg/DEBIAN
cat << EOF  > tmp-mapdeps-pkg/DEBIAN/control
Package: tmp-mapdeps-pkg
Version: 1.0-1
Section: base
Priority: optional
Architecture: amd64
Depends: $1
Maintainer: Your Name <[email protected]>
Description: Temporary package to workaround https://github.com/helixarch/debtap/issues/41
EOF

dpkg-deb --build tmp-mapdeps-pkg > /dev/null

debtap -P -Q tmp-mapdeps-pkg.deb 2>/dev/null > tmpfile
if grep "Warning: These dependencies" tmpfile > /dev/null; then
    echo could_not_translate
    rm tmp-mapdeps-pkg.deb tmpfile
    rm -rf tmp-mapdeps-pkg
    exit 1
fi

cat tmp-mapdeps-pkg/PKGBUILD | grep depends | sed 's/depends=('\''//' | sed 's/'\'' '\''/\n/g' | sed 's/'\'')//g'
rm tmp-mapdeps-pkg.deb tmpfile
rm -rf tmp-mapdeps-pkg

Can be checked with these commands:

bash translate_deb_to_arch_dependency.sh xserver-xorg-hwe-18.04 # result - could_not_translate
bash translate_deb_to_arch_dependency.sh zlib1g # result - zlib
bash translate_deb_to_arch_dependency.sh libgcc1 # result - empty output (no package)

@Ashark
Copy link
Author

Ashark commented Jun 14, 2019

translate_deb_to_arch_dependency.txt
Attached as a file for convenience. Just change extension txt to sh.

@Strykar
Copy link

Strykar commented Nov 30, 2019

@Ashark The script expects to find dpkg-deb on an Arch system?

@Ashark
Copy link
Author

Ashark commented Nov 30, 2019

@Strykar yes

@Strykar
Copy link

Strykar commented Nov 30, 2019

@Ashark Uhm, how since it's not bundled with Arch or in the aur (understandbly)? You just copy the binary over from a Debian install?

[root@i-5 ~]# ./translate_deb_to_arch_dependency.sh gir1.2-gtk-3.0
could_not_translate

@Ashark
Copy link
Author

Ashark commented Nov 30, 2019

@Strykar Just install dpkg. See this.

@Ashark
Copy link
Author

Ashark commented Jul 7, 2021

Ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants