Originally posted by Vim_User
View Post
Announcement
Collapse
No announcement yet.
FreeBSD Still Working On Next-Gen Package Manager
Collapse
X
-
Originally posted by Ibidem View PostObviously, someone doesn't even know how to read basic C, let alone how to compare it to C++...there is no justification for confusing this:
Code:// TryToInstall - Mark a package for installation /*{{{*/ struct TryToInstall { pkgCacheFile* Cache; pkgProblemResolver* Fix; bool FixBroken; unsigned long AutoMarkChanged; APT::PackageSet doAutoInstallLater; TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const FixBroken) : Cache(&Cache), Fix(PM), FixBroken(FixBroken), AutoMarkChanged(0) {}; void operator() (pkgCache::VerIterator const &Ver) { pkgCache::PkgIterator Pkg = Ver.ParentPkg(); Cache->GetDepCache()->SetCandidateVersion(Ver); pkgDepCache::StateCache &State = (*Cache)[Pkg]; // Handle the no-upgrade case if (_config->FindB("APT::Get::upgrade",true) == false && Pkg->CurrentVer != 0) ioprintf(c1out,_("Skipping %s, it is already installed and upgrade is not set.\n"), Pkg.FullName(true).c_str()); // Ignore request for install if package would be new else if (_config->FindB("APT::Get::Only-Upgrade", false) == true && Pkg->CurrentVer == 0) ioprintf(c1out,_("Skipping %s, it is not installed and only upgrades are requested.\n"), Pkg.FullName(true).c_str()); else { if (Fix != NULL) { Fix->Clear(Pkg); Fix->Protect(Pkg); } Cache->GetDepCache()->MarkInstall(Pkg,false); if (State.Install() == false) { if (_config->FindB("APT::Get::ReInstall",false) == true) { if (Pkg->CurrentVer == 0 || Pkg.CurrentVer().Downloadable() == false) ioprintf(c1out,_("Reinstallation of %s is not possible, it cannot be downloaded.\n"), Pkg.FullName(true).c_str()); else Cache->GetDepCache()->SetReInstall(Pkg, true); } else ioprintf(c1out,_("%s is already the newest version.\n"), Pkg.FullName(true).c_str()); } // Install it with autoinstalling enabled (if we not respect the minial // required deps or the policy) if (FixBroken == false) doAutoInstallLater.insert(Pkg); } // see if we need to fix the auto-mark flag // e.g. apt-get install foo // where foo is marked automatic if (State.Install() == false && (State.Flags & pkgCache::Flag::Auto) && _config->FindB("APT::Get::ReInstall",false) == false && _config->FindB("APT::Get::Only-Upgrade",false) == false && _config->FindB("APT::Get::Download-Only",false) == false) { ioprintf(c1out,_("%s set to manually installed.\n"), Pkg.FullName(true).c_str()); Cache->GetDepCache()->MarkAuto(Pkg,false); AutoMarkChanged++; } }
Code:int pkg_add(struct pkgdb *db, const char *path, unsigned flags, struct pkg_manifest_key *keys) { const char *arch; const char *myarch; const char *origin; const char *name; struct archive *a; struct archive_entry *ae; struct pkg *pkg = NULL; struct pkg_dep *dep = NULL; struct pkg *pkg_inst = NULL; bool extract = true; bool handle_rc = false; char dpath[MAXPATHLEN + 1]; const char *basedir; const char *ext; char *mtree; char *prefix; int retcode = EPKG_OK; int ret; assert(path != NULL); /* * Open the package archive file, read all the meta files and set the * current archive_entry to the first non-meta file. * If there is no non-meta files, EPKG_END is returned. */ ret = pkg_open2(&pkg, &a, &ae, path, keys, 0); if (ret == EPKG_END) extract = false; else if (ret != EPKG_OK) { retcode = ret; goto cleanup; } if ((flags & PKG_ADD_UPGRADE) == 0) pkg_emit_install_begin(pkg); if (pkg_is_valid(pkg) != EPKG_OK) { pkg_emit_error("the package is not valid"); return (EPKG_FATAL); } if (flags & PKG_ADD_AUTOMATIC) pkg_set(pkg, PKG_AUTOMATIC, (int64_t)true); /* * Check the architecture */ pkg_config_string(PKG_CONFIG_ABI, &myarch); pkg_get(pkg, PKG_ARCH, &arch, PKG_ORIGIN, &origin, PKG_NAME, &name); if (fnmatch(myarch, arch, FNM_CASEFOLD) == FNM_NOMATCH && strncmp(arch, myarch, strlen(myarch)) != 0) { pkg_emit_error("wrong architecture: %s instead of %s", arch, myarch); if ((flags & PKG_ADD_FORCE) == 0) { retcode = EPKG_FATAL; goto cleanup; } } /* * Check if the package is already installed */ ret = pkg_try_installed(db, origin, &pkg_inst, PKG_LOAD_BASIC); if (ret == EPKG_OK) { if ((flags & PKG_FLAG_FORCE) == 0) { pkg_emit_already_installed(pkg_inst); retcode = EPKG_INSTALLED; pkg_free(pkg_inst); goto cleanup; } else { pkg_emit_notice("package %s is already installed, forced install", name); pkg_free(pkg_inst); } } else if (ret != EPKG_END) { retcode = ret; goto cleanup; } /* * Check for dependencies */ basedir = dirname(path); if ((ext = strrchr(path, '.')) == NULL) { pkg_emit_error("%s has no extension", path); retcode = EPKG_FATAL; goto cleanup; } while (pkg_deps(pkg, &dep) == EPKG_OK) { if (pkg_is_installed(db, pkg_dep_origin(dep)) != EPKG_OK) { const char *dep_name = pkg_dep_name(dep); const char *dep_ver = pkg_dep_version(dep); snprintf(dpath, sizeof(dpath), "%s/%s-%s%s", basedir, dep_name, dep_ver, ext); if ((flags & PKG_ADD_UPGRADE) == 0 && access(dpath, F_OK) == 0) { ret = pkg_add(db, dpath, PKG_ADD_AUTOMATIC, keys); if (ret != EPKG_OK) { retcode = EPKG_FATAL; goto cleanup; } } else { retcode = EPKG_FATAL; pkg_emit_missing_dep(pkg, dep); goto cleanup; } } } /* register the package before installing it in case there are * problems that could be caught here. */ retcode = pkgdb_register_pkg(db, pkg, flags & PKG_ADD_UPGRADE, flags & PKG_FLAG_FORCE); if (retcode != EPKG_OK) goto cleanup; pkg_get(pkg, PKG_PREFIX, &prefix, PKG_MTREE, &mtree); if ((retcode = do_extract_mtree(mtree, prefix)) != EPKG_OK) goto cleanup_reg; /* * Execute pre-install scripts */ if ((flags & (PKG_ADD_NOSCRIPT | PKG_ADD_USE_UPGRADE_SCRIPTS)) == 0) pkg_script_run(pkg, PKG_SCRIPT_PRE_INSTALL); /* add the user and group if necessary */ /* pkg_add_user_group(pkg); */ /* * Extract the files on disk. */ if (extract && (retcode = do_extract(a, ae)) != EPKG_OK) { /* If the add failed, clean up */ pkg_delete_files(pkg, 1); pkg_delete_dirs(db, pkg, 1); goto cleanup_reg; } /* * Execute post install scripts */ if ((flags & PKG_ADD_NOSCRIPT) == 0) { if (flags & PKG_ADD_USE_UPGRADE_SCRIPTS) pkg_script_run(pkg, PKG_SCRIPT_POST_UPGRADE); else pkg_script_run(pkg, PKG_SCRIPT_POST_INSTALL); } /* * start the different related services if the users do want that * and that the service is running */ pkg_config_bool(PKG_CONFIG_HANDLE_RC_SCRIPTS, &handle_rc); if (handle_rc) pkg_start_stop_rc_scripts(pkg, PKG_RC_START); cleanup_reg: if ((flags & PKG_ADD_UPGRADE) == 0) pkgdb_register_finale(db, retcode); if (retcode == EPKG_OK && (flags & PKG_ADD_UPGRADE) == 0) pkg_emit_install_finished(pkg); cleanup: if (a != NULL) archive_read_free(a); pkg_free(pkg); pkg_free(pkg_inst); return (retcode); }
Anyhow, I wonder why i386reaper hasn't reported this purported GPL violation to the copyright holders, if he actually believes what he's saying.
bsd should really stop claiming that they have better documentation
Comment
-
Originally posted by i386reaper View PostAre you fucking me ?
The pkgng is clearly more bloated (more SLOC) and it looks like it's been written by a bunch of kids with down syndrome.
It clearly does doesn't make use of the advance memory management offered by C with apt-get does. No wander why pkgng and all things BSD are slower then apt-get and Linux.
That's why blackout23 is correct, PKGN(OT)G(OOD) is so much slower that every Linux package manager.
Just goes to show how shitty BSD fucks are at programming. As what kraftman said about them:
Reaper, civil tongue, remember? "Kids with down syndrome," "bsd fucks"--> not civil. We get that you dont like BSD but you can still be respectful (even if you have to fake it) so that you dont encourage the conversation descending into chaos.
Back on topic however... Yes the code is more lines of code but that doesnt necessarily make it bad code, maybe they were going for verbose code to make sure it was maintainable or so that it was more open to new programmers who wanted to contribute. Also I said the code LOOKS nicer and was cleaner, not that it was better. As in, its more aesthetically pleasing and easy to follow. That being said, the are using a few goto's in there, which makes me sad and NOW makes me question a few things about their design choices since that could have EASILY been a function call.
Originally posted by CthulhuxPKGNG code uses so much local variables. So literally even time a function is called, a whole bunch of memory addresses has to be created. That's so fucking dumb. It's a waste of CPU. No wonder why BSD has shitty performance.All opinions are my own not those of my employer if you know who they are.
Comment
-
Originally posted by CthuIhuxPKGNG code uses so much local variables. So literally even time a function is called, a whole bunch of memory addresses has to be created. That's so fucking dumb. It's a waste of CPU. No wonder why BSD has shitty performance.
Comment
-
BSD guys ARE nuts.
No, seriously, BSD guys are real NUTS. Well, it took them almost 20 years to understand that package manager is essential if they're serious about making somethings that is anyhow usable. No, I've looked on package manager and it even does not looks bad on it's own. Small and nice C program is how it should be done, sure. RedHat could really learn how to make package managers (their slow and resource hog python crap called "yum" is a really horrible thing).
The problem? It seems that for BSD guys it will take yet another 10 years to actually learn how to use package managers properly. They really haven't got it. Why the heck I would need some moron "base system" crap which can't be handled properly as collection of packages you can alter and replace? Just because those guys are real retards and got stuck to their ways of doing things so much that they fail to recognize there could be better approaches? I really fail to understand why they can't get idea that you can offer "good" set of packages with metapackage but then system builder/user/admin/whoever could override/replace/uninstall/... part of packages, should they ever need to do so. Now they're rather will got stuck and it will be really better to make use of more decent package management. Say, debian-based would do the trick right just as you could expect it from modern and powerful package management system. Let's check how many years it will take for BSD guys to recognize such a simple fact and get idea that they're not just one OS in unuverse and got some competitors, fortunately.Last edited by 0xBADCODE; 21 May 2013, 12:31 PM.
Comment
-
Originally posted by 0xBADCODE View PostNo, seriously, BSD guys are real NUTS. Well, it took them almost 20 years to understand that package manager is essential if they're serious about making somethings that is anyhow usable. No, I've looked on package manager and it even does not looks bad on it's own. Small and nice C program is how it should be done, sure. RedHat could really learn how to make package managers (their slow and resource hog python crap called "yum" is a really horrible thing).
The problem? It seems that for BSD guys it will take yet another 10 years to actually learn how to use package managers properly. They really haven't got it. Why the heck I would need some moron "base system" crap which can't be handled properly as collection of packages you can alter and replace? Just because those guys are real retards and got stuck to their ways of doing things so much that they fail to recognize there could be better approaches? I really fail to understand why they can't get idea that you can offer "good" set of packages with metapackage but then system builder/user/admin/whoever could override/replace/uninstall/... part of packages, should they ever need to do so. Now they're rather will got stuck and it will be really better to make use of more decent package management. Say, debian-based would do the trick right just as you could expect it from modern and powerful package management system. Let's check how many years it will take for BSD guys to recognize such a simple fact and get idea that they're not just one OS in unuverse and got some competitors, fortunately.
Comment
-
Originally posted by i386reaper View PostThat's only a small section of the codes, you can't just conclusion at the whole thing is different all because a tiny section doesn't match.
That's why Git is better then SVN or CVS or especially OpenCVS. Those who don't use Git are mentality insane.
Comment
-
Originally posted by i386reaper View PostThat site talks nothing but shit that comes out of Kris Moore's mouth/ass. No sane person would ever take the time reading it.
yeah, classic BSD apologist response to having no binary repository:
http://aboutthebsds.wordpress.com/20...bians-apt-get/
Comment
Comment