mvo5 / synaptic

The synaptic package manager
GNU General Public License v2.0
161 stars 55 forks source link

please fix Synaptic sources to prevent its removal from Debian testing and then Ubuntu #97

Closed N0rbert closed 2 years ago

N0rbert commented 2 years ago

I have seen two bad news at

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011688 https://tracker.debian.org/news/1339850/synaptic-removed-from-testing/

So you have to fix Synaptic sources to prevent its removal from Debian testing and then Ubuntu.

Below is the way to reproduce:

mkdir /tmp/synaptic
cat <<EOF > /tmp/synaptic/build-synaptic.sh
set -x
set -e
echo "deb-src http://deb.debian.org/debian testing main" >> /etc/apt/sources.list

apt-get update -qq > /dev/null
apt-get dist-upgrade -y -q > /dev/null
apt-get install -y -q wget xz-utils dpkg-dev debhelper-compat libapt-pkg-dev gettext libgtk-3-dev libvte-2.91-dev intltool xmlto libsm-dev sharutils lsb-release libept-dev > /dev/null

cd /root
wget http://deb.debian.org/debian/pool/main/s/synaptic/synaptic_0.90.2.tar.xz
tar -xf synaptic_0.90.2.tar.xz
cd synaptic-0.90.2
dpkg-buildpackage -uc -us
EOF

docker run -it --rm -v /tmp/synaptic:/root debian:testing bash /root/build-synaptic.sh

to get the following error:

make[4]: Entering directory '/root/synaptic-0.90.2/common'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include/apt-pkg  -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/var/lib/synaptic"\" -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -ffile-prefix-map=/root/synaptic-0.90.2=. -fstack-protector-strong -Wformat -Werror=format-security -c -o pkg_acqfile.o pkg_acqfile.cc
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include/apt-pkg  -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/var/lib/synaptic"\" -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -ffile-prefix-map=/root/synaptic-0.90.2=. -fstack-protector-strong -Wformat -Werror=format-security -c -o rconfiguration.o rconfiguration.cc
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include/apt-pkg  -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/var/lib/synaptic"\" -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -ffile-prefix-map=/root/synaptic-0.90.2=. -fstack-protector-strong -Wformat -Werror=format-security -c -o rinstallprogress.o rinstallprogress.cc
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include/apt-pkg  -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/var/lib/synaptic"\" -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -ffile-prefix-map=/root/synaptic-0.90.2=. -fstack-protector-strong -Wformat -Werror=format-security -c -o rpackage.o rpackage.cc
rconfiguration.cc: In function 'bool RWriteConfigFile(Configuration&)':
rconfiguration.cc:89:8: error: 'getuid' was not declared in this scope; did you mean 'getpwuid'?
   89 |    if (getuid() == 0) {
      |        ^~~~~~
      |        getpwuid
rconfiguration.cc: In function 'bool checkConfigDir(std::string&)':
rconfiguration.cc:138:19: error: 'getuid' was not declared in this scope; did you mean 'getpwuid'?
  138 |    pwd = getpwuid(getuid());
      |                   ^~~~~~
      |                   getpwuid
rconfiguration.cc: In function 'bool RInitConfiguration(std::string)':
rconfiguration.cc:244:7: error: 'getuid' was not declared in this scope; did you mean 'getpwuid'?
  244 |    if(getuid() == 0) {
      |       ^~~~~~
      |       getpwuid
make[4]: *** [Makefile:478: rconfiguration.o] Error 1
make[4]: *** Waiting for unfinished jobs....
rpackage.cc: In member function 'bool RPackage::isShallowDependency(RPackage*)':
rpackage.cc:1148:1: warning: no return statement in function returning non-void [-Wreturn-type]
 1148 | }
      | ^
make[4]: Leaving directory '/root/synaptic-0.90.2/common'
make[3]: *** [Makefile:426: all-recursive] Error 1
make[3]: Leaving directory '/root/synaptic-0.90.2'
make[2]: *** [Makefile:367: all] Error 2
make[2]: Leaving directory '/root/synaptic-0.90.2'
dh_auto_build: error: make -j4 returned exit code 2
make[1]: *** [debian/rules:39: override_dh_auto_build] Error 2
make[1]: Leaving directory '/root/synaptic-0.90.2'
make: *** [debian/rules:16: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
mvo5 commented 2 years ago

Thank you! And sorry for me not being very active, I really need some help maintaining synaptic. But I merged the fix for this and uploaded a new version to Debian that also contains some more fixes (shoutout to @BryanQuigley especially)