udpkg-1.16/0000755000000000000000000000000012170211312007427 5ustar udpkg-1.16/makefile.in0000644000000000000000000000145712145213761011557 0ustar DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) CC=@CC@ CFLAGS=@CFLAGS@ -D_GNU_SOURCE -DADMINDIR=\"@ADMINDIR@\" -DARCH_TEXT='"$(DEB_HOST_ARCH)"' -DOS_TEXT='"$(DEB_HOST_ARCH_OS)"' OBJS=$(subst .c,.o,$(wildcard *.c)) BIN=udpkg BUSYBOX=@BUSYBOXDIR@ LIBS=-ldebian-installer STRIP=@STRIP@ ifdef DEBUG CFLAGS:=$(CFLAGS) -DDODEBUG endif all: $(BIN) # Size optimized and stripped binary target. small: CFLAGS += -Os -fomit-frame-pointer small: clean $(BIN) $(STRIP) --remove-section=.comment --remove-section=.note $(BIN) ls -l $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) $(LIBS) clean: -rm -f $(BIN) $(OBJS) *~ distclean: clean -rm -f config.status config.log config.cache makefile config.h -rm -rf autom4te.cache *.o: udpkg.h udpkg-1.16/status.c0000644000000000000000000002307012170211312011120 0ustar #include "udpkg.h" #include #include #include #include #include /* Status file handling routines * * This is a fairly minimalistic implementation. there are two main functions * that are supported: * * 1) reading the entire status file: * the status file is read into memory as a binary-tree, with just the * package and status info preserved * * 2) merging the status file * control info from (new) packages is merged into the status file, * replacing any pre-existing entries. when a merge happens, status info * read using the status_read function is written back to the status file */ static const char *statuswords[][10] = { { (char *)STATUS_WANTSTART, "unknown", "install", "hold", "deinstall", "purge", 0 }, { (char *)STATUS_FLAGSTART, "ok", "reinstreq", "hold", "hold-reinstreq", 0 }, { (char *)STATUS_STATUSSTART, "not-installed", "unpacked", "half-configured", "installed", "half-installed", "config-files", "post-inst-failed", "removal-failed", 0 } }; int package_compare(const void *p1, const void *p2) { return strcmp(((struct package_t *)p1)->package, ((struct package_t *)p2)->package); } static unsigned long status_parse(const char *line) { char *p; int i, j; unsigned long l = 0; for (i = 0; i < 3; i++) { p = strchr(line, ' '); if (p) *p = 0; j = 1; while (statuswords[i][j] != 0) { if (strcmp(line, statuswords[i][j]) == 0) { l |= (1 << ((long)statuswords[i][0] + j - 1)); break; } j++; } if (statuswords[i][j] == 0) return 0; /* parse error */ line = p+1; } return l; } static const char *status_print(unsigned long flags) { /* this function returns a static buffer... */ static char buf[256]; int i, j; buf[0] = 0; for (i = 0; i < 3; i++) { j = 1; while (statuswords[i][j] != 0) { if ((flags & (1 << ((long)statuswords[i][0] + j - 1))) != 0) { strcat(buf, statuswords[i][j]); if (i < 2) strcat(buf, " "); break; } j++; } if (statuswords[i][j] == 0) { fprintf(stderr, "corrupted status flag!!: %lx\n",flags); return NULL; } } return buf; } static char *read_block(FILE *f) { char ch; char *multiple_lines = strdup(""); size_t len = 0; char buf[BUFSIZE]; while (((ch = fgetc(f)) == ' ') && !feof(f)) { size_t buflen; if (fgets(buf, BUFSIZE, f) == NULL) { if (ferror(f)) perror("fgets"); break; } buflen = strlen(buf); multiple_lines = (char *) di_realloc(multiple_lines, len + buflen + 2); memset(multiple_lines + len, '\0', buflen + 2); strcat(multiple_lines, " "); strcat(multiple_lines, buf); len += buflen + 1; } ungetc(ch, f); return multiple_lines; } /* * Read a control file (or a stanza of a status file) and parse it, * filling parsed fields into the package structure */ void control_read(FILE *f, struct package_t *p) { char buf[BUFSIZE]; while (fgets(buf, BUFSIZE, f) && !feof(f)) { buf[strlen(buf)-1] = 0; if (*buf == 0) return; /* these are common to both installed and uninstalled packages */ else if (strstr(buf, "Package: ") == buf) { p->package = strdup(buf+9); } else if (strstr(buf, "Status: ") == buf) { p->status = status_parse(buf+8); } else if (strstr(buf, "Depends: ") == buf) { p->depends = strdup(buf+9); } else if (strstr(buf, "Provides: ") == buf) { p->provides = strdup(buf+10); } else if (strstr(buf, "Description: ") == buf) { p->description = strdup(buf+13); p->long_description = read_block(f); } #ifdef SUPPORTL10N else if (strstr(buf, "description-") == buf) { /* Localized description */ struct language_description_t *l; l = di_malloc(sizeof(struct language_description_t)); memset(l,'\0',sizeof (struct language_description_t)); l->next = p->localized_descriptions; p->localized_descriptions = l; buf[14] = '\0'; l->language = strdup(buf+12); l->description = strdup(buf+16); l->long_description = read_block(f); } #endif /* This is specific to the Debian Installer. Ifdef? */ else if (strcasestr(buf, "Installer-Menu-Item: ") == buf) { p->installer_menu_item = atoi(buf+21); } else if (strcasestr(buf, "Priority: ") == buf) { p->priority = strdup(buf + 10); } else if (strcasestr(buf, "Section: ") == buf) { p->section = strdup(buf + 9); } else if (strcasestr(buf, "Installed-Size: ") == buf) { p->installed_size = strdup(buf + 16); } else if (strcasestr(buf, "Maintainer: ") == buf) { p->maintainer = strdup(buf + 12); } else if (strcasestr(buf, "Version: ") == buf) { p->version = strdup(buf + 9); } else if (strcasestr(buf, "Suggests: ") == buf) { p->suggests = strdup(buf + 10); } else if (strcasestr(buf, "Recommends: ") == buf) { p->recommends = strdup(buf + 12); } else if (strcasestr(buf, "Conffiles: ") == buf) { p->conffiles = read_block(f); } } } void *status_read(void) { FILE *f; void *status = 0; struct package_t *m = 0, *p = 0, *t = 0; if ((f = fopen(STATUSFILE, "r")) == NULL) { perror(STATUSFILE); return 0; } if (getenv(UDPKG_QUIET) == NULL) printf("(Reading database...)\n"); while (!feof(f)) { m = (struct package_t *)di_malloc(sizeof(struct package_t)); memset(m, 0, sizeof(struct package_t)); control_read(f, m); if (m->package) { /* * If there is an item in the tree by this name, * it must be a virtual package; insert real * package in preference. */ tdelete(m, &status, package_compare); tsearch(m, &status, package_compare); if (m->provides) { /* * A "Provides" triggers the insertion * of a pseudo package into the status * binary-tree. */ p = (struct package_t *)di_malloc(sizeof(struct package_t)); memset(p, 0, sizeof(struct package_t)); p->package = strdup(m->provides); t = *(struct package_t **)tsearch(p, &status, package_compare); if (!(t == p)) { di_free(p->package); di_free(p); } else { /* * Pseudo package status is the * same as the status of the * package providing it * FIXME: (not quite right, if 2 * packages of different statuses * provide it). */ t->status = m->status; } } } else { di_free(m); } } fclose(f); return status; } int status_merge(void *status, struct package_t *pkgs) { FILE *fin, *fout; char buf[BUFSIZE]; struct package_t *pkg = 0, *statpkg = 0; struct package_t locpkg; int r = 0; if ((fin = fopen(STATUSFILE, "r")) == NULL) { perror(STATUSFILE); return 0; } if ((fout = fopen(STATUSFILE ".new", "w")) == NULL) { perror(STATUSFILE ".new"); return 0; } if (getenv(UDPKG_QUIET) == NULL) printf("(Updating database...)\n"); while (fgets(buf, BUFSIZE, fin) && !feof(fin)) { buf[strlen(buf)-1] = 0; /* trim newline */ /* If we see a package header, find out if it's a package * that we have processed. if so, we skip that block for * now (write it at the end). * * we also look at packages in the status cache and update * their status fields */ if (strstr(buf, "Package: ") == buf) { for (pkg = pkgs; pkg != 0 && strcmp(buf+9, pkg->package)!=0; pkg = pkg->next) ; locpkg.package = buf+9; statpkg = tfind(&locpkg, &status, package_compare); /* note: statpkg should be non-zero, unless the status * file was changed while we are processing (no locking * is currently done... */ if (statpkg != 0) statpkg = *(struct package_t **)statpkg; } if (pkg != 0) continue; if (strstr(buf, "Status: ") == buf && statpkg != 0) { snprintf(buf, sizeof(buf), "Status: %s", status_print(statpkg->status)); } fputs(buf, fout); fputc('\n', fout); } // Print out packages we processed. for (pkg = pkgs; pkg != 0; pkg = pkg->next) { fprintf(fout, "Package: %s\nStatus: %s\n", pkg->package, status_print(pkg->status)); if (pkg->priority) fprintf(fout, "Priority: %s\n", pkg->priority); if (pkg->section) fprintf(fout, "Section: %s\n", pkg->section); if (pkg->priority) fprintf(fout, "Installed-Size: %s\n", pkg->installed_size); if (pkg->maintainer) fprintf(fout, "Maintainer: %s\n", pkg->maintainer); if (pkg->source) fprintf(fout, "Source: %s\n", pkg->source); if (pkg->version) fprintf(fout, "Version: %s\n", pkg->version); if (pkg->pre_depends) fprintf(fout, "Pre-Depends: %s\n", pkg->pre_depends); if (pkg->depends) fprintf(fout, "Depends: %s\n", pkg->depends); if (pkg->replaces) fprintf(fout, "Replaces: %s\n", pkg->replaces); if (pkg->recommends) fprintf(fout, "Recommends: %s\n", pkg->recommends); if (pkg->suggests) fprintf(fout, "Suggests: %s\n", pkg->suggests); if (pkg->provides) fprintf(fout, "Provides: %s\n", pkg->provides); if (pkg->conflicts) fprintf(fout, "Conflicts: %s\n", pkg->conflicts); if (pkg->conffiles) fprintf(fout, "Conffiles:\n %s\n", pkg->conffiles); if (pkg->description) fprintf(fout, "Description: %s\n%s", pkg->description, pkg->long_description); #ifdef SUPPORTL10N if (pkg->localized_descriptions) { struct language_description_t *ld; ld = pkg->localized_descriptions; while (ld) { if (ld->language && ld->description && ld->long_description) { fprintf(fout, "description-%s: %s\n%s", ld->language, ld->description, ld->long_description); } ld = ld->next; } } #endif if (pkg->installer_menu_item) fprintf(fout, "Installer-Menu-Item: %i\n", pkg->installer_menu_item); fputc('\n', fout); } fclose(fin); fclose(fout); r = rename(STATUSFILE, STATUSFILE ".bak"); if (r == 0) r = rename(STATUSFILE ".new", STATUSFILE); return 0; } udpkg-1.16/configure.ac0000644000000000000000000000545012145213761011735 0ustar dnl Process this file with autoconf to produce a configure script. dnl The ONLY thing this is used for is to configure for different dnl linux architectures and configurations, it is not used to make the dnl code more portable AC_INIT([udpkg], m4_esyscmd(dpkg-parsechangelog | perl -ne 'print $1 if m/^Version: (.*)$/;')) AC_CONFIG_SRCDIR([udpkg.c]) CFLAGS="$CFLAGS -Wall -Wwrite-strings -Wmissing-prototypes" AC_CONFIG_AUX_DIR(.) AC_CONFIG_HEADER(config.h:config.h.in) AC_CANONICAL_HOST dnl dh_auto_configure may pass these options, used by some automake macros. dnl Ignore them. AC_ARG_ENABLE([maintainer-mode], []) AC_ARG_ENABLE([dependency-tracking], []) dnl Checks for programs. AC_PROG_CC AC_ISC_POSIX AC_PATH_TOOL([STRIP], [strip]) dnl Checks for libraries. dnl Enable debugging? AC_ARG_WITH(debug,[ --without-debug turn off debugging?]) if test "$with_debug" != "no"; then AC_DEFINE([DODEBUG], [], [Should we do debugging?]) CFLAGS="$CFLAGS -g" fi dnl Do dependency checking? AC_ARG_WITH(depends,[ --without-depends do not do dependency checking]) if test "$with_depends" != "no"; then AC_DEFINE([DODEPENDS], [], [Should we do full dependency checking?]) fi dnl Load templates? AC_ARG_WITH(loadtemplate,[ --without-loadtemplate do not call debconf-loadtemplate]) if test "$with_loadtemplate" != "no"; then AC_DEFINE([DOLOADTEMPLATE], [], [Should we call debconf-loadtemplate?]) fi dnl Support localized status files? AC_ARG_WITH(l10n,[ --without-l10n do not support localized status files]) if test "$with_l10n" != "no"; then AC_DEFINE([SUPPORTL10N], [], [Support l10n?]) fi dnl Do we need --remove support? AC_ARG_WITH(remove,[ --without-remove do not support the --remove flag]) if test "$with_remove" != "no"; then AC_DEFINE([DOREMOVE], [], [Should we support the --remove flag?]) fi dnl dpkg library directory ADMINDIR="/var/lib/dpkg" AC_ARG_WITH(admindir,[ --with-admindir=DIR store dpkg data in DIR [/var/lib/dpkg]], [case "$withval" in "") AC_MSG_ERROR(invalid admindir specified) ;; *) ADMINDIR="$withval" ;; esac]) AC_SUBST(ADMINDIR) dnl use busybox? AC_ARG_WITH(busybox,[ --with-busybox=DIR link with busybox in DIR [/usr/src/busybox]]) if test -n "$with_busybox"; then BUSYBOXDIR="/usr/src/busybox" if test "$with_busybox" != "yes"; then BUSYBOXDIR="$with_busybox" fi AC_MSG_CHECKING(for busybox in $BUSYBOXDIR) if test -f "$BUSYBOXDIR/busybox.def.h"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) exit 1 fi fi AC_SUBST(BUSYBOXDIR) dnl Checks for header files. AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h string.h sys/time.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_HEADER_TIME dnl Checks for library functions. AC_TYPE_SIGNAL AC_OUTPUT(makefile:makefile.in) udpkg-1.16/DESIGN0000644000000000000000000000217411515471401010340 0ustar udpkg is a much-trimmed down version of the Debian package manager. The goal is to implement a small subset of dpkg's functionality sufficient to bootstrap a newly installed system. Assumptions: * udpkg needs to provide support for the following operation modes of dpkg: -i: install package(s) -r: remove package(s) --unpack: unpack packages --configure: configure packages * Full dependency checking is not supported. In particular, udpkg does not support: - Pre-depends - Versioned depends - Alternate depends (udpkg forces the first one to be used) - Versioned provides (not currently in policy) - Conflicts and replaces Simple dependencies on either a real package or a virtual package is supported. * udpkg must be able to recognize and update the status file based on packages being installed or removed * dependency checking can be turned off completely at compile time to save space * udpkg depends on the availability of external tools; in particular, ar, tar, zcat and the existence of /bin/sh. (TODO: optionally link in busybox versions of these routines instead of running them from the shell) udpkg-1.16/install-sh0000755000000000000000000001124411515471401011446 0ustar #! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" tranformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 udpkg-1.16/autogen.sh0000755000000000000000000000011211515471401011433 0ustar #!/bin/sh autoreconf -i -v # not needed in tarball rm -r autom4te.cache udpkg-1.16/depends.c0000644000000000000000000001002111515471401011220 0ustar #include "udpkg.h" #ifdef DODEPENDS #include #include #include #include #include static char **depends_split(const char *dependsstr) { static char *dependsvec[DEPENDSMAX]; char *p; int i = 0; dependsvec[0] = 0; if (dependsstr != 0) { p = strdup(dependsstr); while (*p != 0 && *p != '\n') { if (*p != ' ') { if (*p == ',') { *p = 0; dependsvec[++i] = 0; } else if (dependsvec[i] == 0) dependsvec[i] = p; } else *p = 0; /* eat the space... */ p++; } *p = 0; } dependsvec[i+1] = 0; return dependsvec; } static void depends_sort_visit(struct package_t **ordered, struct package_t *pkgs, struct package_t *pkg) { /* Topological sort algorithm: * ordered is the output list, pkgs is the dependency graph, pkg is * the current node * * recursively add all the adjacent nodes to the ordered list, marking * each one as visited along the way * * yes, this algorithm looks a bit odd when all the params have the * same type :-) */ unsigned short i; /* mark node as processing */ pkg->color = COLOR_GRAY; /* visit each not-yet-visited node */ for (i = 0; i < pkg->requiredcount; i++) if (pkg->requiredfor[i]->color == COLOR_WHITE) depends_sort_visit(ordered, pkgs, pkg->requiredfor[i]); #if 0 /* add it to the list */ newnode = (struct package_t *)di_malloc(sizeof(struct package_t)); /* make a shallow copy */ *newnode = *pkg; newnode->next = *ordered; *ordered = newnode; #endif pkg->next = *ordered; *ordered = pkg; /* mark node as done */ pkg->color = COLOR_BLACK; } static struct package_t *depends_sort(struct package_t *pkgs) { /* TODO: it needs to break cycles in the to-be-installed package * graph... */ struct package_t *ordered = NULL; struct package_t *pkg; for (pkg = pkgs; pkg != 0; pkg = pkg->next) pkg->color = COLOR_WHITE; for (pkg = pkgs; pkg != 0; pkg = pkg->next) if (pkg->color == COLOR_WHITE) depends_sort_visit(&ordered, pkgs, pkg); /* Leaks the old list... return the new one... */ return ordered; } /* resolve package dependencies -- * for each package in the list of packages to be installed, we parse its * dependency info to determine if the dependent packages are either * already installed, or are scheduled to be installed. If both tests fail * than bail. * * The algorithm here is O(n^2*m) where n = number of packages to be * installed and m is the # of dependencies per package. Not a terribly * efficient algorithm, but given that at any one time you are unlikely * to install a very large number of packages it doesn't really matter */ struct package_t *depends_resolve(struct package_t *pkgs, void *status) { struct package_t *pkg, *chk; struct package_t dependpkg; char **dependsvec; int i; void *found; for (pkg = pkgs; pkg != 0; pkg = pkg->next) { dependsvec = depends_split(pkg->depends); i = 0; while (dependsvec[i] != 0) { /* Check for dependencies; first look for installed packages */ dependpkg.package = dependsvec[i]; if ((found = tfind(&dependpkg, &status, package_compare)) == 0 || ((chk = *(struct package_t **)found) && (chk->status & (STATUS_FLAGOK | STATUS_STATUSINSTALLED)) != (STATUS_FLAGOK | STATUS_STATUSINSTALLED))) { /* if it fails, we look through the list of packages we are going to * install */ for (chk = pkgs; chk != 0; chk = chk->next) { if (strcmp(chk->package, dependsvec[i]) == 0 || (chk->provides && strncmp(chk->provides, dependsvec[i], strlen(dependsvec[i])) == 0)) { if (chk->requiredcount >= DEPENDSMAX) { fprintf(stderr, "Too many dependencies for %s\n", chk->package); return 0; } if (chk != pkg) chk->requiredfor[chk->requiredcount++] = pkg; break; } } if (chk == 0) { fprintf(stderr, "%s depends on %s, but it is not going to be installed\n", pkg->package, dependsvec[i]); return 0; } } i++; } } return depends_sort(pkgs); } #endif udpkg-1.16/udpkg.h0000644000000000000000000000577611515471401010742 0ustar #ifndef _UDPKG_H_ #define _UDPKG_H_ #include #include "config.h" #ifdef DODEBUG #include #define ASSERT(x) assert(x) #define DPRINTF(fmt,args...) fprintf(stderr, fmt, ##args) #else #define ASSERT(x) /* nothing */ #define DPRINTF(fmt,args...) /* nothing */ #endif #define PRINTF(fmt,args...) if (getenv(UDPKG_QUIET) == NULL) printf(fmt, ##args) #define FPRINTF(str,fmt,args...) if (getenv(UDPKG_QUIET) == NULL) fprintf(str, fmt, ##args) #define BUFSIZE 4096 #define STATUSFILE ADMINDIR "/status" #define DPKGCIDIR ADMINDIR "/tmp.ci/" #define INFODIR ADMINDIR "/info/" #define UDPKG_QUIET "UDPKG_QUIET" #define DEPENDSMAX 64 /* maximum number of depends we can handle */ #define STATUS_WANTSTART (0) #define STATUS_WANTUNKNOWN (1 << 0) #define STATUS_WANTINSTALL (1 << 1) #define STATUS_WANTHOLD (1 << 2) #define STATUS_WANTDEINSTALL (1 << 3) #define STATUS_WANTPURGE (1 << 4) #define STATUS_WANTMASK ~(STATUS_WANTUNKNOWN | STATUS_WANTINSTALL | STATUS_WANTHOLD | STATUS_WANTDEINSTALL | STATUS_WANTPURGE) #define STATUS_FLAGSTART (5) #define STATUS_FLAGOK (1 << 5) #define STATUS_FLAGREINSTREQ (1 << 6) #define STATUS_FLAGHOLD (1 << 7) #define STATUS_FLAGHOLDREINSTREQ (1 << 8) #define STATUS_FLAGMASK ~(STATUS_FLAGOK | STATUS_FLAGREINSTREQ | STATUS_FLAGHOLD | STATUS_FLAGHOLDREINSTREQ) #define STATUS_STATUSSTART (9) #define STATUS_STATUSNOTINSTALLED (1 << 9) #define STATUS_STATUSUNPACKED (1 << 10) #define STATUS_STATUSHALFCONFIGURED (1 << 11) #define STATUS_STATUSINSTALLED (1 << 12) #define STATUS_STATUSHALFINSTALLED (1 << 13) #define STATUS_STATUSCONFIGFILES (1 << 14) #define STATUS_STATUSPOSTINSTFAILED (1 << 15) #define STATUS_STATUSREMOVALFAILED (1 << 16) #define STATUS_STATUSMASK ~(STATUS_STATUSNOTINSTALLED | STATUS_STATUSUNPACKED | STATUS_STATUSHALFCONFIGURED | STATUS_STATUSINSTALLED | STATUS_STATUSCONFIGFILES | STATUS_STATUSPOSTINSTFAILED | STATUS_STATUSREMOVALFAILED | STATUS_STATUSHALFINSTALLED) #define COLOR_WHITE 0 #define COLOR_GRAY 1 #define COLOR_BLACK 2 /* data structures */ struct language_description_t { char *language; char *description; char *long_description; struct language_description_t *next; }; struct package_t { char *file; char *package; unsigned long status; char *priority; char *section; char *installed_size; char *maintainer; char *source; char *version; char *pre_depends; char *depends; char *replaces; char *recommends; char *suggests; char *provides; char *conflicts; char *conffiles; char *description; char *long_description; int installer_menu_item; char color; /* for topo-sort */ struct package_t *requiredfor[DEPENDSMAX]; unsigned short requiredcount; struct language_description_t *localized_descriptions; struct package_t *next; }; /* function prototypes */ void *status_read(void); void control_read(FILE *f, struct package_t *p); int status_merge(void *status, struct package_t *pkgs); int package_compare(const void *p1, const void *p2); struct package_t *depends_resolve(struct package_t *pkgs, void *status); #endif udpkg-1.16/udpkg.c0000644000000000000000000003705512170211312010717 0ustar #include "udpkg.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int force_configure = 0; static int loadtemplate = 1; static const char *data_member_base = "data.tar."; /* * Main udpkg implementation routines */ static char *xasprintf(const char *format, ...) { va_list args; char *result; va_start(args, format); if (vasprintf(&result, format, args) < 0) { if (errno == ENOMEM) { fputs("Out of memory!\n", stderr); abort(); } return NULL; } return result; } static int is_file(const char *fn) { struct stat statbuf; if (stat(fn, &statbuf) < 0) return 0; return S_ISREG(statbuf.st_mode); } static int dpkg_print_architecture() { puts(ARCH_TEXT); return 0; } static int dpkg_print_os() { puts(OS_TEXT); return 0; } static int dpkg_copyfile(const char *src, const char *dest) { /* copy a (regular) file if it exists, preserving the mode, mtime * and atime */ char buf[8192]; int infd, outfd; int r; struct stat srcStat; struct utimbuf times; if (stat(src, &srcStat) < 0) { if (errno == ENOENT) return 0; else return -1; } if ((infd = open(src, O_RDONLY)) < 0) return -1; if ((outfd = open(dest, O_WRONLY|O_CREAT|O_TRUNC, srcStat.st_mode)) < 0) return -1; while ((r = read(infd, buf, sizeof(buf))) > 0) { if (write(outfd, buf, r) < 0) return -1; } close(outfd); close(infd); if (r < 0) return -1; times.actime = srcStat.st_atime; times.modtime = srcStat.st_mtime; if (utime(dest, ×) < 0) return -1; return 1; } static int dpkg_doconfigure(struct package_t *pkg) { int r; char postinst[1024]; char config[1024]; char buf[1024]; DPRINTF("Configuring %s [force=%d]\n", pkg->package, force_configure); if ((pkg->status & STATUS_STATUSINSTALLED) != 0 && !force_configure) { PRINTF("Package %s is already installed and configured\n", pkg->package); return 1; } pkg->status &= STATUS_STATUSMASK; snprintf(config, sizeof(config), "%s%s.config", INFODIR, pkg->package); if (is_file(config)) { snprintf(buf, sizeof(buf), "exec %s configure", config); if ((r = di_exec_shell_log(buf)) != 0) { FPRINTF(stderr, "config exited with status %d\n", r); pkg->status |= STATUS_STATUSHALFCONFIGURED; return 1; } } snprintf(postinst, sizeof(postinst), "%s%s.postinst", INFODIR, pkg->package); if (is_file(postinst)) { snprintf(buf, sizeof(buf), "exec %s configure", postinst); if ((r = di_exec_shell_log(buf)) != 0) { FPRINTF(stderr, "%s's postinst exited with status %d\n", pkg->package, di_exec_mangle_status(r)); pkg->status |= STATUS_STATUSHALFCONFIGURED; return di_exec_mangle_status(r); } } pkg->status |= STATUS_STATUSINSTALLED; return 0; } typedef enum compression_type compression_type; enum compression_type { gz_compression, xz_compression, unknown_compression, }; static const char *compression_extension (const compression_type t) { switch (t) { case gz_compression: return "gz"; case xz_compression: return "xz"; default: return ""; } } static const char *decompression_tool (const compression_type t) { switch (t) { case gz_compression: return "gunzip"; case xz_compression: return "unxz"; default: return ""; } } static compression_type get_compression_type (struct package_t *pkg) { FILE *infp = NULL; char buf[1024]; char *extension = NULL; snprintf(buf, sizeof(buf), "ar -t %s", pkg->file); if ((infp = popen(buf, "r")) == NULL) { FPRINTF(stderr, "Cannot retrieve archive members of %s: %s\n", pkg->file, strerror(errno)); return unknown_compression; } while (fgets(buf, sizeof(buf), infp)) { if (strncmp(buf, data_member_base, strlen(data_member_base)) == 0) { extension = buf + strlen(data_member_base); if (extension[strlen(extension) - 1] == '\n') extension[strlen(extension) - 1] = '\0'; break; } } pclose(infp); if (extension == NULL) { FPRINTF(stderr, "No %s* found in %s\n", data_member_base, pkg->file); return unknown_compression; } if (strcmp(extension, compression_extension(gz_compression)) == 0) { return gz_compression; } else if (strcmp(extension, compression_extension(xz_compression)) == 0) { return xz_compression; } else { FPRINTF(stderr, "Invalid compression type for %s* of %s\n", data_member_base, pkg->file); return unknown_compression; } } static int dpkg_dounpack(struct package_t *pkg) { int r = 0; char *cwd; char buf[1024], buf2[1024]; unsigned int i; const char *adminscripts[] = { "prerm", "postrm", "preinst", "postinst", "conffiles", "md5sums", "shlibs", "templates", "menutest", "isinstallable", "config" }; #ifdef DOREMOVE char *p; FILE *outfp = NULL; FILE *infp = NULL; #endif compression_type compression_type; DPRINTF("Unpacking %s\n", pkg->package); compression_type = get_compression_type(pkg); if (compression_type == unknown_compression) return 1; cwd = getcwd(0, 0); if (chdir("/") != 0) { FPRINTF(stderr, "chdir /: %s\n", strerror(errno)); return 1; } snprintf(buf, sizeof(buf), "ar -p %s %s%s|%s -c|tar -x", pkg->file, data_member_base, compression_extension(compression_type), decompression_tool(compression_type)); if ((r = di_exec_shell_log(buf)) == 0) { /* Installs the package scripts into the info directory */ for (i = 0; i < sizeof(adminscripts) / sizeof(adminscripts[0]); i++) { int ret; snprintf(buf, sizeof(buf), "%s%s/%s", DPKGCIDIR, pkg->package, adminscripts[i]); snprintf(buf2, sizeof(buf), "%s%s.%s", INFODIR, pkg->package, adminscripts[i]); ret = dpkg_copyfile(buf, buf2); if (ret < 0) { FPRINTF(stderr, "Cannot copy %s to %s: %s\n", buf, buf2, strerror(errno)); r = 1; break; } else if (ret > 0) { #ifdef DOLOADTEMPLATE /* Is this the templates file? If * so, call debconf-loadtemplate on it */ if (loadtemplate && strcmp(adminscripts[i], "templates") == 0) { /* Possibly reduce templates prior * to loading. Done on lowmem * installs. */ snprintf(buf, sizeof(buf), "trimtemplates %s", buf2); di_exec_shell_log(buf); snprintf(buf, sizeof(buf), "debconf-loadtemplate %s %s", pkg->package, buf2); if ((r = di_exec_shell_log(buf)) != 0) FPRINTF(stderr, "debconf-loadtemplate " "exited with status " "%d\n", r); /* Delete templates after loading. */ unlink(buf2); } #endif } } // Only generate .list files when we need --remove support #ifdef DOREMOVE /* ugly hack to create the list file; should * probably do something more elegant * * why oh why does dpkg create the list file * so oddly... */ snprintf(buf, sizeof(buf), "ar -p %s %s%s|%s -c|tar -t", pkg->file, data_member_base, compression_extension(compression_type), decompression_tool(compression_type)); snprintf(buf2, sizeof(buf2), "%s%s.list", INFODIR, pkg->package); if ((infp = popen(buf, "r")) == NULL || (outfp = fopen(buf2, "w")) == NULL) { FPRINTF(stderr, "Cannot create %s\n", buf2); r = 1; } else while (fgets(buf, sizeof(buf), infp) && !feof(infp)) { p = buf; if (*p == '.') p++; if (*p == '/' && *(p+1) == '\n') { *(p+1) = '.'; *(p+2) = '\n'; *(p+3) = 0; } if (p[strlen(p)-2] == '/') { p[strlen(p)-2] = '\n'; p[strlen(p)-1] = 0; } fputs(p, outfp); } pclose(infp); fclose(outfp); #endif pkg->status &= STATUS_WANTMASK; pkg->status |= STATUS_WANTINSTALL; pkg->status &= STATUS_FLAGMASK; pkg->status |= STATUS_FLAGOK; pkg->status &= STATUS_STATUSMASK; if (r == 0) pkg->status |= STATUS_STATUSUNPACKED; else pkg->status |= STATUS_STATUSHALFINSTALLED; } else FPRINTF(stderr, "%s exited with status %d\n", buf, r); if (chdir(cwd) != 0) { FPRINTF(stderr, "chdir %s: %s\n", cwd, strerror(errno)); return 1; } return r; } static int dpkg_doinstall(struct package_t *pkg) { DPRINTF("Installing %s\n", pkg->package); return (dpkg_dounpack(pkg) || dpkg_doconfigure(pkg)); } static int dpkg_unpackcontrol(struct package_t *pkg) { int r; char *cwd = 0; char *p; char buf[1024], buf2[1024]; FILE *f; p = strrchr(pkg->file, '/'); if (p) p++; else p = pkg->file; p = pkg->package = strdup(p); while (*p != 0 && *p != '_' && *p != '.') p++; *p = 0; p = pkg->package; cwd = getcwd(0, 0); snprintf(buf, sizeof(buf), "%s%s", DPKGCIDIR, pkg->package); DPRINTF("dir = %s\n", buf); if (mkdir(buf, S_IRWXU) != 0) { FPRINTF(stderr, "mkdir %s: %s\n", buf, strerror(errno)); return 1; } if (chdir(buf) != 0) { FPRINTF(stderr, "chdir %s: %s\n", buf, strerror(errno)); return 1; } snprintf(buf, sizeof(buf), "ar -p %s control.tar.gz|tar -xzf -", pkg->file); if ((r = di_exec_shell_log(buf)) != 0) { FPRINTF(stderr, "%s exited with status %d\n", buf, r); return r; } if ((f = fopen("control", "r")) == NULL) { FPRINTF(stderr, "fopen control: %s\n", strerror(errno)); return 1; } control_read(f, pkg); if (strcmp(pkg->package, p) != 0) { snprintf(buf, sizeof(buf), "%s%s", DPKGCIDIR, p); snprintf(buf2, sizeof(buf2), "%s%s", DPKGCIDIR, pkg->package); if (rename(buf, buf2) != 0) { FPRINTF(stderr, "rename %s %s: %s\n", buf, buf2, strerror(errno)); return 1; } } free(p); if (chdir(cwd) != 0) { FPRINTF(stderr, "chdir %s: %s\n", cwd, strerror(errno)); return 1; } free(cwd); return 0; } static int dpkg_unpack(struct package_t *pkgs) { int r = 0; struct package_t *pkg; void *status = status_read(); if (di_exec_shell_log("rm -rf -- " DPKGCIDIR) != 0 || mkdir(DPKGCIDIR, S_IRWXU) != 0) { perror("mkdir"); return 1; } for (pkg = pkgs; pkg != 0; pkg = pkg->next) { dpkg_unpackcontrol(pkg); r = dpkg_dounpack(pkg); if (r != 0) break; } status_merge(status, pkgs); if (di_exec_shell_log("rm -rf -- " DPKGCIDIR) != 0) r = 1; return r; } static int dpkg_configure(struct package_t *pkgs) { int r = 0; void *found; struct package_t *pkg; void *status = status_read(); for (pkg = pkgs; pkg != 0 && r == 0; pkg = pkg->next) { found = tfind(pkg, &status, package_compare); if (found == 0) { FPRINTF(stderr, "Trying to configure %s, but it is not installed\n", pkg->package); r = 1; } else { /* configure the package listed in the status file; * not pkg, as we have info only for the latter */ r = dpkg_doconfigure(*(struct package_t **)found); } } status_merge(status, 0); return r; } static int dpkg_install(struct package_t *pkgs) { struct package_t *p, *ordered = 0; void *status = status_read(); if (di_exec_shell_log("rm -rf -- " DPKGCIDIR) != 0 || mkdir(DPKGCIDIR, S_IRWXU) != 0) { perror("mkdir"); return 1; } /* Stage 1: parse all the control information */ for (p = pkgs; p != 0; p = p->next) if (dpkg_unpackcontrol(p) != 0) { /* force loop break, and prevents further ops */ pkgs = 0; } /* Stage 2: resolve dependencies */ #ifdef DODEPENDS ordered = depends_resolve(pkgs, status); #else ordered = pkgs; #endif /* Stage 3: install */ for (p = ordered; p != 0; p = p->next) { p->status &= STATUS_WANTMASK; p->status |= STATUS_WANTINSTALL; /* for now the flag is always set to ok... this is probably * not what we want */ p->status &= STATUS_FLAGMASK; p->status |= STATUS_FLAGOK; /* don't worry about errors here; error messages are printed * internally */ dpkg_doinstall(p); } if (ordered != 0) status_merge(status, pkgs); return di_exec_shell_log("rm -rf -- " DPKGCIDIR); } static void reqarg (struct package_t *pkg) { if (pkg == NULL) { FPRINTF(stderr, "udpkg: Missing argument.\n"); exit(1); } } static int dpkg_fields(struct package_t *pkg) { char *command; int ret; reqarg(pkg); command = xasprintf("ar -p %s control.tar.gz|tar -xzOf - ./control", pkg->file); ret = system(command); free(command); return ret; } static int dpkg_contents(struct package_t *pkg) { char *command; int ret; compression_type compression_type; reqarg(pkg); compression_type = get_compression_type(pkg); if (compression_type == unknown_compression) return 1; command = xasprintf("ar -p %s %s%s|%s|tar t", pkg->file, data_member_base, compression_extension(compression_type), decompression_tool(compression_type)); ret = system(command); free(command); return ret; } static int dpkg_remove(struct package_t *pkgs) { #ifdef DOREMOVE int r=0; struct package_t *p; char buf[1024], buf2[1024]; FILE *fp; void *status = status_read(); for (p = pkgs; p != 0; p = p->next) { di_debug("Start removing package %s", p->package); snprintf(buf, sizeof(buf), "%s%s.list", INFODIR, p->package); if ((fp = fopen(buf, "r")) == NULL) { FPRINTF(stderr, "Cannot read %s\n", buf); r = 1; } else { while (fgets(buf, sizeof(buf), fp) && !feof(fp)) { /* we remove only files, not directories */ if (is_file(buf)) { snprintf(buf2, sizeof(buf2), "rm -f -- %s", buf); if (di_exec_shell_log(buf2) != 0) r = 1; di_debug("File %s removed",buf); } } } if (r == 0) { snprintf(buf, sizeof(buf), "rm -f -- %s%s.*", INFODIR, p->package); if (di_exec_shell_log(buf) != 0) r = 1; } p->status &= STATUS_WANTMASK; p->status |= STATUS_WANTDEINSTALL; p->status &= STATUS_FLAGMASK; p->status |= STATUS_FLAGOK; p->status &= STATUS_STATUSMASK; if (r == 0) p->status |= STATUS_STATUSNOTINSTALLED; else /* do not know which best status flag * should be used */ p->status |= STATUS_STATUSHALFINSTALLED; } status_merge(status, pkgs); return r; #else FPRINTF(stderr, "udpkg: No support for -r.\n"); return 1; (void)pkgs; /* avoid -W warning */ #endif } #ifdef UDPKG_MODULE int udpkg(int argc, char **argv) #else int main(int argc, char **argv) #endif { int opt = 0; struct package_t *p, *packages = NULL; char *cwd = getcwd(0, 0); char **origargv = argv; struct option longopts[] = { /* name, has_arg, flag, val */ { "unpack", 0, 0, 'u' }, { "configure", 0, 0, 'C' }, { "print-architecture", 0, 0, 'a' } , { "print-os", 0, 0, 'o' } , { "force-configure", 0, &force_configure, 1 }, { "no-loadtemplate", 0, &loadtemplate, 0 }, { 0, 0, 0, 0 }, }; while (*++argv) { if (**argv != '-') { p = (struct package_t *)di_malloc(sizeof(struct package_t)); memset(p, 0, sizeof(struct package_t)); if (**argv == '/') p->file = *argv; else p->file = xasprintf("%s/%s", cwd, *argv); p->package = strdup(*argv); p->next = packages; packages = p; } } /* let's do this in a silly way, the first pass lets us * set flags (e.g. --force-configure), whereas the second * will actually do stuff */ while (getopt_long(argc, origargv, "irfc", longopts, 0) >= 0) /* nothing */; optind = 1; while ((opt = getopt_long(argc, origargv, "irfc", longopts, 0)) >= 0) { switch (opt) { case 'i': return dpkg_install(packages); break; case 'r': return dpkg_remove(packages); break; case 'u': return dpkg_unpack(packages); break; case 'C': return dpkg_configure(packages); break; case 'a': return dpkg_print_architecture(); break; case 'o': return dpkg_print_os(); break; case 'f': return dpkg_fields(packages); break; case 'c': return dpkg_contents(packages); break; case 0: /* option, not action */; break; } } /* if it falls through to here, some of the command line options were wrong */ FPRINTF(stderr, "udpkg [--force-configure] <-i|-r|--unpack|--configure|--print-architecture|--print-os|-f|-c> my.deb\n"); return 0; } udpkg-1.16/TODO0000644000000000000000000000074011515471401010131 0ustar * fix bugs 1) Multiple packages are removed from status file. e.g. udpkg -r apt-move_4.1.13_i386.deb removes both apt and apt-move from the status file 2) udpkg -i apt-move doesnt add all the fields to the status file that dpkg does. 3) Improve error handling, when the disk is full at 'ar' and 'tar' fails. * Check to see which of the above are really bugs. This TODO file is quite old.. * Integrate any useful changes from the branches/packages/udpkg/devel branch. udpkg-1.16/debian/0000755000000000000000000000000012170502321010654 5ustar udpkg-1.16/debian/control0000644000000000000000000000103112170333065012261 0ustar Source: udpkg Section: debian-installer Priority: standard Maintainer: Debian Install System Team Uploaders: Bastian Blank , Christian Perrier Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.7.0), libdebian-installer4-dev (>= 0.41), dh-autoreconf Vcs-Browser: http://anonscm.debian.org/gitweb/?p=d-i/udpkg.git Vcs-Git: git://anonscm.debian.org/d-i/udpkg.git Package: udpkg Package-Type: udeb Architecture: any Depends: ${shlibs:Depends} Description: tiny dpkg clone udpkg-1.16/debian/copyright0000644000000000000000000000041411515471401012614 0ustar udpkg is initially written by Randolph Chung udpkg is copyrighted (c) 2000 by Randolph Chung under version 2 of the GNU Public License. The GNU Public License is available in /usr/share/common-licenses/GPL on any Debian system. udpkg-1.16/debian/dirs0000644000000000000000000000002211515471401011540 0ustar var/lib/dpkg/info udpkg-1.16/debian/source/0000755000000000000000000000000012170211312012151 5ustar udpkg-1.16/debian/source/format0000644000000000000000000000001512170211312013360 0ustar 3.0 (native) udpkg-1.16/debian/changelog0000644000000000000000000002624112170502222012533 0ustar udpkg (1.16) unstable; urgency=low [ Dmitrijs Ledkovs ] * Set debian source format to '3.0 (native)'. * Bump debhelper compat level to 9. * Set Vcs-* to canonical format. [ Colin Watson ] * Handle asprintf failures consistently. * Handle fgets failure in read_block. * Handle chdir failures consistently. [ Christian Perrier ] * Add myself to Uploaders -- Christian Perrier Sun, 14 Jul 2013 12:59:30 +0200 udpkg (1.15) unstable; urgency=low * Team upload [ Colin Watson ] * Use dh-autoreconf. * Find the correct path to strip at configure time. * Override dh_auto_configure a little more carefully so as not to break cross-building. * Avoid warning in dpkg_remove in a different way to avoid tripping -Wunused-but-set-parameter. * Ignore some automake-related configure options, silencing warnings from dh_auto_configure. -- Christian Perrier Thu, 16 May 2013 19:31:50 +0200 udpkg (1.14) unstable; urgency=low * Team upload * Replace XC-package-Type with Package-Type [ Joey Hess ] * Add -c mode to list the files contained in a deb. Unlike dpkg, this only lists the files, not other information. -- Christian Perrier Sat, 16 Jun 2012 07:20:48 +0200 udpkg (1.13) unstable; urgency=low * Implement support for udebs compressed with xz. -- Philipp Kern Wed, 23 Nov 2011 15:53:51 +0100 udpkg (1.12) unstable; urgency=low * Redesign read_block interface, fixing crashes caused by memory leak fix (closes: #318879). -- Colin Watson Thu, 04 Nov 2010 18:26:29 +0000 udpkg (1.11) unstable; urgency=low * Team upload * Use autoreconf at build time to avoid forgetting to run autogen.sh. Really Closes: #602134 Thanks to Mehdi Dogguy for helping. -- Christian Perrier Thu, 04 Nov 2010 08:12:51 +0100 udpkg (1.10) unstable; urgency=low * Team upload * Fix memory leak. Closes: #318879 * Rebuild after running autogen.sh. Closes: #602134 -- Christian Perrier Tue, 02 Nov 2010 19:45:51 +0100 udpkg (1.09) unstable; urgency=low [ Colin Watson ] * Upgrade to debhelper v7. [ Frans Pop ] * Remove no longer needed Lintian override for missing Standards- Version field. [ Otavio Salvador ] * Drop autoconf build-depends having the configure script being generated at upload time. [ Jeremie Koenig ] * udpkg.c: use ENOENT instead of 'errno == 2' for ignoring non-existing maintainer scripts. -- Otavio Salvador Mon, 01 Nov 2010 19:01:22 -0200 udpkg (1.08) unstable; urgency=low [ Frans Pop ] * Remove myself as uploader. [ Aurelien Jarno ] * Add --print-os option to output DEB_HOST_ARCH_OS. -- Aurelien Jarno Wed, 12 Aug 2009 17:21:11 +0200 udpkg (1.07) unstable; urgency=low [ Colin Watson ] * Remove HACKING and add configure to svn instead. -- Frans Pop Tue, 26 Aug 2008 10:03:35 +0200 udpkg (1.06) unstable; urgency=low * Add --no-loadtemplate option to suppress calling debconf-loadtemplate (like configuring --without-loadtemplate but selected at run-time). -- Colin Watson Tue, 26 Jun 2007 22:41:00 +0100 udpkg (1.05) unstable; urgency=low [ Colin Watson ] * Make current autoheader happier with configure.ac. * Fix compiler warning in status_print. * Rename configure --without-l18n option to --without-l10n, and fix the code so that l10n actually gets enabled when this option is not used. * Build the udeb --without-l10n, as apparently we were effectively doing that anyway and I can't think of anything in d-i that would actually use localised descriptions right now. * Make udpkg build cleanly with -Wwrite-strings and -Wmissing-prototypes. * Add a HACKING file. * Rationalise error handling to avoid some bogus perror calls with undefined errno. -- Frans Pop Mon, 21 May 2007 17:02:14 +0200 udpkg (1.04) unstable; urgency=low [ Sylvain Ferriol ] * add STATUS_STATUSINSTALLED to STATUS_STATUSMASK * add remove functionality (dpkg_remove function) [ Joey Hess ] * Rebuilt with current libd-i to fix udeb deps. -- Joey Hess Sat, 18 Mar 2006 15:30:43 -0500 udpkg (1.03) unstable; urgency=low [ Tollef Fog Heen ] * Handle packages with weird characters in the package name properly when unpacking the control files. This means packages like some-modules-2.6.12 can have postinsts, earlier they got lost. -- Tollef Fog Heen Tue, 25 Oct 2005 16:09:28 +0200 udpkg (1.02) unstable; urgency=low [ Colin Watson ] * Use memory allocation routines from libdebian-installer so that out-of-memory conditions are detected. [ Petter Reinholdtsen ] * Remove myself as uploaders. Leaving this package to others in the debian-boot team. [ Frans Pop ] * Also accept "Installer-Menu-Item" in control files; needed as a result of #306474. * Add myself to uploaders. [ Joey Hess ] * Use case insensitive comparisons when finding status fields. -- Frans Pop Sun, 4 Sep 2005 23:25:15 +0200 udpkg (1.01) unstable; urgency=low [ Joey Hess ] * -fomit-frame-pointer saves some space. * Add myself to uploaders. * Remove useless extended description and standards-version. * Clean up autoconf usage and update to current version of autoconf. * Fix a few warnings. -- Joey Hess Wed, 15 Jun 2005 16:45:04 -0400 udpkg (1.00) unstable; urgency=low * Colin Watson - dpkg_doconfigure returns di_exec_mangle_status of the postinst rather than just WEXITSTATUS, so that a segfaulting postinst doesn't send main-menu into an infinite loop. * Joey Hess - Call this release 1.00. -- Joey Hess Fri, 3 Sep 2004 16:08:31 -0400 udpkg (0.024) unstable; urgency=low * Use /var/lib/dpkg/status, not /var/lib/dpkg/status.udeb. -- Joey Hess Mon, 22 Mar 2004 16:02:25 -0500 udpkg (0.023) unstable; urgency=low * Call trimtemplates (from lowmem) on templates files before loading. -- Joey Hess Mon, 8 Mar 2004 16:00:38 -0500 udpkg (0.022) unstable; urgency=low * Delete templates files after calling debconf-loadtemplates, to save space. -- Joey Hess Mon, 8 Mar 2004 15:11:30 -0500 udpkg (0.021) unstable; urgency=low * Update to debhelper v4 and use debhelper's udeb support. -- Joey Hess Mon, 9 Feb 2004 19:25:10 -0500 udpkg (0.020) unstable; urgency=low * Petter Reinholdtsen - Report arch 'sparc' instead of 'sparc64' on UltraSparc. Patch from Thomas Poindessous. (Closes: #227851) * Bastian Blank - Remove runtime detection of debian architecture. -- Bastian Blank Sat, 24 Jan 2004 18:57:24 +0100 udpkg (0.019) unstable; urgency=low * Thiemo Seufer - Add CFLAGS for warnings and space optimization. * Joey Hess - Use architecture "powerpc" for ppc64, patch from Anton Blanchard. -- Joey Hess Mon, 22 Dec 2003 14:41:14 -0500 udpkg (0.018) unstable; urgency=low * Don't use di_exec_shell_log for -f, because it has undefined behvaior that does not include printing out what dpkg is supported to print out. This should un-break the floppy retreiver. -- Joey Hess Sun, 2 Nov 2003 02:24:46 -0500 udpkg (0.017) unstable; urgency=low * Karsten Merker - fix mipsel architecture detection for "udpkg --print-architecture" (udpkg wrongly reported "mips" instead of "mipsel" on mipsel systems) -- Karsten Merker Sat, 1 Nov 2003 22:15:03 +0100 udpkg (0.016) unstable; urgency=low * Matt Kraai - Check the return values of commands (closes: #197922). - Use di_exec_shell_log instead of system. -- Petter Reinholdtsen Sun, 19 Oct 2003 17:47:02 +0200 udpkg (0.015) unstable; urgency=low * Move to Standards-Version 3.6.0, converting changelog to UTF-8 * Sebastian Ley - Really output nothing if setting UDPKG_QUIET - Pass the exitcode of postinst scripts when they fail -- Petter Reinholdtsen Sun, 28 Sep 2003 14:47:30 +0200 udpkg (0.014) unstable; urgency=low * Bastian Blank - add "exec" to the configure calls, ash isn't able to optimize the fork away if it should execute only one command * Tollef Fog Heen - Add powerpc to xlattbl (closes: #194933) * Petter Reinholdtsen - Add myself as uploader. -- Petter Reinholdtsen Tue, 22 Jul 2003 09:09:06 +0200 udpkg (0.013) unstable; urgency=low * Bastian Blank - use tar -z - builds .list only once (Closes: #190030) * Martin Sjögren - Add compile-time flag for the -r command (remove package). This also means we don't have to generate the .list files at all. -- Bastian Blank Sun, 04 May 2003 14:54:09 +0200 udpkg (0.012) unstable; urgency=low * Print the package name if its postinst exits unsuccessfully. * Remove extra leading space from multi-line fields. -- Matt Kraai Tue, 11 Feb 2003 21:25:28 -0800 udpkg (0.011) unstable; urgency=low * added ia64 architecture. * fix support for long options and add --force-configure which always runs the configure script -- Tollef Fog Heen Tue, 26 Nov 2002 04:16:02 +0100 udpkg (0.010) unstable; urgency=low * Martin Sjögren - Add --fields (-f) flag to print the contents of a package control file -- Tollef Fog Heen Wed, 13 Nov 2002 18:28:54 +0100 udpkg (0.009) unstable; urgency=low * waldi: add s390 architecture. -- Tollef Fog Heen Thu, 24 Oct 2002 12:52:33 +0200 udpkg (0.008) unstable; urgency=low * Add --print-architecture for use in maintainer scripts. -- Tollef Fog Heen Mon, 14 Oct 2002 05:48:15 +0200 udpkg (0.007) unstable; urgency=low * Apply asprintf patch from Martin Sjögren. -- Tollef Fog Heen Fri, 30 Aug 2002 17:19:16 +0200 udpkg (0.006) unstable; urgency=low * Add support for localized descriptions (tfheen) * Call debconf-loadtemplates if there is a templates file. * Add menutest and isinstallable to list of maintainer scripts (cjwatson) -- Tollef Fog Heen Sun, 21 Apr 2002 11:40:11 +0200 udpkg (0.005) unstable; urgency=medium * Fix makefile (closes: #142110) * Fix CPP string concatenations -- Randolph Chung Tue, 9 Apr 2002 23:21:29 -0700 udpkg (0.004) unstable; urgency=low * fixes builddeps (closes: #86934) -- Randolph Chung Wed, 21 Feb 2001 21:00:45 -0700 udpkg (0.003) unstable; urgency=low * Patch from David Wedon to fix half-installed/installed status confusion. Closes: #80239 -- Joey Hess Sat, 30 Dec 2000 17:22:29 -0800 udpkg (0.002) unstable; urgency=low * de-relavatized paths. Use with caution, this will work just like real dpkg now, except it's more buggy! -- Joey Hess Thu, 21 Dec 2000 14:26:04 -0800 udpkg (0.001) unstable; urgency=low * Non-release. -- Joey Hess Thu, 26 Oct 2000 12:02:04 -0700 udpkg-1.16/debian/compat0000644000000000000000000000000212170211312012047 0ustar 9 udpkg-1.16/debian/install0000644000000000000000000000001611515471401012250 0ustar udpkg usr/bin udpkg-1.16/debian/rules0000755000000000000000000000100212145213761011736 0ustar #! /usr/bin/make -f %: dh $@ --with autoreconf export CFLAGS=-W -Wall -g autoreconf: autoreconf -f -i # autoreconf will not do this for us, since this package does not use # automake. cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./ override_dh_autoreconf: dh_autoreconf debian/rules -- autoreconf override_dh_auto_configure: dh_auto_configure -- --without-depends --without-debug --without-l10n \ --without-remove --with-admindir=/var/lib/dpkg override_dh_auto_build: $(MAKE) small udpkg-1.16/debian/clean0000644000000000000000000000001211515471401011660 0ustar configure