Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#16501 closed enhancement (duplicate)

Allow installation of spkgs whose names don't match their top-level directories.

Reported by: robertwb Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: build Keywords:
Cc: embray Merged in:
Authors: Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: u/robertwb/ticket/16501 (Commits) Commit: 56769aea8e8c0922d2d22092a26f5345a3f3f571
Dependencies: Stopgaps:

Description

This is handy to be able to pull the archive directly from services such as github, e.g. https://github.com/user/project/archive/master.tar.gz

Change History (11)

comment:1 Changed 6 years ago by robertwb

  • Branch set to u/robertwb/ticket/16501
  • Created changed from 06/19/14 21:36:43 to 06/19/14 21:36:43
  • Modified changed from 06/19/14 21:36:43 to 06/19/14 21:36:43

comment:2 Changed 6 years ago by robertwb

  • Commit set to 56769aea8e8c0922d2d22092a26f5345a3f3f571
  • Status changed from new to needs_review

New commits:

56769aeInstall from arbitrary tarball with spkg-install script.

comment:3 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:4 Changed 6 years ago by jdemeyer

Instead of grepping the output of tar tf -, I would prefer a simple shell script along the lines of

# Find the unique subdirectory name
PKG_SUBDIR=""
for d in *; do
    if [ -d "$d" ]; then
        if [ -z "$PKG_SUBDIR" ]; then
            PKG_SUBDIR="$d"
        else
            echo >&2 "Multiple directories in package, no idea what to do..."
            exit 1
        fi
    fi
done
if [ -z "$PKG_SUBDIR" ]; then
    echo >&2 "No directory found in package, no idea what to do..."
    exit 1
fi
cd "$PKG_SUBDIR" || exit $?

This also deals with the case that there are multiple directories, and there are less worries about portability of tar tf -.

comment:5 Changed 6 years ago by jdemeyer

While you're at it, could you add 2>/dev/null to the mv command in

if [ "$USE_LOCAL_SCRIPTS" = yes ]; then
    shopt -s nocaseglob      # see trac:16415
    mv "${PKG_NAME_UPSTREAM%.tar*}"* src
    shopt -u nocaseglob
    echo "Finished set up"

comment:6 Changed 5 years ago by jdemeyer

  • Status changed from needs_review to needs_info

comment:7 Changed 4 years ago by mkoeppe

  • Cc embray added

comment:8 Changed 4 years ago by embray

I think probably this can be closed as of #20721.

comment:9 Changed 4 years ago by jdemeyer

  • Authors Robert Bradshaw deleted
  • Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_info to positive_review

comment:10 Changed 4 years ago by embray

  • Resolution set to duplicate
  • Status changed from positive_review to closed

I like to actually close tickets, so... I think I'll close as a duplicate of #20721 (even though this one came first).

comment:11 Changed 4 years ago by mkoeppe

Thanks!

Note: See TracTickets for help on using tickets.