Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gfan-0.4plu keeps getting upgraded #8307

Closed
qed777 mannequin opened this issue Feb 19, 2010 · 6 comments
Closed

gfan-0.4plu keeps getting upgraded #8307

qed777 mannequin opened this issue Feb 19, 2010 · 6 comments

Comments

@qed777
Copy link
Mannequin

qed777 mannequin commented Feb 19, 2010

I think this happens because we misuse rstrip in SAGE_LOCAL/bin/sage-update.

CC: @sagetrac-mvngu

Component: build

Author: Mitesh Patel

Reviewer: Minh Van Nguyen

Merged: sage-4.3.4.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/8307

@qed777 qed777 mannequin added this to the sage-4.3.4 milestone Feb 19, 2010
@qed777 qed777 mannequin added c: build labels Feb 19, 2010
@qed777
Copy link
Mannequin Author

qed777 mannequin commented Feb 19, 2010

Fix rstrip problems. Various cleanups. scripts repo.

@qed777
Copy link
Mannequin Author

qed777 mannequin commented Feb 19, 2010

comment:1

Attachment: trac_8307-update_sage-update.patch.gz

The patch

  • Fixes rstrip problems.
  • Includes pep8-related cleanup and cosmetic changes.
  • Uses textwrap.

Feel free to make further improvements, or to undo mine!

@qed777 qed777 mannequin added the s: needs review label Feb 19, 2010
@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Feb 20, 2010

comment:2

Based on a freshly compiled Sage 4.3.3.alpha1, I made a source distribution called sage-4.3.3.alpha1.1, which is essentially the same as Sage 4.3.3.alpha1. From a Sage 4.3.3.alpha1 binary, I upgraded it to sage-4.3.3.alpha1.1 and received the following upgrade message:

The following packages will be upgraded:
  examples-4.3.3.alpha1.1 extcode-4.3.3.alpha1.1 gfan-0.4plu sage-4.3.3.alpha1.1 sage_scripts-4.3.3.alpha1.1

I didn't make any changes to the gfan spkg and yet it is slated for upgrading. After upgrading the Sage library, I received the following message about upgrading gfan:

Done
The following packages will be upgraded:
  gfan-0.4plu

Answering yes to the upgrade, the install log shows this line:

gfan-0.4plus.spkg already present

Yep, it's redudant and annoying that gfan is upgraded everytime one does a source upgrade.

Here's another try. With a freshly compiled Sage 4.3.3.alpha1, I applied trac_8307-update_sage-update.patch to the scripts repository and produced a source distribution sage-4.3.3.alpha1.1. I then applied that same patch on top of a binary version of Sage 4.3.3.alpha1 and upgraded that binary distribution to sage-4.3.3.alpha1.1. This time the upgrade message reads:

The following packages will be upgraded:

    examples-4.3.3.alpha1.1 extcode-4.3.3.alpha1.1 sage-4.3.3.alpha1.1
    sage_scripts-4.3.3.alpha1.1

with no gfan within sight. The upgrade process didn't upgrade gfan.

The patch moves some code to the following conditional at the end of sage-update:

if __name__ == '__main__':
   <SNIP>

There are some clean up of docstrings and clean up conforming to PEP8. The real change is in adding the new function chop() and using it as follows:

-    installed = set(os.listdir("%s/installed/"%SPKG_ROOT))
-    to_download = [x for x in packages if not x.rstrip('.spkg') in installed]
+    installed = set(os.listdir("%s/installed/" % SPKG_ROOT))
+    to_download = [x for x in packages if not chop(x, '.spkg') in installed]

Previously, the script sage-update used rstrip() for finding a list of spkg's to upgrade. This function won't work as intended for spkg's that has an "s" at the end of their names just before the extension ".spkg". The new function chop() does this better by testing that the name of an spkg actually ends in ".spkg". That's why the update script wants to upgrade "gfan-0.4plu" when the gfan spkg is named "gfan-0.4plus".

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Feb 20, 2010

Reviewer: Minh Van Nguyen

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Mar 2, 2010

comment:3

Merged trac_8307-update_sage-update.patch in the script repository.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Mar 2, 2010

Merged: sage-4.3.4.alpha0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants