Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: FreeBSD Still Working On Next-Gen Package Manager

  1. #21
    Join Date
    Apr 2013
    Posts
    24

    Default

    Quote Originally Posted by Vim_User View Post
    Banned as LinuxAnalsBSD, BSDSucksDick, systemdrulez, OpenSLOWlaris and more I have forgotten, now back as i386reaper with the same moronic lies, linking to his own blog full of lies and accusations, guilty of accusing the OpenBSD developers to be the Boston Bombers and recently even accusing them to being part in the 9/11 attacks.

    And still allowed to spread his hate here. Michael, can we get rid of this one already? The mods already know that this is one guy with many accounts, why are they not allowed to ban them all?
    WTF are you talking about?

  2. #22
    Join Date
    Apr 2013
    Posts
    24

    Default

    Quote Originally Posted by Ibidem View Post
    Obviously, 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++;
          }
       }
    with this:
    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);
    }
    Those are the two most comparable sections in apt and pkgng, AFAICT.
    Anyhow, I wonder why i386reaper hasn't reported this purported GPL violation to the copyright holders, if he actually believes what he's saying.
    apt-get code appears to be more highly documented also well.

    bsd should really stop claiming that they have better documentation

  3. #23
    Join Date
    Aug 2012
    Location
    Pennsylvania, United States
    Posts
    1,900

    Default

    Quote Originally Posted by i386reaper View Post
    Are 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.

    Quote Originally Posted by Cthulhux
    PKGNG 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.
    From the looks of it this is the entirety of the code to install packages.. a one shot operation. So what would you have done differently? The vars get allocated, used, installation is dine, the vars get de-allocated. Memory used, memory gone, end of story.

  4. #24
    Join Date
    Jun 2009
    Posts
    559

    Default

    Quote Originally Posted by CthuIhux View Post
    PKGNG 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.
    Would you rather they gone with defining a bunch of instance variables and then keep reassigning values to them for every function that is called?

  5. #25
    Join Date
    Jun 2012
    Posts
    328

    Default 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; 05-21-2013 at 12:31 PM.

  6. #26
    Join Date
    Jan 2013
    Posts
    525

    Default

    Quote Originally Posted by 0xBADCODE View Post
    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.
    Do you mind repeating that in intelligible English rather than incomprehensible babble?

  7. #27
    Join Date
    Jan 2013
    Posts
    1,116

    Default

    Quote Originally Posted by i386reaper View Post
    That'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.
    So, then show us the parts where they use the same code. For one time you could try to back up your claims with something different than your blog, but with actual facts.

    That's why Git is better then SVN or CVS or especially OpenCVS. Those who don't use Git are mentality insane.
    So, show us your work on your Git account. You have something to show us, I would assume, show us your contributions to the open source world.

  8. #28
    Join Date
    Oct 2011
    Posts
    5

    Default

    Quote Originally Posted by i386reaper View Post
    That 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/
    What are you on about?
    http://lists.freebsd.org/pipermail/f...ay/001476.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •