Changeset 8


Ignore:
Timestamp:
Sep 3, 2010, 5:27:35 PM (15 years ago)
Author:
Yuri Dario
Message:

rpm: merged offline changes.

Location:
rpm/trunk
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • rpm/trunk/Makefile.in

    r2 r8  
    263263LIBINTL = @LIBINTL@
    264264LIBOBJS = @LIBOBJS@
    265 LIBS = @LIBS@
     265LIBS = misc/libmisc.la -lmagic @LIBS@
    266266LIBTOOL = @LIBTOOL@
    267267LIPO = @LIPO@
     
    750750        @rm -f rpm$(EXEEXT)
    751751        $(LINK) $(rpm_OBJECTS) $(rpm_LDADD) $(LIBS)
     752        # YD link rpm_s statically, so we can use it for bootstrap
     753        $(CC) $(LDFLAGS) -o rpm_s.exe $(rpm_OBJECTS) \
     754                build/.libs/rpmbuild_s.a lib/.libs/rpm_s.a rpmio/.libs/rpmio_s.a \
     755                -lsqlite3_s -lz -lbz2 -ldb -lpopt -lmagic -lurpo -lmmap -lpthread -lssp
     756
    752757rpm2cpio$(EXEEXT): $(rpm2cpio_OBJECTS) $(rpm2cpio_DEPENDENCIES)
    753758        @rm -f rpm2cpio$(EXEEXT)
     
    15521557install-data-local:
    15531558        @case "@host_os@" in \
    1554         solaris*|linux*|darwin*) \
     1559        solaris*|linux*|darwin*|os2*) \
    15551560           DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
    15561561        esac
  • rpm/trunk/build.c

    r2 r8  
    222222    }
    223223
    224     if (*specFile != '/') {
     224    if (*specFile != '/'
     225#ifdef __EMX__
     226        && specFile[1] != ':'
     227#endif
     228        ) {
    225229        char *cwd = rpmGetCwd();
    226230        char *s = NULL;
  • rpm/trunk/build/Makefile.in

    r2 r8  
    410410librpmbuild.la: $(librpmbuild_la_OBJECTS) $(librpmbuild_la_DEPENDENCIES)
    411411        $(librpmbuild_la_LINK) -rpath $(usrlibdir) $(librpmbuild_la_OBJECTS) $(librpmbuild_la_LIBADD) $(LIBS)
     412        cp .libs/rpmbuild.a .libs/rpmbuild_s.a
     413        dllar -g -nolxlite -Zomf -o .libs/rpmbuild .libs/rpmbuild.a -l../lib/.libs/rpm.a -l../rpmio/.libs/rpmio.a -lmagic -lsqlite3 -ldb -lbz2 -lz -lpopt -lurpo -lmmap -lpthread -lssp
    412414
    413415mostlyclean-compile:
  • rpm/trunk/build/build.c

    r2 r8  
    55
    66#include "system.h"
     7#ifdef __EMX__
     8#include <process.h>
     9#include <fcntl.h>
     10#endif
    711
    812#include <rpm/rpmbuild.h>
     
    144148    }
    145149   
    146     if (*rootDir == '\0') rootDir = "/";
     150    if (*rootDir == '\0') rootDir = "/@unixroot";
    147151
    148152    buildTemplate = rpmExpand(mTemplate, NULL);
     
    171175if (_build_debug)
    172176fprintf(stderr, "*** rootDir %s buildDir %s\n", rootDir, buildDir);
    173     if (buildDir && buildDir[0] != '/') {
     177    if (buildDir && buildDir[0] != '/'
     178#ifdef __EMX__
     179         && buildDir[1] != ':'
     180#endif
     181        ) {
    174182        rc = RPMRC_FAIL;
    175183        goto exit;
     
    180188
    181189    rpmlog(RPMLOG_NOTICE, _("Executing(%s): %s\n"), name, buildCmd);
     190#ifdef __EMX__
     191    child = spawnvp(P_NOWAIT, argv[0], (char *const *)argv);
     192    if (child == -1)
     193        // waitpid will fail too!
     194        rpmlog(RPMLOG_ERR, _("Exec of %s failed (%s): %s\n"),
     195                scriptName, name, strerror(errno));
     196#else
    182197    if (!(child = fork())) {
    183198
     
    190205        _exit(127); /* exit 127 for compatibility with bash(1) */
    191206    }
     207#endif
    192208
    193209    pid = waitpid(child, &status, 0);
  • rpm/trunk/build/files.c

    r2 r8  
    21812181        flp->langs = xstrdup("");
    21822182       
     2183#ifndef __EMX__
    21832184        if (! (flp->uname && flp->gname)) {
    21842185            rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), diskPath);
    21852186            fl.processingFailed = 1;
    21862187        }
     2188#endif
    21872189
    21882190        isSpec = 0;
  • rpm/trunk/build/names.c

    r2 r8  
    106106const char *getGname(gid_t gid)
    107107{
     108#ifdef __EMX__
     109    struct group fake_gr = { "root", NULL, 0, NULL};
     110#endif
    108111    struct group *gr;
    109112    int x;
     
    118121    if (x == UGIDMAX)
    119122        rpmlog(RPMLOG_CRIT, _("getGname: too many gid's\n"));
    120    
     123
     124#ifdef __EMX__
     125    gr = &fake_gr;
     126#else   
    121127    if ((gr = getgrgid(gid)) == NULL)
    122128        return NULL;
     129#endif
    123130    gids[gid_used] = gid;
    124131    gnames[gid_used] = xstrdup(gr->gr_name);
  • rpm/trunk/build/pack.c

    r2 r8  
    477477        payloadtag = RPMSIGTAG_LONGARCHIVESIZE;
    478478    }
    479     (void) rpmAddSignature(sig, sigtarget, sizetag, passPhrase);
    480     (void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase);
     479//    (void) rpmAddSignature(sig, sigtarget, sizetag, passPhrase);
     480//    (void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase);
    481481
    482482    if ((sigtag = rpmLookupSignatureType(RPMLOOKUPSIG_QUERY)) > 0) {
  • rpm/trunk/build/parsePrep.c

    r2 r8  
    2626        return RPMRC_FAIL;
    2727    }
     28#ifndef __EMX__
    2829    if (!getUname(sb.st_uid) || !getGname(sb.st_gid)) {
    2930        rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), urlfn);
    3031        return RPMRC_FAIL;
    3132    }
     33#endif
    3234
    3335    return RPMRC_OK;
  • rpm/trunk/build/reqprov.c

    r2 r8  
    5151    rpmTag indextag = 0;
    5252    rpmsenseFlags extra = RPMSENSE_ANY;
     53    char N2[_MAX_PATH];
    5354   
    5455    if (Flags & RPMSENSE_PROVIDES) {
     
    9596   
    9697    /* Avoid adding duplicate dependencies. */
    97     if (isNewDep(h, nametag, N, EVR, Flags, indextag, index)) {
    98         headerPutString(h, nametag, N);
     98    strcpy( N2, "");
     99#ifdef __EMX__
     100        // YD need to add @unixroot remapping
     101        if (!strncmp( N, "/bin", 4) || !strncmp( N, "/usr/bin", 8)) {
     102            strcpy( N2, "/@unixroot");
     103        }
     104#endif
     105    strcat( N2, N);
     106    if (isNewDep(h, nametag, N2, EVR, Flags, indextag, index)) {
     107        headerPutString(h, nametag, N2);
    99108        headerPutString(h, versiontag, EVR);
    100109        headerPutUint32(h, flagtag, &Flags, 1);
  • rpm/trunk/build/rpmfc.c

    r2 r8  
    11#include "system.h"
     2
     3#ifdef __EMX__
     4#include <process.h>
     5#include <stdlib.h>
     6#endif
    27
    38#include <signal.h>
     
    95100    StringBuf readBuff;
    96101    int done;
    97 
     102#ifdef __EMX__
     103    int i, fd, nbw, nbr;
     104        FILE* in;
     105        char tmpfile[_MAX_PATH];
     106        char buffer[32*1024];
     107#endif
     108
     109#ifndef __EMX__
    98110    /* FIX: cast? */
    99111    oldhandler = signal(SIGPIPE, SIG_IGN);
     
    145157    (void) fcntl(toProg[1], F_SETFL, O_NONBLOCK);
    146158   
     159#else
     160
     161        if (dir && chdir(dir)) {
     162            rpmlog(RPMLOG_ERR, _("Couldn't chdir to %s: %s\n"),
     163                    dir, strerror(errno));
     164            _exit(EXIT_FAILURE);
     165        }
     166
     167        // write data to file
     168        strcpy( tmpfile, "check-files-XXXXXX");
     169        if (mktemp( tmpfile) == NULL) {
     170                rpmlog(RPMLOG_ERR, _("Couldn't get temp file: %s\n"),
     171                        strerror(errno));
     172                return NULL;
     173        }
     174        fd = open( tmpfile, O_CREAT|O_TRUNC|O_BINARY|O_WRONLY);
     175        if (fd == -1) {
     176                unlink(tmpfile);
     177                rpmlog(RPMLOG_ERR, _("Couldn't open temp file: %s\n"),
     178                        strerror(errno));
     179                return NULL;
     180        }
     181        nbw = write( fd, writePtr,writeBytesLeft);
     182        if (nbw != writeBytesLeft) {
     183                close(fd);
     184                unlink(tmpfile);
     185                rpmlog(RPMLOG_ERR, _("Couldn't write temp file: %s\n"),
     186                        strerror(errno));
     187                return NULL;
     188        }
     189        close(fd);
     190       
     191        // create command line, popen does
     192        // not directly execute shell scripts :-(
     193        // TODO rewrite check-files.sh in rexx
     194        strcpy( buffer, "sh -c \"");
     195        strcat( buffer, argv[0]);
     196        // popen requires backslash!
     197        //for( i=0; i<strlen(buffer); i++)
     198        //      if (buffer[i] == '/')
     199        //              buffer[i] = '\\';
     200
     201        i = 1;
     202        while( argv[i] != NULL) {
     203                strcat( buffer, " ");
     204                strcat( buffer, argv[i++]);
     205        }
     206        // add temp file
     207        strcat( buffer, " ");
     208        strcat( buffer, tmpfile);
     209        strcat( buffer, "\"");
     210        if (0)
     211            fprintf( stderr,"command line: '%s'\n", buffer);
     212
     213        // execute child and read input pipe
     214        in = popen( buffer, "r");
     215        if (in == NULL) {
     216                unlink(tmpfile);
     217                rpmlog(RPMLOG_ERR, _("Couldn't popen: %s\n"),
     218                        strerror(errno));
     219                return NULL;
     220        }
     221       
     222        readBuff = newStringBuf();
     223
     224        /* Read any data from prog */
     225        {   char buf[BUFSIZ+1];
     226            while (!feof(in)) {
     227                        nbr = fread(buf, 1, sizeof(buf)-1, in);
     228                        buf[nbr] = '\0';
     229                        if (0)
     230                            fprintf( stderr,"read '%s'\n",buf);
     231                        appendStringBuf(readBuff, buf);
     232            }
     233        }
     234        fclose(in);
     235
     236        // delete temporary
     237        unlink(tmpfile);
     238
     239#endif // __EMX__
     240
     241#ifndef __EMX__
    147242    readBuff = newStringBuf();
    148243
     
    226321        return NULL;
    227322    }
     323#endif // __EMX__
     324
    228325    return readBuff;
    229326}
     
    715812
    716813        if (is_executable) {
     814            char s2[_MAX_PATH];
    717815            /* Add to package requires. */
    718             ds = rpmdsSingle(RPMTAG_REQUIRENAME, s, "", RPMSENSE_FIND_REQUIRES);
     816            strcpy( s2, "");
     817#ifdef __EMX__
     818                // YD need to add @unixroot remapping
     819                if (!strncmp( s, "/bin", 4) || !strncmp( s, "/usr/bin", 8)) {
     820                    strcpy( s2, "/@unixroot");
     821                }
     822#endif
     823            strcat( s2, s);
     824            ds = rpmdsSingle(RPMTAG_REQUIRENAME, s2, "", RPMSENSE_FIND_REQUIRES);
    719825            xx = rpmdsMerge(&fc->requires, ds);
    720826
  • rpm/trunk/configure

    r2 r8  
    1854718547else
    1854818548
    18549   as_fn_error "missing required NSPR / NSS header" "$LINENO" 5
     18549  echo as_fn_error "missing required NSPR / NSS header" "$LINENO" 5
    1855018550
    1855118551fi
     
    1859518595else
    1859618596
    18597   as_fn_error "missing required NSS library 'nss3'" "$LINENO" 5
     18597  echo as_fn_error "missing required NSS library 'nss3'" "$LINENO" 5
    1859818598
    1859918599fi
     
    1861618616else
    1861718617  ac_check_lib_save_LIBS=$LIBS
    18618 LIBS="-lmagic $LIBS"
     18618LIBS="-lmagic -lz $LIBS"
    1861918619cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1862018620/* end confdefs.h.  */
  • rpm/trunk/lib/Makefile.in

    r2 r8  
    456456AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) \
    457457        -I$(top_builddir)/include/ @WITH_NSS_INCLUDE@ \
     458        -I$(top_builddir)/include/nss \
    458459        @WITH_POPT_INCLUDE@ @WITH_SQLITE3_INCLUDE@ \
    459460        -I$(top_srcdir)/misc -DLOCALEDIR="\"$(localedir)\"" \
     
    647648librpm.la: $(librpm_la_OBJECTS) $(librpm_la_DEPENDENCIES)
    648649        $(librpm_la_LINK) -rpath $(usrlibdir) $(librpm_la_OBJECTS) $(librpm_la_LIBADD) $(LIBS)
     650        cp .libs/rpm.a .libs/rpm_s.a
     651        dllar -g -nolxlite -Zomf -o .libs/rpm .libs/rpm.a -l../rpmio/.libs/rpmio.a -lsqlite3 -ldb -lbz2 -lz -lpopt -lurpo -lmmap -lpthread -lssp
     652        cp .libs/rpm.dll ..
    649653
    650654clean-checkPROGRAMS:
  • rpm/trunk/lib/backend/sqlite.c

    r2 r8  
    104104    rpmdb db = dbi->dbi_rpmdb;
    105105
    106     if (rstreq(db->db_root, "/") || db->db_chrootDone || sqlInRoot)
     106    if (rstreq(db->db_root, "/")
     107#ifdef __EMX__00
     108        || rstreq(db->db_root, "/@unixroot")
     109#endif
     110        || db->db_chrootDone || sqlInRoot)
    107111       /* Nothing to do, was not already in chroot */
    108112       return;
     113
     114#ifdef __EMX__
     115    // if @unixroot, at least be sure to set current drive!
     116    if (rstreq(db->db_root, "/@unixroot")) {
     117if (_debug)
     118fprintf(stderr,"cwd:%s\n", getcwd(NULL,0));
     119       chdir("/@unixroot/");
     120       /* Nothing to do, was not already in chroot */
     121       return;
     122    }
     123#endif
    109124
    110125if (_debug)
     
    114129    xx = chdir("/");
    115130    xx = chroot(db->db_root);
     131if (_debug)
    116132assert(xx == 0);
    117133    sqlInRoot=1;
  • rpm/trunk/lib/depends.c

    r2 r8  
    3434#define HTKEYTYPE const char *
    3535#define HTDATATYPE int
    36 #include "lib/rpmhash.H"
    37 #include "lib/rpmhash.C"
     36#include "lib/rpmhashC.H"
     37#include "lib/rpmhashC.C"
    3838
    3939/**
  • rpm/trunk/lib/fprint.c

    r2 r8  
    1515
    1616/* Create new hash table type rpmFpEntryHash */
    17 #include "lib/rpmhash.C"
     17#include "lib/rpmhashC.C"
    1818
    1919#undef HASHTYPE
     
    2323#define HTKEYTYPE const char *
    2424#define HTDATATYPE const struct fprintCacheEntry_s *
    25 #include "lib/rpmhash.C"
     25#include "lib/rpmhashC.C"
    2626
    2727fingerPrintCache fpCacheCreate(int sizeHint)
  • rpm/trunk/lib/fprint.h

    r2 r8  
    3636#define HTKEYTYPE const char *
    3737#define HTDATATYPE const struct fprintCacheEntry_s *
    38 #include "lib/rpmhash.H"
     38#include "lib/rpmhashC.H"
    3939
    4040/**
     
    7171#define HTKEYTYPE const fingerPrint *
    7272#define HTDATATYPE struct rpmffi_s
    73 #include "lib/rpmhash.H"
     73#include "lib/rpmhashC.H"
    7474
    7575/** */
  • rpm/trunk/lib/fsm.c

    r2 r8  
    832832        fdFiniDigest(fsm->wfd, fsm->digestalgo, &digest, NULL, asAscii);
    833833
     834#ifndef __EMX__ // YD FIXME
    834835        if (digest == NULL) {
    835836            rc = CPIOERR_DIGEST_MISMATCH;
    836837            goto exit;
    837838        }
     839#endif
    838840
    839841        if (fsm->digest != NULL) {
     
    20722074        break;
    20732075    case FSM_MKDIR:
     2076#ifdef __EMX__
     2077        if (strcmp(fsm->path, "/@unixroot")==0)
     2078            rc = 0;
     2079        else
     2080#endif
    20742081        rc = mkdir(fsm->path, (st->st_mode & 07777));
    20752082        if (_fsm_debug && (stage & FSM_SYSCALL))
     
    20802087        break;
    20812088    case FSM_RMDIR:
     2089#ifdef __EMX__
     2090        if (strcmp(fsm->path, "/@unixroot")==0)
     2091            rc = 0;
     2092        else
     2093#endif
    20822094        rc = rmdir(fsm->path);
    20832095        if (_fsm_debug && (stage & FSM_SYSCALL))
  • rpm/trunk/lib/poptALL.c

    r2 r8  
    6767const char * rpmcliRcfile = NULL;
    6868
    69 const char * rpmcliRootDir = "/";
     69const char * rpmcliRootDir = "/@unixroot";
    7070
    7171rpmQueryFlags rpmcliQueryFlags;
  • rpm/trunk/lib/psm.c

    r2 r8  
    33 * Package state machine to handle a package from a transaction set.
    44 */
     5
     6#ifdef __EMX__
     7#include <process.h>
     8#endif
    59
    610#include "system.h"
     
    696700        xx = Fclose(fd);
    697701
     702#ifdef __EMX__
     703        argvAdd(argvp, "-c");
     704        argvAdd(argvp, fn);
     705#else
    698706        {   const char * sn = fn;
    699707            if (!rpmtsChrootDone(ts) && rootDir != NULL &&
     
    704712            argvAdd(argvp, sn);
    705713        }
     714#endif
    706715
    707716        if (arg1 >= 0) {
     
    713722    }
    714723
     724#ifdef __EMX__
     725    //psm->sq.child = spawnvp(P_NOWAIT, argvp[0], *argvp);
     726    psm->sq.child = spawnvp(P_NOWAIT, "sh.exe", *argvp);
     727    psm->sq.reaped = waitpid(psm->sq.child, &psm->sq.status, 0);
     728
     729#else
    715730    scriptFd = rpmtsScriptFd(ts);
    716731    if (scriptFd != NULL) {
     
    745760
    746761    (void) psmWait(psm);
     762#endif
    747763
    748764    if (psm->sq.reaped < 0) {
     
    15301546        /* Change root directory if requested and not already done. */
    15311547        if (rootDir != NULL && !(rootDir[0] == '/' && rootDir[1] == '\0')
     1548#ifdef __EMX__
     1549         && strcmp( rootDir, "/@unixroot") != 0
     1550         && strcmp( rootDir, "/@unixroot/") != 0
     1551#endif
    15321552         && !rpmtsChrootDone(ts) && !psm->chrootDone)
    15331553        {
     
    15471567            const char * rootDir = rpmtsRootDir(ts);
    15481568            const char * currDir = rpmtsCurrDir(ts);
    1549             if (rootDir != NULL && !rstreq(rootDir, "/") && *rootDir == '/')
     1569            if (rootDir != NULL
     1570#ifdef __EMX__
     1571             && strcmp( rootDir, "/@unixroot") != 0
     1572             && strcmp( rootDir, "/@unixroot/") != 0
     1573#endif
     1574             && !rstreq(rootDir, "/") && *rootDir == '/')
    15501575                rc = chroot(".");
    15511576            psm->chrootDone = 0;
  • rpm/trunk/lib/rpmal.c

    r2 r8  
    6363#define HTKEYTYPE const char *
    6464#define HTDATATYPE struct availableIndexEntry_s
    65 #include "lib/rpmhash.H"
    66 #include "lib/rpmhash.C"
     65#include "lib/rpmhashC.H"
     66#include "lib/rpmhashC.C"
    6767
    6868#undef HASHTYPE
     
    7272#define HTKEYTYPE struct fileNameEntry_s
    7373#define HTDATATYPE struct fileIndexEntry_s
    74 #include "lib/rpmhash.H"
    75 #include "lib/rpmhash.C"
     74#include "lib/rpmhashC.H"
     75#include "lib/rpmhashC.C"
    7676
    7777
  • rpm/trunk/lib/rpmdb.c

    r2 r8  
    719719}
    720720
     721#ifdef __EMX__
     722#define _DB_ROOT        "/@unixroot"
     723#else
    721724#define _DB_ROOT        "/"
     725#endif
    722726#define _DB_HOME        "%{_dbpath}"
    723727#define _DB_FULLPATH    NULL
  • rpm/trunk/lib/rpmlock.c

    r2 r8  
    117117
    118118    if (!rootDir || rpmtsChrootDone(ts))
    119         rootDir = "/";
     119        rootDir = "/@unixroot";
    120120    lock = rpmlock_new(rootDir);
    121121    if (!lock) {
  • rpm/trunk/lib/rpmrc.c

    r2 r8  
    459459
    460460        /* Find end-of-line. */
    461         while (*se && *se != '\n') se++;
     461        while (*se && *se != '\r' && *se != '\n') se++;
    462462        if (*se != '\0') *se++ = '\0';
    463463        next = se;
  • rpm/trunk/lib/rpmts.c

    r2 r8  
    630630        case URL_IS_DASH:
    631631        default:
    632             rootDir = "/";
     632            rootDir = "/@unixroot";
    633633            break;
    634634        }
  • rpm/trunk/lib/transaction.c

    r2 r8  
    879879#define HASHTYPE rpmStringSet
    880880#define HTKEYTYPE const char *
    881 #include "lib/rpmhash.H"
    882 #include "lib/rpmhash.C"
     881#include "lib/rpmhashC.H"
     882#include "lib/rpmhashC.C"
    883883
    884884/* Get a rpmdbMatchIterator containing all files in
     
    13061306    uint64_t fileCount = countFiles(ts);
    13071307    const char * rootDir = rpmtsRootDir(ts);
    1308     int dochroot = (rootDir != NULL && !rstreq(rootDir, "/") && *rootDir == '/');
     1308    int dochroot = (rootDir != NULL
     1309#ifdef __EMX__
     1310         && !rstreq(rootDir, "/@unixroot")
     1311         && !rstreq(rootDir, "/@unixroot/")
     1312#endif
     1313         && !rstreq(rootDir, "/") && *rootDir == '/');
    13091314
    13101315    fingerPrintCache fpc = fpCacheCreate(fileCount/2 + 10001);
  • rpm/trunk/lib/verify.c

    r2 r8  
    477477    rpmtsOpenDB(ts, O_RDONLY);
    478478    rpmdbOpenAll(rpmtsGetRdb(ts));
    479     if (rootDir && !rstreq(rootDir, "/")) {
     479    if (rootDir
     480#ifdef __EMX__
     481         && strcmp( rootDir, "/@unixroot") != 0
     482         && strcmp( rootDir, "/@unixroot/") != 0
     483#endif
     484         && !rstreq(rootDir, "/")) {
    480485        dirfd = open(".", O_RDONLY);
    481486        if (dirfd == -1 || chdir("/") == -1 || chroot(rootDir) == -1) {
  • rpm/trunk/macros.in

    r2 r8  
    367367#
    368368# Note: Disable (by commenting out) for legacy compatibility.
    369 %__check_files         %{_rpmconfigdir}/check-files %{buildroot}
     369%__check_files         %{_rpmconfigdir}/check-files.os2 %{buildroot}
    370370
    371371#
     
    488488%__perl_requires        %{_rpmconfigdir}/perl.req
    489489
    490 %__python_provides      %{_rpmconfigdir}/pythondeps.sh --provides
    491 %__python_requires      %{_rpmconfigdir}/pythondeps.sh --requires
     490#%__python_provides     %{_rpmconfigdir}/pythondeps.sh --provides
     491#%__python_requires     %{_rpmconfigdir}/pythondeps.sh --requires
    492492
    493493%__mono_provides        %{_rpmconfigdir}/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
     
    661661# There are two macros so that --rebuilddb can convert db1 -> db3.
    662662#
    663 %_dbapi                 3
    664 %_dbapi_rebuild         3
     663%_dbapi                 4
     664%_dbapi_rebuild         4
    665665
    666666#==============================================================================
     
    793793# Define per-arch and per-os defaults. Normally overridden by per-target macros.
    794794%__arch_install_post    %{nil}
    795 %__os_install_post      %{___build_post}
     795%__os_install_post      %{_rpmconfigdir}/brp-strip.os2
    796796
    797797#==============================================================================
     
    973973%_libexecdir            %{_exec_prefix}/libexec
    974974%_datadir               %{_prefix}/share
    975 %_sysconfdir            /etc
     975%_sysconfdir            @sysconfdir@
    976976%_sharedstatedir        %{_prefix}/com
    977 %_localstatedir         %{_prefix}/var
     977%_localstatedir         @localstatedir@
    978978%_lib                   lib
    979979%_libdir                %{_exec_prefix}/%{_lib}
  • rpm/trunk/misc/glob.c

    r2 r8  
    942942weak_alias (__glob_pattern_p, glob_pattern_p)
    943943# endif
     944
     945#ifdef __EMX__
     946int glob_pattern_p (const char *pattern, int quote) {
     947  return __glob_pattern_p( pattern, quote);
     948}
     949
     950#endif
     951
    944952#endif
    945953
  • rpm/trunk/python/Makefile.in

    r2 r8  
    351351@PYTHON_TRUE@   -I$(top_builddir)/include/ -I$(top_srcdir)/python \
    352352@PYTHON_TRUE@   -I$(top_srcdir)/misc -I@WITH_PYTHON_INCLUDE@
    353 @PYTHON_TRUE@pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la
     353@PYTHON_TRUE@#pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la
     354@PYTHON_TRUE@pkgpyexec_LTLIBRARIES = _rpm.dll _rpmb.dll
    354355@PYTHON_TRUE@pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py
    355356@PYTHON_TRUE@_rpmmodule_la_LDFLAGS = -module -avoid-version
     
    729730# Otherwise a system limit (for SysV at least) may be exceeded.
    730731.NOEXPORT:
     732
     733_rpmb.dll: _rpmbmodule.la
     734        echo "LIBRARY _rpmb INITINSTANCE TERMINSTANCE" > _rpmb.def
     735        echo "DATA MULTIPLE" >> _rpmb.def
     736        echo "EXPORTS" >> _rpmb.def
     737        cd .libs ; emxexp $(subst .lo,.o,$(_rpmbmodule_la_OBJECTS)) >> ../_rpmb.def
     738        $(_rpmbmodule_la_LINK) -Zdll _rpmb.def $(am__rpmbmodule_la_rpath) $(_rpmbmodule_la_OBJECTS) $(_rpmbmodule_la_LIBADD) $(LIBS) -lssp
     739
     740_rpm.dll: _rpmmodule.la
     741        echo "LIBRARY _rpm INITINSTANCE TERMINSTANCE" > _rpm.def
     742        echo "DATA MULTIPLE" >> _rpm.def
     743        echo "EXPORTS" >> _rpm.def
     744        cd .libs ; emxexp $(subst .lo,.o,$(_rpmmodule_la_OBJECTS)) >> ../_rpm.def
     745        $(_rpmmodule_la_LINK) -Zdll _rpm.def $(am__rpmmodule_la_rpath) $(_rpmmodule_la_OBJECTS) $(_rpmmodule_la_LIBADD) $(LIBS) -lssp
     746
  • rpm/trunk/python/rpmts-py.c

    r2 r8  
    715715static int rpmts_init(rpmtsObject *s, PyObject *args, PyObject *kwds)
    716716{
    717     char * rootDir = "/";
     717    char * rootDir = "/@unixroot";
    718718    rpmVSFlags vsflags = rpmExpandNumeric("%{?__vsflags}");
    719719    char * kwlist[] = {"rootdir", "vsflags", 0};
  • rpm/trunk/rpm2cpio.c

    r2 r8  
    2020    rpmRC rc;
    2121    FD_t gzdi;
     22
     23#ifdef __EMX__
     24    _fsetmode( stdin, "b");
     25    _fsetmode( stdout, "b");
     26#endif
    2227   
    2328    setprogname(argv[0]);       /* Retrofit glibc __progname */
  • rpm/trunk/rpmio/Makefile.in

    r2 r8  
    326326AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) \
    327327        -I$(top_builddir)/include/ @WITH_NSS_INCLUDE@ \
     328        -I$(top_builddir)/include/nss \
    328329        @WITH_LUA_INCLUDE@ @WITH_POPT_INCLUDE@ -I$(top_srcdir)/misc \
    329330        @WITH_LIBELF_INCLUDE@ -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\"" \
     
    410411librpmio.la: $(librpmio_la_OBJECTS) $(librpmio_la_DEPENDENCIES)
    411412        $(librpmio_la_LINK) -rpath $(usrlibdir) $(librpmio_la_OBJECTS) $(librpmio_la_LIBADD) $(LIBS)
     413        cp .libs/rpmio.a .libs/rpmio_s.a
     414        dllar -g -nolxlite -Zomf -o .libs/rpmio .libs/rpmio.a -lbz2 -lz -lpopt -lurpo -lmmap -lpthread -lssp
     415        cp .libs/rpmio.dll ..
    412416
    413417clean-checkPROGRAMS:
  • rpm/trunk/rpmio/digest.c

    r2 r8  
    22 * \file rpmio/digest.c
    33 */
     4
     5#include <stdio.h>
    46
    57#include "system.h"
     
    1416#define DPRINTF(_a)
    1517#endif
    16 
    1718
    1819/**
     
    115116    DIGEST_CTX nctx = NULL;
    116117    if (octx) {
    117         HASHContext *hctx = HASH_Clone(octx->hashctx);
     118        HASHContext *hctx = NULL;//HASH_Clone(octx->hashctx);
    118119        if (hctx) {
    119120            nctx = memcpy(xcalloc(1, sizeof(*nctx)), octx, sizeof(*nctx));
     
    158159rpmDigestLength(pgpHashAlgo hashalgo)
    159160{
    160     return HASH_ResultLen(getHashType(hashalgo));
     161    return 0;//HASH_ResultLen(getHashType(hashalgo));
    161162}
    162163
     
    171172        goto exit;
    172173
    173     if ((hashctx = HASH_Create(type)) != NULL) {
     174    if ((hashctx = (NULL /* HASH_Create(type)*/)) != NULL) {
    174175        ctx = xcalloc(1, sizeof(*ctx));
    175176        ctx->flags = flags;
    176177        ctx->algo = hashalgo;
    177178        ctx->hashctx = hashctx;
    178         HASH_Begin(ctx->hashctx);
     179        //HASH_Begin(ctx->hashctx);
    179180    }
    180181   
     
    199200                partlen = len;
    200201        }
    201         HASH_Update(ctx->hashctx, ptr, partlen);
     202        //HASH_Update(ctx->hashctx, ptr, partlen);
    202203        ptr += partlen;
    203204        len -= partlen;
     
    214215    if (ctx == NULL)
    215216        return -1;
    216     digestlen = HASH_ResultLenContext(ctx->hashctx);
     217    digestlen = 0;//HASH_ResultLenContext(ctx->hashctx);
    217218    digest = xmalloc(digestlen);
    218219
    219220DPRINTF((stderr, "*** Final(%p,%p,%p,%zd) hashctx %p digest %p\n", ctx, datap, lenp, asAscii, ctx->hashctx, digest));
    220221/* FIX: check rc */
    221     HASH_End(ctx->hashctx, digest, (unsigned int *) &digestlen, digestlen);
     222    //HASH_End(ctx->hashctx, digest, (unsigned int *) &digestlen, digestlen);
    222223
    223224    /* Return final digest. */
     
    239240        free(digest);
    240241    }
    241     HASH_Destroy(ctx->hashctx);
     242    //HASH_Destroy(ctx->hashctx);
    242243    memset(ctx, 0, sizeof(*ctx));       /* In case it's sensitive */
    243244    free(ctx);
  • rpm/trunk/rpmio/fts.c

    r2 r8  
    5151#   define __fxstat64(_stat_ver, _fd, _sbp)     fstat((_fd), (_sbp))
    5252#endif
     53#if defined(__EMX__)
     54# define        _INCLUDE_POSIX_SOURCE
     55#   define __errno_location()   (&errno)
     56#   define dirfd(dirp)          -1
     57#   define stat64               stat
     58#   define _STAT_VER            0
     59#   define __fxstat64(_stat_ver, _fd, _sbp)     fstat((_fd), (_sbp))
     60#endif
    5361#if defined(sun)
    5462#   define __errno_location()   (&errno)
  • rpm/trunk/rpmio/fts.h

    r2 r8  
    3737#else
    3838
     39#ifndef __EMX__
    3940#   define __THROW
     41#endif
    4042#ifdef  __cplusplus
    4143# define __BEGIN_DECLS  extern "C" {
  • rpm/trunk/rpmio/rpmfileutil.c

    r2 r8  
    292292    }
    293293    de = d;
     294#ifdef __EMX__
     295    // YD cannot create /@unixroot dir, skip it
     296    if (strncmp( de, "/@unixroot", 10) == 0)
     297        de=strchr(de+1,'/');
     298#endif
    294299    for (;(de=strchr(de+1,'/'));) {
    295300        struct stat st;
     
    378383char *rpmCleanPath(char * path)
    379384{
     385#ifdef __EMX__
     386    #define AT_UNIXROOT "/@unixroot"
     387    const int AT_UNIXROOT_LEN = strlen(AT_UNIXROOT);
     388#endif
    380389    const char *s;
    381390    char *se, *t, *te;
     
    387396/*fprintf(stderr, "*** RCP %s ->\n", path); */
    388397    s = t = te = path;
     398
     399#ifdef __EMX__
     400    // clean '//X:/...' or '/X:/...'
     401    if (s[3] == ':')
     402        s++;
     403    if (s[2] == ':')
     404        s++;
     405    // clean '/@unixroot//@unixroot/...'
     406    if (strncmp( s, AT_UNIXROOT "/" AT_UNIXROOT, AT_UNIXROOT_LEN*2) == 0)
     407       s += (AT_UNIXROOT_LEN);
     408    // clean '/@unixroot/@unixroot/...'
     409    if (strncmp( s, AT_UNIXROOT AT_UNIXROOT, AT_UNIXROOT_LEN*2) == 0)
     410       s += (AT_UNIXROOT_LEN);
     411    // clean '/@unixroot/X:/...'
     412    if (strncmp( s, AT_UNIXROOT, AT_UNIXROOT_LEN) == 0
     413        && s[AT_UNIXROOT_LEN+2] == ':')
     414       s += (AT_UNIXROOT_LEN+1);
     415#endif
     416
    389417    while (*s != '\0') {
    390418/*fprintf(stderr, "*** got \"%.*s\"\trest \"%s\"\n", (t-path), path, s); */
     
    453481            }
    454482            break;
     483#ifdef __EMX__
     484        case '\\':
     485            *t = '/';
     486            break;
     487#endif
    455488        default:
    456489            begin = 0;
     
    561594    int i, j;
    562595    int rc;
     596#ifdef __EMX__
     597    char* _patterns, *_p;
     598#endif
    563599
    564600    if (home != NULL && strlen(home) > 0)
    565601        gflags |= GLOB_TILDE;
    566602
     603#ifdef __EMX__
     604    // hack to convert \\ into / but only for paths (X:\aa\bb\cc)
     605    _patterns = _p = strdup(patterns);
     606    if (_patterns[1]==':' && _patterns[2]=='\\')
     607        do { if (*_p=='\\') *_p='/';} while(*_p++);
     608    /* Can't use argvSplit() here, it doesn't handle whitespace etc escapes */
     609    rc = poptParseArgvString(_patterns, &ac, &av);
     610    free(_patterns);
     611#else
    567612    /* Can't use argvSplit() here, it doesn't handle whitespace etc escapes */
    568613    rc = poptParseArgvString(patterns, &ac, &av);
     614#endif
    569615    if (rc)
    570616        return rc;
  • rpm/trunk/rpmio/rpmpgp.c

    r2 r8  
    350350
    351351    if (item == NULL) {
    352         if ((item=SECITEM_AllocItem(arena, item, nbytes)) == NULL)
     352        //if ((item=SECITEM_AllocItem(arena, item, nbytes)) == NULL)
    353353            return item;
    354354    } else {
    355355        if (arena != NULL)
    356             item->data = PORT_ArenaGrow(arena, item->data, item->len, nbytes);
     356            item->data = NULL;//PORT_ArenaGrow(arena, item->data, item->len, nbytes);
    357357        else
    358             item->data = PORT_Realloc(item->data, nbytes);
     358            item->data = NULL;//PORT_Realloc(item->data, nbytes);
    359359       
    360360        if (item->data == NULL) {
    361361            if (arena == NULL)
    362                 SECITEM_FreeItem(item, PR_TRUE);
     362                //SECITEM_FreeItem(item, PR_TRUE);
    363363            return NULL;
    364364        }
     
    376376    SECKEYPublicKey *key;
    377377   
    378     arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
     378    arena = NULL;//PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
    379379    if (arena == NULL)
    380380        return NULL;
    381381   
    382     key = PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey));
     382    key = NULL;//PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey));
    383383   
    384384    if (key == NULL) {
    385         PORT_FreeArena(arena, PR_FALSE);
     385        //PORT_FreeArena(arena, PR_FALSE);
    386386        return NULL;
    387387    }
     
    629629                    xx = pgpMpiSet(pgpSigDSA[i], DSA_SUBPRIME_LEN*8, dsaraw.data + DSA_SUBPRIME_LEN, p, pend);
    630630                    if (_dig->sigdata != NULL)
    631                         SECITEM_FreeItem(_dig->sigdata, PR_FALSE);
    632                     else if ((_dig->sigdata=SECITEM_AllocItem(NULL, NULL, 0)) == NULL) {
    633                         xx = 1;
    634                         break;
    635                     }
    636                     if (DSAU_EncodeDerSig(_dig->sigdata, &dsaraw) != SECSuccess)
     631                        //SECITEM_FreeItem(_dig->sigdata, PR_FALSE);
     632                    //else if ((_dig->sigdata=SECITEM_AllocItem(NULL, NULL, 0)) == NULL) {
     633                    //    xx = 1;
     634                    //    break;
     635                    //}
     636                    //if (DSAU_EncodeDerSig(_dig->sigdata, &dsaraw) != SECSuccess)
    637637                        xx = 1;
    638638                    break;
     
    12611261
    12621262        if (dig->keydata != NULL) {
    1263             SECKEY_DestroyPublicKey(dig->keydata);
     1263            //SECKEY_DestroyPublicKey(dig->keydata);
    12641264            dig->keydata = NULL;
    12651265        }
    12661266
    12671267        if (dig->sigdata != NULL) {
    1268             SECITEM_ZfreeItem(dig->sigdata, PR_TRUE);
     1268            //SECITEM_ZfreeItem(dig->sigdata, PR_TRUE);
    12691269            dig->sigdata = NULL;
    12701270        }
     
    13961396        /* Zero-pad RSA signature to expected size if necessary */
    13971397        if (sigp->pubkey_algo == PGPPUBKEYALGO_RSA) {
    1398             size_t siglen = SECKEY_SignatureLen(dig->keydata);
     1398            size_t siglen = 0;//SECKEY_SignatureLen(dig->keydata);
    13991399            if (siglen > sig->len) {
    14001400                size_t pad = siglen - sig->len;
    1401                 if ((sig = SECITEM_AllocItem(NULL, NULL, siglen)) == NULL) {
     1401                //if ((sig = SECITEM_AllocItem(NULL, NULL, siglen)) == NULL) {
    14021402                    goto exit;
    1403                 }
     1403                //}
    14041404                memset(sig->data, 0, pad);
    14051405                memcpy(sig->data+pad, dig->sigdata->data, dig->sigdata->len);
     
    14081408
    14091409        /* XXX VFY_VerifyDigest() is deprecated in NSS 3.12 */
    1410         if (VFY_VerifyDigest(&digest, dig->keydata, sig,
    1411                              getSigAlg(sigp), NULL) == SECSuccess) {
    1412             res = RPMRC_OK;
    1413         }
     1410        //if (VFY_VerifyDigest(&digest, dig->keydata, sig,
     1411        //                   getSigAlg(sigp), NULL) == SECSuccess) {
     1412        //    res = RPMRC_OK;
     1413        //}
    14141414
    14151415        if (sig != dig->sigdata) {
    1416             SECITEM_ZfreeItem(sig, 1);
     1416            //SECITEM_ZfreeItem(sig, 1);
    14171417        }
    14181418    }
     
    16211621    /* Initialize NSS if not already done */
    16221622    if (!_crypto_initialized) {
    1623         if (NSS_NoDB_Init(NULL) != SECSuccess) {
     1623        //if (NSS_NoDB_Init(NULL) != SECSuccess) {
    16241624            rc = -1;
    1625         } else {
    1626             _crypto_initialized = 1;
    1627         }
     1625        //} else {
     1626        //    _crypto_initialized = 1;
     1627        //}
    16281628    }
    16291629
     
    16421642    int rc = 0;
    16431643    if (_crypto_initialized) {
    1644         rc = (NSS_Shutdown() != SECSuccess);
     1644        //rc = (NSS_Shutdown() != SECSuccess);
    16451645        _crypto_initialized = 0;
    16461646    }
  • rpm/trunk/rpmqv.c

    r2 r8  
    491491                break;
    492492        case URL_IS_UNKNOWN:
     493#ifdef __EMX__
     494            if (rpmcliRootDir[0] != '/' && rpmcliRootDir[1] != ':')
     495#else
    493496            if (rpmcliRootDir[0] != '/')
     497#endif
    494498                argerror(_("arguments to --root (-r) must begin with a /"));
    495499            break;
  • rpm/trunk/rpmrc.in

    r2 r8  
    198198os_canon:       MacOSX: macosx  21
    199199
     200os_canon:       OS2: os2        22
     201
    200202#############################################################
    201203# For a given uname().machine, the default build arch
  • rpm/trunk/scripts/libtooldeps.sh

    r2 r8  
    11#!/bin/sh
     2
     3# TODO fix this script to accept $2 instead of stdin
     4# re-read file to stdin...
     5exec 0<$2
    26
    37[ $# -ge 2 ] || {
  • rpm/trunk/scripts/pkgconfigdeps.sh

    r2 r8  
    1 #!/bin/bash
     1#!/bin/sh
     2
     3# TODO fix this script to accept $2 instead of stdin
     4# re-read file to stdin...
     5exec 0<$2
    26
    37pkgconfig=/usr/bin/pkg-config
  • rpm/trunk/scripts/pythondeps.sh

    r2 r8  
    1 #!/bin/bash
     1#!/bin/sh
     2
     3# TODO fix this script to accept $2 instead of stdin
     4# re-read file to stdin...
     5exec 0<$2
    26
    37[ $# -ge 1 ] || {
Note: See TracChangeset for help on using the changeset viewer.