Compare commits

...

4 Commits

Author SHA1 Message Date
helixarch
7a38d3df70
Add files via upload
Bug fixes
2025-04-17 23:18:09 +03:00
helixarch
1942d4368e
Update README.md 2025-04-17 20:57:02 +03:00
helixarch
af094c7b2b
Update README.md 2025-04-17 20:55:34 +03:00
helixarch
26ed775990
Add files via upload
Bug fixes
2025-04-17 20:51:24 +03:00
2 changed files with 2307 additions and 2273 deletions

View File

@ -31,7 +31,7 @@ A script for converting .deb packages into Arch Linux packages, focused on accur
**Q: How do I use debtap?**
**A:** The syntax is quite simple actually: `debtap [options] package_filename`
**A:** The syntax is quite simple actually: `Syntax: debtap -o output_directory [other_options] package_filename`
For example: `debtap world-of-goo-demo_1.0_i386.deb`
Any recommendations or questions for debtap are welcomed!
@ -47,4 +47,5 @@ Available options:
-w --wipeout Wipeout versions from all dependencies, conflicts etc.
-p --pkgbuild Additionally generate a PKGBUILD file
-P --Pkgbuild Generate a PKGBUILD file only
-o --output Output directory for generated package and/or pkgbuild (optional)
-v --version     Print version

131
debtap
View File

@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Version=3.6
Version=3.6.0
# Defining colors and bold letters
lightgreen='\e[1;32m'
@ -402,42 +402,42 @@ echo -e "${lightgreen}==>${NC} ${bold}Generating .PKGINFO file...${normal}"
# Generating pkgname field
if [[ $pseudo == set ]] && [[ $(ls -A usr/lib32 2> /dev/null) ]] && [[ ! $(ls -A usr/bin 2> /dev/null) ]]; then
for i in {git,bzr,darcs,hg}; do
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = lib32-$(grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]')"-$i | sed s"/-$i-$i$/-$i/" | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = lib32-$(grep -i ^Package: control | gawk -F : '{print $2}' | sed s'/^ //' | tr '[:upper:]' '[:lower:]')"-$i | sed s"/-$i-$i$/-$i/" | sed s'/--/-/g' > .PKGINFO
fi
done
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q svn; echo $?) == 0 ]]; then
echo "pkgname = lib32-$(grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]')"-svn | sed s'/-svn-svn$/-svn/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | grep -q svn; echo $?) == 0 ]]; then
echo "pkgname = lib32-$(grep -i ^Package: control | gawk -F : '{print $2}' | sed s'/^ //' | tr '[:upper:]' '[:lower:]')"-svn | sed s'/-svn-svn$/-svn/' | sed s'/--/-/g' > .PKGINFO
fi
for i in {cvs,CVS}; do
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = lib32-$(grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]')"-cvs | sed s'/-cvs-cvs$/-cvs/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = lib32-$(grep -i ^Package: control | gawk -F : '{print $2}' | sed s'/^ //' | tr '[:upper:]' '[:lower:]')"-cvs | sed s'/-cvs-cvs$/-cvs/' | sed s'/--/-/g' > .PKGINFO
fi
done
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) != 0 ]]; then
echo "pkgname = lib32-$(grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]')" | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) != 0 ]]; then
echo "pkgname = lib32-$(grep -i ^Package: control | gawk -F : '{print $2}' | sed s'/^ //' | tr '[:upper:]' '[:lower:]')" | sed s'/--/-/g' > .PKGINFO
fi
else
for i in {git,bzr,darcs,hg}; do
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = $(grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]')"-$i | sed s"/-$i-$i$/-$i/" | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = $(grep -i ^Package: control | gawk -F : '{print $2}' | sed s'/^ //' | tr '[:upper:]' '[:lower:]')"-$i | sed s"/-$i-$i$/-$i/" | sed s'/--/-/g' > .PKGINFO
fi
done
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q svn; echo $?) == 0 ]]; then
echo "pkgname = $(grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]')"-svn | sed s'/-svn-svn$/-svn/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | grep -q svn; echo $?) == 0 ]]; then
echo "pkgname = $(grep -i ^Package: control | gawk -F : '{print $2}' | sed s'/^ //' | tr '[:upper:]' '[:lower:]')"-svn | sed s'/-svn-svn$/-svn/' | sed s'/--/-/g' > .PKGINFO
fi
for i in {cvs,CVS}; do
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = $(grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]')"-cvs | sed s'/-cvs-cvs$/-cvs/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = $(grep -i ^Package: control | gawk -F : '{print $2}' | sed s'/^ //' | tr '[:upper:]' '[:lower:]')"-cvs | sed s'/-cvs-cvs$/-cvs/' | sed s'/--/-/g' > .PKGINFO
fi
done
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) != 0 ]]; then
echo "pkgname = $(grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]')" | sed s'/demo$/-demo/' | sed s'/trial$/-trial/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) != 0 ]]; then
echo "pkgname = $(grep -i ^Package: control | gawk -F : '{print $2}' | sed s'/^ //' | tr '[:upper:]' '[:lower:]')" | sed s'/demo$/-demo/' | sed s'/trial$/-trial/' | sed s'/--/-/g' > .PKGINFO
fi
fi
# Generating pkgver field
version=$(grep -i ^Version: control | gawk '{print $2}' | sed -e s'/[+~]/-/g' -e s'/[-._]alpha/alpha/' -e s'/[-._]beta/beta/' -e s'/[-._]pre/pre/' -e s'/[-._]rc/rc/' -e s'/[-._]dfsg/dfsg/' | gawk -F 'dev' '{print $1}' | sed -e s'/-\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+\.[0-9]\+//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]*[a-z]*[0-9]*//g' -e s'/--/-/g' -e s'/\.\././g' | sed s'/\.$//')
version=$(grep -i ^Version: control | gawk -F : '{print $2}' | sed s'/^ //' | sed -e s'/[+~]/-/g' -e s'/[-._]alpha/alpha/' -e s'/[-._]beta/beta/' -e s'/[-._]pre/pre/' -e s'/[-._]rc/rc/' -e s'/[-._]dfsg/dfsg/' | gawk -F 'dev' '{print $1}' | sed -e s'/-\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+\.[0-9]\+//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]*[a-z]*[0-9]*//g' -e s'/--/-/g' -e s'/\.\././g' | sed s'/\.$//')
for i in {git,bzr,darcs,hg}; do
if [[ $(echo $version | grep -q $i; echo $?) == 0 ]]; then
echo "pkgver = $(echo $version | gawk -F "$i" '{print $2}' | gawk -F '-' '{print $1}')"-1 >> .PKGINFO
@ -461,15 +461,15 @@ if [[ $(echo $version | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) !
fi
# Generating pkgdesc field
if [[ $(echo $(grep -v ":\| \." control) | grep -iq "$(grep -i ^Description: control | sed s'/^Description: //i' | sed s'/\.//')"; echo $?) == 0 ]]; then
if [[ $(echo $(grep -v ":\| \." control) | grep -iq "$(grep -i ^Description: control | sed -e s'/^Description://i' -e s'/^ //' | sed s'/\.//')"; echo $?) == 0 ]]; then
description=$(echo $(echo "$(grep -v ":\| \." control)") | sed s'/^\s*./\U&\E/g' | sed s'/\(\. \|\! \|\? \)\s*./\U&\E/g')
else
description=$(echo $(echo "$(grep -i ^Description: control | sed s'/^Description: //i' | sed 's/.*/\u&/')" | sed s'/\.//'). $(grep -v ":\| \." control) | sed s'/^\s*./\U&\E/g' | sed s'/\(\. \|\! \|\? \)\s*./\U&\E/g' | sed s'/\!\./\!/g' | sed s'/\?\./\?/g')
description=$(echo $(echo "$(grep -i ^Description: control | sed -e s'/^Description://i' -e s'/^ //' | sed 's/.*/\u&/')" | sed s'/\.//'). $(grep -v ":\| \." control) | sed s'/^\s*./\U&\E/g' | sed s'/\(\. \|\! \|\? \)\s*./\U&\E/g' | sed s'/\!\./\!/g' | sed s'/\?\./\?/g')
fi
echo "pkgdesc = $description" >> .PKGINFO
# Generating url field
echo "url = $(grep -i ^Homepage: control | gawk '{print $2}')" | sed s'/\/$//' >> .PKGINFO
echo "url = $(grep -i ^Homepage: control | sed -e s'/^Homepage://i' -e s'/^ //')" | sed s'/\/$//' >> .PKGINFO
# Generating builddate (which is actually packaging date) field
echo "builddate = $(date -u "+%s")" >> .PKGINFO
@ -487,7 +487,7 @@ fi
# Generating arch field
if [[ $pseudo != set ]]; then
echo "arch = $(grep -i ^Architecture: control | gawk '{print $2}' | sed -e s'/i386/i686/' -e s'/amd64/x86_64/' -e s'/armhf/armv7h/' -e s'/arm64/aarch64/' -e s'/all/any/')" >> .PKGINFO
echo "arch = $(grep -i ^Architecture: control | gawk -F : '{print $2}' | sed s'/^ //' | sed -e s'/i386/i686/' -e s'/amd64/x86_64/' -e s'/armhf/armv7h/' -e s'/arm64/aarch64/' -e s'/all/any/')" >> .PKGINFO
else
echo "arch = x86_64" >> .PKGINFO
fi
@ -564,7 +564,7 @@ packages-names-translator() {
# First method of translating .deb packages names into Arch Linux packages names, more accurate, comparing contents of .deb packages with Arch Linux packages contents
for debian_package_name in $(gawk '{print $1}' $(ls | grep initial-check-list)); do
for debian_package_file in $(grep "/$debian_package_name$" /var/cache/debtap/debian-main-packages-files /var/cache/debtap/debian-non-free-packages-files /var/cache/debtap/debian-contrib-packages-files | grep 'bin\|opt\|\.so' | gawk '{print $1}' | sed s'/\// /g' | gawk '{print $NF}'); do
echo $debian_package_file $(grep "^$debian_package_name$\|^$debian_package_name " $(ls | grep initial-check-list) | gawk '{print $2}')
echo $debian_package_file $(grep "^$debian_package_name$\|^$debian_package_name " $(ls | grep initial-check-list) | gawk -F : '{print $2}')
done >> $debian_package_name-tempfile03
done
@ -581,6 +581,7 @@ for debian_package_name in $(gawk '{print $1}' $(ls | grep initial-check-list));
grep -q "^$debian_package_name$" tempfile05 || echo $debian_package_name >> tempfile05
done
touch tempfile06
for i in $(for j in $(cat tempfile05); do echo $j-tempfile04; done); do
k=$(sort $i | uniq -c | gawk '{print $1}' | sort -n | tail -1)
if [[ $(sort $i | uniq -c | gawk '{print $1}' | sort -n | grep "^$k$" | wc -l) -ge 2 ]]; then
@ -598,14 +599,18 @@ done
cat tempfile06 | sed s'/=/ = /g' | sed s'/>/ > /g' | sed s'/</ < /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' | sed s'/^lib32-\|-multilib$//g' > tempfile07
if [[ $(cat tempfile07 | wc -l) == 0 ]]; then
echo >> tempfile07
fi
cat tempfile07 | while read line; do
if [[ $(echo "$line" | wc -w) -eq 0 ]]; then
echo >> final-check-list
elif [[ $(echo "$line" | wc -w) -eq 1 ]] || [[ $(echo "$line" | wc -w) -eq 3 ]]; then
echo "$(echo "$line" | gawk '{print $1}') $(echo "$line" | gawk '{print $2}') $(echo "$line" | gawk '{print $3}')" >> final-check-list
echo "$line" | gawk '{print $1,$2,$3}' >> final-check-list
elif [[ $(echo "$line" | wc -w) -eq 5 ]]; then
echo "$(echo "$line" | gawk '{print $1}') $(echo "$line" | gawk '{print $2}') $(echo "$line" | gawk '{print $3}')" >> final-check-list
echo "$(echo "$line" | gawk '{print $1}') $(echo "$line" | gawk '{print $4}') $(echo "$line" | gawk '{print $5}')" >> final-check-list
echo "$line" | gawk '{print $1,$2,$3}' >> final-check-list
echo "$line" | gawk '{print $1,$4,$5}' >> final-check-list
fi
done
@ -619,7 +624,7 @@ for i in $(eval echo {1..$(cat $(ls | grep initial-check-list) | wc -l)}); do
done
# Second method of translating remaining untranslated .deb packages names into Arch Linux packages names, same as first method, but searches in Ubuntu database for packages contents instead of Debian database
if [[ -e untranslated-names-only ]]; then
if [[ -e untranslated-names-only ]] && [[ $(cat untranslated-names-only 2> /dev/null) != "" ]]; then
for ubuntu_package_name in $(sort -u untranslated-names-only); do
for ubuntu_package_file in $(grep "/$ubuntu_package_name$" /var/cache/debtap/ubuntu-packages-files | grep 'bin\|opt\|\.so' | gawk '{print $1}' | sed s'/\// /g' | gawk '{print $NF}'); do
echo $ubuntu_package_file $(grep "^$ubuntu_package_name$\|^$ubuntu_package_name " untranslated | gawk '{print $2}')
@ -639,6 +644,7 @@ if [[ -e untranslated-names-only ]]; then
grep -q "^$ubuntu_package_name$" tempfile10 || echo $ubuntu_package_name >> tempfile10
done
touch tempfile11
for i in $(for j in $(cat tempfile10); do echo $j-tempfile09; done); do
k=$(sort $i | uniq -c | gawk '{print $1}' | sort -n | tail -1)
if [[ $(sort $i | uniq -c | gawk '{print $1}' | sort -n | grep "^$k$" | wc -l) -ge 2 ]]; then
@ -656,14 +662,18 @@ if [[ -e untranslated-names-only ]]; then
cat tempfile11 | sed s'/=/ = /g' | sed s'/>/ > /g' | sed s'/</ < /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' | sed s'/^lib32-\|-multilib$//g' > tempfile12
if [[ $(cat tempfile12 | wc -l) == 0 ]]; then
echo >> tempfile12
fi
cat tempfile12 | while read line; do
if [[ $(echo "$line" | wc -w) -eq 0 ]]; then
echo >> final-check-list
elif [[ $(echo "$line" | wc -w) -eq 1 ]] || [[ $(echo "$line" | wc -w) -eq 3 ]]; then
echo "$(echo "$line" | gawk '{print $1}') $(echo "$line" | gawk '{print $2}') $(echo "$line" | gawk '{print $3}')" >> final-check-list
echo "$line" | gawk '{print $1,$2,$3}' >> final-check-list
elif [[ $(echo "$line" | wc -w) -eq 5 ]]; then
echo "$(echo "$line" | gawk '{print $1}') $(echo "$line" | gawk '{print $2}') $(echo "$line" | gawk '{print $3}')" >> final-check-list
echo "$(echo "$line" | gawk '{print $1}') $(echo "$line" | gawk '{print $4}') $(echo "$line" | gawk '{print $5}')" >> final-check-list
echo "$line" | gawk '{print $1,$2,$3}' >> final-check-list
echo "$line" | gawk '{print $1,$4,$5}' >> final-check-list
fi
done
@ -680,7 +690,7 @@ if [[ -e untranslated-names-only ]]; then
fi
# Third method of translating remaining untranslated .deb packages names into Arch Linux packages names, less accurate, comparing .deb packages names with Arch Linux packages names
if [[ -e new-untranslated-names-only ]]; then
if [[ -e new-untranslated-names-only ]] && [[ $(cat new-untranslated-names-only 2> /dev/null) != "" ]]; then
for i in $(sort -u new-untranslated-names-only | grep -v python-support); do
j=$(echo "$i" | sed s'/-svn$\|-git$\|-cvs$\|-bzr$\|-darcs$\|-hg$//')
@ -2659,7 +2669,7 @@ if [[ -e new-untranslated-names-only ]]; then
fi
# Appending untranslated packages names (if any exist) to the translated packages names list
if [[ $(cat new-untranslated 2> /dev/null | wc -l) -ne 0 ]]; then
if [[ -e new-untranslated-names ]] && [[ $(cat new-untranslated-names 2> /dev/null) != "" ]]; then
tac new-untranslated | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
gawk '{print $1}' new-untranslated | sort -u > $(echo $(ls | grep initial-check-list) | sed s'/initial-check-list/untranslated-names-only/')
fi
@ -2673,7 +2683,7 @@ fi
# Special rules for optional dependencies
if [[ -e optional-dependencies-untranslated-names-only ]]; then
if [[ -e dependencies-untranslated-names-only ]]; then
if [[ $(cat dependencies-untranslated-names-only) != "" ]]; then
for i in $(cat optional-dependencies-untranslated-names-only); do
if [[ $(grep -q "^$i$" dependencies-untranslated-names-only; echo $?) != 0 ]]; then
echo "$i" >> optional-dependencies-untranslated-names-only-1
@ -2714,11 +2724,13 @@ else
fi
# Stripping unnecessary symbols and words from packages versions
touch tempfile13
grep -v "^$" final-check-list | while read line; do
echo "$(echo "$line" | gawk '{print $1}') $(echo "$line" | gawk '{print $2}') $(echo "$line" | gawk '{print $3}' | sed s'/^[^:]*://' | sed -e s'/[+~]/-/g' -e s'/[-._]alpha/alpha/' -e s'/[-._]beta/beta/' -e s'/[-._]pre/pre/' -e s'/[-._]rc/rc/' -e s'/[-._]dfsg/dfsg/' | gawk -F 'dev' '{print $1}' | sed -e s'/-\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+\.[0-9]\+//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]*[a-z]*[0-9]*//g' -e s'/--/-/g' -e s'/\.\././g' | sed s'/\.$//')" >> tempfile13
done
# Special rules for version control systems
touch tempfile14
cat tempfile13 | while read line; do
for i in {git,bzr,darcs,hg}; do
if [[ $(echo "$line" | gawk '{print $3}' | grep -q $i; echo $?) == 0 ]]; then
@ -2747,6 +2759,7 @@ if [[ $pseudo != set ]]; then
mv tempfile14 tempfile15
else
# Special rules for multilib packages
touch tempfile15
cat tempfile14 | while read line; do
i=$(echo "$line" | gawk '{print $1}')
pacman -Ssq "lib32-$i" > result
@ -2841,6 +2854,9 @@ if [[ $(grep -q ^Replaces: control; echo $?) == 0 ]]; then
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v '^xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > replacements-initial-check-list
if [[ $(cat replacements-initial-check-list | wc -l) == 0 ]]; then
echo >> replacements-initial-check-list
fi
packages-names-translator
if [[ $wipeout != set ]]; then
for i in $(sort -u tempfile22); do echo "replaces = $i" >> .PKGINFO; done
@ -2849,6 +2865,7 @@ if [[ $(grep -q ^Replaces: control; echo $?) == 0 ]]; then
fi
rm -rf *tempfile* replacements-initial-check-list final-check-list
fi
touch replacements-untranslated-names-only
# Generating conflicts fields
if [[ $(grep -q ^Conflicts: control; echo $?) == 0 ]]; then
@ -2859,6 +2876,9 @@ if [[ $(grep -q ^Conflicts: control; echo $?) == 0 ]]; then
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > conflicts-initial-check-list
if [[ $(cat conflicts-initial-check-list | wc -l) == 0 ]]; then
echo >> conflicts-initial-check-list
fi
packages-names-translator
if [[ $wipeout != set ]]; then
for i in $(sort -u tempfile22); do echo "conflict = $i" >> .PKGINFO; done
@ -2867,6 +2887,7 @@ if [[ $(grep -q ^Conflicts: control; echo $?) == 0 ]]; then
fi
rm -rf *tempfile* conflicts-initial-check-list final-check-list
fi
touch conflicts-untranslated-names-only
# Generating provisions fields
if [[ $(grep -q ^Provides: control; echo $?) == 0 ]]; then
@ -2877,6 +2898,9 @@ if [[ $(grep -q ^Provides: control; echo $?) == 0 ]]; then
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > provisions-initial-check-list
if [[ $(cat provisions-initial-check-list | wc -l) == 0 ]]; then
echo >> provisions-initial-check-list
fi
packages-names-translator
if [[ $wipeout != set ]] && [[ $pkgbuild != set ]] && [[ $Pkgbuild != set ]]; then
for i in $(sort -u tempfile22); do echo "provides = $i" >> .PKGINFO; done
@ -2885,6 +2909,7 @@ if [[ $(grep -q ^Provides: control; echo $?) == 0 ]]; then
fi
rm -rf *tempfile* provisions-initial-check-list final-check-list
fi
touch provisions-untranslated-names-only
# Generating backups fields
if [[ -e conffiles ]]; then
@ -2911,6 +2936,9 @@ if [[ $(grep -q '^Depends:\|^Pre-Depends:' control; echo $?) == 0 ]]; then
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > dependencies-initial-check-list
if [[ $(cat dependencies-initial-check-list | wc -l) == 0 ]]; then
echo >> dependencies-initial-check-list
fi
packages-names-translator
if [[ $wipeout != set ]]; then
for i in $(sort -u tempfile22); do echo "depend = $i" >> .PKGINFO; done
@ -2919,6 +2947,7 @@ if [[ $(grep -q '^Depends:\|^Pre-Depends:' control; echo $?) == 0 ]]; then
fi
rm -rf *tempfile* dependencies-initial-check-list final-check-list
fi
touch dependencies-untranslated-names-only
# Generating optional dependencies fields
if [[ $(grep -q '^Recommends:\|^Suggests:' control; echo $?) == 0 ]]; then
@ -2929,6 +2958,9 @@ if [[ $(grep -q '^Recommends:\|^Suggests:' control; echo $?) == 0 ]]; then
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > optional-dependencies-initial-check-list
if [[ $(cat optional-dependencies-initial-check-list | wc -l) == 0 ]]; then
echo >> optional-dependencies-initial-check-list
fi
packages-names-translator
if [[ $wipeout != set ]]; then
for i in $(sort -u tempfile22); do
@ -2946,8 +2978,9 @@ if [[ $(grep -q '^Recommends:\|^Suggests:' control; echo $?) == 0 ]]; then
fi
rm -rf *tempfile* optional-dependencies-initial-check-list final-check-list
fi
touch optional-dependencies-untranslated-names-only-1
# Moving report files to /tmp/debtap (if any exist)
# Moving report files to /tmp/debtap
rm -rf /tmp/debtap 2> /dev/null
mkdir /tmp/debtap 2> /dev/null
if [[ $? != 0 ]]; then
@ -2957,49 +2990,49 @@ mv *untranslated* /tmp/debtap 2> /dev/null
mv *missing-files /tmp/debtap 2> /dev/null
# Report of (warning messages for) untranslated packages names and packages with missing files (if any exist)
if [[ -e /tmp/debtap/dependencies-untranslated-names-only ]]; then
if [[ $(cat /tmp/debtap/dependencies-untranslated-names-only) != "" ]]; then
echo -e "\n${lightred}Warning: These dependencies (depend = fields) could not be translated into Arch Linux packages names:${NC}"
echo $(cat /tmp/debtap/dependencies-untranslated-names-only) | sed s'/ /, /g'
echo $($(cat /tmp/debtap/dependencies-untranslated-names-only)) | sed s'/ /, /g'
fi
if [[ -e /tmp/debtap/dependencies-missing-files ]]; then
if [[ -e /tmp/debtap/dependencies-untranslated-names-only ]]; then
if [[ $(cat /tmp/debtap/dependencies-untranslated-names-only) != "" ]]; then
echo -e "${lightred}Warning: These packages names could not be included as dependencies, because debtap has translated them into the same name with the package for conversion. This happens sometimes when you convert packages that already exist in your repositories (which is a bad idea in general). The following packages contain files that are already included in the package from your repositories (without these files your converted package may be dysfunctional):${NC}"
else
echo -e "\n${lightred}Warning: These packages names could not be included as dependencies, because debtap has translated them into the same name with the package for conversion. This happens sometimes when you convert packages that already exist in your repositories (which is a bad idea in general). The following packages contain files that are already included in the package from your repositories (without these files your converted package may be dysfunctional):${NC}"
fi
echo $(cat /tmp/debtap/dependencies-missing-files) | sed s'/ /, /g'
fi
if [[ -e /tmp/debtap/optional-dependencies-untranslated-names-only-1 ]]; then
if [[ -e /tmp/debtap/dependencies-untranslated-names-only ]] || [[ -e /tmp/debtap/dependencies-missing-files ]]; then
if [[ $(cat /tmp/debtap/optional-dependencies-untranslated-names-only-1) != "" ]]; then
if [[ $(cat /tmp/debtap/dependencies-untranslated-names-only) != "" ]] || [[ -e /tmp/debtap/dependencies-missing-files ]]; then
echo -e "${lightred}Warning: These optional dependencies (optdepend = fields) could not be translated into Arch Linux packages names:${NC}"
else
echo -e "\n${lightred}Warning: These optional dependencies (optdepend = fields) could not be translated into Arch Linux packages names:${NC}"
fi
echo $(cat /tmp/debtap/optional-dependencies-untranslated-names-only-1) | sed s'/ /, /g'
echo $($(cat /tmp/debtap/optional-dependencies-untranslated-names-only-1)) | sed s'/ /, /g'
fi
if [[ -e /tmp/debtap/replacements-untranslated-names-only ]]; then
if [[ -e /tmp/debtap/dependencies-untranslated-names-only ]] || [[ -e /tmp/debtap/dependencies-missing-files ]] || [[ -e /tmp/debtap/optional-dependencies-untranslated-names-only-1 ]]; then
if [[ $(cat /tmp/debtap/replacements-untranslated-names-only) != "" ]]; then
if [[ $(cat /tmp/debtap/dependencies-untranslated-names-only) != "" ]] || [[ -e /tmp/debtap/dependencies-missing-files ]] || [[ $(cat /tmp/debtap/optional-dependencies-untranslated-names-only-1) != "" ]]; then
echo -e "${lightred}Warning: These replacements (replaces = fields) could not be translated into Arch Linux packages names:${NC}"
else
echo -e "\n${lightred}Warning: These replacements (replaces = fields) could not be translated into Arch Linux packages names:${NC}"
fi
echo $(cat /tmp/debtap/replacements-untranslated-names-only) | sed s'/ /, /g'
echo $($(cat /tmp/debtap/replacements-untranslated-names-only)) | sed s'/ /, /g'
fi
if [[ -e /tmp/debtap/conflicts-untranslated-names-only ]]; then
if [[ -e /tmp/debtap/dependencies-untranslated-names-only ]] || [[ -e /tmp/debtap/dependencies-missing-files ]] || [[ -e /tmp/debtap/optional-dependencies-untranslated-names-only-1 ]] || [[ -e /tmp/debtap/replacements-untranslated-names-only ]]; then
if [[ $(cat /tmp/debtap/conflicts-untranslated-names-only) != "" ]]; then
if [[ $(cat /tmp/debtap/dependencies-untranslated-names-only) != "" ]] || [[ -e /tmp/debtap/dependencies-missing-files ]] || [[ $(cat /tmp/debtap/optional-dependencies-untranslated-names-only-1) != "" ]] || [[ $(cat /tmp/debtap/replacements-untranslated-names-only) != "" ]]; then
echo -e "${lightred}Warning: These conflicts (conflict = fields) could not be translated into Arch Linux packages names:${NC}"
else
echo -e "\n${lightred}Warning: These conflicts (conflict = fields) could not be translated into Arch Linux packages names:${NC}"
fi
echo $(cat /tmp/debtap/conflicts-untranslated-names-only) | sed s'/ /, /g'
echo $($(cat /tmp/debtap/conflicts-untranslated-names-only)) | sed s'/ /, /g'
fi
if [[ -e /tmp/debtap/provisions-untranslated-names-only ]]; then
if [[ -e /tmp/debtap/dependencies-untranslated-names-only ]] || [[ -e /tmp/debtap/dependencies-missing-files ]] || [[ -e /tmp/debtap/optional-dependencies-untranslated-names-only-1 ]] || [[ -e /tmp/debtap/replacements-untranslated-names-only ]] || [[ -e /tmp/debtap/conflicts-untranslated-names-only ]]; then
if [[ $(cat /tmp/debtap/provisions-untranslated-names-only) != "" ]]; then
if [[ $(cat /tmp/debtap/dependencies-untranslated-names-only) != "" ]] || [[ -e /tmp/debtap/dependencies-missing-files ]] || [[ $(cat /tmp/debtap/optional-dependencies-untranslated-names-only-1) != "" ]] || [[ $(cat /tmp/debtap/replacements-untranslated-names-only) != "" ]] || [[ $(cat /tmp/debtap/conflicts-untranslated-names-only) != "" ]]; then
echo -e "${lightred}Warning: These provisions (provides = fields) could not be translated into Arch Linux packages names:${NC}"
else
echo -e "\n${lightred}Warning: These provisions (provides = fields) could not be translated into Arch Linux packages names:${NC}"
fi
echo $(cat /tmp/debtap/provisions-untranslated-names-only) | sed s'/ /, /g'
echo $($(cat /tmp/debtap/provisions-untranslated-names-only)) | sed s'/ /, /g'
fi
# Generating .INSTALL file (if necessary)