├── man ├── po │ ├── zh_CN.add │ ├── it.add │ ├── nl.add │ ├── pt_BR.add │ ├── hu.add │ ├── sv.add │ ├── ru.add │ ├── fr.add │ ├── pl.add │ ├── ja.add │ ├── de.add │ └── es.add ├── .gitignore ├── utf8toman.sed ├── dpkg.cfg.man └── dselect.cfg.man ├── debian ├── compat ├── source │ ├── format │ └── lintian-overrides ├── libdpkg-dev.docs ├── dpkg.docs ├── dselect.lintian-overrides ├── dpkg-dev.lintian-overrides ├── dselect.docs ├── dselect.manpages ├── libdpkg-dev.install ├── libdpkg-dev.lintian-overrides ├── libdpkg-perl.lintian-overrides ├── libdpkg-perl.docs ├── dpkg.lintian-overrides ├── .gitignore ├── libdpkg-perl.install ├── dpkg.logrotate ├── dpkg-dev.docs ├── dpkg.alternatives.logrotate ├── dselect.install ├── tests │ ├── test-root │ ├── test-not-root │ └── control ├── dselect.cfg ├── shlibs.override ├── shlibs.default ├── dpkg.cfg ├── dpkg.manpages ├── dpkg.install ├── dpkg-dev.install ├── dpkg.postrm ├── dpkg.postinst └── dpkg.cron.daily ├── dpkg-deb ├── .gitignore └── Makefile.am ├── scripts ├── t │ ├── Dpkg_Checksums │ │ ├── empty │ │ ├── data-1 │ │ └── data-2 │ ├── origins │ │ ├── default │ │ ├── debian │ │ ├── ubuntu │ │ └── gnewsense │ ├── Dpkg_OpenPGP │ │ ├── package_1.0.orig.tar │ │ ├── package_1.0.orig.tar.sig │ │ └── package_1.0.orig.tar.asc │ ├── Dpkg_Shlibs │ │ ├── .gitignore │ │ ├── ld.so.conf_2 │ │ ├── ld.so.conf.d │ │ │ ├── normal.conf │ │ │ ├── inf_recurse.conf │ │ │ └── recursive.conf │ │ ├── symbols.fake-1 │ │ ├── symbols.include-2 │ │ ├── spacesyms.map │ │ ├── symbols.blacklist-filter │ │ ├── symbols.blacklist-ignore │ │ ├── patterns.map │ │ ├── symbols.blacklisted │ │ ├── symbols.blacklist-groups │ │ ├── ld.so.conf │ │ ├── symbols.include-3 │ │ ├── objdump.space │ │ ├── symbols.fake-3 │ │ ├── symbols.include-1 │ │ ├── symbols.fake-2 │ │ ├── objdump.blacklisted │ │ ├── spacesyms-o-map.pl │ │ ├── basictags.symbols │ │ ├── spacesyms-c-gen.pl │ │ └── patterns.symbols │ ├── Dpkg_Dist_Files │ │ ├── files-fragment-a │ │ ├── files-fragment-b │ │ └── files-byhand │ ├── Dpkg_Source_Patch │ │ ├── partial.patch │ │ ├── c-style.patch │ │ ├── index-alone.patch │ │ ├── index-+++.patch │ │ ├── ghost-hunk.patch │ │ ├── indent-header.patch │ │ └── index-inert.patch │ ├── Dpkg_Control │ │ ├── bogus-armor-no-sig.dsc │ │ ├── bogus-unsigned.dsc │ │ ├── bogus-armor-inline.dsc │ │ ├── bogus-armor-double.dsc │ │ ├── bogus-armor-trail.dsc │ │ ├── bogus-armor-nested.dsc │ │ ├── bogus-armor-spaces.dsc │ │ ├── bogus-armor-formfeed.dsc │ │ └── control-1 │ ├── Dpkg_Control_Tests │ │ ├── tests-missing-fields │ │ ├── tests-plain-text │ │ └── tests-valid │ ├── Dpkg_Substvars │ │ ├── substvars2 │ │ └── substvars1 │ ├── mk │ │ ├── debian │ │ │ └── changelog │ │ ├── vendor-v1.mk │ │ ├── vendor-v0.mk │ │ ├── vendor.mk │ │ ├── pkg-info.mk │ │ ├── buildflags.mk │ │ └── buildtools.mk │ ├── merge_changelogs │ │ ├── ch-badver-a │ │ ├── ch-badver-old │ │ ├── ch-badver-b │ │ └── ch-badver-merged │ ├── Dpkg_Source_Quilt │ │ └── parse │ │ │ └── debian │ │ │ └── patches │ │ │ └── series │ ├── Dpkg_Changelog │ │ ├── unreleased │ │ ├── regressions │ │ ├── misplaced-tz │ │ ├── stop-modeline │ │ ├── date-format │ │ ├── countme │ │ └── fields │ ├── dpkg_source │ │ ├── testsuite_3.dsc │ │ ├── testsuite_0.dsc │ │ ├── testsuite_1.dsc │ │ └── testsuite_2.dsc │ ├── dpkg_buildpackage │ │ ├── test-source_0.dsc │ │ ├── test-source_0_all.changes │ │ ├── test-source_0_any.changes │ │ ├── test-source_0_source.changes │ │ └── test-source_0_binary.changes │ ├── Dpkg_Conf │ │ └── config-mixed │ ├── Dpkg_File.t │ ├── Dpkg_Lock.t │ ├── Dpkg_Index.t │ ├── Dpkg_Gettext.t │ ├── Dpkg_ErrorHandling.t │ ├── Dpkg_Source_Archive.t │ ├── Dpkg_Source_Functions.t │ ├── Dpkg_Source_Package.t │ ├── Dpkg_Interface_Storable.t │ ├── Dpkg_Changelog_Ubuntu.t │ ├── Dpkg_Build_Info.t │ ├── Dpkg_Package.t │ ├── Dpkg_Source_Quilt.t │ ├── Dpkg_Vars.t │ ├── Dpkg_Vendor.t │ ├── Dpkg_Getopt.t │ └── Dpkg_Exit.t ├── po │ ├── .gitignore │ └── LINGUAS ├── mk │ ├── default.mk │ ├── architecture.mk │ ├── Makefile.am │ └── pkg-info.mk ├── .gitignore └── Dpkg │ ├── Control │ ├── Hash.pm │ └── Changelog.pm │ ├── Getopt.pm │ ├── Package.pm │ ├── File.pm │ └── Vars.pm ├── dpkg-split ├── .gitignore └── Makefile.am ├── lib ├── dpkg │ ├── .gitignore │ ├── libdpkg.pc.in │ ├── t │ │ ├── .gitignore │ │ ├── t-test-skip.c │ │ ├── Makefile.am │ │ ├── t-namevalue.c │ │ ├── t-macros.c │ │ ├── t-mod-db.c │ │ ├── t-progname.c │ │ └── t-trigger.c │ ├── program.h │ ├── progname.h │ ├── dir.h │ ├── namevalue.c │ ├── trigname.c │ ├── glob.h │ ├── fdio.h │ ├── pager.h │ ├── glob.c │ ├── pkg-files.h │ ├── pkg-list.h │ ├── progress.h │ ├── strhash.c │ ├── pkg-show.h │ ├── i18n.h │ ├── namevalue.h │ ├── pkg-format.h │ ├── dlist.h │ ├── program.c │ ├── i18n.c │ ├── cleanup.c │ └── pkg.h ├── Makefile.am └── compat │ ├── empty.c │ ├── alphasort.c │ ├── strchrnul.c │ ├── asprintf.c │ ├── unsetenv.c │ ├── snprintf.c │ ├── strndup.c │ ├── md5.h │ ├── strnlen.c │ ├── strerror.c │ └── vasprintf.c ├── m4 ├── .gitignore └── dpkg-unicode.m4 ├── dselect ├── .gitignore ├── methods │ ├── ftp │ │ ├── names │ │ ├── .gitignore │ │ └── desc.ftp │ ├── disk │ │ ├── desc.cdrom │ │ ├── names │ │ ├── desc.harddisk │ │ ├── desc.nfs │ │ └── desc.mounted │ ├── multicd │ │ ├── desc.multi_cd │ │ ├── names │ │ ├── desc.multi_mount │ │ └── desc.multi_nfs │ └── Makefile.am ├── po │ ├── .gitignore │ ├── LINGUAS │ └── POTFILES.in ├── curkeys.cc ├── dselect-curses.h ├── helpmsgs.h └── keyoverride ├── doc ├── .gitignore ├── frontend.txt └── README.api ├── autogen ├── NEWS ├── t-func ├── .gitignore ├── testsuite.at ├── deb-fields.at ├── local.at ├── atlocal.in ├── deb-content.at └── Makefile.am ├── data ├── no-pie-link.specs ├── pie-link.specs ├── no-pie-compile.specs ├── pie-compile.specs └── abitable ├── src ├── .gitignore ├── rootlessJB │ ├── calljailbreakd.h │ └── objc-helper.h ├── file-match.h ├── filters.h ├── file-match.c ├── perpkgstate.c └── Makefile.am ├── utils ├── .gitignore ├── README.alternatives └── update-alternatives.polkit.in ├── po ├── .gitignore ├── its │ ├── polkit.loc │ └── polkit.its └── LINGUAS ├── t ├── codespell │ └── stopwords ├── pod.t ├── synopsis.t ├── minimum-version.t ├── strict.t ├── cppcheck.t ├── po.t ├── syntax.t └── codespell.t ├── .gitignore ├── README_LIMNEOS ├── run-script ├── .mailmap ├── AUTHORS └── get-version /man/po/zh_CN.add: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /dpkg-deb/.gitignore: -------------------------------------------------------------------------------- 1 | dpkg-deb 2 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Checksums/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/t/origins/default: -------------------------------------------------------------------------------- 1 | debian -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /dpkg-split/.gitignore: -------------------------------------------------------------------------------- 1 | dpkg-split 2 | -------------------------------------------------------------------------------- /lib/dpkg/.gitignore: -------------------------------------------------------------------------------- 1 | libdpkg.pc 2 | -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | *.m4 2 | !dpkg-*.m4 3 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Checksums/data-1: -------------------------------------------------------------------------------- 1 | data-1 2 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_OpenPGP/package_1.0.orig.tar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dselect/.gitignore: -------------------------------------------------------------------------------- 1 | curkeys.h 2 | dselect 3 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/.gitignore: -------------------------------------------------------------------------------- 1 | spacesyms.c 2 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | Doxyfile 2 | html 3 | coverage 4 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Checksums/data-2: -------------------------------------------------------------------------------- 1 | data-2 data-2 2 | -------------------------------------------------------------------------------- /dselect/methods/ftp/names: -------------------------------------------------------------------------------- 1 | 60 ftp Install using ftp. 2 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/ld.so.conf_2: -------------------------------------------------------------------------------- 1 | /nonexistent/lib128 2 | -------------------------------------------------------------------------------- /autogen: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | autoreconf -f -i 6 | -------------------------------------------------------------------------------- /dselect/methods/ftp/.gitignore: -------------------------------------------------------------------------------- 1 | install 2 | setup 3 | update 4 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/ld.so.conf.d/normal.conf: -------------------------------------------------------------------------------- 1 | /usr/local/lib/ 2 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | See debian/changelog for major changes between dpkg releases. 2 | -------------------------------------------------------------------------------- /debian/source/lintian-overrides: -------------------------------------------------------------------------------- 1 | dpkg source: redundant-origin-field 2 | -------------------------------------------------------------------------------- /debian/libdpkg-dev.docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | THANKS 3 | debian/usertags 4 | doc/README.api 5 | -------------------------------------------------------------------------------- /man/po/it.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | -------------------------------------------------------------------------------- /man/po/nl.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Dist_Files/files-fragment-a: -------------------------------------------------------------------------------- 1 | pkg-frag-a_0.0_arch.type section priority 2 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Dist_Files/files-fragment-b: -------------------------------------------------------------------------------- 1 | pkg-frag-b_0.0_arch.type section priority 2 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf: -------------------------------------------------------------------------------- 1 | include t/Dpkg_Shlibs/ld.so.conf 2 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/ld.so.conf.d/recursive.conf: -------------------------------------------------------------------------------- 1 | include t/Dpkg_Shlibs/ld.so.conf_2 2 | -------------------------------------------------------------------------------- /t-func/.gitignore: -------------------------------------------------------------------------------- 1 | testsuite 2 | testsuite.dir/ 3 | atconfig 4 | atlocal 5 | package.m4 6 | -------------------------------------------------------------------------------- /data/no-pie-link.specs: -------------------------------------------------------------------------------- 1 | *self_spec: 2 | + %{!shared:%{!r:%{!fPIE:%{!pie:-fno-PIE -no-pie}}}} 3 | -------------------------------------------------------------------------------- /man/po/pt_BR.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | 3 | -------------------------------------------------------------------------------- /data/pie-link.specs: -------------------------------------------------------------------------------- 1 | *self_spec: 2 | + %{!static:%{!shared:%{!r:%{!fno-PIE:%{!no-pie:-fPIE -pie}}}}} 3 | -------------------------------------------------------------------------------- /debian/dpkg.docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | THANKS 3 | debian/usertags 4 | doc/README.feature-removal-schedule 5 | -------------------------------------------------------------------------------- /debian/dselect.lintian-overrides: -------------------------------------------------------------------------------- 1 | dselect: redundant-origin-field 2 | dselect: redundant-bugs-field 3 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | dpkg 2 | dpkg-divert 3 | dpkg-query 4 | dpkg-statoverride 5 | dpkg-trigger 6 | t.tmp 7 | -------------------------------------------------------------------------------- /debian/dpkg-dev.lintian-overrides: -------------------------------------------------------------------------------- 1 | dpkg-dev: redundant-origin-field 2 | dpkg-dev: redundant-bugs-field 3 | -------------------------------------------------------------------------------- /debian/dselect.docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | THANKS 3 | debian/usertags 4 | dselect/methods/multicd/README.multicd 5 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Patch/partial.patch: -------------------------------------------------------------------------------- 1 | +++ b/symlink/partial-file 2 | @@ -0,0 +1,1 @@ 3 | +Escaped 4 | -------------------------------------------------------------------------------- /data/no-pie-compile.specs: -------------------------------------------------------------------------------- 1 | *self_spec: 2 | + %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fno-PIE}}}}}} 3 | -------------------------------------------------------------------------------- /debian/dselect.manpages: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/share/man/*/dselect.cfg.5 2 | debian/tmp/usr/share/man/*/dselect.1 3 | -------------------------------------------------------------------------------- /debian/libdpkg-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/dpkg/*.h 2 | usr/lib/*/pkgconfig/libdpkg.pc 3 | usr/lib/*/libdpkg.a 4 | -------------------------------------------------------------------------------- /debian/libdpkg-dev.lintian-overrides: -------------------------------------------------------------------------------- 1 | libdpkg-dev: redundant-origin-field 2 | libdpkg-dev: redundant-bugs-field 3 | -------------------------------------------------------------------------------- /debian/libdpkg-perl.lintian-overrides: -------------------------------------------------------------------------------- 1 | libdpkg-perl: redundant-origin-field 2 | libdpkg-perl: redundant-bugs-field 3 | -------------------------------------------------------------------------------- /man/po/hu.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | .P 3 | Ford: SZERVÁC Attila 4 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Patch/c-style.patch: -------------------------------------------------------------------------------- 1 | --- /dev/null 2 | +++ "b/\tmp/c-style" 3 | @@ -0,0 +1 @@ 4 | +Escaped 5 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Patch/index-alone.patch: -------------------------------------------------------------------------------- 1 | Index: index/symlink/index-file 2 | @@ -0,0 +1,1 @@ 3 | +Escaped 4 | -------------------------------------------------------------------------------- /lib/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS = \ 4 | compat \ 5 | dpkg 6 | -------------------------------------------------------------------------------- /lib/compat/empty.c: -------------------------------------------------------------------------------- 1 | /* Some implementations of ar cannot create an empty archive. */ 2 | int libdpkg_empty_dummy_symbol; 3 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/bogus-armor-no-sig.dsc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE----- 2 | Hash: SHA1 3 | 4 | Source: pass 5 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.fake-1: -------------------------------------------------------------------------------- 1 | symbol1_fake1@Base 1.0 2 | symbol2_fake1@Base 1.0 3 | symbol3_fake1@Base 1.0 4 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.include-2: -------------------------------------------------------------------------------- 1 | libfake.so.1 libfake1 2 | symbol1_fake2@Base 0.5 3 | #include "symbols.fake-2" 4 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Patch/index-+++.patch: -------------------------------------------------------------------------------- 1 | Index: index/symlink/index-file 2 | +++ 3 | @@ -0,0 +1,1 @@ 4 | +Escaped 5 | -------------------------------------------------------------------------------- /scripts/t/origins/debian: -------------------------------------------------------------------------------- 1 | Vendor: Debian 2 | Vendor-URL: https://www.debian.org/ 3 | Bugs: debbugs://bugs.debian.org 4 | -------------------------------------------------------------------------------- /utils/.gitignore: -------------------------------------------------------------------------------- 1 | org.dpkg.pkexec.update-alternatives.policy 2 | start-stop-daemon 3 | update-alternatives 4 | t.tmp 5 | -------------------------------------------------------------------------------- /data/pie-compile.specs: -------------------------------------------------------------------------------- 1 | *self_spec: 2 | + %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:%{!fno-PIE:%{!no-pie:-fPIE}}}}}}}} 3 | -------------------------------------------------------------------------------- /debian/libdpkg-perl.docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | THANKS 3 | debian/usertags 4 | doc/README.api 5 | doc/README.feature-removal-schedule 6 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/bogus-unsigned.dsc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP MESSAGE----- 2 | 3 | Source: fail 4 | 5 | -----END PGP MESSAGE----- 6 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control_Tests/tests-missing-fields: -------------------------------------------------------------------------------- 1 | Tests: aaa 2 | 3 | Test-Command: command 4 | 5 | Other: 6 | 7 | Tests: bbb 8 | -------------------------------------------------------------------------------- /utils/README.alternatives: -------------------------------------------------------------------------------- 1 | Please read the update-alternatives(1) man page for information on this 2 | directory and its contents. 3 | -------------------------------------------------------------------------------- /debian/dpkg.lintian-overrides: -------------------------------------------------------------------------------- 1 | dpkg: redundant-origin-field 2 | dpkg: redundant-bugs-field 3 | dpkg: arch-dep-package-has-big-usr-share 4 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_OpenPGP/package_1.0.orig.tar.sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/limneos/dpkg/HEAD/scripts/t/Dpkg_OpenPGP/package_1.0.orig.tar.sig -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | libdpkg-dev 2 | libdpkg-perl 3 | dpkg 4 | dpkg-dev 5 | dselect 6 | tmp 7 | files 8 | *.substvars 9 | *.debhelper.log 10 | -------------------------------------------------------------------------------- /man/po/sv.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | .SH ÖVERSÄTTNING 3 | Peter Krefting och Daniel Nylander. 4 | -------------------------------------------------------------------------------- /po/.gitignore: -------------------------------------------------------------------------------- 1 | *.gmo 2 | *.sin 3 | *.sed 4 | *.header 5 | Makefile.in.in 6 | Makevars.template 7 | POTFILES 8 | Rules-quot 9 | stamp-po 10 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/spacesyms.map: -------------------------------------------------------------------------------- 1 | V1 { 2 | global: symshortver*; 3 | }; 4 | 5 | VERY_LONG_VERSION_1 { 6 | global: symlongver*; 7 | } V1; 8 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.blacklist-filter: -------------------------------------------------------------------------------- 1 | libblacklisted.so.0 libblacklisted0 #MINVER# 2 | #include "symbols.blacklisted" 3 | symbol@Base 1.0 4 | -------------------------------------------------------------------------------- /dselect/methods/ftp/desc.ftp: -------------------------------------------------------------------------------- 1 | Installation using ftp, you must know one (or more) ftp site(s) and the 2 | correct directories for the Debian distribution. 3 | -------------------------------------------------------------------------------- /dselect/po/.gitignore: -------------------------------------------------------------------------------- 1 | *.gmo 2 | *.sin 3 | *.sed 4 | *.header 5 | Makefile.in.in 6 | Makevars.template 7 | POTFILES 8 | Rules-quot 9 | stamp-po 10 | -------------------------------------------------------------------------------- /scripts/po/.gitignore: -------------------------------------------------------------------------------- 1 | *.gmo 2 | *.sin 3 | *.sed 4 | *.header 5 | Makefile.in.in 6 | Makevars.template 7 | POTFILES 8 | Rules-quot 9 | stamp-po 10 | -------------------------------------------------------------------------------- /scripts/po/LINGUAS: -------------------------------------------------------------------------------- 1 | # This file contains the list of available and enabled translations. 2 | 3 | ca 4 | de 5 | es 6 | fr 7 | pl 8 | ru 9 | sv 10 | -------------------------------------------------------------------------------- /scripts/t/origins/ubuntu: -------------------------------------------------------------------------------- 1 | Vendor: Ubuntu 2 | Vendor-URL: http://www.ubuntu.com/ 3 | Bugs: https://bugs.launchpad.net/ubuntu/+filebug 4 | Parent: Debian 5 | -------------------------------------------------------------------------------- /debian/libdpkg-perl.install: -------------------------------------------------------------------------------- 1 | usr/share/dpkg/*.specs 2 | usr/share/locale/*/LC_MESSAGES/dpkg-dev.mo 3 | usr/share/man/man3/Dpkg*.3perl 4 | usr/share/perl5/Dpkg* 5 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.blacklist-ignore: -------------------------------------------------------------------------------- 1 | libblacklisted.so.0 libblacklisted0 #MINVER# 2 | (ignore-blacklist)#include "symbols.blacklisted" 3 | symbol@Base 1.0 4 | -------------------------------------------------------------------------------- /scripts/t/origins/gnewsense: -------------------------------------------------------------------------------- 1 | Vendor: gNewSense 2 | Vendor-URL: http://www.gnewsense.org/ 3 | Bugs: https://savannah.nongnu.org/bugs/?group=gnewsense 4 | Parent: Debian 5 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/patterns.map: -------------------------------------------------------------------------------- 1 | SYMVER_1 { 2 | global: 3 | _ZN3NSB6Symver*; 4 | }; 5 | 6 | SYMVEROPT_2 { 7 | global: 8 | _ZN3NSB14SymverOptional*; 9 | }; 10 | -------------------------------------------------------------------------------- /debian/dpkg.logrotate: -------------------------------------------------------------------------------- 1 | /var/log/dpkg.log { 2 | monthly 3 | rotate 12 4 | compress 5 | delaycompress 6 | missingok 7 | notifempty 8 | create 644 root root 9 | } 10 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.blacklisted: -------------------------------------------------------------------------------- 1 | .gomp_critical_user_foo@Base 2.0 2 | .gomp_critical_user_bar@Base 2.0 3 | __aeabi_lcmp@GCC_3.0 3.0 4 | __aeabi_unknown@GCC_4.0 4.0 5 | -------------------------------------------------------------------------------- /t/codespell/stopwords: -------------------------------------------------------------------------------- 1 | cas 2 | chage 3 | cmo 4 | creat 5 | iff 6 | isnt 7 | lowercased 8 | mitre 9 | objext 10 | readded 11 | rela 12 | te 13 | thru 14 | ths 15 | troup 16 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control_Tests/tests-plain-text: -------------------------------------------------------------------------------- 1 | This is a plain text file 2 | that does not contain 3 | 4 | any of the expected fields nor values 5 | 6 | and should fail to load. 7 | -------------------------------------------------------------------------------- /debian/dpkg-dev.docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | THANKS 3 | debian/usertags 4 | doc/README.api 5 | doc/README.feature-removal-schedule 6 | doc/frontend.txt 7 | doc/rootless-builds.txt 8 | doc/triggers.txt 9 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.blacklist-groups: -------------------------------------------------------------------------------- 1 | libblacklisted.so.0 libblacklisted0 #MINVER# 2 | * Ignore-Blacklist-Groups: aeabi gomp 3 | #include "symbols.blacklisted" 4 | symbol@Base 1.0 5 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Substvars/substvars2: -------------------------------------------------------------------------------- 1 | var1=Some value 2 | var2=Some other value 3 | name3=Yet another value 4 | name4=Name value 5 | prefix:var5=Foo 6 | prefix:name6=Bar 7 | otherprefix:var7=Quux 8 | -------------------------------------------------------------------------------- /scripts/t/mk/debian/changelog: -------------------------------------------------------------------------------- 1 | source (1:2:3.4-5-6) suite; urgency=low 2 | 3 | * Initial release. 4 | 5 | -- Dpkg Developers Tue, 04 Aug 2015 16:13:50 +0200 6 | -------------------------------------------------------------------------------- /debian/dpkg.alternatives.logrotate: -------------------------------------------------------------------------------- 1 | /var/log/alternatives.log { 2 | monthly 3 | rotate 12 4 | compress 5 | delaycompress 6 | missingok 7 | notifempty 8 | create 644 root root 9 | } 10 | -------------------------------------------------------------------------------- /scripts/t/mk/vendor-v1.mk: -------------------------------------------------------------------------------- 1 | include $(srcdir)/mk/vendor.mk 2 | 3 | dpkg_vendor_derives_from = $(dpkg_vendor_derives_from_v1) 4 | 5 | test: 6 | test "$(call dpkg_vendor_derives_from,debian)" = "yes" 7 | -------------------------------------------------------------------------------- /dselect/methods/disk/desc.cdrom: -------------------------------------------------------------------------------- 1 | Installation from a CD-ROM containing a Debian distribution. The 2 | CD-ROM may be or not be mounted already; it should contain a standard 3 | ISO9660 CD-ROM filesystem. 4 | -------------------------------------------------------------------------------- /scripts/t/mk/vendor-v0.mk: -------------------------------------------------------------------------------- 1 | dpkg_vendor_derives_from = $(dpkg_vendor_derives_from_v0) 2 | 3 | include $(srcdir)/mk/vendor.mk 4 | 5 | test: 6 | test "$(shell $(call dpkg_vendor_derives_from,debian))" = "yes" 7 | -------------------------------------------------------------------------------- /dselect/methods/multicd/desc.multi_cd: -------------------------------------------------------------------------------- 1 | Installation from a CD-ROM set containing a Debian distribution. The 2 | CD-ROMs may be or not be mounted already and should contain a standard 3 | ISO9660 CD-ROM filesystem. 4 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/ld.so.conf: -------------------------------------------------------------------------------- 1 | # Comment and empty line 2 | 3 | # Paths 4 | /nonexistent32 5 | /nonexistent/lib64 6 | 7 | include /nonexistent/*.conf 8 | include t/Dpkg_Shlibs/ld.so.conf.d/*.conf 9 | 10 | -------------------------------------------------------------------------------- /scripts/t/mk/vendor.mk: -------------------------------------------------------------------------------- 1 | include $(srcdir)/mk/vendor.mk 2 | 3 | test: 4 | test "$(DEB_VENDOR)" = "Debian" 5 | test "$(DEB_PARENT_VENDOR)" = "" 6 | test "$(shell $(call dpkg_vendor_derives_from,debian))" = "yes" 7 | -------------------------------------------------------------------------------- /man/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated man pages 2 | *.1 3 | *.5 4 | *.7 5 | *.8 6 | # Translated man pages 7 | de 8 | es 9 | fr 10 | hu 11 | it 12 | ja 13 | nl 14 | pl 15 | pt_BR 16 | ru 17 | sv 18 | zh_CN 19 | man.stamp 20 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Patch/ghost-hunk.patch: -------------------------------------------------------------------------------- 1 | --- a/disable/partial-file 2 | +++ b/disable/partial-file 3 | @@ -0,0 +1,1 @@disable 4 | +++ b/symlink/hunk-file 5 | --- a/symlink/hunk-file 6 | @@ -0,0 +1,1 @@ 7 | +Escaped 8 | -------------------------------------------------------------------------------- /scripts/t/merge_changelogs/ch-badver-a: -------------------------------------------------------------------------------- 1 | egcs (ss-970814-1) experimental; urgency=low 2 | 3 | * Initial packaging (of initial snapshot!) 4 | 5 | -- Galen Hazelwood Wed, 20 Aug 1997 00:36:28 +0000 6 | -------------------------------------------------------------------------------- /scripts/t/merge_changelogs/ch-badver-old: -------------------------------------------------------------------------------- 1 | egcs (ss-970814-1) experimental; urgency=low 2 | 3 | * Initial packaging (of initial snapshot!) 4 | 5 | -- Galen Hazelwood Wed, 20 Aug 1997 00:36:28 +0000 6 | -------------------------------------------------------------------------------- /po/its/polkit.loc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dselect/methods/multicd/names: -------------------------------------------------------------------------------- 1 | 31 multi_cd Install from a CD-ROM set. 2 | 36 multi_nfs Install from an NFS server (using the CD-ROM set) (not yet mounted). 3 | 46 multi_mount Install from a mounted partition with changing contents. 4 | -------------------------------------------------------------------------------- /debian/dselect.install: -------------------------------------------------------------------------------- 1 | ../dselect.cfg etc/dpkg 2 | 3 | etc/dpkg/dselect.cfg.d 4 | usr/bin/dselect 5 | usr/lib/dpkg/methods usr/lib/dpkg 6 | usr/share/locale/*/LC_MESSAGES/dselect.mo 7 | usr/share/perl5/Dselect 8 | var/lib/dpkg/methods 9 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/bogus-armor-inline.dsc: -------------------------------------------------------------------------------- 1 | Source: fail 2 | -----BEGIN PGP SIGNED MESSAGE----- 3 | 4 | Binary: pass 5 | 6 | -----BEGIN PGP SIGNATURE----- 7 | 8 | Valid signature here. 9 | -----END PGP SIGNATURE----- 10 | -------------------------------------------------------------------------------- /debian/tests/test-root: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [ "$(id -u)" != '0' ]; then 6 | exit 1 7 | fi 8 | 9 | t=test-root 10 | 11 | mkdir -p $t 12 | cd $t 13 | ../configure --disable-nls --disable-dselect 14 | make installcheck 15 | -------------------------------------------------------------------------------- /debian/tests/test-not-root: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [ "$(id -u)" = '0' ]; then 6 | exit 1 7 | fi 8 | 9 | t=test-not-root 10 | 11 | mkdir -p $t 12 | cd $t 13 | ../configure --disable-nls --disable-dselect 14 | make installcheck 15 | -------------------------------------------------------------------------------- /dselect/methods/disk/names: -------------------------------------------------------------------------------- 1 | 30 cdrom Install from a CD-ROM. 2 | 35 nfs Install from an NFS server (not yet mounted). 3 | 40 harddisk Install from a hard disk partition (not yet mounted). 4 | 42 mounted Install from a filesystem which is already mounted. 5 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.include-3: -------------------------------------------------------------------------------- 1 | libbasictags.so.2 libbasictags2 2 | symbol0_before@Base 1.0 3 | (optional|random tag=random value)#include "symbols.fake-1" 4 | symbol9_after@Base 1.0 5 | (optional=from parent|t=v)#include "basictags.symbols" 6 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Patch/indent-header.patch: -------------------------------------------------------------------------------- 1 | --- /dev/null 2 | +++ b/symlink/index-file 3 | @@ -0,0 +1,1 @@ 4 | +Escaped 5 | 6 | --- /dev/null 7 | +++ b/dummy-file 8 | @@ -0,0 +1,1 @@ 9 | +Dummy to make the code see a valid hunk 10 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Quilt/parse/debian/patches/series: -------------------------------------------------------------------------------- 1 | # Comment-only line 2 | change-a.patch -p1 3 | 4 | # Blank line with comments 5 | change-b.patch 6 | change-c.patch -p1 7 | change-d.patch 8 | 9 | # End comment 10 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Substvars/substvars1: -------------------------------------------------------------------------------- 1 | var1=Some value 2 | var2=Some other value 3 | # the next line is empty 4 | 5 | # the next line has some spaces 6 | 7 | # this line has a late comment 8 | var3=Yet another value 9 | #var4=This is not set 10 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/objdump.space: -------------------------------------------------------------------------------- 1 | 2 | phony-output: file format elf32-i386 3 | architecture: i386, flags 0x00000112: 4 | EXEC_P, HAS_SYMS, D_PAGED 5 | start address 0x08049b50 6 | 7 | DYNAMIC SYMBOL TABLE: 8 | 00000000 DF *UND* 00000075 singlespace 9 | -------------------------------------------------------------------------------- /man/po/ru.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | .SH ПЕРЕВОД 3 | Перевёл с английского Виктор Вислобоков 4 | Обновление и корректура: Alexey Mahotkin . 5 | Юрий Козлов . 6 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Dist_Files/files-byhand: -------------------------------------------------------------------------------- 1 | pkg-templ_1.2.3_arch.type section priority 2 | pkg-arch_2.0.0_amd64.deb admin required 3 | pkg-indep_0.0.1-2_all.deb net standard 4 | other_0.txt text optional mime-type=text/plain 5 | BY-HAND-file webdocs optional by-hand=true 6 | -------------------------------------------------------------------------------- /debian/dselect.cfg: -------------------------------------------------------------------------------- 1 | # dselect configuration file 2 | # 3 | # This file can contain default options for dselect. All command-line 4 | # options are allowed. Values can be specified by putting them after 5 | # the option, separated by whitespace and/or an `=' sign. 6 | # 7 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.fake-3: -------------------------------------------------------------------------------- 1 | # if included, this file will change the current "object" parsed 2 | # after the include it will be libdivert.so.1 instead of the object 3 | # of the including symbols file 4 | libdivert.so.1 libdivert1 #MINVER# 5 | divert_something@Base 1.0 6 | -------------------------------------------------------------------------------- /debian/tests/control: -------------------------------------------------------------------------------- 1 | Tests: test-not-root 2 | Depends: build-essential, autoconf, pkg-config 3 | Restrictions: superficial rw-build-tree 4 | 5 | Tests: test-root 6 | Depends: build-essential, autoconf, pkg-config 7 | Restrictions: superficial rw-build-tree needs-root breaks-testbed 8 | -------------------------------------------------------------------------------- /man/po/fr.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | .SH TRADUCTION 3 | Ariel VARDI , 2002. 4 | Philippe Batailler, 2006. 5 | Nicolas François, 2006. 6 | Veuillez signaler toute erreur à . 7 | -------------------------------------------------------------------------------- /debian/shlibs.override: -------------------------------------------------------------------------------- 1 | # dpkg shlibs override file 2 | # 3 | # Entries in this file will override all others, only use if you 4 | # are really sure that is what you want! 5 | # 6 | # For more information see the dpkg-shlibdeps(1) manual page. 7 | # 8 | # 9 | -------------------------------------------------------------------------------- /debian/shlibs.default: -------------------------------------------------------------------------------- 1 | # dpkg shlibs defaults file 2 | # 3 | # This file contains shlibs entries that are used as a last resort when 4 | # no matching entries are found elsewhere. For more information see the 5 | # dpkg-shlibdeps(1) manual page. 6 | # 7 | # 8 | -------------------------------------------------------------------------------- /t-func/testsuite.at: -------------------------------------------------------------------------------- 1 | AT_INIT([dpkg tools functional test suite]) 2 | AT_COLOR_TESTS 3 | 4 | AT_BANNER([Binary .deb packages]) 5 | m4_include([deb-format.at]) 6 | m4_include([deb-content.at]) 7 | m4_include([deb-fields.at]) 8 | 9 | AT_BANNER([Split .deb packages]) 10 | m4_include([deb-split.at]) 11 | -------------------------------------------------------------------------------- /scripts/mk/default.mk: -------------------------------------------------------------------------------- 1 | # Include all the Makefiles that define variables that can be useful 2 | # within debian/rules 3 | 4 | dpkg_datadir = $(srcdir)/mk 5 | include $(dpkg_datadir)/architecture.mk 6 | include $(dpkg_datadir)/buildflags.mk 7 | include $(dpkg_datadir)/pkg-info.mk 8 | include $(dpkg_datadir)/vendor.mk 9 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Changelog/unreleased: -------------------------------------------------------------------------------- 1 | source (2.0) UNRELEASED; urgency=medium 2 | 3 | * This version has not been finished yet. 4 | 5 | -- 6 | 7 | source (1.0) unstable; urgency=medium 8 | 9 | * New release. 10 | 11 | -- Dpkg Developers Sat, 05 Nov 2016 18:42:23 +0100 12 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.include-1: -------------------------------------------------------------------------------- 1 | libfake.so.1 libfake1 #MINVER# 2 | symbol1_fake1@Base 0.9 3 | symbol2_fake1@Base 0.9 4 | symbol_before@Base 0.9 5 | #include "symbols.fake-1" 6 | symbol3_fake1@Base 0 7 | symbol_after@Base 1.1 8 | #include "symbols.fake-3" 9 | symbol_in_libdivert@Base 1.0~beta1 10 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Patch/index-inert.patch: -------------------------------------------------------------------------------- 1 | This could be a comment about the patch itself, where we could use an 2 | Index: a/ header with /../ inside that could be interpreted as a 3 | malicious pseudo-header, so we should not validate it, 4 | 5 | --- /dev/null 6 | +++ b/inert-file 7 | @@ -0,0 +1,1 @@ 8 | +Inert 9 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/bogus-armor-double.dsc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE----- 2 | Hash: SHA1 3 | 4 | Source: pass 5 | 6 | -----BEGIN PGP SIGNATURE----- 7 | 8 | Valid signature here. 9 | -----END PGP SIGNATURE----- 10 | -----BEGIN PGP SIGNATURE----- 11 | 12 | Fake signature here. 13 | -----END PGP SIGNATURE----- 14 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/bogus-armor-trail.dsc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE 2 | 3 | Source: fail 4 | 5 | -----BEGIN PGP SIGNATURE 6 | -----BEGIN PGP SIGNED MESSAGE----- 7 | Hash: SHA256 8 | 9 | Source: pass 10 | 11 | -----BEGIN PGP SIGNATURE----- 12 | 13 | Valid signature here. 14 | -----END PGP SIGNATURE----- 15 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/symbols.fake-2: -------------------------------------------------------------------------------- 1 | #include "symbols.include-2" 2 | # This is just a comment 3 | libfake.so.1 #PACKAGE# #MINVER# 4 | * Build-Depends-Package: libfake-dev 5 | # The alternate dependency is below 6 | | libvirtualfake 7 | symbol1_fake2@Base 1.0 1 8 | symbol2_fake2@Base 1.0 9 | symbol3_fake2@Base 1.1 10 | -------------------------------------------------------------------------------- /po/its/polkit.its: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Changelog/regressions: -------------------------------------------------------------------------------- 1 | re-gressions++1.2.3 (0) ALLOWED.chars-567+890; urgency=low 2 | 3 | * Test allowed chars in package name and distribution name. 4 | (Closes: #361171) 5 | * Test how version 0 is exported through methods. 6 | 7 | -- Frank Lichtenheld Thu, 01 Jan 1970 00:00:00 +0000 8 | -------------------------------------------------------------------------------- /dselect/po/LINGUAS: -------------------------------------------------------------------------------- 1 | # This file contains the list of available and enabled translations. 2 | 3 | bs 4 | ca 5 | cs 6 | da 7 | de 8 | el 9 | es 10 | et 11 | eu 12 | fr 13 | gl 14 | hu 15 | id 16 | it 17 | ja 18 | ko 19 | nb 20 | nl 21 | nn 22 | pl 23 | pt 24 | pt_BR 25 | ro 26 | ru 27 | sk 28 | sv 29 | tl 30 | vi 31 | zh_CN 32 | zh_TW 33 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Changelog/misplaced-tz: -------------------------------------------------------------------------------- 1 | error-tz (1.1-1) unstable; urgency=low 2 | 3 | * 4 | 5 | -- Frank Lichtenheld Mon, 16 Jul 2007 02:54:18 +0200 6 | +0200 7 | 8 | error-tz (1.0-1) unstable; urgency=low 9 | 10 | * 11 | 12 | -- Frank Lichtenheld Mon, 16 Jul 2007 02:54:18 +0200 13 | -------------------------------------------------------------------------------- /lib/dpkg/libdpkg.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@devlibdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libdpkg 7 | Description: Debian package management system library 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -ldpkg 10 | Libs.private: @MD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @BZ2_LIBS@ 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/bogus-armor-nested.dsc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE----- 2 | Hash: SHA1 3 | 4 | Source: pass 5 | 6 | -----BEGIN PGP SIGNATURE----- 7 | -----BEGIN PGP SIGNED MESSAGE----- 8 | Hash: SHA1 9 | 10 | Source: fail 11 | 12 | -----BEGIN PGP SIGNATURE----- 13 | 14 | Valid signature here. 15 | -----END PGP SIGNATURE----- 16 | -------------------------------------------------------------------------------- /scripts/t/mk/pkg-info.mk: -------------------------------------------------------------------------------- 1 | include $(srcdir)/mk/pkg-info.mk 2 | 3 | test: 4 | test "$(DEB_SOURCE)" = "source" 5 | test "$(DEB_VERSION)" = "1:2:3.4-5-6" 6 | test "$(DEB_VERSION_EPOCH_UPSTREAM)" = "1:2:3.4-5" 7 | test "$(DEB_VERSION_UPSTREAM_REVISION)" = "2:3.4-5-6" 8 | test "$(DEB_VERSION_UPSTREAM)" = "2:3.4-5" 9 | test "$(DEB_DISTRIBUTION)" = "suite" 10 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Changelog/stop-modeline: -------------------------------------------------------------------------------- 1 | modeline (2.0-1) unstable; urgency=low 2 | 3 | * Upload. 4 | 5 | -- Dpkg Developers Tue, 4 Oct 2005 01:49:05 +0200 6 | 7 | modeline (1.0-1) unstable; urgency=low 8 | 9 | * Upload. 10 | 11 | -- Dpkg Developers Tue, 4 Oct 2005 01:48:05 +0200 12 | 13 | vim: et 14 | -------------------------------------------------------------------------------- /man/po/pl.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | .SH TŁUMACZE 3 | Piotr Roszatycki , 1999 4 | .br 5 | Bartosz Feński , 2004-2005 6 | .br 7 | Robert Luberda , 2006-2008 8 | .br 9 | Wiktor Wandachowicz , 2008 10 | .br 11 | Michał Kułach , 2012 12 | -------------------------------------------------------------------------------- /scripts/t/merge_changelogs/ch-badver-b: -------------------------------------------------------------------------------- 1 | egcs (970904-1) experimental; urgency=low 2 | 3 | * New upstream snapshot 4 | 5 | -- Galen Hazelwood Sun, 7 Sep 1997 18:25:06 -0600 6 | 7 | egcs (ss-970814-1) experimental; urgency=low 8 | 9 | * Initial packaging (of initial snapshot!) 10 | 11 | -- Galen Hazelwood Wed, 20 Aug 1997 00:36:28 +0000 12 | -------------------------------------------------------------------------------- /scripts/t/merge_changelogs/ch-badver-merged: -------------------------------------------------------------------------------- 1 | egcs (970904-1) experimental; urgency=low 2 | 3 | * New upstream snapshot 4 | 5 | -- Galen Hazelwood Sun, 7 Sep 1997 18:25:06 -0600 6 | 7 | egcs (ss-970814-1) experimental; urgency=low 8 | 9 | * Initial packaging (of initial snapshot!) 10 | 11 | -- Galen Hazelwood Wed, 20 Aug 1997 00:36:28 +0000 12 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control_Tests/tests-valid: -------------------------------------------------------------------------------- 1 | Tests: aaa, bbb, ccc 2 | 3 | Tests: danger, warning 4 | Restrictions: rw-build-tree, needs-root, breaks-testbed 5 | 6 | Tests: depends 7 | Depends: @, @builddeps@, extra-package 8 | 9 | Tests: dir 10 | Tests-Directory: . 11 | 12 | Tests: feature 13 | Features: 14 | 15 | Tests: class 16 | Classes: self-test 17 | 18 | Test-Command: command arg1 arg2 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Inherited ignores 2 | *.a 3 | *.o 4 | *.lo 5 | *.la 6 | *.so 7 | *.gcno 8 | *.gcda 9 | *.gcov 10 | *.lcov 11 | *.log 12 | *.trs 13 | *~ 14 | .*.swp 15 | .deps/ 16 | .libs/ 17 | Makefile 18 | Makefile.in 19 | 20 | # Top dir ignores 21 | autom4te.cache/ 22 | build-aux/ 23 | build-tree/ 24 | ABOUT-NLS 25 | ChangeLog 26 | INSTALL 27 | configure 28 | config.* 29 | libtool 30 | aclocal.m4 31 | stamp-h1 32 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # This file contains the list of available and enabled translations. 2 | 3 | ast 4 | bs 5 | ca 6 | cs 7 | da 8 | de 9 | dz 10 | el 11 | eo 12 | es 13 | et 14 | eu 15 | fr 16 | gl 17 | hu 18 | id 19 | it 20 | ja 21 | km 22 | ko 23 | ku 24 | lt 25 | mr 26 | nb 27 | ne 28 | nl 29 | nn 30 | pa 31 | pl 32 | pt 33 | pt_BR 34 | ro 35 | ru 36 | sk 37 | sv 38 | th 39 | tl 40 | tr 41 | vi 42 | zh_CN 43 | zh_TW 44 | -------------------------------------------------------------------------------- /data/abitable: -------------------------------------------------------------------------------- 1 | # Version=2.0 2 | # 3 | # This file contains the table of arch ABI attribute overrides. 4 | # 5 | # If the ABI is not present here then the attribute information for a 6 | # Debian arch tuple matches the one on the cputable. 7 | # 8 | # - Column 1 is the Debian name for the ABI. 9 | # - Column 2 is the size (in bits) of the ABI pointers. 10 | # 11 | # 12 | abin32 32 13 | ilp32 32 14 | x32 32 15 | -------------------------------------------------------------------------------- /man/po/ja.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | .SH 翻訳者 3 | 高橋 基信 . 4 | 喜瀬 浩 . 5 | 関戸 幸一 . 6 | 鍋谷 栄展 . 7 | 倉澤 望 . 8 | 石川 睦 . 9 | 鵜飼 文敏 . 10 | 中野 武雄 . 11 | .SH 翻訳校正 12 | Debian JP Documentation ML . 13 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/bogus-armor-spaces.dsc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE----- 2 | Hash: SHA1 3 | 4 | Source: pass 5 | 6 | -----BEGIN PGP SIGNATURE----- 7 | Version: GnuPG v1.4.12 (GNU/Linux) 8 | 9 | Valid signature here. 10 | -----END PGP SIGNATURE----- 11 | 12 | Source: fail 13 | 14 | -----BEGIN PGP SIGNATURE 15 | Version: vim v7.3.547 (GNU/Linux) 16 | 17 | Fake signature here. 18 | -----END PGP SIGNATURE 19 | -------------------------------------------------------------------------------- /README_LIMNEOS: -------------------------------------------------------------------------------- 1 | autoreconf -f 2 | ./autogen 3 | export CPPFLAGS="-I/usr/local/opt/ncurses/include"; export CFLAGS="-arch arm64 -isysroot $(xcrun -sdk iphoneos --show-sdk-path)"; export AR=ar; ./configure --disable-dselect --disable-start-stop-daemon --host=x86_64-apple-darwin --target=arm64-apple-darwin --prefix= --disable-devel-docs 4 | make clean; make; 5 | make DESTDIR=$PWD/installdir install 6 | ldid2 -Slsdents.plist installdir/var/bin/dpkg 7 | -------------------------------------------------------------------------------- /dselect/methods/disk/desc.harddisk: -------------------------------------------------------------------------------- 1 | Installation from filesystem on a hard disk partition that's not 2 | currently mounted. 3 | 4 | The partition should contain the Packages.gz file from each 5 | distribution area being installed (usually stable, contrib and 6 | non-free) as well as the corresponding binary/*/*.deb files. 7 | 8 | The easiest way to get this is to make a (partial) copy of the 9 | distribution site's directory hierarchy, if possible. 10 | -------------------------------------------------------------------------------- /dselect/methods/disk/desc.nfs: -------------------------------------------------------------------------------- 1 | Installation across the network, from an NFS server which not 2 | currently mounted. 3 | 4 | The server should have contain the Packages.gz file from each 5 | distribution area being installed (usually stable, contrib and 6 | non-free) as well as the corresponding binary/*/*.deb files. 7 | 8 | The easiest way for them to get this is to make a (partial) copy of 9 | the distribution site's directory hierarchy, if possible. 10 | -------------------------------------------------------------------------------- /man/po/de.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | .SH ÜBERSETZUNG 3 | Die deutsche Übersetzung wurde 2004, 2006-2018 von Helge Kreutzmann 4 | , 2007 von Florian Rehnisch und 5 | 2008 von Sven Joachim 6 | angefertigt. Diese Übersetzung ist Freie Dokumentation; lesen Sie die 7 | GNU General Public License Version 2 oder neuer für die Kopierbedingungen. 8 | Es gibt KEINE HAFTUNG. 9 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | Build.PL 2 | dpkg-architecture 3 | dpkg-buildflags 4 | dpkg-buildpackage 5 | dpkg-checkbuilddeps 6 | dpkg-distaddfile 7 | dpkg-genbuildinfo 8 | dpkg-genchanges 9 | dpkg-gencontrol 10 | dpkg-gensymbols 11 | dpkg-maintscript-helper 12 | dpkg-mergechangelogs 13 | dpkg-name 14 | dpkg-parsechangelog 15 | dpkg-scanpackages 16 | dpkg-scansources 17 | dpkg-shlibdeps 18 | dpkg-source 19 | dpkg-statoverride 20 | dpkg-vendor 21 | t.tmp 22 | cover_db 23 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/bogus-armor-formfeed.dsc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE----- 2 | 3 | Source: fail 4 | 5 | -----BEGIN PGP SIGNATURE----- 6 | Version: vim v7.3.547 (GNU/Linux) 7 | 8 | Fake signature here. 9 | -----END PGP SIGNATURE----- 10 | -----BEGIN PGP SIGNED MESSAGE----- 11 | Hash: SHA1 12 | 13 | Source: pass 14 | 15 | -----BEGIN PGP SIGNATURE 16 | Version: GnuPG v1.4.12 (GNU/Linux) 17 | 18 | Valid signature here. 19 | -----END PGP SIGNATURE----- 20 | -------------------------------------------------------------------------------- /man/po/es.add: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.TH;beginboundary=FakePo4aBoundary 2 | .SH TRADUCTOR 3 | Rudy Godoy , 4 | Rubén Porras , 5 | Bruno Barrera C. , 6 | Carlos Izquierdo , 7 | Esteban Manchado y 8 | NOK. 9 | Debian L10n Spanish . 10 | .br 11 | Revisiones por Santiago Vila , 12 | Javier Fernández\-Sanguino, Rubén Porras, 13 | Luis Uribe y Omar Campagne. 14 | -------------------------------------------------------------------------------- /debian/dpkg.cfg: -------------------------------------------------------------------------------- 1 | # dpkg configuration file 2 | # 3 | # This file can contain default options for dpkg. All command-line 4 | # options are allowed. Values can be specified by putting them after 5 | # the option, separated by whitespace and/or an `=' sign. 6 | # 7 | 8 | # Do not enable debsig-verify by default; since the distribution is not using 9 | # embedded signatures, debsig-verify would reject all packages. 10 | no-debsig 11 | 12 | # Log status changes and actions to a file. 13 | log /var/log/dpkg.log 14 | -------------------------------------------------------------------------------- /lib/dpkg/t/.gitignore: -------------------------------------------------------------------------------- 1 | c-tarextract 2 | c-treewalk 3 | c-trigdeferred 4 | t-ar 5 | t-arch 6 | t-buffer 7 | t-c-ctype 8 | t-command 9 | t-deb-version 10 | t-ehandle 11 | t-error 12 | t-file 13 | t-fsys-dir 14 | t-fsys-hash 15 | t-headers-cpp 16 | t-macros 17 | t-mod-db 18 | t-namevalue 19 | t-pager 20 | t-path 21 | t-pkginfo 22 | t-pkg-hash 23 | t-pkg-list 24 | t-pkg-queue 25 | t-pkg-show 26 | t-progname 27 | t-string 28 | t-subproc 29 | t-tar 30 | t-test 31 | t-test-skip 32 | t-trigger 33 | t-varbuf 34 | t-version 35 | t.tmp 36 | -------------------------------------------------------------------------------- /debian/dpkg.manpages: -------------------------------------------------------------------------------- 1 | debian/tmp/usr/share/man/*/dpkg-deb.1 2 | debian/tmp/usr/share/man/*/dpkg-divert.1 3 | debian/tmp/usr/share/man/*/dpkg-maintscript-helper.1 4 | debian/tmp/usr/share/man/*/dpkg-query.1 5 | debian/tmp/usr/share/man/*/dpkg-split.1 6 | debian/tmp/usr/share/man/*/dpkg-statoverride.1 7 | debian/tmp/usr/share/man/*/dpkg-trigger.1 8 | debian/tmp/usr/share/man/*/dpkg.cfg.5 9 | debian/tmp/usr/share/man/*/dpkg.1 10 | debian/tmp/usr/share/man/*/start-stop-daemon.8 11 | debian/tmp/usr/share/man/*/update-alternatives.1 12 | -------------------------------------------------------------------------------- /run-script: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | top_srcdir="$(dirname "$0")" 6 | 7 | # To avoid using «readlink -f» or «realpath» we just change into the 8 | # desired directory and work from there. 9 | cd "$top_srcdir" 10 | cwd="$(pwd)" 11 | cd "$OLDPWD" 12 | 13 | # Set up the environment, to use local perl modules and data files. 14 | export PERL="${PERL:-perl}" 15 | export PERL5LIB="$cwd/scripts:$cwd/dselect/methods" 16 | export DPKG_DATADIR="$cwd/data" 17 | 18 | script="$1" 19 | shift 1 20 | 21 | exec "$PERL" "$cwd/$script" "$@" 22 | -------------------------------------------------------------------------------- /scripts/t/mk/buildflags.mk: -------------------------------------------------------------------------------- 1 | DEB_CPPFLAGS_MAINT_APPEND = -DTEST_MK=test 2 | 3 | include $(srcdir)/mk/buildflags.mk 4 | 5 | test: 6 | test "$(CFLAGS)" = "$(TEST_CFLAGS)" 7 | test "$(CPPFLAGS)" = "$(TEST_CPPFLAGS) -DTEST_MK=test" 8 | test "$(CXXFLAGS)" = "$(TEST_CXXFLAGS)" 9 | test "$(FCFLAGS)" = "$(TEST_FCFLAGS)" 10 | test "$(FFLAGS)" = "$(TEST_FFLAGS)" 11 | test "$(GCJFLAGS)" = "$(TEST_GCJFLAGS)" 12 | test "$(LDFLAGS)" = "$(TEST_LDFLAGS)" 13 | test "$(OBJCFLAGS)" = "$(TEST_OBJCFLAGS)" 14 | test "$(OBJCXXFLAGS)" = "$(TEST_OBJCXXFLAGS)" 15 | -------------------------------------------------------------------------------- /dselect/po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # This is the list of all source files with translatable strings. 2 | 3 | dselect/basecmds.cc 4 | dselect/baselist.cc 5 | dselect/basetop.cc 6 | dselect/bindings.cc 7 | dselect/curkeys.cc 8 | dselect/helpmsgs.cc 9 | dselect/main.cc 10 | dselect/methkeys.cc 11 | dselect/methlist.cc 12 | dselect/method.cc 13 | dselect/methparse.cc 14 | dselect/pkgcmds.cc 15 | dselect/pkgdepcon.cc 16 | dselect/pkgdisplay.cc 17 | dselect/pkginfo.cc 18 | dselect/pkgkeys.cc 19 | dselect/pkglist.cc 20 | dselect/pkgsublist.cc 21 | dselect/pkgtop.cc 22 | -------------------------------------------------------------------------------- /dpkg-deb/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | localedir = $(datadir)/locale 4 | AM_CPPFLAGS = \ 5 | -DLOCALEDIR=\"$(localedir)\" \ 6 | -idirafter $(top_srcdir)/lib/compat \ 7 | -I$(top_builddir) \ 8 | -I$(top_srcdir)/lib 9 | 10 | 11 | bin_PROGRAMS = dpkg-deb 12 | 13 | dpkg_deb_SOURCES = \ 14 | dpkg-deb.h \ 15 | build.c \ 16 | extract.c \ 17 | info.c \ 18 | main.c 19 | 20 | dpkg_deb_LDADD = \ 21 | ../lib/dpkg/libdpkg.la \ 22 | $(LIBINTL) \ 23 | $(Z_LIBS) \ 24 | $(LZMA_LIBS) \ 25 | $(BZ2_LIBS) 26 | -------------------------------------------------------------------------------- /debian/dpkg.install: -------------------------------------------------------------------------------- 1 | ../dpkg.cfg etc/dpkg 2 | 3 | etc/dpkg/dpkg.cfg.d 4 | etc/alternatives 5 | sbin/start-stop-daemon 6 | usr/bin/dpkg 7 | usr/bin/dpkg-deb 8 | usr/bin/dpkg-divert 9 | usr/bin/dpkg-maintscript-helper 10 | usr/bin/dpkg-query 11 | usr/bin/dpkg-split 12 | usr/bin/dpkg-statoverride 13 | usr/bin/dpkg-trigger 14 | usr/bin/update-alternatives 15 | usr/share/dpkg/*table 16 | usr/share/locale/*/LC_MESSAGES/dpkg.mo 17 | usr/share/polkit-1/actions 18 | var/lib/dpkg/alternatives 19 | var/lib/dpkg/info 20 | var/lib/dpkg/parts 21 | var/lib/dpkg/updates 22 | -------------------------------------------------------------------------------- /scripts/t/dpkg_source/testsuite_3.dsc: -------------------------------------------------------------------------------- 1 | Format: 3.0 (native) 2 | Source: testsuite 3 | Binary: test-binary 4 | Architecture: all 5 | Version: 3 6 | Maintainer: Dpkg Developers 7 | Standards-Version: 1.0 8 | Package-List: 9 | test-binary deb test optional arch=all 10 | Checksums-Sha1: 11 | 0000000000000000000000000000000000000000 0 testsuite_3.tar.xz 12 | Checksums-Sha256: 13 | 0000000000000000000000000000000000000000000000000000000000000000 0 testsuite_3.tar.xz 14 | Files: 15 | 00000000000000000000000000000000 0 testsuite_3.tar.xz 16 | -------------------------------------------------------------------------------- /scripts/t/dpkg_source/testsuite_0.dsc: -------------------------------------------------------------------------------- 1 | Format: 3.0 (native) 2 | Source: testsuite 3 | Binary: test-binary 4 | Architecture: all 5 | Version: 0 6 | Maintainer: Dpkg Developers 7 | Standards-Version: 1.0 8 | Testsuite: autopkgtest 9 | Package-List: 10 | test-binary deb test optional arch=all 11 | Checksums-Sha1: 12 | 0000000000000000000000000000000000000000 0 testsuite_0.tar.xz 13 | Checksums-Sha256: 14 | 0000000000000000000000000000000000000000000000000000000000000000 0 testsuite_0.tar.xz 15 | Files: 16 | 00000000000000000000000000000000 0 testsuite_0.tar.xz 17 | -------------------------------------------------------------------------------- /scripts/t/dpkg_source/testsuite_1.dsc: -------------------------------------------------------------------------------- 1 | Format: 3.0 (native) 2 | Source: testsuite 3 | Binary: test-binary 4 | Architecture: all 5 | Version: 1 6 | Maintainer: Dpkg Developers 7 | Standards-Version: 1.0 8 | Testsuite: autopkgtest 9 | Package-List: 10 | test-binary deb test optional arch=all 11 | Checksums-Sha1: 12 | 0000000000000000000000000000000000000000 0 testsuite_1.tar.xz 13 | Checksums-Sha256: 14 | 0000000000000000000000000000000000000000000000000000000000000000 0 testsuite_1.tar.xz 15 | Files: 16 | 00000000000000000000000000000000 0 testsuite_1.tar.xz 17 | -------------------------------------------------------------------------------- /debian/dpkg-dev.install: -------------------------------------------------------------------------------- 1 | ../shlibs.default etc/dpkg 2 | ../shlibs.override etc/dpkg 3 | 4 | usr/bin/dpkg-architecture 5 | usr/bin/dpkg-buildflags 6 | usr/bin/dpkg-buildpackage 7 | usr/bin/dpkg-checkbuilddeps 8 | usr/bin/dpkg-distaddfile 9 | usr/bin/dpkg-genbuildinfo 10 | usr/bin/dpkg-genchanges 11 | usr/bin/dpkg-gencontrol 12 | usr/bin/dpkg-gensymbols 13 | usr/bin/dpkg-mergechangelogs 14 | usr/bin/dpkg-name 15 | usr/bin/dpkg-parsechangelog 16 | usr/bin/dpkg-scanpackages 17 | usr/bin/dpkg-scansources 18 | usr/bin/dpkg-shlibdeps 19 | usr/bin/dpkg-source 20 | usr/bin/dpkg-vendor 21 | usr/share/dpkg/*.mk 22 | -------------------------------------------------------------------------------- /dselect/methods/multicd/desc.multi_mount: -------------------------------------------------------------------------------- 1 | Installation from a pre-mounted directory with changing content. 2 | 3 | The directory contains the Packages.gz file from each distribution 4 | area being installed (usually main, contrib, non-free and local) 5 | as well as an excerpt of the corresponding binary/*/*.deb files. 6 | 7 | The easiest way for them to get this is to make a (partial) copy of 8 | the distribution site's directory hierarchy, if possible. 9 | 10 | The contents of the mounted directory may change. Thus it's possible 11 | to use this method for installations from images of a CDROM set. 12 | -------------------------------------------------------------------------------- /dselect/methods/multicd/desc.multi_nfs: -------------------------------------------------------------------------------- 1 | Installation across the network, from an NFS server which is not 2 | currently mounted. 3 | 4 | The server should contain the Packages.gz file from each distribution 5 | area being installed (usually main, contrib, non-free and local) 6 | as well as the corresponding binary/*/*.deb files. 7 | 8 | The easiest way for them to get this is to make a (partial) copy of 9 | the distribution site's directory hierarchy, if possible. 10 | 11 | The contents of the mounted directory may change. Thus it's possible 12 | to use this method for installations from a CDROM set. 13 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Control/control-1: -------------------------------------------------------------------------------- 1 | Source: mysource 2 | # This is a comment 3 | numeric-field: 0 4 | my-field-one: myvalue1 5 | my-field-two: myvalue2 6 | long-field: line1 7 | line 2 line 2 line 2 8 | . 9 | line 3 line 3 line 3 10 | . 11 | .. 12 | line 4 13 | empty-field: 14 | 15 | # First package 16 | Package: mypackage1 17 | Architecture: any 18 | Depends: libc6 19 | 20 | # Second package 21 | Package: mypackage2 22 | Architecture: all 23 | Depends: hello 24 | 25 | Package: mypackage3 26 | Architecture: all 27 | Depends:hello 28 | Description: short one 29 | long one 30 | very long one 31 | -------------------------------------------------------------------------------- /dpkg-split/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | localedir = $(datadir)/locale 4 | AM_CPPFLAGS = \ 5 | -DLOCALEDIR=\"$(localedir)\" \ 6 | -DADMINDIR=\"$(admindir)\" \ 7 | -idirafter $(top_srcdir)/lib/compat \ 8 | -I$(top_builddir) \ 9 | -I$(top_srcdir)/lib 10 | 11 | 12 | bin_PROGRAMS = dpkg-split 13 | 14 | dpkg_split_SOURCES = \ 15 | dpkg-split.h \ 16 | info.c \ 17 | join.c \ 18 | main.c \ 19 | queue.c \ 20 | split.c 21 | 22 | dpkg_split_LDADD = \ 23 | ../lib/dpkg/libdpkg.la \ 24 | $(LIBINTL) 25 | 26 | install-data-local: 27 | $(MKDIR_P) $(DESTDIR)$(admindir)/parts 28 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/objdump.blacklisted: -------------------------------------------------------------------------------- 1 | 2 | libblacklisted.so.0: file format elf32-littlearm 3 | architecture: arm, flags 0x00000150: 4 | HAS_SYMS, DYNAMIC, D_PAGED 5 | start address 0x0000f668 6 | 7 | Dynamic Section: 8 | SONAME libblacklisted.so.0 9 | 10 | DYNAMIC SYMBOL TABLE: 11 | 00018ef4 g DF .text 00000008 Base .gomp_critical_user_foo 12 | 0001c7f0 g DF .text 00000018 Base .gomp_critical_user_bar 13 | 00011614 g DF .text 00000014 GCC_3.0 __aeabi_lcmp 14 | 000115d8 w DF .text 00000000 GCC_4.0 __aeabi_unknown 15 | 00015378 g DF .text 0000000c Base symbol 16 | -------------------------------------------------------------------------------- /scripts/t/dpkg_buildpackage/test-source_0.dsc: -------------------------------------------------------------------------------- 1 | Format: 3.0 (native) 2 | Source: test-source 3 | Binary: test-binary-all, test-binary-any 4 | Architecture: any all 5 | Version: 0 6 | Maintainer: Dpkg Developers 7 | Package-List: 8 | test-binary-all deb test optional arch=all 9 | test-binary-any deb test optional arch=any 10 | Checksums-Sha1: 11 | 0000000000000000000000000000000000000000 0 test-source_0.tar.xz 12 | Checksums-Sha256: 13 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0.tar.xz 14 | Files: 15 | 00000000000000000000000000000000 0 test-source_0.tar.xz 16 | -------------------------------------------------------------------------------- /scripts/t/dpkg_source/testsuite_2.dsc: -------------------------------------------------------------------------------- 1 | Format: 3.0 (native) 2 | Source: testsuite 3 | Binary: test-binary 4 | Architecture: all 5 | Version: 2 6 | Maintainer: Dpkg Developers 7 | Standards-Version: 1.0 8 | Testsuite: autopkgtest, funcpkgtest, smokepkgtest, unitpkgtest 9 | Package-List: 10 | test-binary deb test optional arch=all 11 | Checksums-Sha1: 12 | 0000000000000000000000000000000000000000 0 testsuite_2.tar.xz 13 | Checksums-Sha256: 14 | 0000000000000000000000000000000000000000000000000000000000000000 0 testsuite_2.tar.xz 15 | Files: 16 | 00000000000000000000000000000000 0 testsuite_2.tar.xz 17 | -------------------------------------------------------------------------------- /src/rootlessJB/calljailbreakd.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | #ifndef PAYLOADS_COMMON_H 11 | #define PAYLOADS_COMMON_H 12 | 13 | #include 14 | 15 | #define JAILBREAKD_COMMAND_FIXUP_DYLIB 8 16 | 17 | void openjailbreakdsocket(void); 18 | void calljailbreakd(const char *dylib); 19 | void closejailbreakfd(void); 20 | 21 | #endif // PAYLOADS_COMMON_H 22 | 23 | struct __attribute__((__packed__)) JAILBREAKD_FIXUP_DYLIB { 24 | uint8_t Command; 25 | char dylib[1024]; 26 | }; 27 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Changelog/date-format: -------------------------------------------------------------------------------- 1 | date-format (0.2) unstable; urgency=low 2 | 3 | * Date without day of week name and negative timezone offset. 4 | 5 | -- Dpkg Developers 01 Jul 2100 23:59:59 -1200 6 | 7 | date-format (0.1) unstable; urgency=low 8 | 9 | * Date with day of week name and positive timezone offset. 10 | 11 | -- Dpkg Developers Tue, 27 Feb 2050 12:00:00 +1245 12 | 13 | date-format (0.0) unstable; urgency=low 14 | 15 | * Date with day of week name and zero timezone offset. 16 | 17 | -- Dpkg Developers Mon, 01 Jan 2000 00:00:00 +0000 18 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Conf/config-mixed: -------------------------------------------------------------------------------- 1 | # Comment followed by an empty line. 2 | 3 | option-double-quotes = "value double quotes" 4 | option-single-quotes = 'value single quotes' 5 | option-space = value words space 6 | 7 | option-dupe=value1 8 | option-name=value-name 9 | 10 | # Indented comment. 11 | option-indent = value-indent 12 | 13 | option-equal=value-equal=subvalue-equal 14 | option-noequal value-noequal 15 | option-dupe=value2 16 | option-simple 17 | 18 | # Fully spelled out options. 19 | --option-dash=value-dash 20 | --option-dupe=value3 21 | 22 | # Long option with one character name. 23 | l=v 24 | # Short option. 25 | -o=vd 26 | -s 27 | -------------------------------------------------------------------------------- /scripts/mk/architecture.mk: -------------------------------------------------------------------------------- 1 | # This Makefile snippet defines all the DEB_HOST_* / DEB_BUILD_* variables 2 | # that dpkg-architecture can return. Existing values of those variables 3 | # are preserved as per policy. 4 | 5 | dpkg_lazy_eval ?= $$(or $$(value DPKG_CACHE_$(1)),$$(eval DPKG_CACHE_$(1) := $$(shell $(2)))$$(value DPKG_CACHE_$(1))) 6 | 7 | dpkg_architecture_setvar = export $(1) ?= $(call dpkg_lazy_eval,$(1),dpkg-architecture -q$(1)) 8 | 9 | $(foreach machine,BUILD HOST TARGET,\ 10 | $(foreach var,ARCH ARCH_ABI ARCH_LIBC ARCH_OS ARCH_CPU ARCH_BITS ARCH_ENDIAN GNU_CPU GNU_SYSTEM GNU_TYPE MULTIARCH,\ 11 | $(eval $(call dpkg_architecture_setvar,DEB_$(machine)_$(var))))) 12 | -------------------------------------------------------------------------------- /debian/dpkg.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # See deb-postrm(5). 3 | 4 | set -e 5 | 6 | # Remove log file when dpkg is purged 7 | remove_logfile() { 8 | logdir=$DPKG_ROOT/var/log 9 | 10 | rm -f "$logdir"/dpkg.log "$logdir"/dpkg.log.* 2>/dev/null 11 | rm -f "$logdir"/alternatives.log "$logdir"/alternatives.log.* 2>/dev/null 12 | } 13 | 14 | case "$1" in 15 | remove) 16 | ;; 17 | 18 | purge) 19 | remove_logfile 20 | ;; 21 | 22 | upgrade) 23 | ;; 24 | 25 | failed-upgrade|disappear|abort-install|abort-upgrade) 26 | ;; 27 | 28 | 29 | *) 30 | echo "$0 called with unknown argument '$1'" 1>&2 31 | exit 1 32 | ;; 33 | esac 34 | 35 | #DEBHELPER# 36 | exit 0 37 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/spacesyms-o-map.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # spacesyms-o-map.pl INPUT OUTPUT 4 | # 5 | # Copy the object file INPUT to OUTPUT, redefining any symbol in INPUT that 6 | # contains "SPACE" in its name to contain "SPA CE" instead. 7 | 8 | use strict; 9 | use warnings; 10 | 11 | my ($input, $output) = @ARGV; 12 | my @cmds = ('objcopy'); 13 | 14 | open my $nm, '-|', 'nm', $input or die "cannot run nm: $!"; 15 | while (<$nm>) { 16 | next if not m/SPACE/; 17 | chomp; 18 | my $x = (split / /, $_, 3)[2]; 19 | my $y = $x =~ s/SPACE/SPA CE/r; 20 | push @cmds, "--redefine-sym=$x=$y"; 21 | } 22 | close $nm; 23 | 24 | push @cmds, $input, $output; 25 | exec @cmds; 26 | -------------------------------------------------------------------------------- /t-func/deb-fields.at: -------------------------------------------------------------------------------- 1 | AT_TESTED([dpkg-deb]) 2 | 3 | AT_SETUP([dpkg-deb .deb fields]) 4 | AT_KEYWORDS([dpkg-deb deb fields]) 5 | 6 | DPKG_GEN_CONTROL([pkg-package-type-void]) 7 | AT_CHECK([ 8 | dpkg-deb -b pkg-package-type-void 9 | # Test absence of Package-Type field. 10 | test -z "$(dpkg-deb -f pkg-package-type-void.deb Package-Type)" 11 | ], [0], [ignore]) 12 | 13 | DPKG_GEN_CONTROL([pkg-package-type-use]) 14 | DPKG_MOD_CONTROL([pkg-package-type-use], [/^Package:/aPackage-Type: udeb]) 15 | AT_CHECK([ 16 | dpkg-deb -b pkg-package-type-use 17 | # Test presence of Package-Type field. 18 | test -n "$(dpkg-deb -f pkg-package-type-use.deb Package-Type)" 19 | ], [0], [ignore]) 20 | 21 | AT_CLEANUP 22 | -------------------------------------------------------------------------------- /dselect/methods/disk/desc.mounted: -------------------------------------------------------------------------------- 1 | Installation from a directory on a filesystem that has already been 2 | mounted. If the options available for mounting things automatically 3 | are inadequate for your needs you'll need to get a shell command 4 | prompt (for example by switching VT using Alt-F or quitting 5 | dselect) and use it to mount the filesystem before continuing. 6 | 7 | The area you're installing from should contain the Packages.gz file 8 | from each distribution area being installed (usually stable, contrib 9 | and non-free) as well as the corresponding binary/*/*.deb files. 10 | 11 | The easiest way to do get this is to make a (partial) copy of the 12 | distribution site's directory hierarchy, if possible. 13 | -------------------------------------------------------------------------------- /src/rootlessJB/objc-helper.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void addObjcSymbols(void); 4 | 5 | void *_objc_msgSend; 6 | void* (*_objc_getClass)(const char*); 7 | char* (*_sel_registerName)(const char *); 8 | 9 | void *_description(void *object); 10 | char *UTF8String(void *object); 11 | void removeSubstring(char *s,const char *toremove); 12 | void* NSStringFromUTF8String(const char *charString); 13 | 14 | int validatePlist(const char *plistPath); 15 | void createMinimalEntitlementsPlist(const char *plistPath); 16 | char * getPlistValueForKey(const char *key, const char *plistPath); 17 | char ** getPlistArrayValueForKey(const char *key, const char *plistPath,size_t *count); 18 | void updatePlistEntitlements(const char *path); 19 | -------------------------------------------------------------------------------- /t-func/local.at: -------------------------------------------------------------------------------- 1 | # Dpkg helper macros 2 | 3 | m4_pattern_forbid([^DPKG_]) 4 | 5 | # DPKG_GEN_CONTROL([$pkgname]) 6 | m4_define([DPKG_GEN_CONTROL], [ 7 | mkdir -p '$1/DEBIAN' 8 | 9 | cat >'$1/DEBIAN/control' < 15 | Architecture: all 16 | Description: test package 17 | CTRL_TEMPL 18 | ]) 19 | 20 | # DPKG_MOD_CONTROL([$pkgname], [$sedexpr]) 21 | m4_define([DPKG_MOD_CONTROL], [ 22 | sed -i -e '$2' '$1/DEBIAN/control' 23 | ]) 24 | 25 | # DPKG_GEN_FILE([$pkgname], [$file], [$contents]) 26 | m4_define([DPKG_GEN_FILE], [ 27 | mkdir -p '$1/DEBIAN' 28 | 29 | cat >'$1/DEBIAN/$2' <= 1.1) 3 | (optional)symbol11_optional@Base 1.1 1 4 | (arch=amd64 ia64 alpha)'symbol21_amd64@Base' 2.1 5 | (arch=!amd64 !ia64 !mips)symbol22_i386@Base 2.2 6 | (arch=!amd64 !ia64 !i386)symbol23_mips@Base 2.3 7 | (arch-bits=32)symbol24_32@Base 2.4 8 | (arch-bits=64)symbol25_64@Base 2.5 9 | (arch-endian=little)symbol26_little@Base 2.6 10 | (arch-endian=big)symbol27_big@Base 2.7 11 | (arch-bits=32|arch-endian=little)symbol28_little_32@Base 2.8 12 | (randomtagname=randomtagvalue)symbol31_randomtag@Base 3.1 13 | (arch=i386|optional=reason)"symbol41_i386_and_optional@Base" 4.1 14 | (arch=mips|optional=reason)"symbol42_mips_and_optional@Base" 4.2 15 | symbol51_untagged@Base 5.1 16 | -------------------------------------------------------------------------------- /t-func/atlocal.in: -------------------------------------------------------------------------------- 1 | # Global shell definitions for the autotest test suite 2 | 3 | PATH="@abs_top_builddir@/dpkg-deb:@abs_top_builddir@/dpkg-split:@abs_top_builddir@/src:@abs_top_builddir@/utils:$PATH" 4 | export PATH 5 | 6 | # Setup a sane environment 7 | 8 | umask 0022 9 | 10 | LC_ALL=C 11 | export LC_ALL 12 | 13 | TZ=UTC0 14 | export TZ 15 | 16 | SOURCE_DATE_EPOCH=0 17 | export SOURCE_DATE_EPOCH 18 | 19 | # Cleanup variables that might affect the tests. 20 | unset GZIP 21 | unset BZIP 22 | unset XZ_OPT 23 | unset XZ_DEFAULTS 24 | 25 | if [ "$(id -u)" = 0 ]; then 26 | ASROOT= 27 | elif which fakeroot >/dev/null; then 28 | ASROOT=fakeroot 29 | else 30 | echo "skip: needs to run as root(ish)" >&2 31 | exit 0 32 | fi 33 | export ASROOT 34 | 35 | TESTDATA="@abs_top_srcdir@/t-func" 36 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_File.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::File'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Lock.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Lock'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /m4/dpkg-unicode.m4: -------------------------------------------------------------------------------- 1 | # Copyright © 1995-2003, 2005-2006 Free Software Foundation, Inc. 2 | # Copyright © 2009 Yuri Vasilevski 3 | # Copyright © 2010 Guillem Jover 4 | # 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # DPKG_UNICODE() 10 | # ------------ 11 | # Add configure option to disable Unicode support. 12 | AC_DEFUN([DPKG_UNICODE], [ 13 | AC_MSG_CHECKING([whether Unicode is requested]) 14 | dnl Default: Unicode is enabled. 15 | AC_ARG_ENABLE([unicode], 16 | [AS_HELP_STRING([--disable-unicode], 17 | [do not use Unicode (wide chars) support])], 18 | [USE_UNICODE=$enableval], 19 | [USE_UNICODE=yes]) 20 | AC_MSG_RESULT([$USE_UNICODE]) 21 | AC_SUBST([USE_UNICODE]) 22 | ]) # DPKG_UNICODE 23 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Index.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Index'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Gettext.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Gettext'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_ErrorHandling.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::ErrorHandling'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_OpenPGP/package_1.0.orig.tar.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iQIzBAABCgAdFiEETz509DYFDBD1aWV0uXK/PqSuV6MFAlnijuMACgkQuXK/PqSu 4 | V6Oiuw/+P0+5BMH/WfsyhDrykF90tp2q6+eQvbgny8Mo1SJT647cS0bXFrZqd1Zr 5 | 22hFouKLbbqmJVm7GqIyWzg6mWvRJ85tvKMhwaUHiNKBrwOguw6crk8TdRidvS1p 6 | m7E70wYdoPGvLt0Sr7nDWyaj82r3QkqTWTMxiD9jD4Z3w5Ztz08rpho6CJcGcAlv 7 | 09WGRVo+AiQLDRT70T7598lilHviFNGJdC9sVOrkEyFVDJZirnTvqXgqTJAy5Lve 8 | DjTnfYAzmivtsQUXkYIj31XWLsiFa5mfpl6FSmFUSBPXALO++sZrL+mQZoUqnBv/ 9 | bxCg3RYbPA6dpZ9IB/gyAvvEOEECeA4v5gDqGn67FeZsALPOEhvAYclkMtLOQBxr 10 | sJD9GPCQtT2QfObmaUlqabXASNjzguayprh+a8CJChyBKWSvn6LoSdsBzesPT/bh 11 | DJenc5M9jvIVShiwqQYCdYotebdKYDIvelblz0TbaTs5RZNGrizgj4Mrl0CaKVHs 12 | 51M8Vpb+w1TM+jm3b+5Na+v9TuS0TxGKI1FTyfjZMjF92AF3A13KanSWMg+37eE1 13 | R1R4pPuJ2s4xYULQNh+BTHlrGso43nxzc2gkJbsPRa6n3fZFRVdYfkIJgv4kzaQD 14 | Lgsnhzrz1onBWvfnFWlJaRZ/ti4/3EEHAFvt25ZLMyJC2WOCG4I= 15 | =N2cG 16 | -----END PGP SIGNATURE----- 17 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Archive.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Source::Archive'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Functions.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Source::Functions'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Package.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Source::Package'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Interface_Storable.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 1; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Interface::Storable'); 23 | } 24 | 25 | # TODO: Add actual test cases. 26 | 27 | 1; 28 | -------------------------------------------------------------------------------- /scripts/mk/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | dist_pkgdata_DATA = \ 4 | architecture.mk \ 5 | buildflags.mk \ 6 | buildtools.mk \ 7 | default.mk \ 8 | pkg-info.mk \ 9 | vendor.mk 10 | 11 | do_path_subst = $(AM_V_GEN) sed \ 12 | -e "s:dpkg_datadir[[:space:]]*=[[:space:]]*[^[:space:]]*:dpkg_datadir = $(pkgdatadir):" 13 | 14 | install-data-hook: 15 | mv $(DESTDIR)$(pkgdatadir)/default.mk \ 16 | $(DESTDIR)$(pkgdatadir)/default.mk.tmp 17 | $(do_path_subst) <$(DESTDIR)$(pkgdatadir)/default.mk.tmp \ 18 | >$(DESTDIR)$(pkgdatadir)/default.mk 19 | rm -f $(DESTDIR)$(pkgdatadir)/default.mk.tmp 20 | 21 | mv $(DESTDIR)$(pkgdatadir)/buildtools.mk \ 22 | $(DESTDIR)$(pkgdatadir)/buildtools.mk.tmp 23 | $(do_path_subst) <$(DESTDIR)$(pkgdatadir)/buildtools.mk.tmp \ 24 | >$(DESTDIR)$(pkgdatadir)/buildtools.mk 25 | rm -f $(DESTDIR)$(pkgdatadir)/buildtools.mk.tmp 26 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Changelog_Ubuntu.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::Dpkg qw(:paths); 20 | 21 | $ENV{DEB_VENDOR} = 'Ubuntu'; 22 | 23 | my $datafile = test_get_data_path('t/Dpkg_Changelog.t'); 24 | 25 | do "$datafile"; 26 | -------------------------------------------------------------------------------- /t/pod.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | use Test::Dpkg qw(:needs :paths); 21 | 22 | test_needs_module('Test::Pod', '1.00'); 23 | test_needs_srcdir_switch(); 24 | 25 | my @files = Test::Dpkg::all_perl_files(); 26 | 27 | all_pod_files_ok(@files); 28 | -------------------------------------------------------------------------------- /utils/update-alternatives.polkit.in: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | The Dpkg Project 7 | https://wiki.debian.org/Teams/Dpkg 8 | update-alternatives 9 | 10 | 11 | Run update-alternatives to modify system alternative selections 12 | Authentication is required to run update-alternatives 13 | 14 | auth_admin_keep 15 | auth_admin_keep 16 | auth_admin_keep 17 | 18 | @bindir@/update-alternatives 19 | 20 | 21 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Build_Info.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 2; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Build::Info'); 23 | } 24 | 25 | is(scalar Dpkg::Build::Info::get_build_env_whitelist(), 50, 26 | 'whitelisted environment variables array'); 27 | 28 | 1; 29 | -------------------------------------------------------------------------------- /debian/dpkg.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # See deb-postinst(5). 3 | 4 | set -e 5 | 6 | # Create the database files if they don't already exist 7 | create_database() { 8 | admindir=${DPKG_ADMINDIR:-/var/lib/dpkg} 9 | 10 | for file in diversions statoverride status; do 11 | if [ ! -f "$admindir/$file" ]; then 12 | touch "$admindir/$file" 13 | fi 14 | done 15 | } 16 | 17 | 18 | # Create log file and set default permissions if possible 19 | create_logfile() { 20 | logfile=$DPKG_ROOT/var/log/dpkg.log 21 | 22 | if [ ! -f "$logfile" ]; then 23 | touch "$logfile" 24 | chmod 644 "$logfile" 25 | chown root:root "$logfile" 2>/dev/null || chown 0:0 "$logfile" 26 | fi 27 | } 28 | 29 | 30 | case "$1" in 31 | configure) 32 | create_database 33 | create_logfile 34 | ;; 35 | 36 | abort-upgrade|abort-deconfigure|abort-remove) 37 | ;; 38 | 39 | *) 40 | echo "$0 called with unknown argument '$1'" 1>&2 41 | exit 1 42 | ;; 43 | esac 44 | 45 | #DEBHELPER# 46 | exit 0 47 | -------------------------------------------------------------------------------- /t/synopsis.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | use Test::Dpkg qw(:needs); 21 | 22 | test_needs_author(); 23 | test_needs_module('Test::Synopsis'); 24 | test_needs_srcdir_switch(); 25 | 26 | my @files = Test::Dpkg::all_perl_files(); 27 | 28 | plan tests => scalar @files; 29 | 30 | for my $file (@files) { 31 | synopsis_ok($file); 32 | } 33 | -------------------------------------------------------------------------------- /lib/dpkg/t/t-test-skip.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * t-test-skip.c - test suite self tests, skip all 4 | * 5 | * Copyright © 2014 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | TEST_ENTRY(test) 27 | { 28 | test_skip_all("ignore all tests"); 29 | 30 | test_fail(1); 31 | } 32 | -------------------------------------------------------------------------------- /t/minimum-version.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | use Test::Dpkg qw(:needs); 21 | 22 | test_needs_author(); 23 | test_needs_module('Test::MinimumVersion'); 24 | test_needs_srcdir_switch(); 25 | 26 | my @files = Test::Dpkg::all_perl_files(); 27 | 28 | plan tests => scalar @files; 29 | 30 | for my $file (@files) { 31 | minimum_version_ok($file, '5.20.2'); 32 | } 33 | -------------------------------------------------------------------------------- /scripts/t/dpkg_buildpackage/test-source_0_all.changes: -------------------------------------------------------------------------------- 1 | Format: 1.8 2 | Date: Thu, 30 Jun 2016 20:15:12 +0200 3 | Source: test-source 4 | Binary: test-binary-all 5 | Architecture: all 6 | Version: 0 7 | Distribution: unstable 8 | Urgency: low 9 | Maintainer: Dpkg Developers 10 | Changed-By: Dpkg Developers 11 | Description: 12 | test-binary-all - architecture independent binary package 13 | Closes: 12345 14 | Changes: 15 | test-source (0) unstable; urgency=low 16 | . 17 | * Entry. Closes: #12345 18 | Checksums-Sha1: 19 | 0000000000000000000000000000000000000000 0 test-binary-all_0_all.deb 20 | 0000000000000000000000000000000000000000 0 test-source_0_all.buildinfo 21 | Checksums-Sha256: 22 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-binary-all_0_all.deb 23 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0_all.buildinfo 24 | Files: 25 | 00000000000000000000000000000000 0 test optional test-binary-all_0_all.deb 26 | 00000000000000000000000000000000 0 test optional test-source_0_all.buildinfo 27 | -------------------------------------------------------------------------------- /t/strict.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | use Test::Dpkg qw(:needs); 21 | 22 | test_needs_module('Test::Strict'); 23 | test_needs_srcdir_switch(); 24 | 25 | eval '$Test::Strict::TEST_WARNINGS = 1'; 26 | 27 | my @files = Test::Dpkg::all_perl_files(); 28 | 29 | plan tests => scalar @files * 2; 30 | 31 | for my $file (@files) { 32 | strict_ok($file); 33 | warnings_ok($file); 34 | } 35 | -------------------------------------------------------------------------------- /scripts/t/dpkg_buildpackage/test-source_0_any.changes: -------------------------------------------------------------------------------- 1 | Format: 1.8 2 | Date: Thu, 30 Jun 2016 20:15:12 +0200 3 | Source: test-source 4 | Binary: test-binary-any 5 | Architecture: amd64 6 | Version: 0 7 | Distribution: unstable 8 | Urgency: low 9 | Maintainer: Dpkg Developers 10 | Changed-By: Dpkg Developers 11 | Description: 12 | test-binary-any - architecture dependent binary package 13 | Closes: 12345 14 | Changes: 15 | test-source (0) unstable; urgency=low 16 | . 17 | * Entry. Closes: #12345 18 | Checksums-Sha1: 19 | 0000000000000000000000000000000000000000 0 test-binary-any_0_amd64.deb 20 | 0000000000000000000000000000000000000000 0 test-source_0_amd64.buildinfo 21 | Checksums-Sha256: 22 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-binary-any_0_amd64.deb 23 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0_amd64.buildinfo 24 | Files: 25 | 00000000000000000000000000000000 0 test optional test-binary-any_0_amd64.deb 26 | 00000000000000000000000000000000 0 test optional test-source_0_amd64.buildinfo 27 | -------------------------------------------------------------------------------- /lib/compat/alphasort.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libcompat - system compatibility library 3 | * 4 | * Copyright © 1995 Ian Jackson 5 | * 6 | * This is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include "compat.h" 26 | 27 | int 28 | alphasort(const void *a, const void *b) 29 | { 30 | return strcmp((*(const struct dirent **)a)->d_name, 31 | (*(const struct dirent **)b)->d_name); 32 | } 33 | -------------------------------------------------------------------------------- /lib/compat/strchrnul.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libcompat - system compatibility library 3 | * 4 | * Copyright © 2018 Guillem Jover 5 | * 6 | * This is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include "compat.h" 26 | 27 | char * 28 | strchrnul(const char *s, int c) 29 | { 30 | char *match; 31 | 32 | match = strchr(s, c); 33 | if (match) 34 | return match; 35 | 36 | return (char *)s + strlen(s); 37 | } 38 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Changelog/countme: -------------------------------------------------------------------------------- 1 | countme (2:2.0-1) unstable; urgency=low 2 | 3 | * Final 4 | 5 | -- Frank Lichtenheld Tue, 4 Oct 2005 01:49:05 +0200 6 | 7 | countme (1:2.0~rc2-3) unstable; urgency=low 8 | 9 | * kadabra 10 | 11 | -- Frank Lichtenheld Tue, 4 Oct 2005 01:48:05 +0200 12 | 13 | countme (1:2.0~rc2-2) unstable; urgency=low 14 | 15 | * Abra 16 | 17 | -- Frank Lichtenheld Tue, 4 Oct 2005 01:47:48 +0200 18 | 19 | countme (1:2.0~rc2-1sarge3) unstable; urgency=low 20 | 21 | * Baz 22 | 23 | -- Frank Lichtenheld Tue, 4 Oct 2005 01:47:19 +0200 24 | 25 | countme (1:2.0~rc2-1sarge2) unstable; urgency=low 26 | 27 | * Bar 28 | 29 | -- Frank Lichtenheld Tue, 4 Oct 2005 01:47:08 +0200 30 | 31 | countme (1:2.0~rc2-1sarge1) unstable; urgency=low 32 | 33 | * Foo 34 | 35 | -- Frank Lichtenheld Tue, 4 Oct 2005 01:46:49 +0200 36 | 37 | countme (1.5-1) unstable; urgency=low 38 | 39 | * Initial 40 | 41 | -- Frank Lichtenheld Thu, 01 Jan 1970 00:00:00 +0000 42 | -------------------------------------------------------------------------------- /dselect/curkeys.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * dselect - Debian package maintenance user interface 3 | * curkeys.cc - list of ncurses keys for name <-> key mapping 4 | * 5 | * Copyright © 1995 Ian Jackson 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #include "dselect.h" 27 | #include "bindings.h" 28 | 29 | const keybindings::keyname keybindings::keynames[] = { 30 | #include "curkeys.h" 31 | }; 32 | -------------------------------------------------------------------------------- /lib/compat/asprintf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libcompat - system compatibility library 3 | * 4 | * Copyright © 2010 Guillem Jover 5 | * 6 | * This is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include "compat.h" 26 | 27 | int 28 | asprintf(char **strp, char const *fmt, ...) 29 | { 30 | va_list args; 31 | int n; 32 | 33 | va_start(args, fmt); 34 | n = vasprintf(strp, fmt, args); 35 | va_end(args); 36 | 37 | return n; 38 | } 39 | -------------------------------------------------------------------------------- /lib/compat/unsetenv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libcompat - system compatibility library 3 | * 4 | * Copyright © 1995 Ian Jackson 5 | * 6 | * This is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include "compat.h" 26 | 27 | int 28 | unsetenv(const char *p) 29 | { 30 | char *q; 31 | 32 | q = malloc(strlen(p) + 3); 33 | if (!q) 34 | return -1; 35 | 36 | strcpy(q, p); 37 | strcat(q, "="); 38 | return putenv(q); 39 | } 40 | -------------------------------------------------------------------------------- /doc/frontend.txt: -------------------------------------------------------------------------------- 1 | Frontend Interfaces 2 | =================== 3 | 4 | This file will try to document some of the interfaces that dpkg makes 5 | available to frontends or that expects them to use, which are currently 6 | not covered by any other type of documentation. 7 | 8 | 9 | Database Locking 10 | ---------------- 11 | 12 | Any frontend needing to make sure no write operation is currently happening, 13 | and no other frontend is running should first acquire the frontend lock at 14 | «/lock-frontend», and then acquire the dpkg database lock at 15 | «/lock». When the frontend invokes dpkg, it should set the 16 | environment variable DPKG_FRONTEND_LOCKED (to prevent dpkg from acquiring 17 | the frontend lock), and then release the dpkg database lock, which will be 18 | acquired by dpkg itself. This way no other frontend following this protocol 19 | can race to perform operations while another one has one in progress. 20 | 21 | These locks must be file record locks (i.e. fcntl(2) advisory locking), and 22 | the whole file should be locked, as that's the most portable way to perform 23 | this operation; this can be achieved by using start=0, len=0 and 24 | whence=SEEK_SET. 25 | -------------------------------------------------------------------------------- /lib/compat/snprintf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libcompat - system compatibility library 3 | * 4 | * Copyright © 1995 Ian Jackson 5 | * 6 | * This is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "compat.h" 27 | 28 | int 29 | snprintf(char *str, size_t n, char const *fmt, ...) 30 | { 31 | va_list args; 32 | int i; 33 | 34 | va_start(args, fmt); 35 | i = vsnprintf(str, n, fmt, args); 36 | va_end(args); 37 | 38 | return i; 39 | } 40 | -------------------------------------------------------------------------------- /lib/compat/strndup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libcompat - system compatibility library 3 | * 4 | * Copyright © 2011 Guillem Jover 5 | * 6 | * This is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include "compat.h" 26 | 27 | char * 28 | strndup(const char *s, size_t n) 29 | { 30 | size_t len; 31 | char *str; 32 | 33 | len = strnlen(s, n); 34 | str = malloc(len + 1); 35 | if (str == NULL) 36 | return NULL; 37 | 38 | memcpy(str, s, len); 39 | str[len] = '\0'; 40 | 41 | return str; 42 | } 43 | -------------------------------------------------------------------------------- /scripts/t/dpkg_buildpackage/test-source_0_source.changes: -------------------------------------------------------------------------------- 1 | Format: 1.8 2 | Date: Thu, 30 Jun 2016 20:15:12 +0200 3 | Source: test-source 4 | Architecture: source 5 | Version: 0 6 | Distribution: unstable 7 | Urgency: low 8 | Maintainer: Dpkg Developers 9 | Changed-By: Dpkg Developers 10 | Closes: 12345 11 | Changes: 12 | test-source (0) unstable; urgency=low 13 | . 14 | * Entry. Closes: #12345 15 | Checksums-Sha1: 16 | 0000000000000000000000000000000000000000 0 test-source_0.dsc 17 | 0000000000000000000000000000000000000000 0 test-source_0.tar.xz 18 | 0000000000000000000000000000000000000000 0 test-source_0_source.buildinfo 19 | Checksums-Sha256: 20 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0.dsc 21 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0.tar.xz 22 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0_source.buildinfo 23 | Files: 24 | 00000000000000000000000000000000 0 test optional test-source_0.dsc 25 | 00000000000000000000000000000000 0 test optional test-source_0.tar.xz 26 | 00000000000000000000000000000000 0 test optional test-source_0_source.buildinfo 27 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Package.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 7; 20 | 21 | use_ok('Dpkg::Package'); 22 | 23 | ok(pkg_name_is_illegal(undef), 'package name is undef'); 24 | ok(pkg_name_is_illegal(''), 'package name is empty'); 25 | ok(pkg_name_is_illegal('%_&'), 'package name has invalid chars'); 26 | ok(pkg_name_is_illegal('ABC'), 'package name has uppercase chars'); 27 | ok(pkg_name_is_illegal('-abc'), 'package name has a dash'); 28 | 29 | is(pkg_name_is_illegal('pkg+name-1.0'), undef, 'package name is valid'); 30 | 31 | 1; 32 | -------------------------------------------------------------------------------- /lib/dpkg/program.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * program.h - dpkg-based program support 4 | * 5 | * Copyright © 2013 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_PROGRAM_H 22 | #define LIBDPKG_PROGRAM_H 23 | 24 | #include 25 | 26 | DPKG_BEGIN_DECLS 27 | 28 | /** 29 | * @defgroup program Program support 30 | * @ingroup dpkg-public 31 | * @{ 32 | */ 33 | 34 | void dpkg_program_init(const char *progname); 35 | void dpkg_program_done(void); 36 | 37 | /** @} */ 38 | 39 | DPKG_END_DECLS 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/file-match.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dpkg - main program for package management 3 | * file-match.h - file name/type match tracking functions 4 | * 5 | * Copyright © 2011 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef DPKG_FILE_MATCH_H 22 | #define DPKG_FILE_MATCH_H 23 | 24 | struct match_node { 25 | struct match_node *next; 26 | char *filetype; 27 | char *filename; 28 | }; 29 | 30 | struct match_node * 31 | match_node_new(const char *name, const char *type, struct match_node *next); 32 | void 33 | match_node_free(struct match_node *node); 34 | 35 | #endif /* DPKG_FILE_MATCH_H */ 36 | -------------------------------------------------------------------------------- /lib/compat/md5.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: md5.h,v 1.15 2004/05/03 17:30:14 millert Exp $ */ 2 | 3 | /* 4 | * This code implements the MD5 message-digest algorithm. 5 | * The algorithm is due to Ron Rivest. This code was 6 | * written by Colin Plumb in 1993, no copyright is claimed. 7 | * This code is in the public domain; do with it what you wish. 8 | * 9 | * Equivalent code is available from RSA Data Security, Inc. 10 | * This code has been tested against that, and is equivalent, 11 | * except that you don't need to include two pages of legalese 12 | * with every copy. 13 | */ 14 | 15 | #ifndef _MD5_H_ 16 | #define _MD5_H_ 17 | 18 | #include 19 | 20 | #define MD5_BLOCK_LENGTH 64 21 | #define MD5_DIGEST_LENGTH 16 22 | #define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH * 2 + 1) 23 | 24 | typedef struct MD5Context { 25 | uint32_t state[4]; /* state */ 26 | uint64_t count; /* number of bits, mod 2^64 */ 27 | uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */ 28 | } MD5_CTX; 29 | 30 | void MD5Init(MD5_CTX *); 31 | void MD5Update(MD5_CTX *, const uint8_t *, size_t); 32 | void MD5Pad(MD5_CTX *); 33 | void MD5Final(uint8_t [MD5_DIGEST_LENGTH], MD5_CTX *); 34 | void MD5Transform(uint32_t [4], const uint8_t [MD5_BLOCK_LENGTH]); 35 | 36 | #endif /* _MD5_H_ */ 37 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Changelog/fields: -------------------------------------------------------------------------------- 1 | fields (2.0-0etch1) stable; urgency=low 2 | 3 | * Upload to stable (Closes: #1111111, #2222222) 4 | * Fix more stuff. (LP: #54321, #2424242) 5 | 6 | -- Frank Lichtenheld Sun, 13 Jan 2008 15:49:19 +0100 7 | 8 | fields (2.0-1) unstable frozen; urgency=medium 9 | 10 | [ Frank Lichtenheld ] 11 | * Upload to unstable (Closes: #1111111, #2222222) 12 | * Fix stuff. (LP: #12345, #424242) 13 | 14 | [ Raphaël Hertzog ] 15 | * New upstream release. 16 | - implements a 17 | - implements b 18 | * Update S-V. 19 | 20 | -- Frank Lichtenheld Sun, 12 Jan 2008 15:49:19 +0100 21 | 22 | fields (2.0~b1-1) unstable; urgency=low,xc-userfield=foobar 23 | 24 | * Beta 25 | 26 | -- Frank Lichtenheld Sun, 11 Jan 2008 15:49:19 +0100 27 | 28 | fields (1.0) experimental; urgency=high,xb-userfield2=foobar 29 | 30 | * First upload (Closes: #1000000) 31 | 32 | -- Frank Lichtenheld Sun, 10 Jan 2008 15:49:19 +0100 33 | 34 | fields (0.5) experimental 35 | 36 | * This entry is in an older changelog format and it should not be 37 | parsed. So let's put some non-conforming content. 38 | 39 | This line starts on the first column. 40 | -- Raphaël Hertzog 41 | -------------------------------------------------------------------------------- /lib/dpkg/progname.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * progname.h - program name handling functions 4 | * 5 | * Copyright © 2011 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_PROGNAME_H 22 | #define LIBDPKG_PROGNAME_H 23 | 24 | #include 25 | 26 | DPKG_BEGIN_DECLS 27 | 28 | /** 29 | * @defgroup progname Program name handling 30 | * @ingroup dpkg-public 31 | * @{ 32 | */ 33 | 34 | void dpkg_set_progname(const char *name); 35 | const char *dpkg_get_progname(void); 36 | 37 | /** @} */ 38 | 39 | DPKG_END_DECLS 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/filters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dpkg - main program for package management 3 | * filters.h - external definitions for filter handling 4 | * 5 | * Copyright © 2007, 2008 Tollef Fog Heen 6 | * Copyright © 2008, 2010 Guillem Jover 7 | * 8 | * This is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef DPKG_FILTERS_H 23 | #define DPKG_FILTERS_H 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | DPKG_BEGIN_DECLS 31 | 32 | void filter_add(const char *glob, bool include); 33 | bool filter_should_skip(struct tar_entry *ti); 34 | 35 | DPKG_END_DECLS 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /dselect/dselect-curses.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dselect - Debian package maintenance user interface 3 | * dselect-curses.h - curses header wrapper 4 | * 5 | * Copyright © 2009 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef DSELECT_CURSES_H 22 | #define DSELECT_CURSES_H 23 | 24 | #include 25 | 26 | #undef ERR 27 | 28 | #if defined(HAVE_NCURSESW_NCURSES_H) 29 | #include 30 | #elif defined(HAVE_NCURSES_NCURSES_H) 31 | #include 32 | #elif defined(HAVE_NCURSES_H) 33 | #include 34 | #else 35 | #include 36 | #endif 37 | 38 | #endif /* DSELECT_CURSES_H */ 39 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Source_Quilt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 2; 20 | use Test::Dpkg qw(:paths); 21 | 22 | BEGIN { 23 | use_ok('Dpkg::Source::Quilt'); 24 | } 25 | 26 | my $datadir = test_get_data_path(); 27 | 28 | my $quilt; 29 | my (@series_got, @series_exp); 30 | 31 | $quilt = Dpkg::Source::Quilt->new("$datadir/parse"); 32 | @series_got = $quilt->series(); 33 | @series_exp = qw(change-a.patch change-b.patch change-c.patch change-d.patch); 34 | is_deeply(\@series_got, \@series_exp, 'Parsed series file matches ref'); 35 | 36 | # TODO: Add actual test cases. 37 | 38 | 1; 39 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | # Spell names properly 2 | Raphaël Hertzog 3 | Nicolas François 4 | Javier Fernández-Sanguino Peña 5 | Javier Fernández-Sanguino Peña 6 | Eddy Petrișor 7 | Jiří Paleček 8 | # Use full names 9 | Felipe E. F. de Castro 10 | Marcos Alvarez Costales 11 | Kenshi Muto 12 | Zhou Mo 13 | # Handle alias disparity 14 | Felipe Augusto van de Wiel 15 | Daniel Nylander 16 | Bart Cornelis 17 | Bart Cornelis 18 | Andrei Popescu 19 | Christian Perrier 20 | # Name changes 21 | Peter Krefting 22 | Peter Krefting 23 | Peter Krefting 24 | # Use real mail addresses 25 | Miguel Figueiredo 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/spacesyms-c-gen.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # spacesyms-c-gen.pl 4 | # 5 | # Output a C file that contains symbols matching the shell glob 6 | # sym{defaultver,longver,shortver}{nospace,SPACE}{default,hidden,protected,internal} 7 | # with symbol visibility matching the final element and at least one relocation 8 | # against each symbol. 9 | # 10 | # When used together with spacesyms-o-map.pl and spacesyms.map, makes a shared 11 | # object that contains symbols that covers all cases of: 12 | # 13 | # 1) has a short, long or Base version, 14 | # 2) has or does not have a space in the symbol name, 15 | # 3) default, hidden, protected or internal visibility. 16 | 17 | use strict; 18 | use warnings; 19 | 20 | my @symbols; 21 | 22 | foreach my $version (qw(defaultver longver shortver)) { 23 | foreach my $space (qw(nospace SPACE)) { 24 | foreach my $visibility (qw(default hidden protected internal)) { 25 | my $symbol = "sym$version$space$visibility"; 26 | push @symbols, $symbol; 27 | print "void $symbol(void) __attribute__((visibility(\"$visibility\")));\n"; 28 | print "void $symbol(void) {}\n"; 29 | } 30 | } 31 | } 32 | 33 | print "void (*funcs[])(void) = {\n"; 34 | foreach my $symbol (@symbols) { 35 | print "$symbol,\n"; 36 | } 37 | print "};\n"; 38 | -------------------------------------------------------------------------------- /debian/dpkg.cron.daily: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | dbdir=/var/lib/dpkg 4 | 5 | # Backup the 7 last versions of dpkg databases containing user data. 6 | if cd /var/backups ; then 7 | # We backup all relevant database files if any has changed, so that 8 | # the rotation number always contains an internally consistent set. 9 | dbchanged=no 10 | dbfiles="arch status diversions statoverride" 11 | for db in $dbfiles ; do 12 | if ! cmp -s "dpkg.${db}.0" "$dbdir/$db"; then 13 | dbchanged=yes 14 | break; 15 | fi 16 | done 17 | if [ "$dbchanged" = "yes" ] ; then 18 | for db in $dbfiles ; do 19 | [ -e "$dbdir/$db" ] || continue 20 | cp -p "$dbdir/$db" "dpkg.$db" 21 | savelog -c 7 "dpkg.$db" >/dev/null 22 | done 23 | fi 24 | 25 | # The alternatives database is independent from the dpkg database. 26 | dbalt=alternatives 27 | 28 | # XXX: Ideally we'd use --warning=none instead of discarding stderr, but 29 | # as of GNU tar 1.27.1, it does not seem to work reliably (see #749307). 30 | if ! test -e ${dbalt}.tar.0 || 31 | ! tar -df ${dbalt}.tar.0 -C $dbdir $dbalt >/dev/null 2>&1 ; 32 | then 33 | tar -cf ${dbalt}.tar -C $dbdir $dbalt >/dev/null 2>&1 34 | savelog -c 7 ${dbalt}.tar >/dev/null 35 | fi 36 | fi 37 | -------------------------------------------------------------------------------- /lib/dpkg/dir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * dir.h - directory handling routines 4 | * 5 | * Copyright © 2010 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_DIR_H 22 | #define LIBDPKG_DIR_H 23 | 24 | #include 25 | 26 | #include 27 | 28 | DPKG_BEGIN_DECLS 29 | 30 | /** 31 | * @defgroup dir Directory handling 32 | * @ingroup dpkg-internal 33 | * @{ 34 | */ 35 | 36 | void dir_sync_path(const char *path); 37 | void dir_sync_path_parent(const char *path); 38 | void dir_sync_contents(const char *path); 39 | 40 | /** @} */ 41 | 42 | DPKG_END_DECLS 43 | 44 | #endif /* LIBDPKG_DIR_H */ 45 | -------------------------------------------------------------------------------- /lib/dpkg/namevalue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * namevalue.c - name value structure handling 4 | * 5 | * Copyright © 2010-2011, 2014-2015 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | const struct namevalue * 30 | namevalue_find_by_name(const struct namevalue *head, const char *str) 31 | { 32 | const struct namevalue *nv; 33 | 34 | for (nv = head; nv->name; nv++) { 35 | if (strncasecmp(str, nv->name, nv->length) == 0) 36 | return nv; 37 | } 38 | 39 | return NULL; 40 | } 41 | -------------------------------------------------------------------------------- /lib/dpkg/trigname.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * trigname.c - trigger name handling 4 | * 5 | * Copyright © 2007 Canonical Ltd 6 | * Written by Ian Jackson 7 | * 8 | * This is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | const char * 29 | trig_name_is_illegal(const char *p) 30 | { 31 | int c; 32 | 33 | if (!*p) 34 | return _("empty trigger names are not permitted"); 35 | 36 | while ((c = *p++)) { 37 | if (c <= ' ' || c >= 0177) 38 | return _("trigger name contains invalid character"); 39 | } 40 | 41 | return NULL; 42 | } 43 | -------------------------------------------------------------------------------- /lib/compat/strnlen.c: -------------------------------------------------------------------------------- 1 | /* Find the length of STRING, but scan at most MAXLEN characters. 2 | Copyright (C) 2005, 2006 Free Software Foundation, Inc. 3 | Written by Simon Josefsson. 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software Foundation, 17 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "compat.h" 24 | 25 | /* Find the length of STRING, but scan at most MAXLEN characters. 26 | If no '\0' terminator is found in that many characters, return MAXLEN. */ 27 | 28 | size_t 29 | strnlen (const char *string, size_t maxlen) 30 | { 31 | const char *end = memchr (string, '\0', maxlen); 32 | return end ? (size_t) (end - string) : maxlen; 33 | } 34 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Vars.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 6; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Vars'); 23 | } 24 | 25 | eval { set_source_package('foo%bar') }; 26 | ok($@, 'cannot set invalid source package name'); 27 | is(get_source_package(), undef, 'invalid source package name unset'); 28 | 29 | set_source_package('source'); 30 | is(get_source_package(), 'source', 'set/get source package name'); 31 | 32 | set_source_package('source'); 33 | is(get_source_package(), 'source', 'reset/get same source package name'); 34 | 35 | eval { set_source_package('other') }; 36 | ok($@, 'cannot set different source package name'); 37 | 38 | 1; 39 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | The C implementation of dpkg was originally written by: 2 | 3 | Ian Jackson 4 | 5 | based on the Perl implementation by: 6 | 7 | Matt Welsh 8 | Carl Streeter 9 | Ian Murdock 10 | 11 | 12 | It is currently maintained by: 13 | 14 | Guillem Jover 15 | 16 | and has previously been maintained by: 17 | 18 | Raphaël Hertzog (2008-2015) 19 | Christian Perrier (2006-2008) 20 | Frank Lichtenheld (2006-2009) 21 | Brendan O'Dea (2006-2007) 22 | Scott James Remnant (2004-2005) 23 | Adam Heath (2001-2003) 24 | Wichert Akkerman (1999-2003) 25 | Ben Collins (1999-2001) 26 | Daniel Jacobowitz (1998) 27 | J.H.M. Dassen (Ray) (1998) 28 | James Troup (1998) 29 | Nils Rennebarth (1998) 30 | Klee Dienes (1997) 31 | Guy Maor (1997) 32 | Heiko Schlittermann (1996) 33 | 34 | 35 | Countless other people have contributed to dpkg (see THANKS) and provided 36 | code for which they claim copyright (see debian/copyright). Many thanks 37 | to them all. 38 | -------------------------------------------------------------------------------- /lib/dpkg/glob.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * glob.h - file globing functions 4 | * 5 | * Copyright © 2009, 2010 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_GLOB_H 22 | #define LIBDPKG_GLOB_H 23 | 24 | #include 25 | 26 | DPKG_BEGIN_DECLS 27 | 28 | /** 29 | * @defgroup glob File globbing 30 | * @ingroup dpkg-internal 31 | * @{ 32 | */ 33 | 34 | struct glob_node { 35 | struct glob_node *next; 36 | char *pattern; 37 | }; 38 | 39 | void glob_list_prepend(struct glob_node **list, char *pattern); 40 | void glob_list_free(struct glob_node *head); 41 | 42 | /** @} */ 43 | 44 | DPKG_END_DECLS 45 | 46 | #endif /* LIBDPKG_GLOB_H */ 47 | -------------------------------------------------------------------------------- /lib/compat/strerror.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libcompat - system compatibility library 3 | * 4 | * Copyright © 1995 Ian Jackson 5 | * 6 | * This is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "compat.h" 27 | 28 | #define _(str) gettext(str) 29 | 30 | #if !HAVE_DECL_SYS_ERRLIST 31 | extern const char *const sys_errlist[]; 32 | #endif 33 | #if !HAVE_DECL_SYS_NERR 34 | extern const int sys_nerr; 35 | #endif 36 | 37 | const char * 38 | strerror(int e) 39 | { 40 | static char buf[100]; 41 | 42 | if (e >= 0 && e < sys_nerr) 43 | return sys_errlist[e]; 44 | 45 | sprintf(buf, _("Unknown error %d"), e); 46 | 47 | return buf; 48 | } 49 | -------------------------------------------------------------------------------- /t/cppcheck.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | use Test::Dpkg qw(:needs); 21 | 22 | test_needs_author(); 23 | test_needs_command('cppcheck'); 24 | test_needs_srcdir_switch(); 25 | 26 | plan tests => 1; 27 | 28 | my @cppcheck_opts = (qw( 29 | -q --force --error-exitcode=2 30 | --suppressions-list=t/cppcheck/cppcheck.supp 31 | ), ( 32 | '--enable=warning,performance,portability,style', 33 | '--template=\'{file}:{line}: {severity} ({id}): {message}\'' 34 | )); 35 | my $tags = qx(cppcheck @cppcheck_opts . 2>&1); 36 | 37 | # Fixup the output: 38 | chomp $tags; 39 | 40 | my $ok = length $tags == 0; 41 | 42 | ok($ok, 'cppcheck'); 43 | if (not $ok) { 44 | diag($tags); 45 | } 46 | -------------------------------------------------------------------------------- /lib/dpkg/fdio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * fdio.h - safe file descriptor based input/output 4 | * 5 | * Copyright © 2009-2010 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_FDIO_H 22 | #define LIBDPKG_FDIO_H 23 | 24 | #include 25 | 26 | #include 27 | 28 | DPKG_BEGIN_DECLS 29 | 30 | /** 31 | * @defgroup fdio File descriptor I/O 32 | * @ingroup dpkg-internal 33 | * @{ 34 | */ 35 | 36 | ssize_t fd_read(int fd, void *buf, size_t len); 37 | ssize_t fd_write(int fd, const void *buf, size_t len); 38 | 39 | int 40 | fd_allocate_size(int fd, off_t offset, off_t len); 41 | 42 | /** @} */ 43 | 44 | DPKG_END_DECLS 45 | 46 | #endif /* LIBDPKG_FDIO_H */ 47 | -------------------------------------------------------------------------------- /lib/dpkg/pager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * pager.h - pager execution support 4 | * 5 | * Copyright © 2018 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_PAGER_H 22 | #define LIBDPKG_PAGER_H 23 | 24 | #include 25 | 26 | #include 27 | 28 | DPKG_BEGIN_DECLS 29 | 30 | /** 31 | * @defgroup pager Pager execution 32 | * @ingroup dpkg-internal 33 | * @{ 34 | */ 35 | 36 | struct pager; 37 | 38 | void 39 | pager_enable(bool enable); 40 | 41 | const char * 42 | pager_get_exec(void); 43 | 44 | struct pager * 45 | pager_spawn(const char *desc); 46 | 47 | void 48 | pager_reap(struct pager *pager); 49 | 50 | /** @} */ 51 | 52 | DPKG_END_DECLS 53 | 54 | #endif /* LIBDPKG_PAGER_H */ 55 | -------------------------------------------------------------------------------- /scripts/Dpkg/Control/Hash.pm: -------------------------------------------------------------------------------- 1 | # Copyright © 2007-2009 Raphaël Hertzog 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | package Dpkg::Control::Hash; 17 | 18 | use strict; 19 | use warnings; 20 | 21 | our $VERSION = '1.00'; 22 | 23 | use Dpkg::Gettext; 24 | use Dpkg::ErrorHandling; 25 | use Dpkg::Control::Fields; # Force execution of vendor hook. 26 | 27 | use parent qw(Dpkg::Control::HashCore); 28 | 29 | =encoding utf8 30 | 31 | =head1 NAME 32 | 33 | Dpkg::Control::Hash - parse and manipulate a block of RFC822-like fields 34 | 35 | =head1 DESCRIPTION 36 | 37 | This module is just like Dpkg::Control::HashCore, with vendor-specific 38 | field knowledge. 39 | 40 | =head1 CHANGES 41 | 42 | =head2 Version 1.00 (dpkg 1.15.6) 43 | 44 | Mark the module as public. 45 | 46 | =cut 47 | 48 | 1; 49 | -------------------------------------------------------------------------------- /scripts/Dpkg/Getopt.pm: -------------------------------------------------------------------------------- 1 | # Copyright © 2014 Guillem Jover 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | package Dpkg::Getopt; 17 | 18 | use strict; 19 | use warnings; 20 | 21 | our $VERSION = '0.02'; 22 | our @EXPORT = qw( 23 | normalize_options 24 | ); 25 | 26 | use Exporter qw(import); 27 | 28 | sub normalize_options 29 | { 30 | my (%opts) = @_; 31 | my $norm = 1; 32 | my @args; 33 | 34 | @args = map { 35 | if ($norm and m/^(-[A-Za-z])(.+)$/) { 36 | ($1, $2) 37 | } elsif ($norm and m/^(--[A-Za-z-]+)=(.*)$/) { 38 | ($1, $2) 39 | } else { 40 | $norm = 0 if defined $opts{delim} and $_ eq $opts{delim}; 41 | $_; 42 | } 43 | } @{$opts{args}}; 44 | 45 | return @args; 46 | } 47 | 48 | 1; 49 | -------------------------------------------------------------------------------- /t-func/deb-content.at: -------------------------------------------------------------------------------- 1 | AT_TESTED([dpkg-deb]) 2 | 3 | AT_SETUP([dpkg-deb .deb conffiles]) 4 | AT_KEYWORDS([dpkg-deb deb conffiles]) 5 | 6 | DPKG_GEN_CONTROL([pkg-conff-dupe]) 7 | DPKG_GEN_FILE([pkg-conff-dupe], [conffiles], [/test-conffile-1 8 | /test-conffile-2 9 | /test-conffile-1]) 10 | AT_DATA([pkg-conff-dupe/test-conffile-1], [test init 11 | ]) 12 | AT_DATA([pkg-conff-dupe/test-conffile-2], [test init 13 | ]) 14 | AT_CHECK([ 15 | # Duplicate conffile entries should produce a warning. 16 | dpkg-deb -b pkg-conff-dupe 17 | ], [0], [ignore], [dpkg-deb: warning: conffile name '/test-conffile-1' is duplicated 18 | dpkg-deb: warning: ignoring 1 warning about the control file(s) 19 | ]) 20 | 21 | DPKG_GEN_CONTROL([pkg-conff-noel]) 22 | printf "/test-conffile-1" >"pkg-conff-noel/DEBIAN/conffiles" 23 | AT_DATA([pkg-conff-noel/test-conffile-1], [test init 24 | ]) 25 | AT_CHECK([ 26 | # Conffiles need a final newline to guarantee there's been no accidental 27 | # file truncation. 28 | dpkg-deb -b pkg-conff-noel pkg-conff-noel.deb 29 | ], [2], [ignore], [dpkg-deb: error: conffile name '/test-conffile-1' is too long, or missing final newline 30 | ]) 31 | 32 | DPKG_GEN_CONTROL([pkg-deb-newline]) 33 | touch 'pkg-deb-newline/file 34 | newline' 35 | AT_CHECK([ 36 | # Cannot create package with newlines in filenames. 37 | dpkg-deb -b pkg-deb-newline 38 | ], [2], [ignore], [dpkg-deb: error: newline not allowed in pathname './file 39 | newline' 40 | ]) 41 | 42 | AT_CLEANUP 43 | -------------------------------------------------------------------------------- /scripts/t/dpkg_buildpackage/test-source_0_binary.changes: -------------------------------------------------------------------------------- 1 | Format: 1.8 2 | Date: Thu, 30 Jun 2016 20:15:12 +0200 3 | Source: test-source 4 | Binary: test-binary-all test-binary-any 5 | Architecture: all amd64 6 | Version: 0 7 | Distribution: unstable 8 | Urgency: low 9 | Maintainer: Dpkg Developers 10 | Changed-By: Dpkg Developers 11 | Description: 12 | test-binary-all - architecture independent binary package 13 | test-binary-any - architecture dependent binary package 14 | Closes: 12345 15 | Changes: 16 | test-source (0) unstable; urgency=low 17 | . 18 | * Entry. Closes: #12345 19 | Checksums-Sha1: 20 | 0000000000000000000000000000000000000000 0 test-binary-all_0_all.deb 21 | 0000000000000000000000000000000000000000 0 test-binary-any_0_amd64.deb 22 | 0000000000000000000000000000000000000000 0 test-source_0_amd64.buildinfo 23 | Checksums-Sha256: 24 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-binary-all_0_all.deb 25 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-binary-any_0_amd64.deb 26 | 0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0_amd64.buildinfo 27 | Files: 28 | 00000000000000000000000000000000 0 test optional test-binary-all_0_all.deb 29 | 00000000000000000000000000000000 0 test optional test-binary-any_0_amd64.deb 30 | 00000000000000000000000000000000 0 test optional test-source_0_amd64.buildinfo 31 | -------------------------------------------------------------------------------- /lib/dpkg/t/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AM_CPPFLAGS = \ 4 | -DADMINDIR=\"$(admindir)\" \ 5 | -idirafter $(top_srcdir)/lib/compat \ 6 | -I$(top_builddir) \ 7 | -I$(top_srcdir)/lib 8 | LDADD = \ 9 | $(top_builddir)/lib/dpkg/libdpkg.la \ 10 | $(LIBINTL) 11 | 12 | EXTRA_DIST = \ 13 | $(test_scripts) \ 14 | $(nil) 15 | 16 | TEST_ENV_VARS = \ 17 | DPKG_PROGTAR=$(TAR) \ 18 | $(nil) 19 | 20 | t_headers_cpp_SOURCES = t-headers-cpp.cc 21 | 22 | # The tests are sorted in order of increasing complexity. 23 | test_programs = \ 24 | t-test \ 25 | t-test-skip \ 26 | t-macros \ 27 | t-headers-cpp \ 28 | t-c-ctype \ 29 | t-namevalue \ 30 | t-ehandle \ 31 | t-error \ 32 | t-string \ 33 | t-file \ 34 | t-buffer \ 35 | t-path \ 36 | t-progname \ 37 | t-subproc \ 38 | t-command \ 39 | t-pager \ 40 | t-varbuf \ 41 | t-ar \ 42 | t-tar \ 43 | t-deb-version \ 44 | t-arch \ 45 | t-version \ 46 | t-pkginfo \ 47 | t-pkg-list \ 48 | t-pkg-queue \ 49 | t-pkg-hash \ 50 | t-pkg-show \ 51 | t-fsys-dir \ 52 | t-fsys-hash \ 53 | t-trigger \ 54 | t-mod-db \ 55 | $(nil) 56 | 57 | test_scripts = \ 58 | t-tarextract.t \ 59 | t-treewalk.t \ 60 | t-trigdeferred.t \ 61 | $(nil) 62 | 63 | check_PROGRAMS = \ 64 | $(test_programs) \ 65 | c-tarextract \ 66 | c-treewalk \ 67 | c-trigdeferred \ 68 | $(nil) 69 | 70 | test_tmpdir = t.tmp 71 | 72 | include $(top_srcdir)/check.am 73 | 74 | clean-local: check-clean 75 | -------------------------------------------------------------------------------- /dselect/methods/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | methodsdir = $(pkglibexecdir)/methods 4 | 5 | nobase_dist_methods_DATA = \ 6 | disk/names \ 7 | disk/desc.cdrom \ 8 | disk/desc.nfs \ 9 | disk/desc.harddisk \ 10 | disk/desc.mounted \ 11 | ftp/names \ 12 | ftp/desc.ftp \ 13 | multicd/names \ 14 | multicd/desc.multi_cd \ 15 | multicd/desc.multi_mount \ 16 | multicd/desc.multi_nfs 17 | 18 | nobase_methods_SCRIPTS = \ 19 | ftp/setup \ 20 | ftp/update \ 21 | ftp/install \ 22 | $(nil) 23 | 24 | nobase_dist_methods_SCRIPTS = \ 25 | disk/setup \ 26 | disk/update \ 27 | disk/install \ 28 | multicd/setup \ 29 | multicd/update \ 30 | multicd/install 31 | 32 | perllibdir = $(PERL_LIBDIR) 33 | nobase_dist_perllib_DATA = Dselect/Ftp.pm 34 | 35 | EXTRA_DIST = \ 36 | ftp/setup.pl \ 37 | ftp/update.pl \ 38 | ftp/install.pl \ 39 | multicd/README.multicd 40 | 41 | CLEANFILES = \ 42 | $(nobase_methods_SCRIPTS) \ 43 | $(nil) 44 | 45 | do_perl_subst = $(AM_V_GEN) sed \ 46 | -e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL):" 47 | 48 | SUFFIXES = .pl 49 | 50 | .pl: Makefile 51 | @test -d `dirname $@` || $(MKDIR_P) `dirname $@` 52 | $(do_perl_subst) <$< >$@ 53 | $(AM_V_at) chmod +x $@ 54 | 55 | install-data-local: 56 | $(MKDIR_P) $(DESTDIR)$(admindir)/methods/mnt 57 | $(MKDIR_P) $(DESTDIR)$(admindir)/methods/disk 58 | $(MKDIR_P) $(DESTDIR)$(admindir)/methods/ftp 59 | $(MKDIR_P) $(DESTDIR)$(admindir)/methods/multicd 60 | -------------------------------------------------------------------------------- /lib/dpkg/glob.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * glob.c - file globing functions 4 | * 5 | * Copyright © 2009, 2010 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | void 30 | glob_list_prepend(struct glob_node **list, char *pattern) 31 | { 32 | struct glob_node *node; 33 | 34 | node = m_malloc(sizeof(*node)); 35 | node->pattern = pattern; 36 | node->next = *list; 37 | *list = node; 38 | } 39 | 40 | void 41 | glob_list_free(struct glob_node *head) 42 | { 43 | while (head) { 44 | struct glob_node *node = head; 45 | 46 | head = head->next; 47 | free(node->pattern); 48 | free(node); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /man/utf8toman.sed: -------------------------------------------------------------------------------- 1 | s/‐/\\(hy/g 2 | s/–/\\(en/g 3 | s/—/\\(em/g 4 | s/•/\\(bu/g 5 | s/¡/\\(r!/g 6 | s/¿/\\(r?/g 7 | s/«/\\(Fo/g 8 | s/»/\\(Fc/g 9 | s/‘/\\(oq/g 10 | s/’/\\(cq/g 11 | s/‚/\\(bq/g 12 | s/“/\\(lq/g 13 | s/”/\\(rq/g 14 | s/„/\\(Bq/g 15 | s/‹/\\(fo/g 16 | s/›/\\(fc/g 17 | s/À/\\(`A/g 18 | s/Á/\\('A/g 19 | s/Â/\\(^A/g 20 | s/Ã/\\(~A/g 21 | s/Ä/\\(:A/g 22 | s/Å/\\(oA/g 23 | s/Æ/\\(AE/g 24 | s/Ç/\\(,C/g 25 | s/È/\\(`E/g 26 | s/É/\\('E/g 27 | s/Ê/\\(^E/g 28 | s/Ë/\\(:E/g 29 | s/Ì/\\(`I/g 30 | s/Í/\\('I/g 31 | s/Î/\\(^I/g 32 | s/Ï/\\(:I/g 33 | s/Ñ/\\(~N/g 34 | s/Ò/\\(`O/g 35 | s/Ó/\\('O/g 36 | s/Ô/\\(^O/g 37 | s/Õ/\\(~O/g 38 | s/Ö/\\(:O/g 39 | s/Ø/\\(\/O/g 40 | s/Ù/\\(`U/g 41 | s/Ú/\\('U/g 42 | s/Û/\\(^U/g 43 | s/Ü/\\(:U/g 44 | s/Ý/\\('Y/g 45 | s/ß/\\(ss/g 46 | s/à/\\(`a/g 47 | s/á/\\('a/g 48 | s/â/\\(^a/g 49 | s/ã/\\(~a/g 50 | s/ä/\\(:a/g 51 | s/å/\\(oa/g 52 | s/æ/\\(ae/g 53 | s/ç/\\(,c/g 54 | s/è/\\(`e/g 55 | s/é/\\('e/g 56 | s/ê/\\(^e/g 57 | s/ë/\\(:e/g 58 | s/ì/\\(`i/g 59 | s/í/\\('i/g 60 | s/î/\\(^i/g 61 | s/ï/\\(:i/g 62 | s/ñ/\\(~n/g 63 | s/ò/\\(`o/g 64 | s/ó/\\('o/g 65 | s/ô/\\(^o/g 66 | s/õ/\\(~o/g 67 | s/ö/\\(:o/g 68 | s/ø/\\(\/o/g 69 | s/ù/\\(`u/g 70 | s/ú/\\('u/g 71 | s/û/\\(^u/g 72 | s/ü/\\(:u/g 73 | s/ý/\\('y/g 74 | s/ÿ/\\(:y/g 75 | s/Ć/\\('C/g 76 | s/ć/\\('c/g 77 | s/ı/\\(.i/g 78 | s/IJ/\\(IJ/g 79 | s/ij/\\(ij/g 80 | s/Ł/\\(\/L/g 81 | s/ł/\\(\/l/g 82 | s/Œ/\\(OE/g 83 | s/œ/\\(oe/g 84 | s/Š/\\(vS/g 85 | s/š/\\(vs/g 86 | s/Ÿ/\\(:Y/g 87 | s/Ž/\\(vZ/g 88 | s/ž/\\(vz/g 89 | -------------------------------------------------------------------------------- /lib/dpkg/pkg-files.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * pkg-files.h - primitives for pkg files handling 4 | * 5 | * Copyright © 2018 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_PKG_FILES_H 22 | #define LIBDPKG_PKG_FILES_H 23 | 24 | #include 25 | #include 26 | 27 | DPKG_BEGIN_DECLS 28 | 29 | /** 30 | * @defgroup pkg-files Package files handling 31 | * @ingroup dpkg-public 32 | * @{ 33 | */ 34 | 35 | void 36 | pkg_files_blank(struct pkginfo *pkg); 37 | 38 | struct fsys_namenode_list ** 39 | pkg_files_add_file(struct pkginfo *pkg, struct fsys_namenode *namenode, 40 | struct fsys_namenode_list **file_tail); 41 | 42 | /** @} */ 43 | 44 | DPKG_END_DECLS 45 | 46 | #endif /* LIBDPKG_PKG_FILES_H */ 47 | -------------------------------------------------------------------------------- /scripts/Dpkg/Package.pm: -------------------------------------------------------------------------------- 1 | # Copyright © 2006 Frank Lichtenheld 2 | # Copyright © 2007,2012 Guillem Jover 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | package Dpkg::Package; 18 | 19 | use strict; 20 | use warnings; 21 | 22 | our $VERSION = '0.01'; 23 | our @EXPORT = qw( 24 | pkg_name_is_illegal 25 | ); 26 | 27 | use Exporter qw(import); 28 | 29 | use Dpkg::Gettext; 30 | 31 | sub pkg_name_is_illegal($) { 32 | my $name = shift // ''; 33 | 34 | if ($name eq '') { 35 | return g_('may not be empty string'); 36 | } 37 | if ($name =~ m/[^-+.0-9a-z]/op) { 38 | return sprintf(g_("character '%s' not allowed"), ${^MATCH}); 39 | } 40 | if ($name !~ m/^[0-9a-z]/o) { 41 | return g_('must start with an alphanumeric character'); 42 | } 43 | 44 | return; 45 | } 46 | 47 | 1; 48 | -------------------------------------------------------------------------------- /src/file-match.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dpkg - main program for package management 3 | * file-match.c - file name/type match tracking functions 4 | * 5 | * Copyright © 2011 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | 28 | #include "file-match.h" 29 | 30 | struct match_node * 31 | match_node_new(const char *name, const char *type, struct match_node *next) 32 | { 33 | struct match_node *node; 34 | 35 | node = m_malloc(sizeof(*node)); 36 | node->next = next; 37 | node->filename = m_strdup(name); 38 | node->filetype = m_strdup(type); 39 | 40 | return node; 41 | } 42 | 43 | void 44 | match_node_free(struct match_node *node) 45 | { 46 | free(node->filetype); 47 | free(node->filename); 48 | free(node); 49 | } 50 | -------------------------------------------------------------------------------- /scripts/Dpkg/File.pm: -------------------------------------------------------------------------------- 1 | # Copyright © 2011 Raphaël Hertzog 2 | # Copyright © 2012 Guillem Jover 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | package Dpkg::File; 18 | 19 | use strict; 20 | use warnings; 21 | 22 | our $VERSION = '0.01'; 23 | our @EXPORT = qw( 24 | file_slurp 25 | ); 26 | 27 | use Exporter qw(import); 28 | use Scalar::Util qw(openhandle); 29 | 30 | use Dpkg::ErrorHandling; 31 | use Dpkg::Gettext; 32 | 33 | sub file_slurp { 34 | my $file = shift; 35 | my $fh; 36 | my $doclose = 0; 37 | 38 | if (openhandle($file)) { 39 | $fh = $file; 40 | } else { 41 | open $fh, '<', $file or syserr(g_('cannot read %s'), $fh); 42 | $doclose = 1; 43 | } 44 | local $/; 45 | my $data = <$fh>; 46 | close $fh if $doclose; 47 | 48 | return $data; 49 | } 50 | 51 | 1; 52 | -------------------------------------------------------------------------------- /dselect/helpmsgs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dselect - Debian package maintenance user interface 3 | * helpmsgs.h - external definitions for the list of help messages 4 | * 5 | * Copyright © 1995 Ian Jackson 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef HELPMSGS_H 22 | #define HELPMSGS_H 23 | 24 | struct helpmessage { 25 | const char *title; 26 | const char *text; 27 | }; 28 | 29 | extern const struct helpmessage hlp_listkeys; 30 | extern const struct helpmessage hlp_mainintro; 31 | extern const struct helpmessage hlp_readonlyintro; 32 | extern const struct helpmessage hlp_recurintro; 33 | extern const struct helpmessage hlp_displayexplain1; 34 | extern const struct helpmessage hlp_displayexplain2; 35 | extern const struct helpmessage hlp_methintro; 36 | extern const struct helpmessage hlp_methkeys; 37 | 38 | #endif /* HELPMSGS_H */ 39 | -------------------------------------------------------------------------------- /lib/dpkg/pkg-list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * pkg-list.h - primitives for pkg linked list handling 4 | * 5 | * Copyright © 2009 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_PKG_LIST_H 22 | #define LIBDPKG_PKG_LIST_H 23 | 24 | #include 25 | 26 | DPKG_BEGIN_DECLS 27 | 28 | /** 29 | * @defgroup pkg-list Package linked lists 30 | * @ingroup dpkg-public 31 | * @{ 32 | */ 33 | 34 | struct pkg_list { 35 | struct pkg_list *next; 36 | struct pkginfo *pkg; 37 | }; 38 | 39 | struct pkg_list *pkg_list_new(struct pkginfo *pkg, struct pkg_list *next); 40 | void pkg_list_free(struct pkg_list *head); 41 | void pkg_list_prepend(struct pkg_list **head, struct pkginfo *pkg); 42 | 43 | /** @} */ 44 | 45 | DPKG_END_DECLS 46 | 47 | #endif /* LIBDPKG_PKG_LIST_H */ 48 | -------------------------------------------------------------------------------- /lib/dpkg/t/t-namevalue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * t-namevalue.c - test name/value implementation 4 | * 5 | * Copyright © 2018 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | static void 29 | test_namevalue(void) 30 | { 31 | const struct namevalue *nv; 32 | 33 | nv = namevalue_find_by_name(booleaninfos, ""); 34 | test_pass(nv == NULL); 35 | 36 | nv = namevalue_find_by_name(booleaninfos, "no"); 37 | test_pass(nv != NULL); 38 | test_pass(nv->value == false); 39 | test_pass(nv->length == strlen("no")); 40 | test_str(nv->name, ==, "no"); 41 | } 42 | 43 | TEST_ENTRY(test) 44 | { 45 | test_plan(5); 46 | 47 | test_namevalue(); 48 | } 49 | -------------------------------------------------------------------------------- /lib/dpkg/t/t-macros.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * t-macros.c - test C support macros 4 | * 5 | * Copyright © 2009,2012 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | TEST_ENTRY(test) 28 | { 29 | test_plan(12); 30 | 31 | test_pass(min(10, 30) == 10); 32 | test_pass(min(30, 10) == 10); 33 | test_pass(min(0, 10) == 0); 34 | test_pass(min(-10, 0) == -10); 35 | 36 | test_pass(max(10, 30) == 30); 37 | test_pass(max(30, 10) == 30); 38 | test_pass(max(0, 10) == 10); 39 | test_pass(max(-10, 0) == 0); 40 | 41 | test_pass(clamp(0, 0, 0) == 0); 42 | test_pass(clamp(0, -10, 10) == 0); 43 | test_pass(clamp(20, -10, 10) == 10); 44 | test_pass(clamp(-20, -10, 10) == -10); 45 | } 46 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Vendor.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 6; 20 | 21 | # Delete variables that can affect the tests. 22 | delete $ENV{DEB_VENDOR}; 23 | 24 | use_ok('Dpkg::Vendor', qw(get_vendor_dir get_current_vendor get_vendor_object)); 25 | 26 | is(get_vendor_dir(), $ENV{DPKG_ORIGINS_DIR}, 'Check vendor dir'); 27 | 28 | my ($vendor, $obj); 29 | 30 | $vendor = get_current_vendor(); 31 | is($vendor, 'Debian', 'Check current vendor name'); 32 | 33 | $obj = get_vendor_object(); 34 | is(ref($obj), 'Dpkg::Vendor::Debian', 'Check current vendor object'); 35 | $obj = get_vendor_object('gNewSense'); 36 | is(ref($obj), 'Dpkg::Vendor::Debian', 'Check parent fallback vendor object'); 37 | $obj = get_vendor_object('Ubuntu'); 38 | is(ref($obj), 'Dpkg::Vendor::Ubuntu', 'Check specific vendor object'); 39 | -------------------------------------------------------------------------------- /lib/dpkg/progress.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * progress.h - generic progress reporting 4 | * 5 | * Copyright © 2009 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_PROGRESS_H 22 | #define LIBDPKG_PROGRESS_H 23 | 24 | #include 25 | 26 | #include 27 | 28 | DPKG_BEGIN_DECLS 29 | 30 | /** 31 | * @defgroup progress Progress reporting 32 | * @ingroup dpkg-internal 33 | * @{ 34 | */ 35 | 36 | struct progress { 37 | const char *text; 38 | 39 | int max; 40 | int cur; 41 | int last_percent; 42 | 43 | bool on_tty; 44 | }; 45 | 46 | void progress_init(struct progress *progress, const char *text, int max); 47 | void progress_step(struct progress *progress); 48 | void progress_done(struct progress *progress); 49 | 50 | /** @} */ 51 | 52 | DPKG_END_DECLS 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /man/dpkg.cfg.man: -------------------------------------------------------------------------------- 1 | .\" dpkg manual page - dpkg.cfg(5) 2 | .\" 3 | .\" Copyright © 2002 Wichert Akkerman 4 | .\" Copyright © 2009, 2013, 2015 Guillem Jover 5 | .\" 6 | .\" This is free software; you can redistribute it and/or modify 7 | .\" it under the terms of the GNU General Public License as published by 8 | .\" the Free Software Foundation; either version 2 of the License, or 9 | .\" (at your option) any later version. 10 | .\" 11 | .\" This is distributed in the hope that it will be useful, 12 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | .\" GNU General Public License for more details. 15 | .\" 16 | .\" You should have received a copy of the GNU General Public License 17 | .\" along with this program. If not, see . 18 | . 19 | .TH dpkg.cfg 5 "%RELEASE_DATE%" "%VERSION%" "dpkg suite" 20 | .nh 21 | .SH NAME 22 | dpkg.cfg \- dpkg configuration file 23 | . 24 | .SH DESCRIPTION 25 | This file contains default options for dpkg. Each line contains a 26 | single option which is exactly the same as a normal command line 27 | option for dpkg except for the leading hyphens which are not used 28 | here. Quotes surrounding option values are stripped. Comments are 29 | allowed by starting a line with a hash sign (‘\fB#\fR’). 30 | . 31 | .SH FILES 32 | .I %PKGCONFDIR%/dpkg.cfg.d/[0-9a-zA-Z_-]* 33 | .br 34 | .I %PKGCONFDIR%/dpkg.cfg 35 | .br 36 | .I ~/.dpkg.cfg 37 | . 38 | .SH SEE ALSO 39 | .BR dpkg (1). 40 | -------------------------------------------------------------------------------- /lib/compat/vasprintf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libcompat - system compatibility library 3 | * 4 | * Copyright © 2010 Guillem Jover 5 | * 6 | * This is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "compat.h" 27 | 28 | int 29 | vasprintf(char **strp, char const *fmt, va_list args) 30 | { 31 | va_list args_copy; 32 | int needed, n; 33 | char *str; 34 | 35 | va_copy(args_copy, args); 36 | needed = vsnprintf(NULL, 0, fmt, args_copy); 37 | va_end(args_copy); 38 | 39 | if (needed < 0) { 40 | *strp = NULL; 41 | return -1; 42 | } 43 | 44 | str = malloc(needed + 1); 45 | if (str == NULL) { 46 | *strp = NULL; 47 | return -1; 48 | } 49 | 50 | n = vsnprintf(str, needed + 1, fmt, args); 51 | if (n < 0) { 52 | free(str); 53 | str = NULL; 54 | } 55 | 56 | *strp = str; 57 | 58 | return n; 59 | } 60 | -------------------------------------------------------------------------------- /lib/dpkg/strhash.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * strhash.c - FNV string hashing support 4 | * 5 | * Copyright © 2003 Daniel Silverstone 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #define FNV_OFFSET_BASIS 2166136261UL 27 | #define FNV_MIXING_PRIME 16777619UL 28 | 29 | /** 30 | * Fowler/Noll/Vo -- FNV-1a simple string hash. 31 | * 32 | * For more info, @see . 33 | * 34 | * @param str The string to hash. 35 | * 36 | * @return The hashed value. 37 | */ 38 | unsigned int 39 | str_fnv_hash(const char *str) 40 | { 41 | register unsigned int h = FNV_OFFSET_BASIS; 42 | register unsigned int p = FNV_MIXING_PRIME; 43 | 44 | while (*str) { 45 | h ^= *str++; 46 | h *= p; 47 | } 48 | 49 | return h; 50 | } 51 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Getopt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 4; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Getopt'); 23 | } 24 | 25 | my @expect_argv; 26 | 27 | @ARGV = normalize_options(args => [ qw(-a -bfoo -c var) ]); 28 | @expect_argv = qw(-a -b foo -c var); 29 | is_deeply(\@ARGV, \@expect_argv, 'unbundle short options'); 30 | 31 | @ARGV = normalize_options(args => [ qw(--option-a --option-b value --option-c=value) ]); 32 | @expect_argv = qw(--option-a --option-b value --option-c value); 33 | is_deeply(\@ARGV, \@expect_argv, 'unbundle long options'); 34 | 35 | @ARGV = normalize_options(args => [ qw(-aaa -bbb --option-a=oa -- --opt=arg -dval) ], 36 | delim => '--'); 37 | @expect_argv = qw(-a aa -b bb --option-a oa -- --opt=arg -dval); 38 | is_deeply(\@ARGV, \@expect_argv, 'unbundle options with delimiter'); 39 | 40 | 1; 41 | -------------------------------------------------------------------------------- /scripts/t/mk/buildtools.mk: -------------------------------------------------------------------------------- 1 | include $(srcdir)/mk/buildtools.mk 2 | 3 | test: 4 | test "$(AS)" = "$(TEST_AS)" 5 | test "$(AS_FOR_BUILD)" = "$(TEST_AS_FOR_BUILD)" 6 | test "$(CC)" = "$(TEST_CC)" 7 | test "$(CC_FOR_BUILD)" = "$(TEST_CC_FOR_BUILD)" 8 | test "$(CXX)" = "$(TEST_CXX)" 9 | test "$(CXX_FOR_BUILD)" = "$(TEST_CXX_FOR_BUILD)" 10 | test "$(OBJC)" = "$(TEST_OBJC)" 11 | test "$(OBJC_FOR_BUILD)" = "$(TEST_OBJC_FOR_BUILD)" 12 | test "$(OBJCXX)" = "$(TEST_OBJCXX)" 13 | test "$(OBJCXX_FOR_BUILD)" = "$(TEST_OBJCXX_FOR_BUILD)" 14 | test "$(GCJ)" = "$(TEST_GCJ)" 15 | test "$(GCJ_FOR_BUILD)" = "$(TEST_GCJ_FOR_BUILD)" 16 | test "$(F77)" = "$(TEST_F77)" 17 | test "$(F77_FOR_BUILD)" = "$(TEST_F77_FOR_BUILD)" 18 | test "$(FC)" = "$(TEST_FC)" 19 | test "$(FC_FOR_BUILD)" = "$(TEST_FC_FOR_BUILD)" 20 | test "$(LD)" = "$(TEST_LD)" 21 | test "$(LD_FOR_BUILD)" = "$(TEST_LD_FOR_BUILD)" 22 | test "$(STRIP)" = "$(TEST_STRIP)" 23 | test "$(STRIP_FOR_BUILD)" = "$(TEST_STRIP_FOR_BUILD)" 24 | test "$(OBJCOPY)" = "$(TEST_OBJCOPY)" 25 | test "$(OBJCOPY_FOR_BUILD)" = "$(TEST_OBJCOPY_FOR_BUILD)" 26 | test "$(OBJDUMP)" = "$(TEST_OBJDUMP)" 27 | test "$(OBJDUMP_FOR_BUILD)" = "$(TEST_OBJDUMP_FOR_BUILD)" 28 | test "$(NM)" = "$(TEST_NM)" 29 | test "$(NM_FOR_BUILD)" = "$(TEST_NM_FOR_BUILD)" 30 | test "$(AR)" = "$(TEST_AR)" 31 | test "$(AR_FOR_BUILD)" = "$(TEST_AR_FOR_BUILD)" 32 | test "$(RANLIB)" = "$(TEST_RANLIB)" 33 | test "$(RANLIB_FOR_BUILD)" = "$(TEST_RANLIB_FOR_BUILD)" 34 | test "$(PKG_CONFIG)" = "$(TEST_PKG_CONFIG)" 35 | test "$(PKG_CONFIG_FOR_BUILD)" = "$(TEST_PKG_CONFIG_FOR_BUILD)" 36 | -------------------------------------------------------------------------------- /t/po.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | use Test::Dpkg qw(:needs); 21 | 22 | test_needs_author(); 23 | test_needs_command('i18nspector'); 24 | test_needs_srcdir_switch(); 25 | 26 | my @files = Test::Dpkg::all_po_files(); 27 | 28 | plan skip_all => 'no PO files distributed' if @files == 0; 29 | plan tests => scalar @files; 30 | 31 | sub po_ok { 32 | my $file = shift; 33 | 34 | my $tags = qx(i18nspector \"$file\" 2>&1); 35 | 36 | # Fixup the output: 37 | $tags =~ s/^.*\.pot: boilerplate-in-initial-comments .*\n//mg; 38 | $tags =~ s/^.*\.po: duplicate-header-field X-POFile-SpellExtra\n//mg; 39 | chomp $tags; 40 | 41 | my $ok = length $tags == 0; 42 | 43 | ok($ok, "PO check $file"); 44 | if (not $ok) { 45 | diag($tags); 46 | } 47 | } 48 | 49 | for my $file (@files) { 50 | po_ok($file); 51 | } 52 | -------------------------------------------------------------------------------- /man/dselect.cfg.man: -------------------------------------------------------------------------------- 1 | .\" dselect manual page - dselect.cfg(5) 2 | .\" 3 | .\" Copyright © 2002 Wichert Akkerman 4 | .\" Copyright © 2009-2011, 2013, 2015 Guillem Jover 5 | .\" 6 | .\" This is free software; you can redistribute it and/or modify 7 | .\" it under the terms of the GNU General Public License as published by 8 | .\" the Free Software Foundation; either version 2 of the License, or 9 | .\" (at your option) any later version. 10 | .\" 11 | .\" This is distributed in the hope that it will be useful, 12 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | .\" GNU General Public License for more details. 15 | .\" 16 | .\" You should have received a copy of the GNU General Public License 17 | .\" along with this program. If not, see . 18 | . 19 | .TH dselect.cfg 5 "%RELEASE_DATE%" "%VERSION%" "dpkg suite" 20 | .nh 21 | .SH NAME 22 | dselect.cfg \- dselect configuration file 23 | . 24 | .SH DESCRIPTION 25 | This file contains default options for dselect. Each line contains a 26 | single option which is exactly the same as a normal command line 27 | option for dselect except for the leading hyphens which are not used 28 | here. Quotes surrounding option values are stripped. Comments are 29 | allowed by starting a line with a hash sign (‘\fB#\fR’). 30 | . 31 | .SH FILES 32 | .I %PKGCONFDIR%/dselect.cfg.d/[0-9a-zA-Z_-]* 33 | .br 34 | .I %PKGCONFDIR%/dselect.cfg 35 | .br 36 | .I ~/.dselect.cfg 37 | . 38 | .SH SEE ALSO 39 | .BR dselect (1). 40 | -------------------------------------------------------------------------------- /scripts/mk/pkg-info.mk: -------------------------------------------------------------------------------- 1 | # Makefile snippet defining the following variables: 2 | # 3 | # DEB_SOURCE: the source package name 4 | # DEB_VERSION: the full version of the package (epoch + upstream vers. + revision) 5 | # DEB_VERSION_EPOCH_UPSTREAM: the package's version without the Debian revision 6 | # DEB_VERSION_UPSTREAM_REVISION: the package's version without the Debian epoch 7 | # DEB_VERSION_UPSTREAM: the package's upstream version 8 | # DEB_DISTRIBUTION: the distribution(s) listed in the current entry of debian/changelog 9 | # 10 | # SOURCE_DATE_EPOCH: the source release date as seconds since the epoch, as 11 | # specified by 12 | 13 | dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1))) 14 | 15 | DEB_SOURCE = $(call dpkg_late_eval,DEB_SOURCE,dpkg-parsechangelog -SSource) 16 | DEB_VERSION = $(call dpkg_late_eval,DEB_VERSION,dpkg-parsechangelog -SVersion) 17 | DEB_VERSION_EPOCH_UPSTREAM = $(call dpkg_late_eval,DEB_VERSION_EPOCH_UPSTREAM,echo '$(DEB_VERSION)' | sed -e 's/-[^-]*$$//') 18 | DEB_VERSION_UPSTREAM_REVISION = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM_REVISION,echo '$(DEB_VERSION)' | sed -e 's/^[0-9]*://') 19 | DEB_VERSION_UPSTREAM = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM,echo '$(DEB_VERSION_EPOCH_UPSTREAM)' | sed -e 's/^[0-9]*://') 20 | DEB_DISTRIBUTION = $(call dpkg_late_eval,DEB_DISTRIBUTION,dpkg-parsechangelog -SDistribution) 21 | 22 | SOURCE_DATE_EPOCH ?= $(call dpkg_late_eval,SOURCE_DATE_EPOCH,dpkg-parsechangelog -STimestamp) 23 | 24 | export SOURCE_DATE_EPOCH 25 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Exit.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More tests => 5; 20 | 21 | BEGIN { 22 | use_ok('Dpkg::Exit'); 23 | } 24 | 25 | my $track = 0; 26 | 27 | sub test_handler { 28 | $track++; 29 | } 30 | 31 | Dpkg::Exit::run_exit_handlers(); 32 | 33 | is($track, 0, 'no handlers run'); 34 | 35 | Dpkg::Exit::push_exit_handler(\&test_handler); 36 | Dpkg::Exit::pop_exit_handler(); 37 | 38 | Dpkg::Exit::run_exit_handlers(); 39 | 40 | is($track, 0, 'push/pop; no handlers run'); 41 | 42 | Dpkg::Exit::push_exit_handler(\&test_handler); 43 | 44 | Dpkg::Exit::run_exit_handlers(); 45 | 46 | is($track, 1, 'push; handler run'); 47 | 48 | # Check the exit handlers, must be the last thing done. 49 | sub exit_handler { 50 | pass('exit handler invoked'); 51 | exit 0; 52 | } 53 | 54 | Dpkg::Exit::push_exit_handler(\&exit_handler); 55 | 56 | kill 'INT', $$; 57 | 58 | 1; 59 | -------------------------------------------------------------------------------- /lib/dpkg/pkg-show.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * pkg-show.h - primitives for pkg information display 4 | * 5 | * Copyright © 2010-2012 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef DPKG_PKG_SHOW_H 22 | #define DPKG_PKG_SHOW_H 23 | 24 | #include 25 | #include 26 | 27 | DPKG_BEGIN_DECLS 28 | 29 | /** 30 | * @defgroup pkg-show Package information display 31 | * @ingroup dpkg-public 32 | * @{ 33 | */ 34 | 35 | int pkg_sorter_by_nonambig_name_arch(const void *a, const void *b); 36 | 37 | const char *pkgbin_synopsis(const struct pkginfo *pkg, 38 | const struct pkgbin *pkgbin, int *len_ret); 39 | int pkg_abbrev_want(const struct pkginfo *pkg); 40 | int pkg_abbrev_status(const struct pkginfo *pkg); 41 | int pkg_abbrev_eflag(const struct pkginfo *pkg); 42 | 43 | /** @} */ 44 | 45 | DPKG_END_DECLS 46 | 47 | #endif /* DPKG_PKG_SHOW_H */ 48 | -------------------------------------------------------------------------------- /src/perpkgstate.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dpkg - main program for package management 3 | * perpkgstate.c - struct perpackagestate and function handling 4 | * 5 | * Copyright © 1995 Ian Jackson 6 | * Copyright © 2000,2001 Wichert Akkerman 7 | * Copyright © 2008-2014 Guillem Jover 8 | * 9 | * This is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include "main.h" 30 | 31 | void 32 | ensure_package_clientdata(struct pkginfo *pkg) 33 | { 34 | if (pkg->clientdata) 35 | return; 36 | pkg->clientdata = nfmalloc(sizeof(*pkg->clientdata)); 37 | pkg->clientdata->istobe = PKG_ISTOBE_NORMAL; 38 | pkg->clientdata->color = PKG_CYCLE_WHITE; 39 | pkg->clientdata->enqueued = false; 40 | pkg->clientdata->replacingfilesandsaid = 0; 41 | pkg->clientdata->cmdline_seen = 0; 42 | pkg->clientdata->trigprocdeferred = NULL; 43 | } 44 | -------------------------------------------------------------------------------- /get-version: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # get-version 4 | # 5 | # Copyright © 2009, 2013-2014 Guillem Jover 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | 21 | if [ -f .dist-version ]; then 22 | # Get the version from the file distributed in the tarball. 23 | version=$(cat .dist-version) 24 | elif [ -d .git ]; then 25 | # Get the version from the git repository. Since tags cannot contain colons 26 | # or tildes, we use percent and underscore instead. Reverse that switch here. 27 | version=$(git describe --abbrev=4 HEAD 2>/dev/null | tr %_ :~) 28 | 29 | # Check if we are on a dirty checkout. 30 | git update-index --refresh -q >/dev/null 31 | dirty=$(git diff-index --name-only HEAD 2>/dev/null) 32 | if [ -n "$dirty" ]; then 33 | version="$version-dirty" 34 | fi 35 | else 36 | echo "error: cannot get project version." 1>&2 37 | exit 1 38 | fi 39 | 40 | # Use printf to avoid the trailing new line that m4_esyscmd would not handle. 41 | printf "%s" "$version" 42 | -------------------------------------------------------------------------------- /lib/dpkg/i18n.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * i18n.h - i18n support 4 | * 5 | * Copyright © 2008-2011 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_I18N_H 22 | #define LIBDPKG_I18N_H 23 | 24 | #include 25 | 26 | #include 27 | 28 | /* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h 29 | * which gets pulled by gettext.h only includes it if building optimized. */ 30 | #include 31 | 32 | DPKG_BEGIN_DECLS 33 | 34 | /** 35 | * @defgroup i18n Internationalization support 36 | * @ingroup dpkg-internal 37 | * @{ 38 | */ 39 | 40 | #define _(str) gettext(str) 41 | #define P_(str, str_plural, n) ngettext(str, str_plural, n) 42 | #define N_(str) gettext_noop(str) 43 | #define C_(ctxt, str) pgettext(ctxt, str) 44 | 45 | void dpkg_locales_init(const char *package); 46 | 47 | /** @} */ 48 | 49 | DPKG_END_DECLS 50 | 51 | #endif /* LIBDPKG_I18N_H */ 52 | -------------------------------------------------------------------------------- /lib/dpkg/namevalue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * namevalue.h - name value structure handling 4 | * 5 | * Copyright © 1994,1995 Ian Jackson 6 | * Copyright © 2009-2012, 2015 Guillem Jover 7 | * 8 | * This is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef LIBDPKG_NAMEVALUE_H 23 | #define LIBDPKG_NAMEVALUE_H 24 | 25 | #include 26 | 27 | DPKG_BEGIN_DECLS 28 | 29 | /** 30 | * @defgroup namevalue Name/Value data 31 | * @ingroup dpkg-public 32 | * @{ 33 | */ 34 | 35 | struct namevalue { 36 | const char *name; 37 | int value; 38 | int length; 39 | }; 40 | 41 | #define NAMEVALUE_DEF(n, v) \ 42 | [v] = { .name = n, .value = v, .length = sizeof(n) - 1 } 43 | 44 | const struct namevalue *namevalue_find_by_name(const struct namevalue *head, 45 | const char *str); 46 | 47 | /** @} */ 48 | 49 | DPKG_END_DECLS 50 | 51 | #endif /* LIBDPKG_NAMEVALUE_H */ 52 | -------------------------------------------------------------------------------- /lib/dpkg/pkg-format.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * pkg-format.g - customizable package formatting 4 | * 5 | * Copyright © 2001 Wichert Akkerman 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_PKG_FORMAT_H 22 | #define LIBDPKG_PKG_FORMAT_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | DPKG_BEGIN_DECLS 29 | 30 | /** 31 | * @defgroup pkg-format Package information formatting 32 | * @ingroup dpkg-public 33 | * @{ 34 | */ 35 | 36 | struct pkg_format_node; 37 | 38 | struct pkg_format_node *pkg_format_parse(const char *fmt, 39 | struct dpkg_error *err); 40 | void pkg_format_free(struct pkg_format_node *head); 41 | void pkg_format_show(const struct pkg_format_node *head, 42 | struct pkginfo *pkg, struct pkgbin *pkgbin); 43 | 44 | /** @} */ 45 | 46 | DPKG_END_DECLS 47 | 48 | #endif /* LIBDPKG_PKG_FORMAT_H */ 49 | -------------------------------------------------------------------------------- /t/syntax.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | use Test::Dpkg qw(:needs); 21 | 22 | test_needs_srcdir_switch(); 23 | 24 | my @files = Test::Dpkg::all_perl_files(); 25 | 26 | plan tests => scalar @files; 27 | 28 | my $PERL = $ENV{PERL} // $^X // 'perl'; 29 | 30 | # Detect compilation warnings that are not found with just «use warnings», 31 | # such as redefinition of symbols from multiple imports. We cannot use 32 | # Test::Strict::syntax_ok because it does not pass -w to perl, and does not 33 | # check for other issues whenever perl states the syntax is ok. 34 | sub syntax_ok { 35 | my $file = shift; 36 | 37 | my $eval = `$PERL -cw \"$file\" 2>&1`; 38 | my $ok = ($eval =~ s{^\Q$file\E syntax OK\n$}{}ms) && length $eval == 0; 39 | 40 | ok($ok, "Compilation check $file"); 41 | if (not $ok) { 42 | diag($eval); 43 | } 44 | } 45 | 46 | for my $file (@files) { 47 | syntax_ok($file); 48 | } 49 | -------------------------------------------------------------------------------- /dselect/keyoverride: -------------------------------------------------------------------------------- 1 | # dselect - Debian package maintenance user interface 2 | # keyoverride - override strings for ncurses key names 3 | # 4 | # Copyright © 1995 Ian Jackson 5 | # 6 | # This is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | 32 Space 20 | 13 Return 21 | 27 Escape 22 | 28 ^\ 23 | 29 ^] 24 | 30 ^^ 25 | 31 ^_ 26 | 34 Quote 27 | 39 Apostrophe 28 | 44 Comma 29 | 45 Hyphen 30 | 47 Slash 31 | 59 Semicolon 32 | 92 Backslash 33 | 96 Backquote 34 | 127 DEL 35 | KEY_UP Up 36 | KEY_DOWN Down 37 | KEY_RIGHT Right 38 | KEY_LEFT Left 39 | KEY_IC Insert 40 | KEY_SIC Shift Insert 41 | KEY_DC Delete 42 | KEY_SDC Shift Delete 43 | KEY_NPAGE Page Down 44 | KEY_PPAGE Page Up 45 | KEY_CATAB Clear Tabs 46 | KEY_EIC EIC 47 | KEY_EOL EOL 48 | KEY_SEOL Shift EOL 49 | KEY_EOS EOS 50 | KEY_LL Bottom 51 | KEY_SF Scroll Forward 52 | KEY_SR Scroll Reverse 53 | KEY_SRESET Soft Reset 54 | KEY_SLEFT Shift Left 55 | KEY_SRIGHT Shift Right 56 | KEY_SPREVIOUS Shift Previous 57 | KEY_MAX [elide] 58 | KEY_MIN [elide] 59 | -------------------------------------------------------------------------------- /scripts/t/Dpkg_Shlibs/patterns.symbols: -------------------------------------------------------------------------------- 1 | libpatterns.so.1 libpatterns1 #MINVER# 2 | (c++|regex|optional)NSA::ClassA::Private(::.*)?@Base 1.private 3 | (c++)NSB::Symver::symver_method2()@SYMVER_1 1.method2 4 | (symver|optional)SYMVEROPT_2 2 5 | SYMVEROPT_2@SYMVEROPT_2 2 6 | (c++|symver)SYMVER_1 1.generic 7 | SYMVER_1@SYMVER_1 1 8 | (regex|c++)^_Z(T[ISV])?N3NSA6ClassA8Internal.*@Base$ 1.internal 9 | _ZN3NSA6ClassAC1Ev@Base 1 10 | _ZN3NSA6ClassAC2Ev@Base 1 11 | _ZN3NSA6ClassAD0Ev@Base 1 12 | _ZN3NSA6ClassAD1Ev@Base 1 13 | _ZN3NSA6ClassAD2Ev@Base 1 14 | _ZN3NSB6ClassDC1Ev@Base 1 15 | _ZN3NSB6ClassDC2Ev@Base 1 16 | _ZN3NSB6ClassDD0Ev@Base 1 17 | _ZN3NSB6ClassDD1Ev@Base 1 18 | _ZN3NSB6ClassDD2Ev@Base 1 19 | _ZN3NSB6Symver14symver_method1Ev@SYMVER_1 1.method1 20 | _ZN6ClassBC1Ev@Base 1 21 | _ZN6ClassBC2Ev@Base 1 22 | _ZN6ClassBD0Ev@Base 1 23 | _ZN6ClassBD1Ev@Base 1 24 | _ZN6ClassBD2Ev@Base 1 25 | _ZN6ClassCC1Ev@Base 1 26 | _ZN6ClassCC2Ev@Base 1 27 | _ZN6ClassCD0Ev@Base 1 28 | _ZN6ClassCD1Ev@Base 1 29 | _ZN6ClassCD2Ev@Base 1 30 | _ZNK3NSA6ClassA11generate_vtEPKc@Base 1 31 | _ZNK3NSB6ClassD11generate_vtEPKc@Base 1 32 | _ZNK6ClassB11generate_vtEPKc@Base 1 33 | _ZNK6ClassC11generate_vtEPKc@Base 1 34 | _ZTI6ClassB@Base 1 35 | _ZTI6ClassC@Base 1 36 | _ZTIN3NSA6ClassAE@Base 1 37 | _ZTIN3NSB6ClassDE@Base 1 38 | _ZTS6ClassB@Base 1 39 | _ZTS6ClassC@Base 1 40 | _ZTSN3NSA6ClassAE@Base 1 41 | _ZTSN3NSB6ClassDE@Base 1 42 | _ZTV6ClassB@Base 1 43 | _ZTV6ClassC@Base 1 44 | _ZTVN3NSA6ClassAE@Base 1 45 | _ZTVN3NSB6ClassDE@Base 1 46 | (c++)"non-virtual thunk to NSB::ClassD::generate_vt(char const*) const@Base" 1 47 | (c++)"non-virtual thunk to NSB::ClassD::~ClassD()@Base" 1 48 | -------------------------------------------------------------------------------- /doc/README.api: -------------------------------------------------------------------------------- 1 | This is an (incomplete) list of currently provided APIs by dpkg, and 2 | their supported status. 3 | 4 | 5 | What: libdpkg.a (C static library) 6 | Status: volatile 7 | Description: 8 | The API provided by this library is highly volatile, still in the process 9 | of being cleaned up. It's only supposed to be used internally by dpkg for 10 | now. Header files, functions, variables and types might get renamed, 11 | removed or change semantics. If you still have a need to use it, which 12 | you'd be doing anyway, say by locally building dpkg to get the library, 13 | then define the C preprocessor macro LIBDPKG_VOLATILE_API in your build 14 | to acknowledge that fact. 15 | 16 | What: libdpkg-perl (perl modules) 17 | Status: stable 18 | Description: 19 | Among the perl modules provided by libdpkg-perl, you can safely rely on 20 | those that have $VERSION set to 1.00 (or higher). Note however that the 21 | API is defined by what's documented in the corresponding manual pages and 22 | nothing more. You can't assume anything else based on what you read in 23 | the source code. If you feel the need for further refinements in the 24 | documented API, don't hesitate to file a wishlist bug against 25 | libdpkg-perl. 26 | . 27 | In case of API-breaking changes, the major number in $VERSION will be 28 | increased. For API extensions, the minor number will be increased. 29 | 30 | What: custom changelog parsers as Dpkg::Changelog derived modules 31 | Status: stable 32 | Description: 33 | Since dpkg 1.18.8, custom changelog parsers are supported as modules 34 | derived from the Dpkg::Changelog module. The derived modules need to 35 | implement all required documented methods. 36 | -------------------------------------------------------------------------------- /lib/dpkg/t/t-mod-db.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * t-mod-db.c - test database implementation 4 | * 5 | * Copyright © 2011 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | static void 30 | test_db_dir(void) 31 | { 32 | char *dir; 33 | 34 | test_str(dpkg_db_get_dir(), ==, ADMINDIR); 35 | 36 | dpkg_db_set_dir("testdir"); 37 | test_str(dpkg_db_get_dir(), ==, "testdir"); 38 | 39 | setenv("DPKG_ADMINDIR", "testenvdir", 1); 40 | dpkg_db_set_dir(NULL); 41 | test_str(dpkg_db_get_dir(), ==, "testenvdir"); 42 | 43 | unsetenv("DPKG_ADMINDIR"); 44 | dpkg_db_set_dir(NULL); 45 | test_str(dpkg_db_get_dir(), ==, ADMINDIR); 46 | 47 | dir = dpkg_db_get_path("testfile"); 48 | test_str(dir, ==, ADMINDIR "/testfile"); 49 | free(dir); 50 | } 51 | 52 | TEST_ENTRY(test) 53 | { 54 | test_plan(5); 55 | 56 | test_db_dir(); 57 | } 58 | -------------------------------------------------------------------------------- /scripts/Dpkg/Vars.pm: -------------------------------------------------------------------------------- 1 | # Copyright © 2007-2009,2012-2013 Guillem Jover 2 | # Copyright © 2007 Raphaël Hertzog 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | package Dpkg::Vars; 18 | 19 | use strict; 20 | use warnings; 21 | 22 | our $VERSION = '0.03'; 23 | our @EXPORT = qw( 24 | get_source_package 25 | set_source_package 26 | ); 27 | 28 | use Exporter qw(import); 29 | 30 | use Dpkg::ErrorHandling; 31 | use Dpkg::Gettext; 32 | use Dpkg::Package; 33 | 34 | my $sourcepackage; 35 | 36 | sub get_source_package { 37 | return $sourcepackage; 38 | } 39 | 40 | sub set_source_package { 41 | my $v = shift; 42 | my $err = pkg_name_is_illegal($v); 43 | error(g_("source package name '%s' is illegal: %s"), $v, $err) if $err; 44 | 45 | if (not defined($sourcepackage)) { 46 | $sourcepackage = $v; 47 | } elsif ($v ne $sourcepackage) { 48 | error(g_('source package has two conflicting values - %s and %s'), 49 | $sourcepackage, $v); 50 | } 51 | } 52 | 53 | 1; 54 | -------------------------------------------------------------------------------- /t-func/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | EXTRA_DIST = 4 | 5 | EXTRA_DIST += $(srcdir)/package.m4 6 | 7 | TESTSUITE_AT = $(srcdir)/testsuite.at 8 | TESTSUITE_AT += $(srcdir)/local.at 9 | TESTSUITE_AT += $(srcdir)/deb-format.at 10 | TESTSUITE_AT += $(srcdir)/deb-fields.at 11 | TESTSUITE_AT += $(srcdir)/deb-content.at 12 | TESTSUITE_AT += $(srcdir)/deb-split.at 13 | EXTRA_DIST += $(TESTSUITE_AT) 14 | 15 | TESTSUITE = $(srcdir)/testsuite 16 | EXTRA_DIST += $(TESTSUITE) 17 | 18 | DISTCLEANFILES = atconfig 19 | 20 | # The ":;" works around a Bash 3.2 bug when the output is not writable. 21 | $(srcdir)/package.m4: $(top_srcdir)/configure.ac 22 | :;{ \ 23 | echo '# Signature of the current package.' && \ 24 | echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \ 25 | echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \ 26 | echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])' && \ 27 | echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \ 28 | echo 'm4_define([AT_PACKAGE_URL], [$(PACKAGE_URL)])' && \ 29 | echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \ 30 | } >'$(srcdir)/package.m4' 31 | 32 | check-local: atconfig atlocal $(TESTSUITE) 33 | $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) 34 | 35 | installcheck-local: atconfig atlocal $(TESTSUITE) 36 | $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' $(TESTSUITEFLAGS) 37 | 38 | clean-local: 39 | test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean 40 | 41 | AUTOTEST = $(AUTOM4TE) --language=autotest 42 | $(TESTSUITE): $(srcdir)/package.m4 $(TESTSUITE_AT) 43 | $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at 44 | mv $@.tmp $@ 45 | -------------------------------------------------------------------------------- /lib/dpkg/dlist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dlist.h - macros for handling doubly linked lists 3 | * 4 | * Copyright © 1997-1999 Ian Jackson 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef DPKG_DLIST_H 21 | #define DPKG_DLIST_H 22 | 23 | #define LIST_UNLINK_PART(list, node, part) \ 24 | do { \ 25 | if ((node)->part.prev) \ 26 | (node)->part.prev->part.next = (node)->part.next; \ 27 | else \ 28 | (list).head = (node)->part.next; \ 29 | if ((node)->part.next) \ 30 | (node)->part.next->part.prev = (node)->part.prev; \ 31 | else \ 32 | (list).tail = (node)->part.prev; \ 33 | } while (0) 34 | 35 | #define LIST_LINK_TAIL_PART(list, node, part) \ 36 | do { \ 37 | (node)->part.next = NULL; \ 38 | (node)->part.prev = (list).tail; \ 39 | if ((list).tail) \ 40 | (list).tail->part.next = (node); \ 41 | else (list).head = (node); \ 42 | (list).tail = (node); \ 43 | } while (0) 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /lib/dpkg/t/t-progname.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * t-progname.c - test program name handling 4 | * 5 | * Copyright © 2011 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | static void 28 | test_progname(void) 29 | { 30 | const char *progname; 31 | 32 | /* Test initially empty progname. */ 33 | progname = dpkg_get_progname(); 34 | /* Handle libtool executables. */ 35 | if (strncmp(progname, "lt-", 3) == 0) 36 | progname += 3; 37 | test_str(progname, ==, "t-progname"); 38 | 39 | /* Test setting a new progname. */ 40 | dpkg_set_progname("newname"); 41 | test_str(dpkg_get_progname(), ==, "newname"); 42 | 43 | /* Test setting a new progname with path. */ 44 | dpkg_set_progname("path/newprogname"); 45 | test_str(dpkg_get_progname(), ==, "newprogname"); 46 | } 47 | 48 | TEST_ENTRY(test) 49 | { 50 | test_plan(3); 51 | 52 | test_progname(); 53 | } 54 | -------------------------------------------------------------------------------- /t/codespell.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | use Test::Dpkg qw(:needs); 21 | 22 | test_needs_author(); 23 | test_needs_command('codespell'); 24 | test_needs_srcdir_switch(); 25 | 26 | plan tests => 1; 27 | 28 | my @codespell_skip = qw( 29 | .git 30 | *.po 31 | *.pot 32 | *.gmo 33 | *.add 34 | *.cache 35 | ChangeLog 36 | Makefile.in 37 | Makefile 38 | configure 39 | libtool 40 | libtool.m4 41 | aclocal.m4 42 | ); 43 | my $codespell_skip = join ',', @codespell_skip; 44 | 45 | my @codespell_opts = (qw( 46 | --ignore-words=t/codespell/stopwords 47 | ), ( 48 | "--skip=$codespell_skip" 49 | )); 50 | my $tags = qx(codespell @codespell_opts 2>&1); 51 | 52 | # Fixup the output: 53 | $tags =~ s/^WARNING: Binary file:.*\n//mg; 54 | $tags =~ s{^\./build-aux/.*\n}{}mg; 55 | $tags =~ s{^\./man/[a-zA-Z_]+/.*\n}{}mg; 56 | chomp $tags; 57 | 58 | my $ok = length $tags == 0; 59 | 60 | ok($ok, 'codespell'); 61 | if (not $ok) { 62 | diag($tags); 63 | } 64 | -------------------------------------------------------------------------------- /lib/dpkg/program.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * program.c - dpkg-based program support 4 | * 5 | * Copyright © 2013 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | /** 34 | * Standard initializations when starting a dpkg-based program. 35 | * 36 | * @param progname The program name. 37 | */ 38 | void 39 | dpkg_program_init(const char *progname) 40 | { 41 | dpkg_set_progname(progname); 42 | dpkg_set_report_buffer(stdout); 43 | 44 | push_error_context(); 45 | 46 | /* Set sane default permissions for newly created files. */ 47 | umask(022); 48 | } 49 | 50 | /** 51 | * Standard cleanups before terminating a dpkg-based program. 52 | */ 53 | void 54 | dpkg_program_done(void) 55 | { 56 | pop_error_context(ehflag_normaltidy); 57 | } 58 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | localedir = $(datadir)/locale 4 | pkgconfdir = $(sysconfdir)/@PACKAGE@ 5 | 6 | AM_CPPFLAGS = \ 7 | -DLOCALEDIR=\"$(localedir)\" \ 8 | -DADMINDIR=\"$(admindir)\" \ 9 | -idirafter $(top_srcdir)/lib/compat \ 10 | -I$(top_builddir) \ 11 | -I$(top_srcdir)/lib 12 | LDADD = \ 13 | ../lib/dpkg/libdpkg.la \ 14 | $(LIBINTL) 15 | 16 | 17 | EXTRA_DIST = \ 18 | $(test_scripts) \ 19 | $(nil) 20 | 21 | bin_PROGRAMS = \ 22 | dpkg \ 23 | dpkg-divert \ 24 | dpkg-query \ 25 | dpkg-statoverride \ 26 | dpkg-trigger 27 | 28 | dpkg_SOURCES = \ 29 | archives.c archives.h \ 30 | cleanup.c \ 31 | configure.c \ 32 | depcon.c \ 33 | enquiry.c \ 34 | errors.c \ 35 | file-match.c file-match.h \ 36 | filters.c filters.h \ 37 | help.c \ 38 | main.c main.h \ 39 | packages.c \ 40 | perpkgstate.c \ 41 | remove.c \ 42 | script.c \ 43 | select.c \ 44 | selinux.c \ 45 | trigproc.c \ 46 | unpack.c \ 47 | update.c \ 48 | verify.c \ 49 | $(nil) 50 | 51 | dpkg_LDADD = \ 52 | $(LDADD) \ 53 | $(SELINUX_LIBS) 54 | 55 | dpkg_divert_SOURCES = \ 56 | divertcmd.c 57 | 58 | dpkg_query_SOURCES = \ 59 | querycmd.c 60 | 61 | dpkg_statoverride_SOURCES = \ 62 | selinux.c \ 63 | statcmd.c 64 | 65 | dpkg_statoverride_LDADD = \ 66 | $(LDADD) \ 67 | $(SELINUX_LIBS) 68 | 69 | dpkg_trigger_SOURCES = \ 70 | trigcmd.c 71 | 72 | install-data-local: 73 | $(MKDIR_P) $(DESTDIR)$(pkgconfdir)/dpkg.cfg.d 74 | $(MKDIR_P) $(DESTDIR)$(admindir)/info 75 | $(MKDIR_P) $(DESTDIR)$(admindir)/updates 76 | 77 | test_tmpdir = t.tmp 78 | 79 | test_scripts = \ 80 | t/dpkg_divert.t 81 | 82 | include $(top_srcdir)/check.am 83 | 84 | clean-local: check-clean 85 | -------------------------------------------------------------------------------- /lib/dpkg/i18n.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * i18n.c - i18n support 4 | * 5 | * Copyright © 2013 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | void 27 | dpkg_locales_init(const char *package) 28 | { 29 | setlocale(LC_ALL, ""); 30 | bindtextdomain(package, LOCALEDIR); 31 | textdomain(package); 32 | 33 | #if defined(__APPLE__) && defined(__MACH__) 34 | /* 35 | * On Mac OS X, the libintl code needs to call into the CoreFoundation 36 | * framework, which is internally threaded, to initialize some caches. 37 | * This is a problem when that first call is done after a fork(3), 38 | * because per POSIX, only one thread will survive, leaving the 39 | * process in a very inconsistent state, leading to crashes. 40 | * 41 | * XXX: To workaround this, we try to force the caches initialization 42 | * at program startup time, by performing a dummy gettext() call. 43 | */ 44 | gettext(""); 45 | #endif 46 | } 47 | -------------------------------------------------------------------------------- /lib/dpkg/cleanup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * cleanup.c - cleanup functions, used when we need to unwind 4 | * 5 | * Copyright © 1995 Ian Jackson 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | void 31 | cu_closepipe(int argc, void **argv) 32 | { 33 | int *p1 = (int *)argv[0]; 34 | 35 | close(p1[0]); 36 | close(p1[1]); 37 | } 38 | 39 | void 40 | cu_closestream(int argc, void **argv) 41 | { 42 | FILE *f = (FILE *)(argv[0]); 43 | 44 | fclose(f); 45 | } 46 | 47 | void 48 | cu_closedir(int argc, void **argv) 49 | { 50 | DIR *d = (DIR *)(argv[0]); 51 | 52 | closedir(d); 53 | } 54 | 55 | void 56 | cu_closefd(int argc, void **argv) 57 | { 58 | int ip = *(int *)argv[0]; 59 | 60 | close(ip); 61 | } 62 | 63 | void 64 | cu_filename(int argc, void **argv) 65 | { 66 | const char *filename = argv[0]; 67 | 68 | (void)unlink(filename); 69 | } 70 | -------------------------------------------------------------------------------- /scripts/Dpkg/Control/Changelog.pm: -------------------------------------------------------------------------------- 1 | # Copyright © 2009 Raphaël Hertzog 2 | 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | package Dpkg::Control::Changelog; 17 | 18 | use strict; 19 | use warnings; 20 | 21 | our $VERSION = '1.00'; 22 | 23 | use Dpkg::Control; 24 | 25 | use parent qw(Dpkg::Control); 26 | 27 | =encoding utf8 28 | 29 | =head1 NAME 30 | 31 | Dpkg::Control::Changelog - represent info fields output by dpkg-parsechangelog 32 | 33 | =head1 DESCRIPTION 34 | 35 | This object derives directly from Dpkg::Control with the type 36 | CTRL_CHANGELOG. 37 | 38 | =head1 METHODS 39 | 40 | =over 4 41 | 42 | =item $c = Dpkg::Control::Changelog->new() 43 | 44 | Create a new empty set of changelog related fields. 45 | 46 | =cut 47 | 48 | sub new { 49 | my $this = shift; 50 | my $class = ref($this) || $this; 51 | my $self = Dpkg::Control->new(type => CTRL_CHANGELOG, @_); 52 | return bless $self, $class; 53 | } 54 | 55 | =back 56 | 57 | =head1 CHANGES 58 | 59 | =head2 Version 1.00 (dpkg 1.15.6) 60 | 61 | Mark the module as public. 62 | 63 | =cut 64 | 65 | 1; 66 | -------------------------------------------------------------------------------- /lib/dpkg/t/t-trigger.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * t-trigger.c - test triggers 4 | * 5 | * Copyright © 2012 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | static void 28 | test_trig_name_is_illegal(void) 29 | { 30 | /* Test invalid trigger names. */ 31 | test_fail(trig_name_is_illegal("") == NULL); 32 | test_fail(trig_name_is_illegal("\a") == NULL); 33 | test_fail(trig_name_is_illegal("\t") == NULL); 34 | test_fail(trig_name_is_illegal("\200") == NULL); 35 | test_fail(trig_name_is_illegal("trigger name") == NULL); 36 | 37 | /* Test valid trigger names. */ 38 | test_pass(trig_name_is_illegal("TRIGGER") == NULL); 39 | test_pass(trig_name_is_illegal("trigger") == NULL); 40 | test_pass(trig_name_is_illegal("0123456789") == NULL); 41 | test_pass(trig_name_is_illegal("/file/trigger") == NULL); 42 | } 43 | 44 | TEST_ENTRY(test) 45 | { 46 | test_plan(9); 47 | 48 | test_trig_name_is_illegal(); 49 | } 50 | -------------------------------------------------------------------------------- /lib/dpkg/pkg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdpkg - Debian packaging suite library routines 3 | * pkg.h - primitives for pkg handling 4 | * 5 | * Copyright © 2009,2011-2012 Guillem Jover 6 | * 7 | * This is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef LIBDPKG_PKG_H 22 | #define LIBDPKG_PKG_H 23 | 24 | #include 25 | #include 26 | 27 | DPKG_BEGIN_DECLS 28 | 29 | /** 30 | * @defgroup pkg Package handling primitives 31 | * @ingroup dpkg-public 32 | * @{ 33 | */ 34 | 35 | typedef int pkg_sorter_func(const void *a, const void *b); 36 | 37 | void pkgset_link_pkg(struct pkgset *set, struct pkginfo *pkg); 38 | 39 | void pkg_set_status(struct pkginfo *pkg, enum pkgstatus status); 40 | void pkg_set_eflags(struct pkginfo *pkg, enum pkgeflag eflag); 41 | void pkg_clear_eflags(struct pkginfo *pkg, enum pkgeflag eflag); 42 | void pkg_reset_eflags(struct pkginfo *pkg); 43 | void pkg_copy_eflags(struct pkginfo *pkg_dst, struct pkginfo *pkg_src); 44 | void pkg_set_want(struct pkginfo *pkg, enum pkgwant want); 45 | 46 | /** @} */ 47 | 48 | DPKG_END_DECLS 49 | 50 | #endif /* LIBDPKG_PKG_H */ 51 | --------------------------------------------------------------------------------